/* ==========================================================================
   THE SOWING ORACLE — SACRED PAN-AFRICAN OWARE STYLES
   Colors: Ebony (#120804), Terracotta (#c1440e), Warm Gold (#f2c14e), Ivory (#fbf3e3)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Inter:wght@400;600;700&display=swap');

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    color: #f5e6c8;
    background-color: #0d0502;
    font-family: 'Inter', system-ui, -apple-system, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #240e06 0%, #0d0502 100%);
    transition: all 0.4s ease;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s ease;
}

#game-container canvas {
    display: block;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
    border-radius: 6px;
    transition: transform 0.3s ease;
}

/* Zen Focus Fit Mode */
#app.zen-active #game-container canvas {
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
}

/* ==========================================================================
   ZEN FULLSCREEN FOCUS EXIT PILL
   ========================================================================== */

.zen-exit-pill {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(18, 8, 4, 0.65);
    border: 1px solid rgba(242, 193, 78, 0.4);
    color: #f2c14e;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    opacity: 0.6;
    transition: all 0.25s ease;
    pointer-events: auto;
}

.zen-exit-pill:hover {
    opacity: 1;
    transform: translateY(-1px);
    background: rgba(36, 17, 9, 0.9);
    border-color: #f2c14e;
    box-shadow: 0 6px 22px rgba(242, 193, 78, 0.3);
}

/* ==========================================================================
   HUD OVERLAY LAYER
   ========================================================================== */

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#hud.zen-hidden {
    opacity: 0;
    pointer-events: none !important;
    transform: scale(0.98);
}

#hud button,
#hud a,
#hud input,
#hud [role="button"],
#hud .interactive {
    pointer-events: auto;
}

/* Peer Notice Toast */
.peer-toast-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 51, 57, 0.9);
    border: 1px solid rgba(72, 201, 176, 0.6);
    color: #48c9b0;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 9999px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

.toast-dot {
    width: 8px;
    height: 8px;
    background: #48c9b0;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #48c9b0;
}

/* ==========================================================================
   LANDSCAPE BLOCKER OVERLAY
   ========================================================================== */

.landscape-blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 5, 2, 0.98);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.landscape-blocker h2 {
    font-family: 'Cinzel', serif;
    color: #f2c14e;
    font-size: clamp(18px, 4vw, 24px);
    margin: 20px 0 10px;
    text-shadow: 0 0 12px rgba(242, 193, 78, 0.4);
}

.landscape-blocker p {
    color: #dfcaa7;
    font-size: clamp(12px, 2.8vw, 15px);
    max-width: 320px;
    line-height: 1.5;
}

.phone-rotate-icon {
    animation: rotatePhone 2.5s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 10% { transform: rotate(0deg); }
    40%, 60% { transform: rotate(90deg); }
    90%, 100% { transform: rotate(0deg); }
}

/* ==========================================================================
   OVERLAYS & SCREENS
   ========================================================================== */

.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(13, 5, 2, 0.88);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   MAIN MENU
   ========================================================================== */

.menu-screen {
    background: radial-gradient(circle at center, rgba(45, 19, 9, 0.94) 0%, rgba(13, 5, 2, 0.98) 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.menu-container {
    width: 92%;
    max-width: 880px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(10px, 2.5vh, 20px);
    box-sizing: border-box;
    margin: 0 auto;
}

/* Tab navigation (Play / Story / Themes / CANEX) */
.menu-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: center;
    margin-bottom: clamp(10px, 2vh, 16px);
}

.menu-tab-btn {
    flex: 1 1 auto;
    min-width: 120px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 9999px;
    border: 1px solid rgba(242, 193, 78, 0.25);
    background: rgba(18, 8, 4, 0.65);
    color: #dfcaa7;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.menu-tab-btn.active {
    background: rgba(193, 68, 14, 0.55);
    border-color: #f2c14e;
    color: #f5e6c8;
    box-shadow: 0 0 14px rgba(242, 193, 78, 0.3);
}

.story-panel .story-scroll {
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
    margin-top: 10px;
}

.narration-toggle-btn {
    width: 100%;
    margin-top: 6px;
}

.canex-version-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(242, 193, 78, 0.15);
    border: 1px solid rgba(242, 193, 78, 0.4);
    color: #f2c14e;
    font-size: 11px;
    font-weight: 700;
}

