/* ===== ANECDOTE OVERLAY (immersive full-screen) ===== */
.anecdote-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 3, 1, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: anecdoteFadeIn 0.8s ease-out;
    cursor: pointer;
}

.anecdote-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 560px;
    padding: 32px 40px;
    text-align: center;
    animation: anecdoteCardIn 0.8s ease-out 0.2s both;
}

.anecdote-portrait {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    background: #1a0e06;
    box-shadow: 0 0 30px rgba(180, 150, 110, 0.4), 0 4px 20px rgba(0,0,0,0.6);
    margin-bottom: 16px;
    animation: portraitPopIn 0.6s ease-out 0.3s both;
}

.anecdote-label {
    font-family: var(--font-score);
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0.8;
}

.anecdote-text {
    font-family: 'IM Fell DW Pica', serif;
    font-size: 1.15rem;
    color: var(--parchment);
    font-style: italic;
    line-height: 1.7;
    max-height: 50vh;
    overflow-y: auto;
}

.anecdote-hint {
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    animation: anecdoteHintIn 0.5s ease-out 2s both;
}

.anecdote-overlay.anecdote-fade-out {
    animation: anecdoteFadeOut 0.8s ease-in forwards;
}

@keyframes anecdoteFadeIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(12px); }
}

@keyframes anecdoteFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

@keyframes anecdoteHintIn {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

@media (max-width: 500px) {
    .anecdote-card {
        padding: 24px 20px;
        max-width: 90vw;
    }
    .anecdote-portrait {
        width: 72px;
        height: 72px;
    }
    .anecdote-text {
        font-size: 1rem;
    }
}

/* Responsive: mobile epilogue */
@media (max-width: 500px) {
    .epilogue-icon svg {
        width: 60px;
        height: 60px;
    }
}

/* ===== 3D DICE ===== */
.die-3d {
    width: 82px;
    height: 82px;
    position: relative;
    perspective: 600px;
}

/* Empty placeholder */
.die-3d.empty {
    border: 3px dashed var(--gold);
    border-radius: 10px;
    background: var(--parchment-dark);
    opacity: 0.5;
}

.die-3d.empty .die-cube {
    display: none;
}

/* The rotating cube */
.die-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(0deg) rotateY(0deg);
}

/* Each face of the cube */
.die-face {
    position: absolute;
    width: 82px;
    height: 82px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25) 0%, transparent 50%),
        linear-gradient(145deg, #f5efe0 0%, #e8dcc4 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 10px;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    backface-visibility: hidden;
}

/* Face placement on cube (opposite faces sum to 7) */
.face-1 { transform: translateZ(41px); }
.face-6 { transform: rotateY(180deg) translateZ(41px); }
.face-3 { transform: rotateY(90deg) translateZ(41px); }
.face-4 { transform: rotateY(-90deg) translateZ(41px); }
.face-2 { transform: rotateX(90deg) translateZ(41px); }
.face-5 { transform: rotateX(-90deg) translateZ(41px); }

/* Dots — classic black pips.
   Use visibility (not display) so hidden dots still occupy their grid cell. */
.die-face .dot {
    width: 13px;
    height: 13px;
    background: radial-gradient(circle at 40% 35%, #333, #111);
    border-radius: 50%;
    align-self: center;
    justify-self: center;
    visibility: hidden;
    box-shadow:
        inset 0 2px 3px rgba(0, 0, 0, 0.8),
        inset 0 -1px 1px rgba(255, 255, 255, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

.die-face .dot.visible {
    visibility: visible;
}

/* Highlight glow on combination */
.die-3d.highlight .die-face {
    border-color: var(--accent);
    box-shadow:
        0 0 20px rgba(122, 40, 20, 0.6),
        0 0 40px rgba(122, 40, 20, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* ===== THROW ANIMATION ===== */
/* Shadow underneath the die */
.die-3d::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 15%;
    width: 70%;
    height: 8px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.die-3d.empty::after {
    display: none;
}

.die-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.die-separator {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--gold);
    align-self: center;
}

/* Responsive dice */
@media (max-width: 500px) {
    .die-3d {
        width: 64px;
        height: 64px;
    }
    .die-face {
        width: 64px;
        height: 64px;
        padding: 7px;
    }
    .face-1 { transform: translateZ(32px); }
    .face-6 { transform: rotateY(180deg) translateZ(32px); }
    .face-3 { transform: rotateY(90deg) translateZ(32px); }
    .face-4 { transform: rotateY(-90deg) translateZ(32px); }
    .face-2 { transform: rotateX(90deg) translateZ(32px); }
    .face-5 { transform: rotateX(-90deg) translateZ(32px); }
    .die-face .dot {
        width: 10px;
        height: 10px;
    }
    .die-3d::after {
        bottom: -6px;
    }
    .dice-label {
        font-size: 0.8rem;
    }
}

/* Torch lighting pulse — warm glow that subtly breathes on dice area border */
.dice-area {
    animation: torchLighting 4s ease-in-out infinite;
}

/* Active player progress bar inside dice area */
.dice-progress {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    max-width: 400px;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 8px;
}
.dice-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(180,150,110,0.2);
}
.dice-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--gold), #f0c040);
    border-radius: 3px;
    transition: width 0.8s ease-out;
}
.dice-progress-label {
    font-family: var(--font-score);
    font-size: 0.75rem;
    color: var(--gold-light);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
}

/* Log entry enrichment */
.log-entries li.log-positive {
    color: var(--success);
}
.log-entries li.log-negative {
    color: var(--danger-light);
}
.log-entries li .log-icon {
    margin-right: 4px;
}

/* ===== SCOREBOARD ===== */
.scoreboard {
    padding: 20px;
}

.scoreboard h3 {
    font-size: 1.15rem;
    text-align: center;
    margin-bottom: 14px;
}

.scoreboard h3::after {
    content: '';
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 4px auto 0;
}

.score-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px dotted rgba(180, 150, 110, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.score-entry:last-child {
    border-bottom: none;
}

.score-entry.active {
    color: var(--accent);
    font-weight: bold;
    background: linear-gradient(90deg, rgba(180, 150, 110, 0.15) 0%, transparent 100%);
    border-left: 4px solid var(--gold);
    padding-left: 12px;
    animation: activePulse 2s ease-in-out infinite;
}
@keyframes activePulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: inset 0 0 12px rgba(212, 168, 67, 0.15); }
}

