:root {
    --red: #0057d9;
    --red-dark: #050505;
    --red-light: #eaf2ff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #d4af37;
    --bg: #f7f9fc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

a {
    color: var(--red);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* HEADER */

.site-header {
    background: linear-gradient(135deg, var(--red-dark), var(--red));
    color: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,.14);
}

.topbar,
.brand-wrap,
.wrap,
.footer {
    max-width: 1180px;
    margin: auto;
}

.topbar {
    padding: 7px 20px;
    font-size: 13px;
    opacity: .9;
}

.brand-wrap {
    padding: 28px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 62px;
    height: 62px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}

.brand strong {
    display: block;
    font-size: 31px;
    letter-spacing: .4px;
}

.brand small {
    display: block;
    color: #fee2e2;
    font-weight: 700;
}

/* NAV */

.nav {
    background: var(--red-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.nav a {
    color: #fff;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
}

.nav-search {
    display: flex;
    gap: 5px;
}

.nav-search input {
    width: 180px;
    border: 1px solid var(--line);
    padding: 8px;
    border-radius: 6px;
}

.nav-search button {
    width: auto;
    padding: 8px 12px;
}

/* LAYOUT */

.wrap {
    padding: 22px 20px;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
    margin-bottom: 20px;
}

.grid,
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

/* TOOLS */

.tool-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tool-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--red-light);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 12px;
}

.tool-card h2 {
    margin: 0 0 8px;
    color: var(--red-dark);
    font-size: 22px;
}

.tool-button {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    margin-top: 12px;
    font-weight: bold;
    width: fit-content;
}

.tool-button:hover {
    background: #0047b3;
    text-decoration: none;
}

/* FORMS */

label {
    display: block;
    font-weight: bold;
    margin-top: 14px;
    margin-bottom: 6px;
}

input,
textarea,
select,
button {
    width: 100%;
    font-size: 16px;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    font-family: inherit;
}

textarea {
    min-height: 160px;
    resize: vertical;
    font-family: Consolas, monospace;
}

button {
    background: var(--red);
    color: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: #0047b3;
}

/* ADS */

.ad-box,
.ad-slot {
    max-width: 100%;
    overflow: hidden;
    margin: 20px auto;
    text-align: center;
    background: #eaf2ff;
    border: 1px dashed var(--line);
    color: #333;
    padding: 18px;
    border-radius: 8px;
}

/* ADMIN */

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.preview-box {
    background: var(--red-light);
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 14px;
    margin-top: 8px;
    overflow-x: auto;
}

.notice {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.error {
    background: #fff1f3;
    border: 1px solid #fecdd3;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.small {
    color: var(--muted);
    font-size: 14px;
}

/* FOOTER */

.footer {
    margin-top: 30px;
    background: linear-gradient(135deg, var(--red-dark), var(--red));
    color: #fff;
    border-radius: 10px 10px 0 0;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.footer a {
    color: #fff;
}

/* MOBILE */

@media (max-width: 850px) {
    .brand strong {
        font-size: 26px;
    }

    .nav {
        gap: 14px;
    }

    .nav-search {
        width: 100%;
    }

    .nav-search input {
        width: 100%;
    }

    .tool-grid,
    .grid {
        grid-template-columns: 1fr;
    }

    .footer {
        display: block;
    }
}
