@font-face {
    font-family: 'Metal Gear Solid';
    src: url('/public/assets/img/metal-gear-solid/METAG___.TTF') format('truetype');
    font-display: swap;
}

:root {
    --bg: #dce8d9;
    --bg-soft: #eef5ea;
    --panel: rgba(255, 252, 245, 0.9);
    --panel-border: rgba(80, 112, 83, 0.16);
    --text: #1d2a1f;
    --muted: #5e7261;
    --accent: #6f9f42;
    --danger: #c95a5a;
    --shadow: 0 24px 60px rgba(59, 85, 58, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        linear-gradient(180deg, rgba(237, 245, 233, 0.8) 0%, rgba(216, 230, 212, 0.84) 50%, rgba(200, 218, 196, 0.9) 100%),
        radial-gradient(circle at top, rgba(171, 211, 118, 0.26), transparent 28%),
        url('/public/assets/img/mgs%20background.jpg') center top / cover fixed no-repeat;
    color: var(--text);
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 72px;
}

.hero {
    margin-bottom: 28px;
}
.hero-topline {
    margin-bottom: 8px;
}

.streak-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 220;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border: 1px solid rgba(183, 136, 42, 0.3);
    border-radius: 999px;
    background: rgba(255, 248, 226, 0.94);
    box-shadow: 0 18px 36px rgba(96, 77, 28, 0.14);
    color: #7b5b12;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.streak-badge__star {
    color: #c6941a;
    font-size: 1rem;
    line-height: 1;
}

.streak-badge__label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
}

.streak-badge__count {
    min-width: 1.6ch;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}


.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 24px;
    font-family: "Metal Gear Solid", "Arial Black", sans-serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 4px 18px rgba(255, 255, 255, 0.24);
}

.lede {
    max-width: 720px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 1.06rem;
}

.hero-note {
    max-width: 720px;
    margin-bottom: 0;
    color: #b7882a;
    font-weight: 700;
}

.hero-subnote {
    max-width: 720px;
    margin-top: 8px;
    margin-bottom: 0;
    color: #4c6550;
}

.panel {
    position: relative;
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.panel-warning {
    border-color: rgba(201, 90, 90, 0.25);
}

.panel-search {
    z-index: 120;
}
.panel-next-challenge {
    border-color: rgba(111, 159, 66, 0.22);
    background: rgba(250, 255, 244, 0.88);
}

#next-challenge-timer {
    display: inline-block;
    min-width: 5.6ch;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}


.guess-form label,
.meta-label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.guess-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.search-shell {
    position: relative;
    z-index: 40;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    padding: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: rgba(255, 252, 245, 0.98);
    box-shadow: 0 18px 50px rgba(36, 54, 35, 0.16);
}

.suggestion-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.suggestion-item:hover,
.suggestion-item.is-active {
    background: rgba(111, 159, 66, 0.18);
}

.suggestion-thumb,
.guess-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(111, 159, 66, 0.12);
}

.guess-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: block;
    transform: scale(1.35);
    transform-origin: center;
}

.suggestion-thumb-placeholder,
.guess-thumb-placeholder {
    display: inline-block;
    background: rgba(111, 159, 66, 0.12);
}

input,
button {
    border: 0;
    border-radius: 14px;
    font: inherit;
}

input {
    width: 100%;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    outline: 1px solid rgba(111, 159, 66, 0.18);
}

input:focus {
    outline: 1px solid rgba(111, 159, 66, 0.5);
}

button {
    padding: 16px 20px;
    background: linear-gradient(135deg, #86b94f 0%, #5f8f38 100%);
    color: #f8fff2;
    font-weight: 700;
    cursor: pointer;
}

.form-error,
.win-banner {
    margin-bottom: 0;
    padding: 14px 16px;
    border-radius: 14px;
}

.form-error {
    background: rgba(201, 90, 90, 0.14);
    color: #8f2f2f;
}

.win-banner {
    background: rgba(111, 159, 66, 0.15);
    color: #365224;
}

.challenge-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.results-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.results-head p,
.empty-state {
    color: var(--muted);
}

.results-table-wrap {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 10px;
}

.results-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
}