/* Avatar column: rank badge + portrait */
.score-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.score-avatar-wrap .score-rank {
    position: absolute;
    top: -4px;
    left: -4px;
    font-size: 0.65rem;
    font-family: var(--font-score);
    background: linear-gradient(180deg, #5a1a0a, #3a0e04);
    color: var(--parchment-light);
    border: 1px solid var(--gold);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 1;
}

.score-portrait {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
    display: block;
    background: var(--parchment-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.score-blason-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: var(--parchment-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.score-blason-avatar svg,
.score-blason-avatar img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.score-initials {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(180deg, #5a1a0a, #3a0e04);
    color: var(--parchment-light);
    font-family: var(--font-score);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Info column: name + progress bar */
.score-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.score-name {
    font-family: var(--font-body);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.score-name .badge {
    font-size: 0.6rem;
    padding: 1px 4px;
    border: 1px solid var(--gold);
    color: var(--gold);
    border-radius: 3px;
    background: rgba(180, 150, 110, 0.08);
    position: relative;
    cursor: help;
}

.score-name .badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: linear-gradient(180deg, #3a0e04, #2a0a02);
    color: var(--parchment-light);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: normal;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--gold);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 50;
}

.score-name .badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Score column: big number + hint */
.score-right {
    text-align: right;
    flex-shrink: 0;
}

.score-value {
    font-family: var(--font-score);
    font-size: 1.6rem;
    color: var(--gold);
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.1s ease, color 0.2s;
}

.score-arcade-done {
    animation: scoreArcadePop 0.4s ease-out;
}

@keyframes scoreArcadePop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); color: #fff; text-shadow: 0 0 12px rgba(212,165,74,0.8); }
    100% { transform: scale(1); }
}

.score-bar {
    width: 100%;
    height: 5px;
    background: var(--parchment-dark);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== MILESTONE TOAST ===== */
.milestone-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 400;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: linear-gradient(145deg, #2a1a08, #1a0e06);
    border: 2px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(212, 168, 67, 0.4), 0 8px 30px rgba(0, 0, 0, 0.6);
    animation: milestoneIn 0.5s ease-out, milestoneOut 0.5s ease-in 2.8s forwards;
}
.milestone-icon {
    font-size: 2rem;
    animation: milestoneIconBounce 0.6s ease-out;
}
.milestone-text {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 168, 67, 0.3);
}
@keyframes milestoneIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    70% { transform: translate(-50%, -50%) scale(1.05); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes milestoneOut {
    0% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -60%) scale(0.9); }
}
@keyframes milestoneIconBounce {
    0% { transform: scale(0) rotate(-20deg); }
    50% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ===== AI SPEECH BUBBLE (BD style — overlay on dice area) ===== */
.ai-speech-bubble {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    gap: 0;
    pointer-events: none;
    animation: speechBubbleIn 0.5s ease-out;
}

.ai-speech-bubble.fade-out {
    animation: speechBubbleOut 0.5s ease-in forwards;
}

.ai-speech-portrait {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    background: #1a0e06;
    box-shadow: 0 3px 14px rgba(0,0,0,0.6), 0 0 0 2px rgba(180,150,110,0.3);
    animation: portraitPopIn 0.5s ease-out;
    z-index: 2;
}

.ai-speech-content {
    position: relative;
    background: rgba(10, 6, 2, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid var(--gold-light);
    border-radius: 12px;
    padding: 10px 16px;
    margin-left: -10px;
    flex: 1;
    max-width: 480px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Arrow pointing left toward the portrait */
.ai-speech-content::before {
    content: '';
    position: absolute;
    bottom: 16px;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--gold-light);
}
.ai-speech-content::after {
    content: '';
    position: absolute;
    bottom: 18px;
    left: -7px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(10, 6, 2, 0.92);
}

.ai-speech-name {
    font-family: var(--font-score);
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: 3px;
}

.ai-speech-line {
    font-family: 'IM Fell DW Pica', serif;
    font-size: 0.95rem;
    color: var(--parchment);
    font-style: italic;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .ai-speech-portrait {
        width: 56px;
        height: 56px;
    }
    .ai-speech-content {
        max-width: none;
    }
}

@media (max-width: 500px) {
    .ai-speech-bubble {
        bottom: 10px;
        left: 8px;
        right: 8px;
    }
    .ai-speech-portrait {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }
    .ai-speech-content {
        padding: 8px 12px;
    }
    .ai-speech-line {
        font-size: 0.85rem;
    }
}

/* ===== COMMENTARY BUBBLE (Père Blaise) ===== */
.commentary-bubble {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    max-width: 560px;
    width: 90%;
    background: rgba(10, 6, 2, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid var(--gold-light);
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 168, 67, 0.15);
    animation: commentaryBubbleIn 0.4s ease-out;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.commentary-portrait {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
    flex-shrink: 0;
    background: #1a0e06;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.commentary-bubble.fade-out {
    animation: commentaryBubbleOut 0.5s ease-in forwards;
}
.commentary-bubble-text {
    font-family: 'IM Fell DW Pica', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--parchment);
    line-height: 1.5;
}
.commentary-bubble-text::after {
    content: '|';
    animation: blink-cursor 0.7s step-end infinite;
    color: var(--gold);
    font-style: normal;
    margin-left: 2px;
}
.commentary-bubble.energy-high {
    border-color: var(--gold);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 168, 67, 0.3);
}
.commentary-bubble.energy-low {
    opacity: 0.85;
}
@keyframes commentaryBubbleIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.95); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes commentaryBubbleOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@media (max-width: 500px) {
    .commentary-bubble {
        top: 8px;
        padding: 8px 12px;
        max-width: 95vw;
        gap: 8px;
    }
    .commentary-portrait {
        width: 36px;
        height: 36px;
    }
    .commentary-bubble-text {
        font-size: 0.85rem;
    }
}

/* ===== STREAK BADGE ===== */
.streak-badge {
    font-size: 0.7rem;
    color: #f59e0b;
    margin-left: 4px;
    animation: streakPulse 0.8s ease-in-out infinite alternate;
}
@keyframes streakPulse {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.15); }
}

/* Streak inferno (7+ consecutive) */
.streak-badge.streak-inferno {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
    animation: streakInferno 0.5s ease-in-out infinite alternate;
}
@keyframes streakInferno {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.2); filter: brightness(1.3); }
}

