/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* ═══════════════════════════════
   COVER SCREEN
═══════════════════════════════ */

.cover-body {
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    padding: 16px;
}

.cover-card {
    position: relative;
    max-width: 380px;
    width: 94vw;
    max-height: calc(100vh - 32px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.cover-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 32px);
    object-fit: cover;
}

.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 28px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.all-done-msg {
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

.play-btn {
    display: inline-block;
    background: #2c5f8a;
    color: #fff;
    font-family: 'Oswald', 'Arial Black', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    border: 3px solid rgba(255,255,255,0.3);
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.play-btn:active {
    background: #1a4060;
    transform: scale(0.97);
}

/* ═══════════════════════════════
   GAME SCREEN
═══════════════════════════════ */

.game-body {
    background: #d8d0c8;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    padding: 10px 10px 0;
    gap: 10px;
}

/* ── The card ── */
.card {
    background: #f8f5f0;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
    padding: 14px 12px 10px;
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* subtle paper texture via gradient noise */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ── Name area ── */
.name-area {
    text-align: center;
    padding: 4px 8px 2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-name {
    font-family: 'Alfa Slab One', serif;
    font-size: 42px;
    line-height: 1.1;
    white-space: nowrap;
    display: block;
    letter-spacing: -0.5px;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.name-hidden {
    color: #bbb;
    filter: blur(0px);
    letter-spacing: 4px;
}

.name-revealed {
    color: #111;
    filter: none;
}

.name-hint {
    font-family: sans-serif;
    font-size: 11px;
    color: #999;
    letter-spacing: 0.5px;
    margin-top: 1px;
    text-transform: uppercase;
}

.name-divider {
    height: 2px;
    background: #111;
    margin: 6px 4px 10px;
    border-radius: 1px;
}

/* ── Info bar ── */
.info-bar {
    background: #8da8c4;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 2px 12px;
    text-align: center;
    color: #0d1a2a;
    font-family: Georgia, serif;
    font-size: 13.5px;
    line-height: 1.5;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.15);
}

.info-born {
    font-weight: 600;
}

.info-details {
    font-weight: 500;
}

/* ── Parchment ── */
.parchment {
    background: #c5b088;
    border-radius: 3px;
    padding: 14px 16px 18px;
    margin: 0 2px 10px;
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow:
        3px 5px 14px rgba(0,0,0,0.45),
        -2px -2px 6px rgba(0,0,0,0.2),
        inset 0 0 12px rgba(0,0,0,0.12);
    /* roughen edges with clip-path */
    clip-path: polygon(
        0.5% 1.2%, 2% 0%, 5% 1%, 10% 0.2%, 18% 1%, 28% 0%, 40% 1.2%,
        55% 0.4%, 68% 1%, 80% 0.2%, 90% 1%, 96% 0%, 99.5% 1.5%,
        100% 5%, 99% 15%, 100% 30%, 99.5% 50%, 100% 70%, 99% 85%,
        100% 95%, 98.5% 98.5%, 95% 100%, 85% 99%, 72% 100%, 58% 99.2%,
        44% 100%, 30% 99%, 18% 100%, 8% 99.2%, 2% 100%, 0.5% 98%,
        0% 90%, 1% 75%, 0% 58%, 1% 42%, 0% 25%, 1% 10%
    );
}

.parchment-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 22px;
    text-align: center;
    color: #111;
    margin-bottom: 4px;
    font-weight: 400;
}

.parchment-divider {
    height: 2px;
    background: #2a1a08;
    margin: 0 0 12px;
    border-radius: 1px;
    opacity: 0.7;
}

/* ── Clues ── */
.clue {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    color: #0d0800;
    margin: 7px 0;
    line-height: 1.35;
    font-weight: 600;
    transition: opacity 0.3s ease, max-height 0.35s ease;
}

.clue-number {
    font-weight: 700;
}

.clue-visible {
    opacity: 1;
    max-height: 200px;
    overflow: hidden;
}

.clue-hidden {
    display: none;
}

/* ── Reveal clue button ── */
.reveal-clue-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 11px 16px;
    background: rgba(0,0,0,0.15);
    border: 2px dashed rgba(0,0,0,0.3);
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #2a1a08;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.reveal-clue-btn:active {
    background: rgba(0,0,0,0.25);
}

/* ── Reveal answer button ── */
.reveal-name-wrap {
    margin-top: 14px;
    text-align: center;
}

.reveal-answer-btn {
    background: #2c5f8a;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 11px 28px;
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.1s;
}

.reveal-answer-btn:active {
    background: #1a4060;
    transform: scale(0.97);
}

/* ── Guess row ── */
.guess-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin: 0 2px 4px;
}

.guess-input {
    flex: 1 1 auto;
    height: 44px;
    padding: 0 12px;
    border: 2px solid #8da8c4;
    border-radius: 50px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #111;
    background: #fff;
    outline: none;
    -webkit-appearance: none;
}

.guess-input:focus {
    border-color: #2c5f8a;
}

.guess-btn {
    height: 44px;
    padding: 0 18px;
    background: #2c5f8a;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.1s;
}

.guess-btn:active {
    background: #1a4060;
    transform: scale(0.96);
}

.guess-result {
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 700;
    height: 20px;
    flex-shrink: 0;
    margin: 0 2px 6px;
}

.guess-result.correct { color: #2a7a2a; }
.guess-result.wrong   { color: #9a2020; }

/* ── Navigation bar ── */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 6px 4px 12px;
    gap: 8px;
    flex-shrink: 0;
}

.nav-btn {
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    padding: 10px 0;
    text-align: center;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
    user-select: none;
}

.nav-prev {
    background: #6b7a8d;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.nav-done {
    background: #8d3030;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.nav-next {
    background: #2c5f8a;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.nav-btn:active {
    transform: scale(0.96);
    opacity: 0.85;
}

.nav-disabled {
    background: #b0b8c4;
    color: #e0e4e8;
    box-shadow: none;
    cursor: default;
}

/* ── Scrollbar hidden on parchment ── */
.parchment::-webkit-scrollbar { display: none; }
.parchment { -ms-overflow-style: none; scrollbar-width: none; }