.title-block {
    text-align: center;
    margin-bottom: clamp(8px, 2vh, 16px);
}

.adinkra-badge {
    font-family: 'Cinzel', serif;
    font-size: clamp(9px, 1.8vw, 11px);
    letter-spacing: 3px;
    color: #c1440e;
    margin-bottom: 2px;
    font-weight: 700;
}

.main-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(22px, 5vw, 34px);
    font-weight: 900;
    letter-spacing: clamp(2px, 0.6vw, 4px);
    margin: 0;
    color: #f2c14e;
    text-shadow: 0 0 20px rgba(242, 193, 78, 0.5), 0 3px 6px #000;
}

.subtitle {
    margin: 4px 0 0;
    font-size: clamp(10px, 2vw, 13px);
    color: #dfcaa7;
    letter-spacing: 0.5px;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(10px, 2vw, 16px);
    width: 100%;
    margin-bottom: clamp(10px, 2.5vh, 18px);
}

.card-panel {
    background: rgba(18, 8, 4, 0.7);
    border: 1px solid rgba(242, 193, 78, 0.25);
    border-radius: 14px;
    padding: clamp(10px, 2vw, 16px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* --- AI Difficulty Selector (plan §4) --- */
.difficulty-panel {
    margin: clamp(6px, 1.4vh, 12px) 0;
    padding: clamp(8px, 1.6vw, 12px);
}

.difficulty-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.diff-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 120px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(242, 193, 78, 0.3);
    background: rgba(18, 8, 4, 0.6);
    color: #dfcaa7;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.diff-pill:hover {
    transform: translateY(-2px);
    border-color: rgba(242, 193, 78, 0.7);
}

.diff-pill.active {
    border-color: #f2c14e;
    background: rgba(242, 193, 78, 0.16);
    color: #f5e6c8;
    box-shadow: 0 0 14px rgba(242, 193, 78, 0.35);
}

.diff-emoji {
    font-size: 18px;
    line-height: 1;
}

.diff-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.diff-desc {
    font-size: 10px;
    opacity: 0.75;
    text-align: center;
}

.diff-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(242, 193, 78, 0.5);
    background: rgba(18, 8, 4, 0.65);
    color: #f2c14e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
}

.panel-heading {
    font-family: 'Cinzel', serif;
    font-size: clamp(11px, 2vw, 13px);
    color: #f2c14e;
    margin: 0 0 clamp(8px, 1.8vh, 12px) 0;
    letter-spacing: 1px;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 8px);
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(36, 17, 9, 0.65);
    border: 1px solid rgba(242, 193, 78, 0.2);
    border-radius: 10px;
    padding: clamp(6px, 1.4vh, 10px) 12px;
    color: #f5e6c8;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background: rgba(193, 68, 14, 0.35);
    border-color: #f2c14e;
    transform: translateY(-1px);
}

.option-btn.active {
    background: rgba(193, 68, 14, 0.6);
    border-color: #f2c14e;
    box-shadow: 0 0 16px rgba(242, 193, 78, 0.3);
}

.btn-icon {
    font-size: clamp(16px, 3vw, 20px);
}

.btn-content strong {
    display: block;
    font-size: clamp(11px, 2vw, 13px);
    color: #ffffff;
}

.btn-content span {
    font-size: clamp(9px, 1.6vw, 10.5px);
    color: #c9a06a;
}

/* Multiplayer Room Panel */
.mp-panel {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(22, 51, 57, 0.35);
    border: 1px solid rgba(72, 201, 176, 0.3);
}