/* Streak glow on score entry */
.score-entry.on-streak {
    box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.15);
}
.score-entry.on-fire {
    box-shadow: inset 0 0 16px rgba(245, 158, 11, 0.25);
    animation: onFireGlow 1s ease-in-out infinite alternate;
}
@keyframes onFireGlow {
    0% { box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.2); }
    100% { box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.35); }
}

/* ===== NEAR-VICTORY ===== */
.score-entry.near-victory .score-bar-fill {
    background: linear-gradient(90deg, var(--gold), #f0c040, var(--gold));
    background-size: 200% 100%;
    animation: nearVictoryBar 2s linear infinite;
}
@keyframes nearVictoryBar {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}
.score-entry.near-victory-hot .score-bar-fill {
    box-shadow: 0 0 8px rgba(240, 192, 64, 0.5);
}
.score-entry.near-victory-hot {
    animation: nearVictoryPulse 1.5s ease-in-out infinite alternate;
}
@keyframes nearVictoryPulse {
    0% { box-shadow: inset 0 0 6px rgba(212, 168, 67, 0.1); }
    100% { box-shadow: inset 0 0 14px rgba(212, 168, 67, 0.3); }
}

.victory-hint {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    color: var(--gold);
    opacity: 0.8;
    margin-top: 1px;
    letter-spacing: 0.03em;
    animation: victoryHintFade 2s ease-in-out infinite alternate;
}
@keyframes victoryHintFade {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== ACTION STATUS BAR ===== */
.action-status-bar {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 5;
    display: flex;
    gap: 6px;
    pointer-events: none;
}
.action-status-bar:empty { display: none; }

.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    animation: badgeFadeIn 0.4s ease-out backwards;
}
.action-badge.badge-grelotine {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.action-badge.badge-civet {
    background: rgba(212, 168, 67, 0.2);
    border: 1px solid rgba(212, 168, 67, 0.4);
    color: var(--gold);
}
.action-badge.badge-sirop {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}
.action-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: badgeDotPulse 1.5s ease-in-out infinite;
}
.badge-grelotine .badge-dot { background: #ef4444; }
.badge-civet .badge-dot { background: var(--gold); }
.badge-sirop .badge-dot { background: #3b82f6; }

@keyframes badgeFadeIn {
    0% { opacity: 0; transform: translateY(-8px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes badgeDotPulse {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* Pre-roll readying pulse */
.dice-area.readying {
    animation: readyingPulse 0.8s ease-in-out;
}
@keyframes readyingPulse {
    0% { border-color: #8b6e4e; }
    50% { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(212, 168, 67, 0.3); }
    100% { border-color: var(--gold); }
}

/* Active player spotlight on scoreboard */
.score-entry.active .score-name {
    position: relative;
}
.score-entry.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gold);
    border-radius: 2px;
    animation: spotlightSlide 0.4s ease-out;
}
@keyframes spotlightSlide {
    0% { transform: scaleY(0); opacity: 0; }
    100% { transform: scaleY(1); opacity: 1; }
}

/* ===== COMBO-DEX (Mastery panel) ===== */
.combo-dex-panel {
    padding: 12px;
    margin-top: 12px;
}
.combo-dex-panel h3 {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 8px;
}
.mastery-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 4px;
    border-bottom: 1px dotted rgba(180, 150, 110, 0.2);
    font-size: 0.8rem;
}
.mastery-row:last-child { border-bottom: none; }
.mastery-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.mastery-name { font-family: var(--font-score); font-size: 0.78rem; color: var(--accent); min-width: 70px; }
.mastery-stars { color: var(--gold); font-size: 0.72rem; letter-spacing: -1px; }
.mastery-count { font-family: var(--font-ui); font-size: 0.7rem; color: var(--ink-light); margin-left: auto; }
.mastery-best { font-family: var(--font-ui); font-size: 0.65rem; color: var(--gold); opacity: 0.7; }
.mastery-reflex { background: rgba(180, 150, 110, 0.06); border-radius: 4px; margin-top: 4px; }
.mastery-bar { width: 100%; height: 3px; background: rgba(180, 150, 110, 0.15); border-radius: 2px; margin-top: 3px; }
.mastery-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 2px; transition: width 0.5s ease; }

/* ===== EMOTES KAAMELOTT ===== */
.emote-panel {
    padding: 12px;
    margin-top: 12px;
}

.emote-panel h3 {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 8px;
}

.emote-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.emote-btn {
    background: var(--parchment-dark);
    border: 1px solid rgba(180, 150, 110, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 6px 2px;
    transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.emote-btn:hover {
    transform: scale(1.15);
    background: rgba(180, 150, 110, 0.15);
    box-shadow: 0 0 8px rgba(212, 165, 74, 0.3);
}

.emote-btn:active {
    transform: scale(0.95);
}

/* Emote toast — floating notification */
.emote-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.emote-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--parchment);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: emoteToastIn 0.3s ease-out, emoteToastOut 0.5s ease-in 3.2s forwards;
    max-width: 320px;
}

.emote-toast-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.emote-toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.emote-toast-player {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.emote-toast-quote {
    font-family: 'IM Fell DW Pica', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--ink);
}

.emote-toast-char {
    font-size: 0.7rem;
    color: var(--ink-light);
}

@keyframes emoteToastIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* ===== REFLEX SCREEN (immersive fullscreen) ===== */
.reflex-screen {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.reflex-screen.hidden { display: none; }

/* Pulsing background */
.reflex-bg-pulse {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    animation: reflexBgPulse 0.8s ease-in-out infinite alternate;
}
.reflex-screen.type-chouette-velute .reflex-bg-pulse {
    background: radial-gradient(circle at center, rgba(212, 168, 67, 0.4) 0%, transparent 70%);
}
.reflex-screen.type-suite .reflex-bg-pulse {
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
}
@keyframes reflexBgPulse {
    0% { transform: scale(0.9); opacity: 0.2; }
    100% { transform: scale(1.2); opacity: 0.5; }
}

/* Content container */
.reflex-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
    pointer-events: none;
}

/* Phrase */
.reflex-phrase-wrap {
    overflow: hidden;
}
.reflex-phrase {
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--parchment-light);
    text-align: center;
    text-shadow: 0 0 20px rgba(180, 150, 110, 0.5), 0 2px 6px rgba(0,0,0,0.7);
    animation: reflexZoomIn 0.3s ease-out;
    margin: 0;
}
@keyframes reflexZoomIn {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.reflex-info {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    color: var(--gold);
    text-align: center;
    margin: 0;
    opacity: 0.9;
}

/* Circular timer ring */
.reflex-timer-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin-top: 8px;
}
.reflex-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.reflex-timer-track {
    fill: none;
    stroke: rgba(180, 150, 110, 0.15);
    stroke-width: 6;
}
.reflex-timer-fill {
    fill: none;
    stroke: var(--gold);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 276.46;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset linear;
}
.reflex-screen.type-suite .reflex-timer-fill {
    stroke: #ef4444;
}
.reflex-timer-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-score);
    font-size: 1rem;
    color: var(--parchment-light);
    letter-spacing: 0.1em;
    animation: reflexTapPulse 0.6s ease-in-out infinite alternate;
}
@keyframes reflexTapPulse {
    0% { opacity: 0.6; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* Clicked / reacted state */
.reflex-screen.reacted .reflex-bg-pulse {
    animation: none;
    opacity: 0.1;
}
.reflex-screen.reacted .reflex-timer-label {
    animation: none;
    opacity: 0.3;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(3px);
}

.modal-overlay.hidden { display: none; }

.modal {
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 12px;
    color: var(--ink-light);
}

.modal .btn-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* ===== SPECIAL PANEL OVERLAY (inside dice-area) ===== */
.special-panel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
}

.special-panel-overlay:empty {
    display: none;
}

.special-panel-overlay > * {
    pointer-events: auto;
}

.special-panel-overlay .sirop-panel,
.special-panel-overlay .grelotine-panel {
    background: rgba(10, 6, 2, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--gold-light);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(180, 150, 110, 0.1);
    animation: slideUpOverlay 0.3s ease-out;
}

@keyframes slideUpOverlay {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== SIROP PANEL ===== */
.sirop-panel {
    padding: 20px;
    margin-top: 0;
}

.sirop-panel h3 {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 12px;
    color: var(--gold);
}

.bird-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.bird-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    font-size: 0.85rem;
}

.bird-btn .bird-value {
    font-family: var(--font-score);
    font-size: 1.2rem;
    color: var(--accent);
}

.bird-btn .bird-name {
    font-style: italic;
    color: var(--ink-light);
    font-size: 0.8rem;
}

/* ===== GRELOTINE PANEL ===== */
.grelotine-panel {
    padding: 20px;
}

.grelotine-panel h3 {
    text-align: center;
    margin-bottom: 12px;
    color: var(--gold);
}

.grelotine-targets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.grelotine-combo-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 12px 0;
}

/* ===== GAME OVER ===== */
.game-over-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
}