.results-table td {
    padding: 14px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    font-weight: 700;
    transform-origin: left center;
    transform: perspective(900px) rotateY(0deg) translateX(0);
    opacity: 1;
    transition:
        transform 720ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 720ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

.results-table td.reveal-pending {
    transform: perspective(900px) rotateY(-88deg) translateX(-10px);
    opacity: 0.08;
    filter: saturate(0.85);
}

.guess-character {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guess-cell {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--text);
}

.status-correct {
    background: linear-gradient(135deg, #8dc63f 0%, #5f9a2f 100%) !important;
    color: #f7fff1;
}

.status-incorrect {
    background: linear-gradient(135deg, #d96a6a 0%, #b64545 100%) !important;
    color: #fff5f5;
}

.status-close {
    background: linear-gradient(135deg, #efb94a 0%, #d7811f 100%) !important;
    color: #fff9ef;
}

.client-note {
    margin: 14px 0 0;
    color: var(--muted);
}

.reveal-name {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.is-hidden {
    display: none !important;
}

@media (max-width: 720px) {
    .page-shell {
        padding-top: 32px;
    }

    .guess-row,
    .challenge-meta,
    .results-head,
    .reveal-card {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero-topline {
        align-items: start;
    }

    .results-head {
        align-items: start;
    }

    .site-footer {
        padding: 0 16px 28px;
    }

    .site-footer__inner {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 24px 20px;
    }

    .site-footer__column {
        width: 100%;
    }

    .site-footer__column--brand {
        padding-right: 0;
        padding-bottom: 18px;
        border-right: 0;
        border-bottom: 1px solid rgba(219, 237, 196, 0.12);
    }

    .site-footer__column--links {
        display: block;
    }

    .site-footer__column--links h3,
    .site-footer__column--links p,
    .site-footer__nav,
    .site-footer__credit {
        margin-top: 0;
    }
}


.win-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 24px;
}

.win-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 17, 0.42);
    backdrop-filter: blur(6px);
    opacity: 1;
    transition: opacity 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.win-modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 252, 245, 0.97);
    box-shadow: 0 30px 90px rgba(29, 42, 31, 0.26);
    text-align: center;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.win-modal.is-entering .win-modal-backdrop {
    opacity: 0;
}

.win-modal.is-entering .win-modal-card {
    opacity: 0;
    transform: translateY(26px) scale(0.94);
}

.win-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
}

.win-modal-copy {
    color: var(--muted);
}

.win-modal-image {
    width: min(280px, 100%);
    height: auto;
    max-height: none;
    margin: 20px auto 18px;
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 18px 40px rgba(29, 42, 31, 0.18);
}


body.modal-open {
    overflow: hidden;
}


.page-shell--narrow {
    max-width: 920px;
}

.policy-panel p:last-child {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 44px;
    padding: 0 20px 40px;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 24px;
    padding: 30px;
    border: 1px solid rgba(112, 140, 112, 0.18);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(153, 192, 105, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(43, 58, 45, 0.94) 0%, rgba(56, 74, 58, 0.94) 100%);
    color: #f2f8eb;
    box-shadow: 0 24px 70px rgba(33, 45, 35, 0.2);
}

.site-footer__column {
    min-width: 0;
}

.site-footer__column--brand {
    padding-right: 18px;
    border-right: 1px solid rgba(219, 237, 196, 0.12);
}

.site-footer__column--brand h2 {
    margin-bottom: 12px;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.02;
}
.site-footer__repo-link {
    margin-top: 14px;
    margin-bottom: 0;
}

.site-footer__repo-link a {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid rgba(219, 236, 198, 0.16);
    border-radius: 14px;
    background: rgba(249, 255, 244, 0.08);
}


.site-footer__column--links {
    display: grid;
    align-content: space-between;
    gap: 16px;
}

.site-footer__column--links h3 {
    margin-bottom: 10px;
    color: #f4ffe9;
}

.site-footer__eyebrow {
    margin-bottom: 10px;
    color: rgba(223, 241, 191, 0.86);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
}

.site-footer p {
    color: rgba(241, 246, 237, 0.84);
}

.site-footer a {
    color: #f3ffd1;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer__nav {
    display: grid;
    gap: 10px;
}

.site-footer__nav a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(219, 236, 198, 0.16);
    border-radius: 14px;
    background: rgba(249, 255, 244, 0.08);
}

.site-footer__credit {
    margin-top: 4px;
    font-size: 0.92rem;
    color: rgba(241, 246, 237, 0.76);
}

.github-link-mark {
    width: 18px;
    height: 18px;
    display: inline-flex;
    flex: 0 0 18px;
}

.github-link-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 720px) {
    .site-footer__inner {
        display: block !important;
    }

    .site-footer__column {
        display: block;
        width: 100%;
    }

    .site-footer__column + .site-footer__column {
        margin-top: 20px;
    }

    .site-footer__column--brand,
    .site-footer__column--links {
        padding: 0;
        border: 0;
    }

    .site-footer__column--brand {
        padding-bottom: 18px;
        border-bottom: 1px solid rgba(219, 237, 196, 0.12);
    }

    .site-footer__column--links {
        margin-top: 18px;
    }
}
