/* ═══════════════════════════════════════════════════════════════════════════
   L'IMPOSTORE — Mobile-first styles
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
    --bg:            #0f0f1a;
    --bg-card:       #1a1a2e;
    --bg-card-alt:   #16213e;
    --primary:       #e94560;
    --primary-hover: #ff6b81;
    --accent:        #0f3460;
    --text:          #eaeaea;
    --text-muted:    #a0a0b0;
    --success:       #2ecc71;
    --warning:       #f39c12;
    --gold:          #ffd700;
    --border:        #2a2a4a;
    --radius:        16px;
    --radius-sm:     10px;
    --shadow:        0 8px 32px rgba(0,0,0,0.4);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(233,69,96,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(15,52,96,0.15) 0%, transparent 50%);
}

/* ─── Container ───────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    min-height: 95dvh;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 24px 0 16px 0;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Main ────────────────────────────────────────────────────────────────── */
main {
    flex: 1;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.card h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.instruction {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.phase-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 16px;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px 32px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
}

/* ─── Player Picker ───────────────────────────────────────────────────────── */
.player-picker {
    margin-bottom: 24px;
}

.player-picker label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.btn-stepper {
    width: 52px;
    height: 52px;
    border: none;
    background: var(--bg-card-alt);
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-stepper:hover {
    background: var(--accent);
}

#players {
    width: 70px;
    height: 52px;
    text-align: center;
    border: none;
    background: var(--bg);
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    -moz-appearance: textfield;
}

#players::-webkit-outer-spin-button,
#players::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Reveal Area ─────────────────────────────────────────────────────────── */
.reveal-area {
    margin: 16px 0;
}

.btn-reveal {
    background: var(--bg-card-alt);
    color: var(--text);
    border: 2px dashed var(--border);
    padding: 40px 20px;
    font-size: 1.2rem;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.btn-reveal:hover {
    border-color: var(--primary);
    background: rgba(233,69,96,0.08);
}

/* ─── Word Display ────────────────────────────────────────────────────────── */
.word-display {
    margin-top: 8px;
}

.word-display .label {
    display: inline-block;
    background: var(--accent);
    color: var(--text);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 16px;
}

/* Impostor */
.impostor-reveal {
    background: rgba(233,69,96,0.1);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 28px 20px;
    margin: 12px 0 20px;
}

.impostor-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 8px;
}

.impostor-text {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.impostor-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Normal player */
.word-reveal {
    background: rgba(46,204,113,0.08);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 28px 20px;
    margin: 12px 0 20px;
}

.word-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.secret-word {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--success);
    margin-bottom: 8px;
    word-break: break-word;
}

.word-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Discussion ──────────────────────────────────────────────────────────── */
.info-box {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin: 16px 0;
    text-align: left;
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ─── Vote (legacy, kept for future use) ─────────────────────────────────── */
.vote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.btn-vote {
    background: var(--bg-card-alt);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 16px 10px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-vote:hover {
    border-color: var(--primary);
    background: rgba(233,69,96,0.08);
}

/* ─── Ready ───────────────────────────────────────────────────────────────── */
.ready .info-box {
    text-align: center;
}

/* ─── Result (legacy, kept for future use) ────────────────────────────────── */
.result-box {
    border-radius: var(--radius);
    padding: 28px 20px;
    margin: 16px 0;
}

.result-box.win {
    background: rgba(46,204,113,0.1);
    border: 2px solid var(--success);
}

.result-box.lose {
    background: rgba(233,69,96,0.1);
    border: 2px solid var(--primary);
}

.result-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.result-box p {
    margin: 6px 0;
    font-size: 1rem;
    line-height: 1.5;
}

.result-details {
    text-align: left;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin: 16px 0;
    line-height: 1.8;
    font-size: 0.95rem;
}

.result-details hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.vote-list {
    list-style: none;
    padding: 0;
}

.vote-list li {
    padding: 4px 0;
}

/* ─── Reset Bar ───────────────────────────────────────────────────────────── */
.reset-bar {
    text-align: center;
    margin-bottom: 8px;
}

.btn-reset {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 24px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-reset:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 500px) {
    body {
        padding: 24px;
        align-items: center;
    }

    .card {
        padding: 36px 32px;
    }

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

@media (min-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
}