.game-over-card {
    padding: 60px 50px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.game-over-card h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.game-over-card .winner-name {
    font-family: var(--font-score);
    font-size: 1.8rem;
    color: var(--gold);
    margin: 15px 0;
}

.game-over-card .final-scores {
    margin: 20px 0;
    text-align: left;
}

/* Game over stat icons */
.game-stats .stat-row {
    transition: opacity 0.3s ease;
}
.game-stats .stat-icon {
    margin-right: 6px;
}
.winner-crown {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
    animation: crownBounce 1s ease-out;
}
@keyframes crownBounce {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(5deg); opacity: 1; }
    70% { transform: scale(0.9) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
/* Winner name dramatic reveal */
.winner-reveal {
    animation: winnerReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.winner-reveal .winner-name-text {
    display: inline-block;
    animation: winnerGlow 2s ease-in-out 0.8s infinite alternate;
}
@keyframes winnerReveal {
    0% { transform: scale(0.4); opacity: 0; filter: blur(8px); }
    60% { transform: scale(1.1); opacity: 1; filter: blur(0); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}
@keyframes winnerGlow {
    0% { text-shadow: 0 0 10px rgba(212, 168, 67, 0.3); }
    100% { text-shadow: 0 0 25px rgba(212, 168, 67, 0.6), 0 0 50px rgba(212, 168, 67, 0.2); }
}

/* Staggered score entry animations */
.victory-1st {
    animation: victory1st 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border-left: 3px solid var(--gold);
}
.victory-2nd {
    animation: victory2nd 0.5s ease-out forwards;
}
.victory-3rd {
    animation: victory3rd 0.4s ease-out forwards;
}
@keyframes victory1st {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes victory2nd {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes victory3rd {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.game-over-card .ornament-rule {
    margin: 15px auto;
}

/* ===== SHARED SCREEN ===== */
.shared-transition {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    z-index: 150;
}

.shared-transition h2 {
    font-size: 2rem;
    color: var(--parchment);
}

.reflex-zones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 160;
}

.reflex-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
    font-size: 1.5rem;
    cursor: pointer;
    user-select: none;
    border: 2px solid var(--gold);
    transition: background 0.15s;
}

.reflex-zone:nth-child(1) { background: rgba(122, 40, 20, 0.15); }
.reflex-zone:nth-child(2) { background: rgba(100, 64, 40, 0.15); }
.reflex-zone:nth-child(3) { background: rgba(45, 90, 30, 0.15); }

.reflex-zone:active {
    background: rgba(180, 150, 110, 0.4) !important;
}

.reflex-zone.clicked {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== SCORE POP ===== */
.score-pop { animation: scorePopIn 0.4s ease-out; }

/* ===== GAME STATS PANEL ===== */
.game-stats {
    margin-top: 20px;
    text-align: left;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dotted rgba(180, 150, 110, 0.2);
    font-family: var(--font-body);
    font-size: 0.9rem;
}
.stat-label { color: var(--ink-light); }
.stat-value {
    color: var(--gold);
    font-family: var(--font-score);
    font-size: 1.1rem;
}
.stat-highlight {
    color: var(--accent);
    font-weight: bold;
}

/* ===== COMBO REVEAL CARD ===== */
.combo-card {
    background: linear-gradient(145deg, #faf4e8, #e8dcc4);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: comboCardIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}
.combo-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    border-radius: 12px;
    animation: comboGlowPulse 1.5s ease-in-out 0.3s 2;
}
.combo-card .combo-icon {
    font-size: 2rem;
    margin-bottom: 4px;
    animation: comboIconBounce 0.6s ease-out;
}
.combo-card .combo-type {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--accent);
}
.combo-card .combo-detail {
    font-family: var(--font-body);
    color: var(--ink-light);
    font-size: 0.9rem;
}
.combo-card .combo-points {
    font-family: var(--font-score);
    font-size: 2rem;
    color: var(--gold);
    margin-top: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Combo-specific colors */
.combo-card.combo-chouette { border-color: #d4a843; }
.combo-card.combo-chouette::before { background: radial-gradient(circle, rgba(212,168,67,0.15) 0%, transparent 70%); }
.combo-card.combo-velute { border-color: #8b5cf6; }
.combo-card.combo-velute::before { background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%); }
.combo-card.combo-velute .combo-type { color: #7c3aed; }
.combo-card.combo-cul-de-chouette { border-color: #ffd700; border-width: 3px; }
.combo-card.combo-cul-de-chouette::before { background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, transparent 70%); }
.combo-card.combo-cul-de-chouette .combo-type { color: #b45309; }
.combo-card.combo-cul-de-chouette .combo-points { color: #f59e0b; font-size: 2.4rem; }
.combo-card.combo-chouette-velute { border-color: #3b82f6; }
.combo-card.combo-chouette-velute::before { background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%); }
.combo-card.combo-chouette-velute .combo-type { color: #2563eb; }
.combo-card.combo-suite { border-color: #ef4444; }
.combo-card.combo-suite::before { background: radial-gradient(circle, rgba(239,68,68,0.12) 0%, transparent 70%); }
.combo-card.combo-suite .combo-type { color: #dc2626; }
.combo-card.combo-suite .combo-points { color: #ef4444; }
.combo-card.combo-neant { border-color: #9ca3af; opacity: 0.8; }
.combo-card.combo-neant .combo-type { color: #6b7280; }

/* Floating points animation */
.floating-points {
    position: fixed;
    z-index: 300;
    font-family: var(--font-score);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 168, 67, 0.6), 0 2px 4px rgba(0,0,0,0.5);
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
}
.floating-points.negative {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.4), 0 2px 4px rgba(0,0,0,0.5);
}
@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    30% { transform: translateY(-30px) scale(1.3); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* Screen shake for big combos */
.dice-area.screen-shake {
    animation: screenShake 0.4s ease-out;
}
@keyframes screenShake {
    0% { transform: translate(0, 0); }
    15% { transform: translate(-4px, 2px); }
    30% { transform: translate(4px, -2px); }
    45% { transform: translate(-3px, 3px); }
    60% { transform: translate(3px, -1px); }
    75% { transform: translate(-2px, 1px); }
    100% { transform: translate(0, 0); }
}

/* Neant dark flash */
.dice-area.neant-flash::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 4;
    pointer-events: none;
    animation: neantDark 1.2s ease-out forwards;
    border-radius: 12px;
}
@keyframes neantDark {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

/* Big combo glow burst on dice area */
.dice-area.combo-burst::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: 12px;
    animation: comboBurst 0.8s ease-out forwards;
}
@keyframes comboBurst {
    0% { box-shadow: inset 0 0 40px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: inset 0 0 0px rgba(255, 215, 0, 0); }
}

/* ===== BLASON PICKER GRID ===== */
.blason-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
}
.blason-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 8px;
    border: 2px solid rgba(180, 150, 110, 0.3);
    border-radius: 8px;
    background: var(--parchment-dark);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.72rem;
    color: var(--ink-light);
    text-align: center;
    line-height: 1.2;
}
.blason-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.blason-btn .blason-svg {
    display: block;
    width: 44px;
    height: 46px;
}
.blason-btn .blason-svg svg,
.blason-btn .blason-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.blason-btn .blason-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.blason-btn:hover {
    border-color: var(--gold);
    background: rgba(180, 150, 110, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.blason-btn.selected {
    border-color: var(--accent);
    background: rgba(122, 40, 20, 0.12);
    color: var(--accent);
    font-weight: bold;
    box-shadow: 0 0 12px rgba(122, 40, 20, 0.2);
}

/* ===== ACHIEVEMENT TOAST + BADGE ===== */
.achievement-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #faf4e8, #e8dcc4);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 300;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: toastIn 0.5s ease-out, toastOut 0.5s ease-in 3s forwards;
}
.achievement-toast .ach-icon { font-size: 1.5rem; }
.achievement-toast .ach-text { font-family: var(--font-ui); font-size: 0.85rem; }
.achievement-toast .ach-name {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1rem;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-20px); }
}

/* ===== KEYBOARD HINT ===== */
.kbd-hint {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--ink-light);
    background: var(--parchment-dark);
    margin-left: 6px;
    vertical-align: middle;
}

/* ===== LOBBY COLUMNS ===== */
.lobby-left,
.lobby-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 16px;
}

/* ===== OPPONENT PICKER ===== */
.opponent-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 6px 0;
}
.opponent-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 3px 5px;
    border: 2px solid rgba(180, 150, 110, 0.3);
    border-radius: 8px;
    background: var(--parchment-dark);
    cursor: pointer;
    transition: all 0.2s;
}
.opponent-btn .opponent-portrait {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(180, 150, 110, 0.3);
    background: var(--parchment);
}
.opponent-btn.opponent-random .opponent-portrait {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border-style: dashed;
}
.opponent-btn .opponent-name {
    font-family: var(--font-ui);
    font-size: 0.62rem;
    color: var(--ink-light);
    text-align: center;
    line-height: 1.2;
}
.opponent-btn:hover {
    border-color: var(--gold);
    background: rgba(180, 150, 110, 0.1);
    transform: translateY(-1px);
}
.opponent-btn.selected {
    border-color: var(--accent);
    background: rgba(122, 40, 20, 0.12);
    box-shadow: 0 0 10px rgba(122, 40, 20, 0.2);
}
.opponent-btn.selected .opponent-portrait {
    border-color: var(--accent);
}
.opponent-btn.selected .opponent-name {
    color: var(--accent);
    font-weight: bold;
}

/* Compact blason/opponent pickers inside solo 2-col layout */
.solo-pickers-row .blason-picker {
    gap: 6px;
    margin: 6px 0;
}
.solo-pickers-row .blason-btn {
    gap: 3px;
    padding: 6px 3px 5px;
}
.solo-pickers-row .blason-btn .blason-svg {
    width: 34px;
    height: 36px;
}
.solo-pickers-row .blason-btn .blason-name {
    font-size: 0.62rem;
}
.lobby-section {
    text-align: left;
}
.lobby-section h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    text-align: center;
    color: var(--accent);
}
.lobby-section h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 4px auto 0;
}
.ach-progress {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--ink-light);
}

/* ===== ACHIEVEMENT CARDS (lobby) ===== */
.ach-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.ach-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--parchment-dark);
    border: 1px solid rgba(180, 150, 110, 0.2);
    opacity: 0.4;
    transition: all 0.3s;
}
.ach-card.ach-unlocked {
    opacity: 1;
    background: linear-gradient(135deg, rgba(180, 150, 110, 0.12) 0%, rgba(122, 40, 20, 0.06) 100%);
    border-color: var(--gold);
    border-left: 3px solid var(--gold);
    animation: achUnlockReveal 0.5s ease-out backwards;
}
@keyframes achUnlockReveal {
    0% { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.ach-card .ach-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
    line-height: 1.2;
}
.ach-card .ach-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.ach-card .ach-name {
    font-family: var(--font-score);
    font-size: 0.8rem;
    color: var(--accent);
    line-height: 1.3;
}
.ach-card .ach-desc {
    font-size: 0.7rem;
    color: var(--ink-light);
    line-height: 1.3;
}
.ach-card .ach-quote {
    font-size: 0.65rem;
    font-style: italic;
    color: var(--gold);
    margin-top: 1px;
}
.ach-card .ach-check {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1;
}
.ach-card .ach-lock {
    font-size: 0.75rem;
    opacity: 0.4;
    flex-shrink: 0;
    line-height: 1.5;
}

@media (max-width: 500px) {
    .blason-picker {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .blason-btn {
        padding: 8px 4px 6px;
        font-size: 0.65rem;
    }
    .blason-btn .blason-svg {
        width: 36px;
        height: 38px;
    }
    .opponent-picker {
        grid-template-columns: repeat(3, 1fr);
    }
    .opponent-btn .opponent-portrait {
        width: 36px;
        height: 36px;
    }
}

/* ===== HELP BUTTON ===== */
.help-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    color: var(--accent);
    font-family: var(--font-score);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.help-btn:hover {
    background: linear-gradient(180deg, var(--parchment-light) 0%, var(--parchment) 100%);
    box-shadow: 0 0 12px var(--gold-glow);
    border-color: var(--gold-light);
}

/* ===== RULES MODAL ===== */
.rules-modal {
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px 35px;
    text-align: left;
}
.rules-modal h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
}
.rules-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--ink-light);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    z-index: 1;
}
.rules-close:hover {
    color: var(--accent);
}
.rules-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.rules-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent);
}
.rules-section p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--ink);
}
.rules-combo {
    background: var(--parchment-dark);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.rules-combo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.rules-combo-name {
    font-family: var(--font-score);
    font-size: 1rem;
    color: var(--accent);
    font-weight: bold;
    min-width: 130px;
}
.rules-combo-desc {
    font-size: 0.85rem;
    color: var(--ink);
    flex: 1;
}
.rules-combo-pts {
    font-family: var(--font-score);
    font-size: 0.9rem;
    color: var(--gold);
    white-space: nowrap;
}
.rules-combo-ex {
    font-size: 0.8rem;
    color: var(--ink-light);
    font-style: italic;
    margin-top: 4px;
}
.rules-special {
    margin-bottom: 12px;
}
.rules-special h4 {
    font-family: var(--font-score);
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 4px;
}
.rules-special p {
    font-size: 0.88rem;
}

/* ===== SETTINGS PANEL ===== */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.settings-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    color: var(--accent);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.settings-btn:hover {
    box-shadow: 0 0 12px var(--gold-glow);
    border-color: var(--gold-light);
}
.settings-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 90;
}
.settings-card {
    padding: 16px 20px;
    min-width: 220px;
}
.settings-card h3 {
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 12px;
}
.settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-family: var(--font-ui);
}
.settings-row label {
    min-width: 70px;
    color: var(--ink-light);
}
.settings-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--parchment-dark);
    border-radius: 2px;
    outline: none;
}
.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--accent);
    cursor: pointer;
}
.settings-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--accent);
    cursor: pointer;
}
.settings-val {
    min-width: 32px;
    text-align: right;
    font-family: var(--font-score);
    font-size: 0.8rem;
    color: var(--gold);
}