.mp-role-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.mp-tab {
    flex: 1;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    background: rgba(18, 8, 4, 0.6);
    border: 1px solid rgba(242, 193, 78, 0.2);
    color: #dfcaa7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-tab.active {
    background: rgba(72, 201, 176, 0.25);
    border-color: #48c9b0;
    color: #48c9b0;
    box-shadow: 0 0 10px rgba(72, 201, 176, 0.2);
}

.mp-host-box, .mp-join-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mp-code-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 5, 2, 0.7);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px dashed rgba(242, 193, 78, 0.4);
}

.code-label {
    font-size: 11px;
    color: #dfcaa7;
}

.code-value {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    color: #f2c14e;
    letter-spacing: 2px;
}

.mp-btn-row {
    display: flex;
    gap: 6px;
}

.compact-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
}

.mp-status-indicator {
    font-size: 10px;
    color: #dfcaa7;
}

.status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 10px;
}

.status-pill.connected {
    background: rgba(46, 196, 182, 0.2);
    color: #2ec4b6;
    border: 1px solid #2ec4b6;
}

.status-pill.waiting {
    background: rgba(245, 176, 65, 0.15);
    color: #f5b041;
    border: 1px solid #f5b041;
}

.mp-input-row {
    display: flex;
    gap: 6px;
}

.mp-code-input {
    flex: 1;
    background: rgba(13, 5, 2, 0.8);
    border: 1px solid rgba(242, 193, 78, 0.4);
    border-radius: 6px;
    padding: 6px 10px;
    color: #f2c14e;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.mp-code-input:focus {
    outline: none;
    border-color: #f2c14e;
    box-shadow: 0 0 8px rgba(242, 193, 78, 0.4);
}

.character-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    background: rgba(13, 5, 2, 0.5);
    border-radius: 10px;
    padding: 6px 10px;
}

.char-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.char-badge .avatar {
    font-size: 20px;
}

.char-badge strong {
    display: block;
    font-size: 11px;
    color: #ffffff;
}

.char-badge small {
    font-size: 9px;
    color: #c9a06a;
}

.vs-sign {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: #c1440e;
    font-weight: 900;
}

/* Themes Grid */
.themes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(6px, 1.2vh, 8px);
}

.theme-card {
    background: rgba(36, 17, 9, 0.65);
    border: 1.5px solid rgba(242, 193, 78, 0.2);
    border-radius: 10px;
    padding: clamp(6px, 1.2vh, 8px);
    color: #f5e6c8;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.theme-card:hover {
    transform: translateY(-1px);
    border-color: #f2c14e;
}

.theme-card.active {
    background: rgba(193, 68, 14, 0.35);
    box-shadow: 0 0 14px rgba(242, 193, 78, 0.25);
}

.theme-glyph {
    font-size: 16px;
    margin-bottom: 2px;
}

.theme-name {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
}

.theme-blurb {
    font-size: 9px;
    color: #dfcaa7;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Menu Actions */
.menu-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.primary-btn {
    background: linear-gradient(135deg, #c1440e 0%, #e67e22 100%);
    border: 1px solid #f2c14e;
    color: #ffffff;
    font-family: 'Cinzel', serif;
    font-size: clamp(12px, 2.5vw, 14px);
    font-weight: 800;
    letter-spacing: 2px;
    padding: clamp(8px, 1.8vh, 12px) clamp(20px, 4vw, 32px);
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(193, 68, 14, 0.6);
    transition: all 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 26px rgba(242, 193, 78, 0.6);
}

.pulse-glow {
    animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(242, 193, 78, 0.4); }
    50% { box-shadow: 0 0 28px rgba(242, 193, 78, 0.8); }
}

.secondary-actions {
    display: flex;
    gap: 16px;
}

.text-btn {
    background: transparent;
    border: none;
    color: #dfcaa7;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 4px 8px;
    transition: color 0.2s;
}

.text-btn:hover {
    color: #f2c14e;
}

/* ==========================================================================
   IN-GAME HUD
   ========================================================================== */

.hud-layer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(6px, 1.5vh, 12px) clamp(10px, 2vw, 18px);
    box-sizing: border-box;
}

