/* ═══════════════════════════════════════════════════════════
   PICTIONARY — Premium Dark Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-deep: #07070f;
    --bg-primary: #0b0b1a;
    --bg-secondary: #12122a;
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(139, 92, 246, 0.5);

    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent2: #06b6d4;
    --accent2-light: #22d3ee;
    --gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);

    --text: #f1f1f6;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.35);

    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(139,92,246,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(6,182,212,0.06) 0%, transparent 60%);
}

/* ── Screens ──────────────────────────────────────────── */

.screen {
    position: fixed; inset: 0;
    display: none;
    flex-direction: column;
    z-index: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; animation: screenIn 0.4s ease; }

@keyframes screenIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-content {
    flex: 1;
    padding: 24px 20px;
    padding-bottom: calc(24px + var(--safe-bottom));
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}
.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* ── Logo ─────────────────────────────────────────────── */

.logo-wrapper { text-align: center; margin-bottom: 8px; }
.logo-icon {
    font-size: 64px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(139,92,246,0.4));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.logo-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}
.logo-sub {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 4px;
}

/* ── Glass Cards ──────────────────────────────────────── */

.glass-card {
    width: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Inputs ───────────────────────────────────────────── */

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.input-field {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.input-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.input-field::placeholder { color: var(--text-muted); }
.input-code {
    text-align: center;
    font-size: 28px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 8px;
    text-transform: uppercase;
}
.input-select {
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--border-glass);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

/* ── Buttons ──────────────────────────────────────────── */

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 30px rgba(139,92,246,0.5);
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1.5px solid var(--border-glass);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
    border-color: var(--accent);
}
.btn-block { width: 100%; }
.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-xs);
}
.btn-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); }
.btn-emoji { font-size: 18px; }

/* ── Divider ──────────────────────────────────────────── */

.divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted); font-size: 13px;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--border-glass);
}

/* ── Header ───────────────────────────────────────────── */

.header-bar {
    width: 100%;
    display: flex; align-items: center; gap: 12px;
}
.header-pseudo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-light);
}
.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    text-align: center;
}
.section-sub {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}
.card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

/* ── Settings ─────────────────────────────────────────── */

.settings-card { gap: 10px; }
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}
.setting-row.mode-row { gap: 10px; }

/* Mode toggle (segmented control) */
.mode-toggle {
    display: inline-flex;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--border-glass);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.mode-opt {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.mode-opt:active { transform: scale(0.97); }
.mode-opt.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 2px 10px rgba(139,92,246,0.35);
}
.mode-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: -2px;
    padding: 0 2px;
}

/* ── Waiting Room ─────────────────────────────────────── */

.room-code-display {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.room-code-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.room-code {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mode-badge-row { display: flex; justify-content: center; }
.mode-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 999px;
    color: var(--accent-light);
}
.players-list { display: flex; flex-direction: column; gap: 8px; }
.player-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    font-weight: 600;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } }
.player-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.waiting-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ── Word Selection ───────────────────────────────────── */

.word-choices {
    display: flex; flex-direction: column; gap: 14px;
    width: 100%; max-width: 400px;
}
.word-card {
    padding: 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    animation: cardIn 0.4s ease backwards;
}
.word-card:nth-child(2) { animation-delay: 0.1s; }
.word-card:nth-child(3) { animation-delay: 0.2s; }
@keyframes cardIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.word-card:hover, .word-card:active {
    border-color: var(--accent);
    background: rgba(139,92,246,0.1);
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(139,92,246,0.2);
}
.word-card-word {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}
.word-card-meta {
    font-size: 13px;
    color: var(--text-muted);
}
.diff-facile { color: var(--success); }
.diff-normal { color: var(--warning); }
.diff-difficile { color: var(--error); }

/* ── Game Screen ──────────────────────────────────────── */

#screen-game {
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#screen-game.active { display: flex; }

.game-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 10;
    flex-shrink: 0;
}
.game-info-left, .game-info-right { display: flex; align-items: center; gap: 8px; }
.round-badge {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    color: var(--text-secondary);
}
.role-badge {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
}
.role-badge.drawer { background: var(--accent); }
.role-badge.guesser { background: var(--accent2); }

/* Timer */
.timer-display {
    position: relative;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
}
.timer-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.timer-ring-bg {
    fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 3;
}
.timer-ring-fg {
    fill: none; stroke: var(--accent); stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 106.81;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.5s;
}
.timer-ring-fg.warning { stroke: var(--warning); }
.timer-ring-fg.danger { stroke: var(--error); }
.timer-text {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
}

/* Score */
.score-mini {
    display: flex; gap: 8px;
    font-size: 12px; font-weight: 600;
}
.score-item {
    padding: 3px 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    white-space: nowrap;
}
.score-item .pts {
    color: var(--accent-light);
    font-weight: 700;
}

/* Word / Hint display */
.word-display, .hint-display {
    padding: 8px 16px;
    text-align: center;
    font-size: 15px;
    background: rgba(139,92,246,0.1);
    border-bottom: 1px solid rgba(139,92,246,0.2);
    flex-shrink: 0;
}
.word-display strong { color: var(--accent-light); font-size: 18px; }
.hint-category {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(6,182,212,0.15);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent2-light);
    margin-right: 10px;
}
.hint-letters {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 6px;
}