/* ===== THEME PICKER ===== */
.settings-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(180, 150, 110, 0.2);
}

.settings-label {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--ink-light);
    margin-bottom: 8px;
}

.theme-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: var(--parchment-dark);
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 6px 2px 4px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    font-size: 1.2rem;
}

.theme-btn .theme-label {
    font-family: var(--font-ui);
    font-size: 0.6rem;
    color: var(--ink-light);
    line-height: 1;
}

.theme-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px var(--gold-glow);
}

.theme-btn.active {
    border-color: var(--gold);
    background: rgba(180, 150, 110, 0.15);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* ===== MEDIEVAL DECORATIONS ===== */

/* Torches flanking the header */
.torch-decoration {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 50px;
    pointer-events: none;
    z-index: 2;
}
.torch-left { left: -8px; }
.torch-right { right: -8px; }

/* Crossed swords under title */
.swords-decoration {
    display: block;
    margin: -2px auto 0;
    width: 80px;
    height: 16px;
    pointer-events: none;
}

/* Pennant banner above scoreboard */
.pennant-decoration {
    display: block;
    margin: 0 auto 8px;
    width: 60px;
    height: 32px;
    pointer-events: none;
}

/* Celtic knot separator */
.celtic-separator {
    display: block;
    margin: 8px auto;
    width: 120px;
    height: 14px;
    pointer-events: none;
}

/* ===== EPILOGUE SCREEN ===== */
.epilogue-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0604;
    z-index: 210;
    overflow: hidden;
}