.top-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(18, 8, 4, 0.55);
    border: 1px solid rgba(242, 193, 78, 0.28);
    border-radius: 9999px;
    padding: 5px 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 215, 106, 0.12);
    transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
    max-height: 120px;
}

.top-hud.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-16px);
    border-width: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.score-pill {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-avatar {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.score-name {
    font-size: 10.5px;
    color: #c9a06a;
    font-weight: 600;
}

.score-value {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
}

@media (max-width: 480px) {
    .score-avatar {
        font-size: 15px;
    }

    .score-name {
        font-size: 8.5px;
    }

    .score-value {
        font-size: 13px;
    }
}

.score-pill.elder .score-value {
    color: #f2c14e;
}

.score-pill.spirit .score-value {
    color: #b57bee;
}

.score-target {
    font-size: 10px;
    color: #a89379;
    font-weight: normal;
}

.match-center-badge {
    text-align: center;
}

.theme-tag {
    font-size: 9.5px;
    font-weight: bold;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.room-badge {
    background: rgba(72, 201, 176, 0.2);
    border: 1px solid #48c9b0;
    color: #48c9b0;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px;
}

.turn-banner {
    font-family: 'Cinzel', serif;
    font-size: clamp(12px, 2.2vw, 15px);
    font-weight: 800;
    letter-spacing: 1.5px;
    margin: 1px 0;
}

.turn-elder {
    color: #f2c14e;
    text-shadow: 0 0 8px rgba(242, 193, 78, 0.6);
}

.turn-spirit {
    color: #b57bee;
    text-shadow: 0 0 8px rgba(181, 123, 238, 0.6);
}

.turn-sub {
    font-size: 8.5px;
    color: #a89379;
}

.top-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-zen-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 9999px;
    background: rgba(36, 17, 9, 0.85);
    border: 1px solid rgba(242, 193, 78, 0.4);
    color: #f2c14e;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-zen-btn:hover {
    border-color: #f2c14e;
    background: rgba(193, 68, 14, 0.7);
    box-shadow: 0 0 10px rgba(242, 193, 78, 0.4);
    transform: translateY(-1px);
}

.hud-icon-btn {
    background: rgba(36, 17, 9, 0.85);
    border: 1px solid rgba(242, 193, 78, 0.3);
    border-radius: 9999px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f5e6c8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-icon-btn:hover {
    border-color: #f2c14e;
    background: rgba(193, 68, 14, 0.6);
    transform: translateY(-1px);
}

.header-fold-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    background: rgba(36, 17, 9, 0.85);
    border: 1px solid rgba(242, 193, 78, 0.35);
    color: #f2c14e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-fold-btn:hover {
    border-color: #f2c14e;
    background: rgba(193, 68, 14, 0.6);
    transform: translateY(-1px);
}

/* Floating mini status pill */
.mini-status-pill {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 14px;
    border-radius: 9999px;
    background: rgba(18, 8, 4, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(242, 193, 78, 0.3);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
    z-index: 60;
}

.mini-turn {
    font-family: 'Cinzel', serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #f2c14e;
    white-space: nowrap;
}

.mini-turn.spirit {
    color: #b57bee;
}

.mini-scores {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
}

.mini-scores .elder-score { color: #f2c14e; }
.mini-scores .spirit-score { color: #b57bee; }
.mini-scores .score-sep { color: #a89379; font-weight: 400; }

/* Bottom Proverb & Sleek Pit Bar */
.bottom-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: max(4px, env(safe-area-inset-bottom));
}

.proverb-card {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    max-width: min(92vw, 680px);
    gap: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(18, 8, 4, 0.6);
    border: 1px solid rgba(242, 193, 78, 0.3);
    border-radius: 14px;
    padding: 4px 10px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.proverb-card.spirit {
    border-color: rgba(181, 123, 238, 0.4);
}

.speaker-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.proverb-body {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.speaker-title {
    display: inline;
    flex-shrink: 0;
    font-size: 9px;
    letter-spacing: 1px;
    font-weight: 700;
    color: #f2c14e;
    font-family: 'Cinzel', serif;
}

.proverb-card.spirit .speaker-title {
    color: #b57bee;
}

.proverb-quote {
    display: inline;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    font-size: 9.5px;
    font-style: italic;
    color: #f5e6c8;
}

.proverb-dismiss-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(242, 193, 78, 0.25);
    color: #dfcaa7;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.proverb-dismiss-btn:hover {
    color: #ffffff;
    border-color: #f2c14e;
    background: rgba(193, 68, 14, 0.6);
}

.proverb-restore-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(18, 8, 4, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(242, 193, 78, 0.3);
    color: #dfcaa7;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-out;
}

.proverb-restore-btn:hover {
    color: #f2c14e;
    border-color: #f2c14e;
    transform: translateY(-1px);
}

/* Sleek Pit Touch Bar */
.pit-touch-bar.sleek {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(18, 8, 4, 0.55);
    border: 1px solid rgba(242, 193, 78, 0.25);
    border-radius: 16px;
    padding: 4px 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.pit-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.pit-bar-label {
    font-size: 9.5px;
    color: #c9a06a;
}

.pit-bar-toggle-btn {
    background: transparent;
    border: none;
    color: #a89379;
    font-size: 9px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.pit-bar-toggle-btn:hover {
    color: #f2c14e;
}

.pit-bar-restore-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: rgba(18, 8, 4, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(242, 193, 78, 0.3);
    color: #dfcaa7;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-out;
}

.pit-bar-restore-btn:hover {
    color: #f2c14e;
    border-color: #f2c14e;
    transform: translateY(-1px);
}

.pit-buttons-row {
    display: flex;
    gap: 6px;
}

.pit-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 3px 6px;
    background: rgba(36, 17, 9, 0.7);
    border: 1px solid rgba(242, 193, 78, 0.25);
    border-radius: 9999px;
    color: #f5e6c8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pit-quick-btn:hover:not(:disabled) {
    background: rgba(193, 68, 14, 0.5);
    border-color: #f2c14e;
    transform: translateY(-2px);
}

.pit-quick-btn.legal {
    border-color: #2ec4b6;
    box-shadow: 0 0 8px rgba(46, 196, 182, 0.25);
}

.pit-quick-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pit-num {
    font-size: 8.5px;
    color: #c9a06a;
    font-weight: bold;
}

.pit-count {
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
}

/* ==========================================================================
   MODALS & FINISHED DIVINATION SCREEN
   ========================================================================== */

.modal-box {
    background: rgba(18, 8, 4, 0.92);
    border: 1px solid rgba(242, 193, 78, 0.4);
    border-radius: 16px;
    padding: clamp(14px, 3vh, 24px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    max-width: 500px;
    width: 90%;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: #f2c14e;
    margin: 0;
}

.close-x {
    background: transparent;
    border: none;
    color: #dfcaa7;
    font-size: 16px;
    cursor: pointer;
}

.rules-content {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 14px;
}

.rules-content h4 {
    color: #f2c14e;
    font-size: 12px;
    margin: 10px 0 3px;
}

.rules-content p {
    font-size: 11px;
    line-height: 1.45;
    color: #dfcaa7;
    margin: 0 0 6px;
}

.handoff-box {
    text-align: center;
    max-width: 400px;
}

.handoff-avatar {
    font-size: 40px;
    margin-bottom: 8px;
}

.handoff-box h2 {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #f2c14e;
    margin: 0 0 6px;
}

.handoff-box p {
    font-size: 12px;
    color: #dfcaa7;
    margin-bottom: 16px;
}

/* Divination Reading */
.divination-container {
    width: 90%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(10px, 2vh, 18px);
    background: rgba(18, 8, 4, 0.94);
    border: 1px solid rgba(242, 193, 78, 0.4);
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    max-height: 90vh;
    overflow-y: auto;
}

.divination-header {
    text-align: center;
    margin-bottom: 10px;
}

.outcome-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(16px, 3.5vw, 22px);
    color: #f2c14e;
    margin: 4px 0;
}

.destiny-badge {
    font-size: 11px;
    color: #c9a06a;
}

.destiny-badge strong {
    color: #ffd700;
}

.stats-strip {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.stat-card {
    flex: 1;
    background: rgba(36, 17, 9, 0.6);
    border: 1px solid rgba(242, 193, 78, 0.2);
    border-radius: 8px;
    padding: 6px;
    text-align: center;
}

.stat-label {
    font-size: 9px;
    color: #a89379;
}

.stat-val {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.stat-val.elder { color: #f2c14e; }
.stat-val.spirit { color: #b57bee; }
.stat-val.gold { color: #ffd700; }

.reading-card {
    position: relative;
    background: rgba(26, 15, 8, 0.7);
    border: 1px solid rgba(242, 193, 78, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.theme-corner-glyph {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 20px;
    opacity: 0.4;
}

.reading-theme-title {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: #f2c14e;
    margin: 0 0 8px;
}

.reading-paragraph {
    font-size: 11px;
    line-height: 1.5;
    color: #f5e6c8;
    margin: 0 0 8px;
}

.reading-paragraph:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: #ffd700;
}

.divination-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.secondary-btn {
    background: rgba(36, 17, 9, 0.85);
    border: 1px solid rgba(242, 193, 78, 0.35);
    color: #f5e6c8;
    font-size: 11px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: #f2c14e;
    background: rgba(193, 68, 14, 0.5);
}

.toast-notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 8, 4, 0.95);
    border: 1px solid #f2c14e;
    color: #f2c14e;
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================================================
   RESPONSIVE MOBILE BREAKPOINTS
   ========================================================================== */

@media (max-width: 768px) {
    .menu-screen {
        padding-left: 8px;
        padding-right: 8px;
    }

    .menu-container {
        width: 100%;
        max-width: 100%;
        padding: 10px 4px;
    }

    .menu-tab-nav {
        gap: 6px;
    }

    .menu-tab-btn {
        min-width: 0;
        flex: 1 1 40%;
        font-size: 10.5px;
        padding: 10px 6px;
        min-height: 48px;
    }

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

    .difficulty-pills {
        flex-direction: column;
    }

    .diff-pill {
        width: 100%;
        min-width: 0;
    }

    .card-panel {
        width: 100%;
        box-sizing: border-box;
    }

    .story-panel .story-scroll {
        max-height: 34vh;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .btn-label-text {
        display: none;
    }

    .hud-zen-btn {
        padding: 5px 8px;
    }

    .proverb-card {
        max-width: 92vw;
    }

    .turn-banner {
        font-size: clamp(10px, 1.8vw, 13px);
    }

    .hud-icon-btn,
    .header-fold-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
        padding: 3px 6px;
    }

    .mini-status-pill {
        padding: 3px 10px;
        font-size: 9px;
        gap: 8px;
    }

    .mini-turn {
        font-size: 9px;
    }

    .mini-scores {
        font-size: 9px;
    }

    .pit-touch-bar.sleek {
        padding: 3px 8px;
        gap: 3px;
    }

    .pit-quick-btn {
        min-width: 36px;
        height: 26px;
        padding: 2px 4px;
    }

    .pit-num {
        font-size: 7.5px;
    }

    .pit-count {
        font-size: 10px;
    }

    .pit-bar-label {
        font-size: 8.5px;
    }

    .modal-box {
        padding: clamp(10px, 2.5vh, 16px);
        width: 94%;
    }

    .modal-header h2 {
        font-size: clamp(13px, 3vw, 15px);
    }

    .modal-box,
    .modal-box p,
    .modal-box li,
    .modal-box span {
        font-size: clamp(11px, 2.5vw, 14px);
    }
}