* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #e2e8f0;
}

.game-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.back-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 700;
}

.back-link:hover {
    color: #bfdbfe;
}

.hero {
    margin: 32px 0 24px;
}

.eyebrow,
.card-label {
    margin: 0 0 8px;
    color: #38bdf8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.04;
    letter-spacing: 0;
}

.hero p:last-child {
    max-width: 620px;
    margin: 0;
    color: #cbd5e1;
    font-size: 18px;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    margin-top: 18px;
    border: 1px solid #38bdf8;
    border-radius: 8px;
    padding: 10px 14px;
    color: #e0f2fe;
    background: rgba(56, 189, 248, 0.1);
    font-weight: 800;
    text-decoration: none;
}

.nav-button:hover {
    background: rgba(56, 189, 248, 0.18);
}

.game-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.riddle-card,
.status-card,
.empty-card {
    border: 1px solid #334155;
    border-radius: 12px;
    background: #111827;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.riddle-card,
.empty-card {
    padding: 24px;
}

.previous-list {
    display: grid;
    gap: 18px;
}

.previous-card .hint-toggle {
    margin-top: 18px;
}

.previous-answer {
    margin-top: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
    color: #cbd5e1;
    font-weight: 700;
}

.pagination a {
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 9px 12px;
    color: #e0f2fe;
    text-decoration: none;
}

.pagination a:hover {
    border-color: #38bdf8;
}

.status-card {
    padding: 18px;
}

.clue {
    margin: 0;
    color: #f8fafc;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 750;
}

.clue-lines {
    display: grid;
    gap: 10px;
}

.letter-count,
.extra-hint {
    margin: 0;
}

.letter-count {
    color: #93c5fd;
    font-size: 18px;
    font-weight: 800;
}

.extra-hint {
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.45;
}

.hint-toggle,
.guess-row button {
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.hint-toggle {
    margin-top: 18px;
    padding: 10px 14px;
    background: #334155;
}

.hint {
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #dbeafe;
    background: #172033;
}

.guess-form {
    margin-top: 26px;
}

.guess-form label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

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

.guess-row input {
    min-width: 0;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 12px 14px;
    background: #0f172a;
    color: #f8fafc;
    font: inherit;
    outline: none;
}

.guess-row input:focus {
    border-color: #38bdf8;
}

.guess-row button {
    padding: 12px 18px;
}

button:disabled,
.guess-row input:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.feedback,
.answer-panel {
    margin-top: 18px;
    border-radius: 8px;
    padding: 13px 14px;
}

.feedback {
    border: 1px solid #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.feedback.success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.answer-panel {
    border: 1px solid #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.answer-panel span,
.attempts span {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.answer-panel strong {
    display: block;
    margin-top: 4px;
    color: #f8fafc;
    font-size: 28px;
}

.answer-panel p {
    margin: 10px 0 0;
    color: #dbeafe;
    line-height: 1.45;
}

.attempts,
.guesses {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #334155;
}

.attempts strong {
    display: block;
    margin-top: 4px;
    color: #f8fafc;
    font-size: 28px;
}

.attempts p,
.guesses p {
    margin: 6px 0 0;
    color: #cbd5e1;
}

.guesses {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.guesses h2 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 18px;
}

.guesses ol {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guesses li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #172033;
    color: #e2e8f0;
}

.guesses li strong {
    color: #fbbf24;
    font-size: 12px;
    text-transform: uppercase;
}

.guesses li.correct strong {
    color: #86efac;
}

.empty-card h2 {
    margin: 0 0 8px;
}

.empty-card p {
    margin: 0;
    color: #cbd5e1;
}

@media (max-width: 760px) {
    .game-shell {
        width: min(100% - 24px, 1040px);
        padding-top: 20px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .riddle-card,
    .empty-card {
        padding: 18px;
    }

    .clue {
        font-size: 20px;
    }

    .guess-row {
        grid-template-columns: 1fr;
    }

    .guess-row button {
        width: 100%;
    }
}