.epilogue-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.6) 100%),
        radial-gradient(ellipse at 50% 40%, rgba(180,150,110,0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.epilogue-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    width: 90%;
    text-align: center;
    padding: 40px 30px;
}

.epilogue-icon {
    margin-bottom: 16px;
    opacity: 0;
    animation: epilogueFadeIn 1.5s ease-out 0.5s forwards;
    filter: drop-shadow(0 0 20px rgba(180,150,110,0.4));
}
.epilogue-icon svg {
    display: block;
    filter: drop-shadow(0 0 12px rgba(212,168,67,0.5));
}

.epilogue-title {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 30px;
    opacity: 0;
    animation: epilogueFadeIn 1.5s ease-out 1s forwards;
}

.epilogue-text {
    font-family: 'IM Fell DW Pica', serif;
    font-style: italic;
    font-size: 1.25rem;
    line-height: 2;
    color: var(--parchment);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    min-height: 120px;
    margin: 0;
}

.epilogue-text::after {
    content: '|';
    animation: blink-cursor 0.7s step-end infinite;
    color: var(--gold);
    font-style: normal;
    margin-left: 2px;
}

.epilogue-skip {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--gold);
    opacity: 0;
    margin-top: 40px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: opacity 0.4s;
}

.epilogue-skip.visible {
    opacity: 0.5;
    animation: epiloguePulse 2s ease-in-out infinite;
}