/* Canvas */
.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    touch-action: none;
    -ms-touch-action: none;
    overscroll-behavior: contain;
    min-height: 0;
}
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    -ms-touch-action: none;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom));
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    flex-shrink: 0;
    z-index: 10;
}
.toolbar-section {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; flex-wrap: wrap;
}
.toolbar-section.colors { gap: 4px; }

.color-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active {
    border-color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.size-dot {
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    flex-shrink: 0;
}
.size-dot.active { border-color: var(--accent); box-shadow: 0 0 6px var(--accent); }

.tool-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid var(--border-glass);
    border-radius: var(--radius-xs);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}
.tool-btn:hover { background: rgba(255,255,255,0.15); }
.tool-btn.active {
    background: rgba(139,92,246,0.2);
    border-color: var(--accent);
}

/* Drawer feed */
.drawer-feed {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-glass);
    padding: 6px 12px;
    max-height: 88px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
    font-size: 13px;
}
.drawer-feed-hint {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 4px 0;
}
.feed-item {
    color: var(--text-secondary);
    padding: 3px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-xs);
    animation: slideIn 0.25s ease;
}
.feed-item .feed-pseudo {
    font-weight: 700;
    color: var(--accent2-light);
}
.feed-item strong {
    color: var(--text);
    font-weight: 600;
}

/* Found button (drawer, local mode) */
.btn-found {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 20px;
    padding-bottom: calc(18px + var(--safe-bottom));
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: #fff;
    border: none;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 20px rgba(16,185,129,0.25);
    transition: filter 0.2s, transform 0.1s;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
.btn-found:hover { filter: brightness(1.08); }
.btn-found:active { transform: scale(0.98); }
.btn-found-emoji {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    font-size: 16px;
}

/* Speak banner (guesser, local mode) */
.speak-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 20px;
    padding-bottom: calc(18px + var(--safe-bottom));
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-glass);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    text-align: center;
}
.speak-emoji {
    font-size: 24px;
    animation: speak-pulse 1.6s ease-in-out infinite;
}
@keyframes speak-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

/* Hint waiting state */
.hint-display.waiting .hint-category {
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
    margin: 0;
    padding: 0;
}

/* Guess area */
.guess-area {
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-glass);
    max-height: 40vh;
    flex-shrink: 0;
}
.guess-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 120px;
}
.guess-item {
    font-size: 14px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    animation: slideIn 0.2s ease;
}
.guess-item.wrong {
    color: var(--text-muted);
}
.guess-item .guess-pseudo { font-weight: 600; color: var(--accent-light); }
.guess-form {
    display: flex; gap: 8px;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom));
}
.guess-input { flex: 1; padding: 12px 14px; font-size: 16px; }
.btn-guess { padding: 12px 20px; font-size: 14px; flex-shrink: 0; }

/* ── Round Result ─────────────────────────────────────── */

.result-icon { font-size: 72px; animation: bounceIn 0.5s ease; }
@keyframes bounceIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.result-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
}
.result-word {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.result-scores {
    text-align: center;
}
.result-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 16px;
}
.result-score-row + .result-score-row {
    border-top: 1px solid var(--border-glass);
}
.result-points {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent-light);
}
.result-points.zero { color: var(--text-muted); }

/* ── Game Over ────────────────────────────────────────── */

.gameover-icon { font-size: 80px; animation: bounceIn 0.6s ease; }
.gameover-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    text-align: center;
}
.gameover-scores { text-align: center; }
.gameover-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    font-size: 18px;
}
.gameover-row + .gameover-row { border-top: 1px solid var(--border-glass); }
.gameover-row.winner { color: var(--warning); }
.gameover-pts {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 22px;
}

/* Confetti */
#confetti-container {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 100;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 10px; height: 10px;
    top: -20px;
    animation: confettiFall 3s ease-in forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Toast ────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease;
    white-space: nowrap;
}
.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.success { border-color: rgba(16,185,129,0.4); color: var(--success); }
.toast.error { border-color: rgba(239,68,68,0.4); color: var(--error); }

/* ── Media Queries ────────────────────────────────────── */

@media (min-width: 768px) {
    .screen-content { padding: 40px 24px; }
    .logo-title { font-size: 56px; }
    .logo-icon { font-size: 80px; }
    .canvas-wrapper { border-radius: 0; }
}

@media (max-height: 600px) {
    .logo-icon { font-size: 40px; }
    .logo-title { font-size: 36px; }
    .glass-card { padding: 16px; gap: 10px; }
    .game-top-bar { padding: 6px 12px; }
}

/* ── Audio control (volume slider) ─────────────────────── */

.audio-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 60%;
}

.audio-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.audio-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid #fff;
}

.audio-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid #fff;
}

.audio-control #volume-display {
    min-width: 3em;
    text-align: right;
    font-size: 0.85rem;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}

/* ── In-game volume control (top bar) ──────────────────── */

.game-volume {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.game-volume-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.game-volume input[type="range"] {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.game-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid #fff;
}

.game-volume input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid #fff;
}

/* ── Music unblock overlay (iOS autoplay fallback) ─────── */

.music-unblock {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    padding: 0.7rem 1.1rem;
    background: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: var(--font-body, inherit);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.music-unblock:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.music-unblock:active {
    transform: translateY(0);
}