.epilogue-skip:hover {
    opacity: 0.8;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--parchment-dark);
    border: 1px solid var(--gold);
    border-radius: 11px;
    transition: background 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--gold);
    border-radius: 50%;
    transition: transform 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: var(--parchment);
}

/* ===== SETTINGS EXTRAS ===== */
.settings-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 10px 0;
}
.settings-section-label {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

/* ===== VOICE INDICATOR ===== */
.voice-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--gold);
    padding: 4px 12px;
    border: 1px solid var(--gold);
    border-radius: 20px;
    background: rgba(180, 150, 110, 0.08);
    margin-top: 8px;
}
.voice-indicator .mic-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: micPulse 1.5s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===== VIDEO STRIP ===== */
.video-strip {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    background: rgba(10, 6, 2, 0.6);
    border: 1px solid rgba(139, 110, 78, 0.3);
    border-radius: 10px;
    min-height: 0;
    transition: opacity 0.3s, max-height 0.3s;
}
.video-strip.hidden {
    display: none;
}

.video-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--gold-dim, #8b6e4e);
    background: #111;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}
.video-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

.video-card video {
    width: 200px;
    height: 150px;
    object-fit: cover;
    display: block;
}
.video-card.local video {
    width: 140px;
    height: 105px;
    transform: scaleX(-1);
}

/* Voice activity: golden pulsing border */
.video-card.speaking {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
    animation: videoSpeakPulse 1s ease-in-out infinite alternate;
}
@keyframes videoSpeakPulse {
    0% { box-shadow: 0 0 8px rgba(212, 168, 67, 0.3); }
    100% { box-shadow: 0 0 16px rgba(212, 168, 67, 0.7); }
}

.video-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text, #e8dcc4);
    font-size: 0.7rem;
    font-family: var(--font-ui);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-badge-you {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--gold);
    color: #1a0e06;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: bold;
    font-family: var(--font-ui);
}

/* ===== VIDEO MODAL (enlarged view) ===== */
.video-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.video-modal-overlay.hidden {
    display: none;
}

.video-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.video-modal video {
    width: 480px;
    height: 360px;
    border-radius: 12px;
    border: 3px solid var(--gold);
    object-fit: cover;
    background: #111;
}

.video-modal-label {
    font-family: var(--font-score);
    font-size: 1.1rem;
    color: var(--gold);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.video-modal-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(180deg, #3a0e04, #1a0604);
    color: var(--parchment-light);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.video-modal-close:hover {
    background: var(--accent);
}

/* ===== VIDEO CONTROLS ===== */
.video-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}
.video-controls .settings-btn {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

/* ===== DICE 3D CANVAS ===== */
#dice-3d-canvas {
    grid-row: 1;
    grid-column: 1;
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: block;
}

/* ===== TUTORIAL OVERLAY ===== */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
}
.tutorial-overlay.hidden { display: none; }

.tutorial-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    transition: clip-path 0.4s ease;
}

.tutorial-tooltip {
    position: absolute;
    z-index: 2;
    background: linear-gradient(145deg, #faf4e8, #e8dcc4);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 320px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: tutorialFadeIn 0.3s ease-out;
}
@keyframes tutorialFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tutorial-step-indicator {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 8px;
}
.tutorial-step-indicator .step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(180, 150, 110, 0.3);
    transition: background 0.3s;
}
.tutorial-step-indicator .step-dot.active {
    background: var(--gold);
}
.tutorial-step-indicator .step-dot.done {
    background: var(--accent);
}

.tutorial-text {
    font-family: 'IM Fell DW Pica', serif;
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.5;
    margin: 0 0 12px;
    text-align: center;
}

.tutorial-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ===== FOCUS INDICATORS (keyboard navigation) ===== */
.btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.25);
}
.emote-btn:focus-visible,
.blason-btn:focus-visible,
.theme-btn:focus-visible,
.settings-btn:focus-visible,
.help-btn:focus-visible,
.bird-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

/* ===== TOUCH-FRIENDLY BUTTONS ===== */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    .btn-small {
        min-height: 40px;
    }
    .bird-btn {
        min-height: 52px;
    }
    .emote-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ===== TURN TIMER ===== */
.turn-timer { height: 4px; background: rgba(0,0,0,0.3); border-radius: 2px; overflow: hidden; position: relative; margin: 0 8px; }
.turn-timer.hidden { display: none; }
.turn-timer-fill { height: 100%; background: linear-gradient(90deg, var(--gold), #f0c040); transition: width 0.1s linear; border-radius: 2px; }
.turn-timer-fill.warning { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.turn-timer-fill.critical { background: #ef4444; animation: timerPulse 0.5s ease-in-out infinite; }
.turn-timer-text { position: absolute; right: 8px; top: -18px; font-family: var(--font-ui); font-size: 0.7rem; color: var(--gold); }
@keyframes timerPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== CHAT ===== */
.chat-container { display: flex; gap: 4px; padding: 6px 10px; border-top: 1px solid rgba(180,150,110,0.2); }
.chat-container.hidden { display: none; }
.chat-input { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid rgba(180,150,110,0.3); border-radius: 6px; padding: 6px 10px; color: var(--parchment); font-family: var(--font-ui); font-size: 0.8rem; outline: none; }
.chat-input:focus { border-color: var(--gold); }
.chat-send-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--gold); background: rgba(180,150,110,0.1); color: var(--gold); cursor: pointer; font-size: 1rem; }
.log-chat { color: var(--parchment) !important; font-weight: normal !important; }
.log-chat .chat-name { color: var(--gold); font-family: var(--font-score); font-size: 0.75rem; }

/* ===== REACTIONS ===== */
.reaction-bar { display: flex; gap: 3px; }
.reaction-bar.hidden { display: none; }
.reaction-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(180,150,110,0.3); background: rgba(0,0,0,0.3); cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; transition: transform 0.15s, border-color 0.2s; }
.reaction-btn:hover { transform: scale(1.15); border-color: var(--gold); }
.reaction-btn:active { transform: scale(0.9); }

.floating-reactions { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.floating-reaction { position: absolute; font-size: 2rem; animation: reactionFloat 2s ease-out forwards; pointer-events: none; }
@keyframes reactionFloat { 0% { opacity: 1; transform: scale(0.5) translateY(0); } 50% { opacity: 1; transform: scale(1.2) translateY(-60px); } 100% { opacity: 0; transform: scale(1) translateY(-120px); } }

/* ===== AFK BADGE ===== */
.score-entry.player-afk { opacity: 0.5; }
.afk-badge { font-family: var(--font-ui); font-size: 0.55rem; padding: 1px 4px; background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em; margin-left: 4px; }

/* ===== RECONNECT OVERLAY ===== */
.reconnect-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(5,3,1,0.9); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; }
.reconnect-overlay.hidden { display: none; }
.reconnect-card { padding: 40px; text-align: center; max-width: 320px; }
.reconnect-spinner { width: 40px; height: 40px; border: 3px solid rgba(180,150,110,0.3); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.reconnect-status { font-family: var(--font-ui); font-size: 0.85rem; color: var(--ink-light); margin-top: 8px; }

/* ===== SPECTATOR ===== */
.spectator-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 90; text-align: center; padding: 4px; background: rgba(99,102,241,0.2); border-bottom: 1px solid rgba(99,102,241,0.4); font-family: var(--font-ui); font-size: 0.75rem; color: #a5b4fc; letter-spacing: 0.05em; }

/* ===== ENRICHED STATS HIGHLIGHTS ===== */
.stat-highlight-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; background: rgba(180,150,110,0.08); border-left: 3px solid var(--gold); margin-bottom: 6px; }
.stat-highlight-icon { font-size: 1.3rem; flex-shrink: 0; }
.stat-highlight-label { font-family: var(--font-ui); font-size: 0.75rem; color: var(--ink-light); }
.stat-highlight-value { font-family: var(--font-score); font-size: 0.9rem; color: var(--gold); }
.stat-highlight-player { font-family: var(--font-body); font-size: 0.85rem; color: var(--parchment); }
