/**
 * Lexicon Royale - Card-based Word Game CSS
 * Balatro-inspired card game styling
 */

/* === BOSS ANNOUNCEMENT OVERLAY === */
.boss-announce {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, rgba(127, 29, 29, 0.95) 0%, rgba(0, 0, 0, 0.98) 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.boss-announce.active {
    opacity: 1;
    pointer-events: auto;
    animation: bossFlash 0.8s ease-out;
}

@keyframes bossFlash {
    0% { background: rgba(239, 68, 68, 0.9); }
    30% { background: radial-gradient(circle at 50% 50%, rgba(127, 29, 29, 0.95) 0%, rgba(0, 0, 0, 0.98) 70%); }
}

/* Flame container */
.boss-flames {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.boss-flame {
    position: absolute;
    bottom: -20px;
    width: 60px;
    height: 120px;
    background: linear-gradient(to top,
        rgba(239, 68, 68, 0.9) 0%,
        rgba(251, 146, 60, 0.8) 40%,
        rgba(251, 191, 36, 0.6) 70%,
        transparent 100%);
    border-radius: 50% 50% 20% 20%;
    filter: blur(8px);
    animation: flameRise 1.5s ease-in-out infinite;
    transform-origin: bottom center;
}

.boss-flame:nth-child(1) { left: 5%; animation-delay: 0s; height: 100px; }
.boss-flame:nth-child(2) { left: 15%; animation-delay: 0.2s; height: 140px; }
.boss-flame:nth-child(3) { left: 25%; animation-delay: 0.4s; height: 110px; }
.boss-flame:nth-child(4) { left: 35%; animation-delay: 0.1s; height: 130px; }
.boss-flame:nth-child(5) { left: 45%; animation-delay: 0.3s; height: 150px; }
.boss-flame:nth-child(6) { left: 55%; animation-delay: 0.5s; height: 120px; }
.boss-flame:nth-child(7) { left: 65%; animation-delay: 0.15s; height: 135px; }
.boss-flame:nth-child(8) { left: 75%; animation-delay: 0.35s; height: 105px; }
.boss-flame:nth-child(9) { left: 85%; animation-delay: 0.25s; height: 125px; }
.boss-flame:nth-child(10) { left: 95%; animation-delay: 0.45s; height: 115px; }

/* Top flames (inverted) */
.boss-flame.top {
    bottom: auto;
    top: -20px;
    transform: rotate(180deg);
}

@keyframes flameRise {
    0%, 100% {
        transform: scaleY(1) scaleX(1) translateX(0);
        opacity: 0.8;
    }
    25% {
        transform: scaleY(1.2) scaleX(0.9) translateX(-5px);
        opacity: 1;
    }
    50% {
        transform: scaleY(0.9) scaleX(1.1) translateX(5px);
        opacity: 0.9;
    }
    75% {
        transform: scaleY(1.1) scaleX(0.95) translateX(-3px);
        opacity: 1;
    }
}

/* Boss content */
.boss-content {
    text-align: center;
    z-index: 1;
    animation: bossSlam 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bossSlam {
    0% {
        transform: scale(3) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(0.9) rotate(2deg);
    }
    70% {
        transform: scale(1.1) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.boss-icon {
    font-size: 6rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: bossIconPulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.8));
}

@keyframes bossIconPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.8)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 50px rgba(251, 146, 60, 1)); }
}

.boss-title {
    font-size: 3rem;
    font-weight: 900;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow:
        0 0 20px rgba(239, 68, 68, 0.8),
        0 0 40px rgba(239, 68, 68, 0.5),
        0 4px 0 #7f1d1d;
    margin: 0;
    animation: bossTitleGlow 1.5s ease-in-out infinite alternate;
}

@keyframes bossTitleGlow {
    0% { text-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 40px rgba(239, 68, 68, 0.5), 0 4px 0 #7f1d1d; }
    100% { text-shadow: 0 0 40px rgba(251, 146, 60, 1), 0 0 80px rgba(239, 68, 68, 0.8), 0 4px 0 #7f1d1d; }
}

.boss-level {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
    margin-top: 0.5rem;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.boss-target {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 1.2rem;
    color: #fca5a5;
}

.boss-target-value {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.boss-subtitle {
    font-size: 0.9rem;
    color: #f87171;
    margin-top: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: subtitlePulse 2s ease-in-out infinite;
}

@keyframes subtitlePulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Boss challenge display */
.boss-challenge {
    margin: 1rem 0;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    border: 2px solid #ef4444;
    border-radius: 12px;
    animation: challengePulse 2s ease-in-out infinite;
}

@keyframes challengePulse {
    0%, 100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.8), 0 0 50px rgba(251, 146, 60, 0.4); }
}

.boss-challenge-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.3rem;
}

.boss-challenge-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

.boss-challenge-desc {
    display: block;
    font-size: 0.85rem;
    color: #fca5a5;
}

/* === ROUND PROGRESS BAR === */
.round-progress {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.round-progress.visible {
    display: flex;
}

.progress-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.progress-dot.completed {
    background: #22c55e;
    border-color: #16a34a;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.progress-dot.current {
    background: #3b82f6;
    border-color: #2563eb;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    animation: currentPulse 1.5s ease-in-out infinite;
}

@keyframes currentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.progress-dot.boss {
    width: auto;
    height: auto;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.progress-dot.boss.current {
    background: rgba(239, 68, 68, 0.5);
    border-color: #ef4444;
    animation: bossPulse 1s ease-in-out infinite;
}

@keyframes bossPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
}

.progress-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Screen shake for boss */
.boss-shake {
    animation: bossShake 0.6s ease;
}

@keyframes bossShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-15px, -8px) rotate(-2deg); }
    20% { transform: translate(15px, 8px) rotate(2deg); }
    30% { transform: translate(-12px, 6px) rotate(-1.5deg); }
    40% { transform: translate(12px, -6px) rotate(1.5deg); }
    50% { transform: translate(-8px, 4px) rotate(-1deg); }
    60% { transform: translate(8px, -4px) rotate(1deg); }
    70% { transform: translate(-5px, 2px) rotate(-0.5deg); }
    80% { transform: translate(5px, -2px) rotate(0.5deg); }
}

/* Red vignette during boss */
.boss-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(127, 29, 29, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.5s;
}

.boss-vignette.active {
    opacity: 1;
}

/* === BOSS MODE RED THEME === */
.card-game.boss-mode {
    background: linear-gradient(180deg, #2a1a1a 0%, #3d1f1f 50%, #4a1010 100%);
}

.card-game.boss-mode .top-bar {
    background: rgba(127, 29, 29, 0.4);
    border-color: rgba(239, 68, 68, 0.3);
}

.card-game.boss-mode .level-badge,
.card-game.boss-mode .target-badge {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.card-game.boss-mode .round-progress {
    background: rgba(127, 29, 29, 0.5);
    border-color: rgba(239, 68, 68, 0.3);
}

.card-game.boss-mode .progress-label {
    color: #f87171;
    font-weight: 700;
}

.card-game.boss-mode .booster-rack {
    background: rgba(127, 29, 29, 0.3);
    border-color: rgba(239, 68, 68, 0.2);
}

.card-game.boss-mode .word-area {
    background: rgba(127, 29, 29, 0.3);
    border-color: rgba(239, 68, 68, 0.3);
}

.card-game.boss-mode .action-btn {
    background: rgba(127, 29, 29, 0.5);
    border-color: rgba(239, 68, 68, 0.4);
}

.card-game.boss-mode .action-btn:not(:disabled):hover {
    background: rgba(239, 68, 68, 0.4);
}

.card-game.boss-mode .play-btn:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.card-game.boss-mode .bottom-bar {
    background: rgba(127, 29, 29, 0.4);
    border-color: rgba(239, 68, 68, 0.3);
}

.card-game.boss-mode .letter-card {
    background: linear-gradient(145deg, #4a2020 0%, #3d1a1a 100%);
    border-color: rgba(239, 68, 68, 0.4);
    /* Smaller cards in boss mode to fit with penalty banner */
    width: clamp(38px, 10vw, 50px);
    height: clamp(54px, 14vw, 72px);
}

.card-game.boss-mode .card-hand {
    gap: 0.35rem;
    padding: 0.35rem;
}

.card-game.boss-mode .letter-card .card-letter {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.card-game.boss-mode .letter-card .card-value {
    color: #fca5a5;
}

.card-game.boss-mode .chips-display {
    color: #fff;
}

.card-game.boss-mode .letter-card.selected {
    border-color: #f87171;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    background: linear-gradient(145deg, #5c2828 0%, #4a1f1f 100%);
}

.card-game.boss-mode .word-placeholder {
    color: #fca5a5;
}

/* === BOSS PENALTY BANNER === */
.boss-penalty-banner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.9) 0%, rgba(127, 29, 29, 0.9) 100%);
    border: 2px solid #f87171;
    border-radius: 8px;
    margin: 0 0.5rem;
    animation: penaltyPulse 2s ease-in-out infinite;
    flex-shrink: 0;
    min-height: 0;
}

.boss-penalty-banner.visible {
    display: flex;
}

/* In boss mode, reduce other element sizes to fit penalty banner */
.card-game.boss-mode .top-bar {
    padding: 0.35rem 0.5rem;
}

.card-game.boss-mode .round-progress {
    padding: 0.2rem 0.5rem;
}

.card-game.boss-mode .booster-rack {
    padding: 0.25rem 0.5rem;
}

.card-game.boss-mode .word-area {
    padding: 0.4rem;
}

.card-game.boss-mode .action-bar {
    padding: 0.15rem;
}

.card-game.boss-mode .bottom-bar {
    padding: 0.4rem 0.75rem;
}

@keyframes penaltyPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
}

.penalty-icon {
    font-size: 1rem;
}

.penalty-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === BOSS MODIFIER INTRO ANIMATION === */
.boss-modifier-intro {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: all;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.modifier-intro-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(127, 29, 29, 0.95) 0%, rgba(0, 0, 0, 0.98) 60%);
    opacity: 0;
}

.boss-modifier-intro.active {
    opacity: 1;
}

.boss-modifier-intro.active .modifier-intro-backdrop {
    animation: modifierBackdropIn 0.5s ease-out forwards;
}

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

.modifier-intro-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    transform: scale(0.3) translateY(50px);
    opacity: 0;
}

.boss-modifier-intro.active .modifier-intro-content {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: modifierContentIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modifierContentIn {
    from {
        transform: scale(0.3) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modifier-intro-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    opacity: 0;
    animation: modifierLabelIn 0.5s ease-out 0.5s forwards;
}

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

.modifier-intro-icon-wrapper {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: modifierIconGlow 1.5s ease-in-out infinite;
}

@keyframes modifierIconGlow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.5), inset 0 0 40px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 80px rgba(239, 68, 68, 0.8), inset 0 0 60px rgba(239, 68, 68, 0.4);
    }
}

.modifier-intro-icon {
    font-size: 5rem;
    animation: modifierIconPulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(239, 68, 68, 1));
}

@keyframes modifierIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.modifier-intro-name {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow:
        0 0 30px rgba(239, 68, 68, 1),
        0 0 60px rgba(239, 68, 68, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.8);
    text-align: center;
    margin-top: 0.5rem;
}

.modifier-intro-divider {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    margin: 0.5rem 0;
}

.modifier-intro-desc {
    font-size: 1.4rem;
    color: #fca5a5;
    text-align: center;
    max-width: 320px;
    line-height: 1.5;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.modifier-intro-warning {
    font-size: 0.75rem;
    color: #f87171;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1rem;
    opacity: 0;
    animation: modifierWarningBlink 0.5s ease-out 1s forwards, modifierWarningPulse 1s ease-in-out 1.5s infinite;
}

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

@keyframes modifierWarningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tap to continue hint */
.modifier-intro-tap {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    opacity: 0;
    animation: tapHintFade 0.5s ease-out 0.8s forwards;
    transition: all 0.3s ease;
}

/* Active pulsing state when ready to tap */
.modifier-intro-tap.pulse {
    animation: tapHintFade 0.5s ease-out 0.8s forwards, tapButtonPulse 1.5s ease-in-out infinite;
    border-color: rgba(255, 200, 100, 0.6);
    color: rgba(255, 220, 150, 1);
    text-shadow: 0 0 10px rgba(255, 200, 100, 0.5);
}

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

@keyframes tapButtonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 200, 100, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(255, 200, 100, 0.3);
    }
}

/* Fly to banner animation */
.boss-modifier-intro.fly-to-banner .modifier-intro-backdrop {
    animation: modifierBackdropOut 0.6s ease-in forwards;
}

.boss-modifier-intro.fly-to-banner .modifier-intro-content {
    animation: modifierContentFlyUp 0.7s cubic-bezier(0.4, 0, 1, 1) forwards;
}

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

@keyframes modifierContentFlyUp {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(0.6) translateY(-30vh);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.2) translateY(-45vh);
        opacity: 0;
    }
}

/* === WELCOME OVERLAY === */
/* === WELCOME OVERLAY - BALATRO STYLE === */
.welcome-overlay {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #0a0a1a 0%, #111827 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s;
    overflow: hidden;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Animated stars background */
.welcome-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.25), transparent),
        radial-gradient(1px 1px at 250px 160px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 300px 90px, rgba(255,255,255,0.2), transparent);
    background-size: 350px 200px;
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.welcome-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    position: relative;
    text-align: center;
    padding: 2.5rem 2rem;
    max-width: 340px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-radius: 24px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    box-shadow:
        0 0 60px rgba(99, 102, 241, 0.2),
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: contentSlideIn 0.5s ease-out;
}

@keyframes contentSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Decorative corner accents */
.welcome-content::before,
.welcome-content::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    pointer-events: none;
}

.welcome-content::before {
    top: -2px;
    left: -2px;
    border-top-color: rgba(99, 102, 241, 0.6);
    border-left-color: rgba(99, 102, 241, 0.6);
    border-radius: 24px 0 0 0;
}

.welcome-content::after {
    bottom: -2px;
    right: -2px;
    border-bottom-color: rgba(99, 102, 241, 0.6);
    border-right-color: rgba(99, 102, 241, 0.6);
    border-radius: 0 0 24px 0;
}

/* Blind Badge */
.blind-badge {
    margin-bottom: 1.5rem;
    animation: badgeSlideIn 0.4s ease-out 0.1s both;
}

@keyframes badgeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.blind-type {
    display: inline-block;
    padding: 0.6rem 2rem;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 20px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.blind-type.boss {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #ef4444 100%);
    border-color: rgba(254, 202, 202, 0.3);
    box-shadow:
        0 4px 25px rgba(220, 38, 38, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: bossPulse 1.5s ease-in-out infinite;
}

@keyframes bossPulse {
    0%, 100% {
        box-shadow: 0 4px 25px rgba(220, 38, 38, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 40px rgba(220, 38, 38, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
}

/* Ante/Level Display */
.ante-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
    animation: levelSlideIn 0.4s ease-out 0.2s both;
}

@keyframes levelSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.ante-label {
    font-size: 0.8rem;
    color: #94a3b8;
    letter-spacing: 0.25em;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.ante-number {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5));
    line-height: 1;
    animation: levelPulse 2s ease-in-out infinite;
}

@keyframes levelPulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)); }
    50% { filter: drop-shadow(0 0 35px rgba(251, 191, 36, 0.8)); }
}

/* Score Target */
.score-target {
    margin-bottom: 1.25rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.2);
    animation: targetSlideIn 0.4s ease-out 0.3s both;
}

@keyframes targetSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.target-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.target-chips {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(180deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(96, 165, 250, 0.5));
}

/* Round Info */
.round-info {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    animation: infoSlideIn 0.4s ease-out 0.4s both;
}

@keyframes infoSlideIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 70px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.info-label {
    font-size: 0.6rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Account Level Item (in round-info row) */
.account-level-item {
    display: none;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.account-level-item.visible {
    display: flex;
}

.account-level-item .info-value {
    color: #a5b4fc;
}

.account-level-item .info-label {
    color: #818cf8;
}

/* Login Prompt */
.login-prompt {
    display: none;
    margin: 1rem 0;
    font-size: 0.8rem;
    color: #64748b;
}

.login-prompt.visible {
    display: block;
}

.login-prompt a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* Seed Display */
.seed-display {
    margin-bottom: 1.5rem;
    font-size: 0.7rem;
    color: #475569;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    display: inline-block;
    animation: seedFadeIn 0.4s ease-out 0.5s both;
}

@keyframes seedFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.seed-label {
    margin-right: 0.25rem;
}

.seed-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #64748b;
}

/* Start Button */
.start-btn {
    padding: 1rem 4rem;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow:
        0 8px 30px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: buttonSlideIn 0.4s ease-out 0.6s both;
}

@keyframes buttonSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 12px 40px rgba(16, 185, 129, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.start-btn:active {
    transform: scale(0.98);
}

/* === GAME OVER OVERLAY === */
.gameover-overlay {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.8s ease;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.gameover-overlay.active {
    opacity: 1;
    pointer-events: auto;
    background: rgba(127, 29, 29, 0.95);
}

.gameover-content {
    text-align: center;
    padding: 2rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease 0.3s;
}

.gameover-overlay.active .gameover-content {
    opacity: 1;
    transform: scale(1);
}

.gameover-title {
    font-size: 3rem;
    font-weight: 900;
    color: #fca5a5;
    text-shadow: 0 0 40px rgba(239, 68, 68, 0.8);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.gameover-quote {
    font-size: 1.1rem;
    color: #fecaca;
    font-style: italic;
    max-width: 300px;
    margin: 0 auto 0.5rem;
    line-height: 1.5;
}

.gameover-author {
    font-size: 0.85rem;
    color: #f87171;
    margin-bottom: 2rem;
}

.gameover-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.gameover-stat {
    text-align: center;
}

.gameover-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}

.gameover-stat-label {
    font-size: 0.7rem;
    color: #fca5a5;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* XP Earned Section */
.gameover-xp-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-radius: 12px;
    border: 2px solid rgba(99, 102, 241, 0.4);
}

.gameover-xp-earned {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.xp-label {
    font-size: 0.75rem;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.xp-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #a5b4fc;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.newgame-btn {
    padding: 1rem 3rem;
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: 2px solid #f87171;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.newgame-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.5);
}

/* === ACCOUNT MODAL === */
.account-modal {
    max-width: 380px;
}

.account-modal h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: #f0f0f0;
}

.account-modal h3 {
    margin: 1rem 0 0.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.account-logged-out {
    text-align: center;
    padding: 1rem 0;
}

.account-logged-out p {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.login-btn {
    display: inline-block;
    text-decoration: none;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.account-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-avatar svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.account-info {
    flex: 1;
}

.account-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 0.25rem;
}

.account-xp-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 4px;
    transition: width 0.3s;
}

.account-xp-text {
    font-size: 0.7rem;
    color: #a5b4fc;
}

.account-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.account-stat {
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.account-stat .stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0f0f0;
}

.account-stat .stat-name {
    display: block;
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.account-bonuses-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bonus-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    color: #6ee7b7;
}

.bonus-badge.locked {
    background: rgba(107, 114, 128, 0.2);
    border-color: rgba(107, 114, 128, 0.3);
    color: #6b7280;
}

.permanent-unlocks-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) rgba(0, 0, 0, 0.2);
}

.permanent-unlocks-container::-webkit-scrollbar {
    width: 6px;
}

.permanent-unlocks-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.permanent-unlocks-container::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 3px;
}

.permanent-unlocks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.unlock-item {
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.unlock-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.unlock-item .unlock-icon {
    font-size: 1.5rem;
    display: block;
}

.unlock-item .unlock-name {
    font-size: 0.55rem;
    color: #9ca3af;
    display: block;
    margin-top: 0.25rem;
}

.unlock-item .unlock-level {
    font-size: 0.5rem;
    color: #6366f1;
}

/* Best Words Section */
.best-words-container {
    margin-top: 0.5rem;
}

.best-words-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.best-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
}

.best-word-text {
    font-size: 1rem;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.best-word-score {
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 600;
}

.best-words-empty {
    text-align: center;
    color: #6b7280;
    font-size: 0.8rem;
    padding: 1rem;
}

/* Sign Out Button */
.signout-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.signout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* === LOGIN MODAL === */
.login-modal {
    max-width: 360px;
    position: relative;
}

.login-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.login-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #f0f0f0;
}

.login-desc {
    color: #9ca3af;
    text-align: center;
    margin-bottom: 1rem;
}

.login-step {
    display: none;
}

.login-step.active {
    display: block;
    animation: loginFadeIn 0.3s ease;
}

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

.login-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: #6366f1;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.login-back-btn:hover {
    color: #818cf8;
}

.login-email-display {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-email-display strong {
    color: #f0f0f0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-field input {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: #f0f0f0;
    transition: all 0.2s;
}

.login-field input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-field input::placeholder {
    color: #6b7280;
}

.login-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}

.login-checkbox label {
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
}

.login-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.login-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.login-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
    margin-bottom: 1rem;
}

.login-error.visible {
    display: block;
    animation: loginShake 0.4s ease;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    color: #6b7280;
    font-size: 0.75rem;
    margin: 0;
}

/* Game Over Login Prompt */
.gameover-login-prompt {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    animation: loginPromptSlide 0.5s ease;
}

.gameover-login-prompt.visible {
    display: block;
}

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

.gameover-login-prompt p {
    color: #a5b4fc;
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
    text-align: center;
}

.login-prompt-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-prompt-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* === BASE LAYOUT === */
.card-game {
    display: flex;
    flex-direction: column;
    /* Ensure stable width during boss intro animations */
    width: 100%;
    max-width: 100%;
    min-width: 0; /* Flex child shrink fix */
    height: 100%;
    max-height: 100dvh;
    padding: 0.5rem;
    gap: 0.5rem;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    touch-action: pan-x pan-y;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* === TOP BAR === */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    flex-shrink: 0;
}

.level-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-badge {
    padding: 0.3rem 0.6rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #000;
}

.level-badge span {
    font-size: 1rem;
}

.target-badge {
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
}

.target-badge span {
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}

/* Target score attention animation */
.target-badge.attention-pulse {
    animation: targetAttention 2s ease-out forwards;
}

@keyframes targetAttention {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
        background: rgba(255, 255, 255, 0.1);
    }
    10% {
        transform: scale(1.15);
        box-shadow: 0 0 20px 5px rgba(251, 191, 36, 0.6);
        background: rgba(251, 191, 36, 0.3);
    }
    20% {
        transform: scale(1.05);
    }
    30% {
        transform: scale(1.12);
        box-shadow: 0 0 25px 8px rgba(251, 191, 36, 0.5);
    }
    40% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px 5px rgba(251, 191, 36, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 15px 3px rgba(251, 191, 36, 0.3);
        background: rgba(251, 191, 36, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
        background: rgba(255, 255, 255, 0.1);
    }
}

.score-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chips-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3b82f6;
    transition: transform 0.1s ease;
}

.chips-display span {
    font-size: 1.4rem;
    font-weight: 800;
}

.chips-display.pts-shake {
    animation: ptsShake 0.3s ease;
}

@keyframes ptsShake {
    0%, 100% { transform: scale(1) rotate(0); }
    20% { transform: scale(1.15) rotate(-2deg); }
    40% { transform: scale(1.2) rotate(2deg); }
    60% { transform: scale(1.15) rotate(-1deg); }
    80% { transform: scale(1.1) rotate(1deg); }
}

/* Balatro-style impact slam */
.chips-display.pts-impact {
    animation: ptsImpact 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chips-display.pts-impact.impact-big {
    animation: ptsImpactBig 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chips-display.pts-impact.impact-epic {
    animation: ptsImpactEpic 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes ptsImpact {
    0% { transform: scale(1) translateY(0); }
    10% { transform: scale(1.4) translateY(-8px); }
    20% { transform: scale(1.5) translateY(-12px); filter: brightness(1.3); }
    35% { transform: scale(1.3) translateY(-4px) rotate(-3deg); }
    50% { transform: scale(1.2) translateY(0) rotate(2deg); }
    65% { transform: scale(1.15) rotate(-1deg); }
    80% { transform: scale(1.08) rotate(0.5deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes ptsImpactBig {
    0% { transform: scale(1) translateY(0); }
    8% { transform: scale(1.6) translateY(-15px); filter: brightness(1.4); }
    18% { transform: scale(1.8) translateY(-20px); filter: brightness(1.5); text-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
    30% { transform: scale(1.5) translateY(-8px) rotate(-5deg); }
    45% { transform: scale(1.3) translateY(0) rotate(4deg); }
    60% { transform: scale(1.2) rotate(-2deg); }
    75% { transform: scale(1.1) rotate(1deg); }
    100% { transform: scale(1) rotate(0); filter: brightness(1); }
}

@keyframes ptsImpactEpic {
    0% { transform: scale(1) translateY(0); }
    5% { transform: scale(2) translateY(-25px); filter: brightness(1.6); }
    12% { transform: scale(2.2) translateY(-35px); filter: brightness(1.8); text-shadow: 0 0 30px rgba(59, 130, 246, 1), 0 0 60px rgba(168, 85, 247, 0.6); }
    25% { transform: scale(1.8) translateY(-15px) rotate(-8deg); }
    40% { transform: scale(1.5) translateY(5px) rotate(6deg); }
    55% { transform: scale(1.3) translateY(0) rotate(-3deg); }
    70% { transform: scale(1.15) rotate(2deg); }
    85% { transform: scale(1.05) rotate(-0.5deg); }
    100% { transform: scale(1) rotate(0); filter: brightness(1); text-shadow: none; }
}

.mult-display {
    font-size: 1rem;
    font-weight: 800;
    color: #ef4444;
}

.stats-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coin-badge {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
}

/* Old hands-badge moved to booster-rack area */

.shop-btn-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.shop-btn-sm:hover {
    transform: scale(1.1);
}

/* === BOOSTER RACK === */
.booster-rack {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    flex-shrink: 0;
}

.hands-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border: 2px solid #a78bfa;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.hands-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #c4b5fd;
    letter-spacing: 0.1em;
}

.hands-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fbbf24;
    line-height: 1;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.booster-slots {
    display: flex;
    gap: 0.5rem;
}

.booster-card {
    position: relative;
    width: 40px;
    height: 50px;
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    border: 2px solid #6366f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.booster-card:hover {
    transform: translateY(-4px);
}

.booster-icon {
    font-size: 1.5rem;
    pointer-events: none;
}

/* Active booster highlight when contributing to word */
.booster-card.booster-active {
    animation: boosterPulse 0.8s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.7);
    border-color: #10b981;
}

@keyframes boosterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Temp booster styling */
.booster-card.temp-booster {
    border-style: dashed;
}

.booster-rounds {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f0e2e;
}

/* Rarity colors for boosters */
.booster-card.rarity-common {
    border-color: #6366f1;
}

.booster-card.rarity-uncommon {
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.booster-card.rarity-rare {
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.booster-card.rarity-legendary {
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
    animation: legendaryGlow 2s ease-in-out infinite alternate;
}

@keyframes legendaryGlow {
    0% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
    100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.7); }
}

.booster-card.rarity-temp {
    border-color: #f97316;
    border-style: dashed;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
}

/* Tooltip duration info */
.booster-tooltip-duration {
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    font-size: 0.7rem;
    color: #fca5a5;
    text-align: center;
}

/* Tooltip rarity styling */
.booster-tooltip.tooltip-legendary {
    border-color: #fbbf24;
}

.booster-tooltip.tooltip-rare {
    border-color: #3b82f6;
}

.booster-tooltip.tooltip-temp {
    border-color: #f97316;
}

/* Shop duration display */
.choice-duration {
    font-size: 0.6rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-top: 0.2rem;
}

/* Shop rarity styling */
.shop-choice.rarity-legendary {
    border-color: #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.shop-choice.rarity-rare {
    border-color: #3b82f6;
}

.shop-choice.rarity-uncommon {
    border-color: #22c55e;
}

.shop-choice.rarity-temp {
    border-color: #f97316;
    border-style: dashed;
}

/* === WORD AREA === */
.word-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.selected-word {
    display: flex;
    gap: 0.25rem;
    min-height: 2.5rem;
    align-items: center;
}

.word-placeholder {
    color: #64748b;
    font-size: 0.9rem;
}

.word-letter {
    width: 2.25rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    position: relative;
}

.word-letter.rare {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-color: #a78bfa;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

/* Valid word - green glow */
.word-area.word-valid {
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3), inset 0 0 30px rgba(34, 197, 94, 0.1);
    transition: all 0.3s ease;
}

.word-area.word-valid .word-letter {
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    border-color: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.word-area.word-valid .word-letter.rare {
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    border-color: #4ade80;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
}

/* Word Info Button - shows definition */
.word-info-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.3);
    border: 2px solid #22c55e;
    color: #22c55e;
    font-size: 0.75rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    animation: infoFadeIn 0.3s ease forwards;
}

@keyframes infoFadeIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.5); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

.word-info-btn:hover {
    background: #22c55e;
    color: #000;
    transform: translateY(-50%) scale(1.1);
}

.word-info-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Word Definition Tooltip */
.word-definition-tooltip {
    position: fixed;
    z-index: 200000;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 1rem;
    max-width: 280px;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 197, 94, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: auto;
}

.word-definition-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.word-definition-tooltip .def-word {
    font-size: 1.1rem;
    font-weight: 800;
    color: #22c55e;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.word-definition-tooltip .def-text {
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.word-definition-tooltip .def-pos {
    display: inline-block;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 600;
    font-style: italic;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    text-transform: lowercase;
}

/* Invalid word - red glow */
.word-area.word-invalid {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), inset 0 0 30px rgba(239, 68, 68, 0.1);
    transition: all 0.3s ease;
}

.word-area.word-invalid .word-letter {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* Checking word - subtle pulse */
.word-area.word-checking {
    animation: checkPulse 1s ease-in-out infinite;
}

@keyframes checkPulse {
    0%, 100% { border-color: rgba(255, 255, 255, 0.1); }
    50% { border-color: rgba(251, 191, 36, 0.4); }
}

/* Wild card word - rainbow shimmer effect */
.word-area.word-wild {
    animation: wildShimmer 2s ease-in-out infinite;
    border-color: rgba(168, 85, 247, 0.4);
}

.word-area.word-wild .word-letter {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
    border-color: #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

@keyframes wildShimmer {
    0%, 100% { border-color: rgba(168, 85, 247, 0.4); }
    50% { border-color: rgba(192, 132, 252, 0.6); }
}

/* Wild card spinning in word preview */
.word-letter.wild-slot-spinning {
    animation: wildPreviewSpin 0.08s linear infinite, wildPreviewRainbow 0.3s ease-in-out infinite;
    transform: scale(1.1);
}

@keyframes wildPreviewSpin {
    0% { transform: scale(1.1) translateY(-1px); }
    50% { transform: scale(1.1) translateY(1px); }
    100% { transform: scale(1.1) translateY(-1px); }
}

@keyframes wildPreviewRainbow {
    0% { background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%); border-color: #a855f7; }
    25% { background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%); border-color: #ec4899; }
    50% { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); border-color: #3b82f6; }
    75% { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); border-color: #f59e0b; }
    100% { background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%); border-color: #a855f7; }
}

/* Wild card resolved letter in word display */
.word-letter.wild-resolved-letter {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%) !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
    animation: wildLetterPulse 1s ease-in-out infinite;
}

@keyframes wildLetterPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.6); }
    50% { box-shadow: 0 0 25px rgba(34, 197, 94, 0.9); }
}

/* Letter slam animation - only for new letters */
.word-letter.slam-in {
    animation: letterSlam 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes letterSlam {
    0% {
        transform: scale(0) translateY(-100px) rotate(-20deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.3) translateY(5px) rotate(5deg);
        opacity: 1;
    }
    80% {
        transform: scale(0.95) translateY(-2px) rotate(-2deg);
    }
    100% {
        transform: scale(1) translateY(0) rotate(0);
    }
}

/* Impact effect behind letter */
.word-letter.slam-in::after {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: impactBurst 0.4s ease-out forwards;
    z-index: -1;
}

.word-letter.rare.slam-in::after {
    background: radial-gradient(circle, rgba(167, 139, 250, 0.6) 0%, transparent 70%);
}

@keyframes impactBurst {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Impact particles */
.impact-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly 0.5s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.word-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 700;
}

.preview-chips, .score-chips {
    font-size: 1.25rem;
    color: #3b82f6;
}

.preview-x, .score-x {
    color: #64748b;
}

.preview-mult, .score-mult {
    font-size: 1.25rem;
    color: #ef4444;
}

.preview-eq, .score-eq {
    color: #64748b;
}

.preview-total, .score-total {
    font-size: 1.5rem;
    color: #fbbf24;
}

.preview-hint {
    color: #64748b;
    font-size: 0.8rem;
}

/* === SCORE CALCULATION DISPLAY === */
.score-calc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 1.1rem;
    font-weight: 700;
}

.calc-open, .calc-close {
    color: #94a3b8;
    font-size: 1.3rem;
}

.preview-plus {
    color: #22c55e;
    font-weight: 800;
}

.preview-bonus {
    color: #22c55e;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.preview-minus {
    color: #ef4444;
    font-weight: 800;
}

.preview-penalty {
    color: #ef4444;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.length-bonus-indicator {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #a855f7;
    font-weight: 700;
    animation: lengthPulse 1s ease-in-out infinite;
}

@keyframes lengthPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* === SPECIAL CARDS === */
.special-card {
    position: relative;
}

.special-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    z-index: -1;
    animation: specialGlow 1.5s ease-in-out infinite;
}

/* Gold special card - Yellow/Gold glow */
.special-gold {
    background: linear-gradient(145deg, #78350f 0%, #451a03 100%) !important;
    border-color: #fbbf24 !important;
}
.special-gold::before {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
}
.special-gold .card-letter {
    color: #fef3c7 !important;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
}
.special-gold .card-value {
    color: #fcd34d !important;
}

/* Foil card - Blue metallic shimmer */
.special-foil {
    background: linear-gradient(145deg, #1e3a5f 0%, #0c1929 100%) !important;
    border-color: #60a5fa !important;
}
.special-foil::before {
    background: linear-gradient(135deg, #3b82f6, #60a5fa, #93c5fd, #60a5fa, #3b82f6);
    background-size: 200% 200%;
    animation: foilShimmer 2s ease infinite;
}
.special-foil .card-letter {
    color: #fff !important;
    text-shadow: 0 0 15px rgba(96, 165, 250, 0.8);
}
.special-foil .card-value {
    color: #93c5fd !important;
}

/* Holographic card - Green/teal animated gradient */
.special-holographic {
    background: linear-gradient(145deg, #064e3b 0%, #022c22 100%) !important;
    border-color: #34d399 !important;
}
.special-holographic::before {
    background: linear-gradient(135deg, #34d399, #2dd4bf, #22d3ee, #34d399);
    background-size: 200% 200%;
    animation: holoShift 1.5s ease infinite;
}
.special-holographic .card-letter {
    color: #fff !important;
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.8);
}
.special-holographic .card-value {
    color: #6ee7b7 !important;
}

/* Polychrome card - Rainbow animated */
.special-polychrome {
    background: linear-gradient(145deg, #312e81 0%, #1e1b4b 100%) !important;
    border-color: #f472b6 !important;
}
.special-polychrome::before {
    background: linear-gradient(135deg, #ef4444, #f97316, #fbbf24, #22c55e, #3b82f6, #a855f7, #f472b6, #ef4444);
    background-size: 300% 300%;
    animation: polyShift 2s ease infinite;
}
.special-polychrome .card-letter {
    color: #fff !important;
    text-shadow: 0 0 20px rgba(244, 114, 182, 0.8);
}
.special-polychrome .card-value {
    color: #f9a8d4 !important;
}

/* Lucky card - Green lucky glow */
.special-lucky {
    background: linear-gradient(145deg, #14532d 0%, #052e16 100%) !important;
    border-color: #22c55e !important;
}
.special-lucky::before {
    background: linear-gradient(135deg, #22c55e, #4ade80, #86efac, #4ade80, #22c55e);
    animation: luckyPulse 1s ease-in-out infinite;
}
.special-lucky .card-letter {
    color: #fff !important;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
}
.special-lucky .card-value {
    color: #86efac !important;
}

@keyframes specialGlow {
    0%, 100% { opacity: 0.6; filter: blur(4px); }
    50% { opacity: 1; filter: blur(6px); }
}

@keyframes foilShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes holoShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes polyShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes polyText {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(60deg); }
}

@keyframes luckyPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Special card badges - compact pill at top-right corner */
.special-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    font-size: 0.4rem;
    font-weight: 800;
    height: 12px;
    line-height: 12px;
    text-align: center;
    padding: 0 3px;
    border-radius: 6px;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: help;
    white-space: nowrap;
}

/* Tooltip on hover - appears below badge */
.special-badge[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 0.35rem 0.5rem;
    border-radius: 5px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.special-badge[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: calc(100% + 1px);
    right: 4px;
    border: 5px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.95);
    z-index: 100;
}

.gold-special-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.6);
}

.foil-badge {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.6);
}

.holo-badge {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.6);
}

.poly-badge {
    background: linear-gradient(135deg, #f472b6 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(244, 114, 182, 0.6);
}

.lucky-badge {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.6);
}

/* === ACTION BAR === */
.action-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    flex-shrink: 0;
}

.action-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 44px;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.play-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    flex: 1;
}

.play-btn:not(:disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.discard-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.discard-btn:not(:disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.sort-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
}

.clear-btn {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #fff;
}

.btn-text {
    font-size: 0.85rem;
}

.btn-sub {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* === BOTTOM BAR === */
.bottom-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem;
    flex-shrink: 0;
    align-items: stretch;
}

.bottom-bar .play-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    min-height: 50px;
}

.coins-display {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 2px solid #4338ca;
    border-radius: 10px;
}

.coins-display .coin-icon {
    font-size: 1.1rem;
}

.coins-display .coin-amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fbbf24;
}

/* === CARD HAND === */
.card-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    flex: 1;
    align-content: center;
    overflow-y: auto;
}

.letter-card {
    width: clamp(42px, 11vw, 56px);
    height: clamp(60px, 16vw, 80px);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 3px solid #cbd5e1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.letter-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.letter-card.selected {
    transform: translateY(-12px);
    border-color: #3b82f6;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}

.letter-card.rare {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.letter-card.rare.selected {
    border-color: #d97706;
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5);
}

.letter-card.vowel {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

/* Gold cards */
.letter-card.gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.letter-card.gold.selected {
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.6), 0 0 20px rgba(245, 158, 11, 0.4);
}

/* Wild cards */
.letter-card.wild {
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #7c3aed 100%);
    border-color: #a855f7;
    animation: rainbowPulse 2s ease-in-out infinite;
}

.letter-card.wild .card-letter {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes rainbowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(168, 85, 247, 0.5); }
    50% { box-shadow: 0 0 25px rgba(192, 132, 252, 0.7); }
}

/* Wild card slot machine animation */
.letter-card.wild-spinning {
    animation: wildSpin 0.1s linear infinite, rainbowFlash 0.2s ease-in-out infinite;
    transform: scale(1.1);
}

.letter-card.wild-spinning .card-letter {
    animation: slotBlur 0.05s linear infinite;
}

@keyframes wildSpin {
    0% { transform: scale(1.1) translateY(-2px); }
    50% { transform: scale(1.1) translateY(2px); }
    100% { transform: scale(1.1) translateY(-2px); }
}

@keyframes rainbowFlash {
    0% { background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #7c3aed 100%); }
    25% { background: linear-gradient(135deg, #f472b6 0%, #ec4899 50%, #db2777 100%); }
    50% { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%); }
    75% { background: linear-gradient(135deg, #4ade80 0%, #22c55e 50%, #16a34a 100%); }
    100% { background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #7c3aed 100%); }
}

@keyframes slotBlur {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.letter-card.wild-resolved {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 50%, #16a34a 100%) !important;
    border-color: #22c55e !important;
    animation: none;
}

.letter-card.wild-flash {
    animation: wildResolveFlash 0.4s ease-out;
}

@keyframes wildResolveFlash {
    0% {
        transform: scale(1.2);
        box-shadow: 0 0 40px rgba(34, 197, 94, 0.9);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 60px rgba(34, 197, 94, 1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    }
}

/* Card badges */
.card-badge {
    position: absolute;
    top: 2px;
    font-size: 0.55rem;
}

.rare-badge {
    left: 3px;
    color: #f59e0b;
}

.gold-badge {
    right: 3px;
    color: #fbbf24;
}

.letter-card.scoring {
    animation: cardScore 0.4s ease;
}

@keyframes cardScore {
    0%, 100% { transform: translateY(-12px) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

.letter-card.shake {
    animation: cardShake 0.4s ease;
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px) rotate(-2deg); }
    40% { transform: translateX(5px) rotate(2deg); }
    60% { transform: translateX(-5px) rotate(-2deg); }
    80% { transform: translateX(5px) rotate(2deg); }
}

.letter-card.deal-in {
    animation: dealIn 0.3s ease backwards;
}

@keyframes dealIn {
    from {
        opacity: 0;
        transform: translateY(50px) rotate(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0);
    }
}

.card-letter {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.card-value {
    font-size: 0.6rem;
    font-weight: 700;
    color: #64748b;
    position: absolute;
    bottom: 4px;
    right: 6px;
}

.card-rare {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.6rem;
    color: #f59e0b;
}

/* === ROUND OVERLAY === */
.round-overlay {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 20% 90%, rgba(251, 191, 36, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, rgba(10, 10, 26, 0.98) 0%, rgba(17, 24, 39, 0.98) 50%, rgba(15, 23, 42, 0.98) 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Subtle animated particles */
.round-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 50px 50px, rgba(16, 185, 129, 0.3), transparent),
        radial-gradient(2px 2px at 150px 100px, rgba(251, 191, 36, 0.2), transparent),
        radial-gradient(1px 1px at 100px 150px, rgba(99, 102, 241, 0.3), transparent),
        radial-gradient(2px 2px at 200px 80px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 250px 200px, rgba(16, 185, 129, 0.25), transparent);
    background-size: 300px 250px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
}

.round-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.round-content {
    position: relative;
    text-align: center;
    padding: 1.5rem;
    width: 100%;
    max-width: 360px;
    margin: 1rem auto;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.7) 100%);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow:
        0 0 40px rgba(16, 185, 129, 0.1),
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: roundContentIn 0.4s ease-out;
}

@keyframes roundContentIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.round-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: titleSlideIn 0.5s ease-out;
}

@keyframes titleSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.round-title.success {
    color: #10b981;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.round-title.fail {
    color: #ef4444;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.score-reveal {
    margin-bottom: 0.5rem;
}

.score-reveal.animate-stats {
    animation: scoreRevealIn 0.6s ease-out 0.2s both;
}

@keyframes scoreRevealIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.final-chips {
    margin: 0.5rem 0;
}

.final-chips span:first-child {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fbbf24;
    display: block;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
    animation: chipsPulse 1s ease-in-out 0.5s;
}

@keyframes chipsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); text-shadow: 0 0 50px rgba(251, 191, 36, 0.8); }
}

.chips-label {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.15em;
}

.ante-result {
    margin: 1rem 0;
}

.level-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.reward {
    font-size: 1.5rem;
    color: #fbbf24;
    font-weight: 700;
}

.bonus-reward {
    font-size: 1rem;
    color: #10b981;
    font-weight: 700;
    animation: bonusPop 0.5s ease;
}

@keyframes bonusPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.needed {
    font-size: 1rem;
    color: #f87171;
}

.continue-btn {
    padding: 0.9rem 2.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s;
    box-shadow:
        0 6px 25px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.continue-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 8px 35px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.continue-btn:active {
    transform: scale(0.98);
}

/* Round buttons container */
.round-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.round-buttons .continue-btn {
    margin-top: 0;
}

/* Skip button */
.skip-btn {
    padding: 0.9rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: #9ca3af;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.skip-btn:active {
    transform: scale(0.98);
}

/* Hide skip button in phase 2 (shop phase) */
.round-buttons.phase-2 .skip-btn {
    display: none;
}

/* === VICTORY CELEBRATION OVERLAY === */
.victory-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.victory-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.victory-content {
    text-align: center;
    position: relative;
}

/* Radial burst effect */
.victory-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    background:
        repeating-conic-gradient(
            from 0deg,
            rgba(16, 185, 129, 0.3) 0deg 10deg,
            transparent 10deg 20deg
        );
    border-radius: 50%;
    animation: burstSpin 8s linear infinite, burstPulse 1s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes burstSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes burstPulse {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.1); opacity: 0.8; }
}

.victory-overlay.active .victory-burst {
    animation: burstSpin 8s linear infinite, burstExpand 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes burstExpand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
}

.victory-text {
    position: relative;
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 30px rgba(16, 185, 129, 0.8),
        0 0 60px rgba(16, 185, 129, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.1em;
    transform: scale(0);
    animation: none;
}

.victory-overlay.active .victory-text {
    animation: victorySlam 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes victorySlam {
    0% { transform: scale(3); opacity: 0; }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.victory-subtext {
    position: relative;
    font-size: 1.2rem;
    color: #10b981;
    margin-top: 0.5rem;
    font-weight: 700;
    opacity: 0;
}

.victory-overlay.active .victory-subtext {
    animation: subtextFade 0.4s ease-out 0.3s forwards;
}

@keyframes subtextFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Boss victory variant */
.victory-overlay.boss-victory {
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%);
}

.victory-overlay.boss-victory .victory-burst {
    background:
        repeating-conic-gradient(
            from 0deg,
            rgba(245, 158, 11, 0.4) 0deg 10deg,
            transparent 10deg 20deg
        );
}

.victory-overlay.boss-victory .victory-text {
    text-shadow:
        0 0 30px rgba(245, 158, 11, 0.8),
        0 0 60px rgba(245, 158, 11, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
}

.victory-overlay.boss-victory .victory-subtext {
    color: #fbbf24;
}

/* Level up variant */
.victory-overlay.level-up {
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%);
}

.victory-overlay.level-up .victory-burst {
    background:
        repeating-conic-gradient(
            from 0deg,
            rgba(99, 102, 241, 0.4) 0deg 10deg,
            transparent 10deg 20deg
        );
}

.victory-overlay.level-up .victory-text {
    text-shadow:
        0 0 30px rgba(99, 102, 241, 0.8),
        0 0 60px rgba(99, 102, 241, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
}

.victory-overlay.level-up .victory-subtext {
    color: #818cf8;
}

/* === REWARDS BREAKDOWN === */
.rewards-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0.5rem auto;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    max-width: 240px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: breakdownFadeIn 0.4s ease-out 0.7s both;
}

@keyframes breakdownFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.reward-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.15rem 0;
    opacity: 0;
    transform: translateX(-20px);
    animation: rewardSlideIn 0.3s ease forwards;
}

.reward-line:nth-child(1) { animation-delay: 0.9s; }
.reward-line:nth-child(2) { animation-delay: 1.0s; }
.reward-line:nth-child(3) { animation-delay: 1.1s; }

@keyframes rewardSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.reward-label {
    color: #94a3b8;
    font-size: 0.75rem;
}

.reward-value {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.8rem;
}

.reward-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    animation: totalReveal 0.4s ease forwards;
    animation-delay: 1.3s;
}

@keyframes totalReveal {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.reward-total .reward-label {
    color: #fff;
    font-weight: 700;
}

.reward-total .reward-value {
    color: #10b981;
    font-size: 0.95rem;
}

/* === ROUND SHOP - BALATRO STYLE === */
.round-shop {
    /* Extend to edges with negative margins, flush to top */
    margin: -0.5rem -1.5rem 0.5rem -1.5rem;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.95) 0%, rgba(49, 46, 129, 0.95) 100%);
    border-radius: 0;
    border-top: 2px solid #4338ca;
    border-bottom: 2px solid #4338ca;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
}

.shop-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.shop-header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.shop-coins {
    color: #fbbf24;
    font-weight: 700;
    font-size: 1rem;
}

/* Reroll Button */
.reroll-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border: 2px solid #8b5cf6;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reroll-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
}

.reroll-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.reroll-icon {
    font-size: 0.85rem;
}

.reroll-cost {
    color: #fde68a;
}

/* Shop Sections */
.shop-section {
    margin-bottom: 0.4rem;
    overflow: visible;
}

.shop-section:last-child {
    margin-bottom: 0;
}

.shop-section-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
}

.shop-cards {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
}

/* Shop Card - Balatro Playing Card Style */
.shop-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 105px;
    height: 130px;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: visible;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Inner content wrapper for overflow clipping */
.shop-card-inner {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 6px;
}

.shop-card::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    pointer-events: none;
}

.shop-card:hover:not(.disabled):not(.purchased):not(.sold-out) {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
    border-color: #6366f1;
}

.shop-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-card.purchased,
.shop-card.sold-out {
    opacity: 0.6;
    cursor: default;
}

.shop-card.purchased::after,
.shop-card.sold-out::after {
    content: 'SOLD';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: #ef4444;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

/* Card Icon */
.shop-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    font-size: 1.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
}

/* Card Body */
.shop-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0.4rem;
    text-align: center;
}

.shop-card-name {
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 0.1rem;
}

.shop-card-desc {
    font-size: 0.6rem;
    color: #9ca3af;
    line-height: 1.2;
    flex: 1;
    overflow: hidden;
}

.shop-card-duration {
    font-size: 0.55rem;
    color: #f59e0b;
    margin-top: 0.15rem;
}

/* Card Footer - Price */
.shop-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-card-price {
    font-size: 0.75rem;
    font-weight: 800;
    color: #fbbf24;
}

/* Rarity Colors */
.shop-card.rarity-common {
    border-color: #6b7280;
}

.shop-card.rarity-uncommon {
    border-color: #22c55e;
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.2);
}

.shop-card.rarity-rare {
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.shop-card.rarity-legendary {
    border-color: #f59e0b;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6); }
}

.shop-card.rarity-temp {
    border-color: #f97316;
    border-style: dashed;
}

/* Consumable cards - green tint, always buyable */
.shop-card[data-type="consumable"] {
    border-color: #22c55e;
    background: linear-gradient(145deg, #14532d 0%, #166534 100%);
}

.shop-card[data-type="consumable"]:hover:not(.disabled) {
    border-color: #4ade80;
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.4);
}

.shop-card[data-type="consumable"] .shop-card-price {
    color: #4ade80;
}

/* Purchase flash animation for consumables */
.shop-card.purchased-flash {
    animation: purchaseFlash 0.3s ease-out;
}

@keyframes purchaseFlash {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); background: rgba(34, 197, 94, 0.3); }
    100% { transform: scale(1); }
}

/* Swap Badge - positioned to overflow card corner */
.shop-card-swap {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transform: rotate(12deg);
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === SHOP PREVIEW MODAL === */
.shop-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.shop-preview-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.shop-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.shop-preview-overlay.active .shop-preview-content {
    transform: scale(1);
}

/* Enlarged card */
.shop-preview-card {
    width: 180px;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #6366f1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.2);
}

.shop-preview-card.rarity-uncommon {
    border-color: #22c55e;
    box-shadow: 0 8px 40px rgba(34, 197, 94, 0.5), 0 0 60px rgba(34, 197, 94, 0.2);
}

.shop-preview-card.rarity-rare {
    border-color: #3b82f6;
    box-shadow: 0 8px 40px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.2);
}

.shop-preview-card.rarity-legendary {
    border-color: #f59e0b;
    box-shadow: 0 8px 40px rgba(245, 158, 11, 0.5), 0 0 60px rgba(245, 158, 11, 0.2);
    animation: legendaryPreviewPulse 2s ease-in-out infinite;
}

@keyframes legendaryPreviewPulse {
    0%, 100% { box-shadow: 0 8px 40px rgba(245, 158, 11, 0.5), 0 0 60px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 8px 50px rgba(245, 158, 11, 0.7), 0 0 80px rgba(245, 158, 11, 0.4); }
}

.shop-preview-card.type-consumable {
    border-color: #22c55e;
    background: linear-gradient(145deg, #14532d 0%, #166534 100%);
    box-shadow: 0 8px 40px rgba(34, 197, 94, 0.5), 0 0 60px rgba(34, 197, 94, 0.2);
}

.shop-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    font-size: 2.5rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
}

.shop-preview-body {
    padding: 0.75rem 1rem;
    text-align: center;
}

.shop-preview-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.shop-preview-desc {
    font-size: 0.9rem;
    color: #d1d5db;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.shop-preview-duration {
    font-size: 0.8rem;
    color: #f59e0b;
    margin-bottom: 0.25rem;
}

.shop-preview-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-preview-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fbbf24;
}

.shop-preview-card.type-consumable .shop-preview-price {
    color: #4ade80;
}

/* Action buttons */
.shop-preview-actions {
    display: flex;
    gap: 0.75rem;
}

.shop-preview-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shop-preview-btn.confirm {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.shop-preview-btn.confirm:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.5);
}

.shop-preview-btn.confirm:active {
    transform: scale(0.98);
}

.shop-preview-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shop-preview-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Swap indicator in preview */
.shop-preview-swap {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Legacy shop-choice (keeping for backward compat) */
.shop-choices {
    display: none;
}

.choice-swap {
    font-size: 0.55rem;
    font-weight: 800;
    color: #000;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    margin-top: 0.2rem;
}

/* === SCREEN SHAKE === */
.screen-shake {
    animation: screenShake 0.3s ease;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -2px); }
    20% { transform: translate(8px, 2px); }
    30% { transform: translate(-6px, 3px); }
    40% { transform: translate(6px, -3px); }
    50% { transform: translate(-4px, 2px); }
    60% { transform: translate(4px, -2px); }
    70% { transform: translate(-3px, 1px); }
    80% { transform: translate(3px, -1px); }
    90% { transform: translate(-2px, 0); }
}

/* Intense shake for big scores */
.screen-shake-intense {
    animation: screenShakeIntense 0.5s ease;
}

@keyframes screenShakeIntense {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    5% { transform: translate(-15px, -5px) rotate(-1deg); }
    10% { transform: translate(15px, 5px) rotate(1deg); }
    15% { transform: translate(-12px, 6px) rotate(-0.5deg); }
    20% { transform: translate(12px, -6px) rotate(0.5deg); }
    25% { transform: translate(-10px, 4px) rotate(-0.3deg); }
    30% { transform: translate(10px, -4px) rotate(0.3deg); }
    40% { transform: translate(-8px, 3px); }
    50% { transform: translate(8px, -3px); }
    60% { transform: translate(-5px, 2px); }
    70% { transform: translate(5px, -2px); }
    80% { transform: translate(-3px, 1px); }
    90% { transform: translate(2px, 0); }
}

/* Epic shake for massive scores */
.screen-shake-epic {
    animation: screenShakeEpic 0.7s ease;
}

@keyframes screenShakeEpic {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    5% { transform: translate(-20px, -8px) rotate(-2deg) scale(1.01); }
    10% { transform: translate(20px, 8px) rotate(2deg) scale(1.01); }
    15% { transform: translate(-18px, 10px) rotate(-1.5deg) scale(1.005); }
    20% { transform: translate(18px, -10px) rotate(1.5deg) scale(1.005); }
    25% { transform: translate(-15px, 8px) rotate(-1deg); }
    30% { transform: translate(15px, -8px) rotate(1deg); }
    40% { transform: translate(-12px, 6px) rotate(-0.5deg); }
    50% { transform: translate(12px, -6px) rotate(0.5deg); }
    60% { transform: translate(-8px, 4px); }
    70% { transform: translate(8px, -4px); }
    80% { transform: translate(-4px, 2px); }
    90% { transform: translate(2px, -1px); }
}

/* Invalid word shake (red tinted) */
.screen-shake-error {
    animation: screenShakeError 0.4s ease;
}

@keyframes screenShakeError {
    0%, 100% { transform: translateX(0); filter: none; }
    10% { transform: translateX(-12px); filter: brightness(1.1) saturate(1.2); }
    20% { transform: translateX(12px); }
    30% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    50% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    70% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* === MODALS === */
/* z-index 999999 with !important ensures modals appear above ALL game overlays */
.game-modal {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 1rem;
}

.game-modal.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
}

.game-modal__content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-modal__content h2 {
    margin-top: 0;
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.game-modal__content h3 {
    color: #fbbf24;
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-modal__content h3:first-of-type {
    border-top: none;
    padding-top: 0;
}

.game-modal__content p {
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.game-modal__content ul {
    padding-left: 1.25rem;
    margin: 0;
}

.game-modal__content li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.game-modal__content li strong {
    color: #fff;
}

/* Help modal special badge examples */
.help-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    height: 16px;
    line-height: 16px;
    text-align: center;
    padding: 0 5px;
    border-radius: 8px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.help-badge.gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
}

.help-badge.foil {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #fff;
}

.help-badge.holo {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #fff;
}

.help-badge.poly {
    background: linear-gradient(135deg, #f472b6 0%, #a855f7 100%);
    color: #fff;
}

.help-badge.lucky {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

/* Shop items */
.shop-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
}

.shop-coins-display {
    color: #fbbf24;
    font-weight: 700;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.shop-item:not(.disabled):not(.owned):hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.shop-item.disabled {
    opacity: 0.5;
}

.shop-item.owned {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.shop-item__icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.shop-item__info {
    flex: 1;
}

.shop-item__name {
    font-weight: 700;
    font-size: 0.9rem;
}

.shop-item__desc {
    font-size: 0.75rem;
    color: #94a3b8;
}

.shop-item__buy {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.shop-item__buy:disabled {
    background: #374151;
    color: #6b7280;
    cursor: not-allowed;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Buttons */
.wordle-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.wordle-btn--secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.wordle-btn--danger {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.wordle-btn--danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

/* === MOBILE === */
@media (max-width: 400px) {
    .card-game {
        padding: 0.35rem;
        gap: 0.35rem;
    }

    .top-bar {
        padding: 0.35rem 0.5rem;
    }

    .ante-badge, .target-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .chips-display {
        font-size: 0.9rem;
    }

    .word-letter {
        width: 1.75rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .action-btn {
        padding: 0.6rem;
    }

    .btn-text {
        font-size: 0.75rem;
    }

    .letter-card {
        width: 38px;
        height: 54px;
    }

    .card-letter {
        font-size: 1.1rem;
    }
}

/* Short screens */
@media (max-height: 650px) {
    .word-area {
        padding: 0.5rem;
        min-height: 60px;
    }

    .joker-rack {
        display: none;
    }

    .action-btn {
        padding: 0.5rem;
    }
}

/* Stats modal styling (always dark) */
.game-modal__content .stat-item {
    background: rgba(51, 65, 85, 0.6);
    border-radius: 8px;
    padding: 0.75rem;
}

.game-modal__content .stat-value {
    color: #fbbf24;
    font-size: 1.5rem;
    font-weight: 800;
}

.game-modal__content .stat-label {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Stats container grid */
.game-modal__content .stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Modal buttons */
.game-modal__content .modal-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.game-modal__content .modal-btn:first-of-type {
    margin-top: 1rem;
}

.game-modal__content .wordle-btn:not(.wordle-btn--danger) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: #fff;
}

.game-modal__content .wordle-btn--danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: #fff;
}

/* Animate score in */
.animate-in {
    animation: popIn 0.3s ease backwards;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === BALATRO SCORING ANIMATIONS === */

/* Card being scored - glows and lifts */
.letter-card.scoring-active {
    transform: translateY(-20px) scale(1.1) !important;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8), 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: #3b82f6 !important;
    z-index: 10;
    transition: all 0.15s ease-out;
}

.letter-card.rare.scoring-active {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.8), 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: #f59e0b !important;
}

/* Card scored - fades and shrinks */
.letter-card.card-scored {
    transform: translateY(-30px) scale(0.8) !important;
    opacity: 0.3;
    filter: grayscale(0.5);
    transition: all 0.2s ease-out;
}

/* Chip value pop */
.chip-pop {
    animation: chipPop 0.2s ease;
}

@keyframes chipPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); color: #60a5fa; }
    100% { transform: scale(1); }
}

/* Mult value pop */
.mult-pop {
    animation: multPop 0.3s ease;
}

@keyframes multPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.6); color: #f87171; }
    100% { transform: scale(1); }
}

/* Floating score indicators - Destiny-style hit markers */
.floating-score {
    position: fixed;
    font-size: 1.5rem;
    font-weight: 900;
    color: #3b82f6;
    text-shadow:
        0 0 10px rgba(59, 130, 246, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10000;
    animation: floatUpBig 0.8s ease-out forwards;
    transform: translateX(-50%);
    white-space: nowrap;
}

.floating-score.mult {
    color: #ef4444;
    text-shadow:
        0 0 10px rgba(239, 68, 68, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-score.gold {
    color: #fbbf24;
    text-shadow:
        0 0 15px rgba(251, 191, 36, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-score.special {
    color: #a855f7;
    font-size: 1.75rem;
    text-shadow:
        0 0 15px rgba(168, 85, 247, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-score.booster {
    color: #22c55e;
    font-size: 1.4rem;
    text-shadow:
        0 0 12px rgba(34, 197, 94, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-score.penalty {
    color: #dc2626;
    text-shadow:
        0 0 10px rgba(220, 38, 38, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.floating-score.impact {
    color: #60a5fa;
    font-size: 2rem;
    font-weight: 900;
    text-shadow:
        0 0 20px rgba(96, 165, 250, 1),
        0 0 40px rgba(59, 130, 246, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.9);
    animation: floatUpImpact 1s ease-out forwards;
}

@keyframes floatUpImpact {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(0.3);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1.5);
    }
    30% {
        transform: translateX(-50%) translateY(-35px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80px) scale(0.8);
    }
}

@keyframes floatUpBig {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-60px) scale(1);
    }
}

/* Legacy floating chip (keep for compatibility) */
.floating-chip {
    position: fixed;
    font-size: 1.25rem;
    font-weight: 800;
    color: #3b82f6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 0.6s ease-out forwards;
    transform: translateX(-50%);
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px) scale(1.2);
    }
}

/* Final score reveal */
.final-reveal {
    animation: finalReveal 0.5s ease;
}

@keyframes finalReveal {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Victory burst overlay for valid word plays */
.victory-burst {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    animation: victoryBurst 0.8s ease-out forwards;
    background: radial-gradient(circle at 50% 50%,
        rgba(34, 197, 94, 0.4) 0%,
        rgba(34, 197, 94, 0.1) 30%,
        transparent 60%);
}

@keyframes victoryBurst {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Epic victory for big scores */
.victory-burst.epic {
    background: radial-gradient(circle at 50% 50%,
        rgba(251, 191, 36, 0.5) 0%,
        rgba(245, 158, 11, 0.3) 25%,
        rgba(34, 197, 94, 0.2) 50%,
        transparent 70%);
}

/* Word glow pulse when confirmed valid */
.word-area.word-confirmed {
    animation: wordConfirmed 0.6s ease;
}

@keyframes wordConfirmed {
    0% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.3), inset 0 0 30px rgba(34, 197, 94, 0.1);
    }
    25% {
        box-shadow: 0 0 50px rgba(34, 197, 94, 0.8), inset 0 0 50px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 80px rgba(251, 191, 36, 0.6), inset 0 0 40px rgba(251, 191, 36, 0.2);
    }
    100% {
        box-shadow: none;
    }
}

/* Spark particles for celebration */
.celebration-spark {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1001;
    animation: sparkFly 0.8s ease-out forwards;
}

@keyframes sparkFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Card fly-away animation for played cards */
.letter-card.fly-away {
    animation: cardFlyAway 0.5s ease-in forwards;
}

@keyframes cardFlyAway {
    0% {
        transform: translateY(-12px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0.3) rotate(20deg);
        opacity: 0;
    }
}

/* Booster trigger flash */
.booster-card.booster-trigger {
    animation: boosterFlash 0.4s ease;
}

@keyframes boosterFlash {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        transform: translateY(-8px) scale(1.15);
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
    }
}

/* Enhanced score display during play */
.score-chips, .score-mult, .score-total {
    transition: transform 0.1s, color 0.1s;
    display: inline-block;
}

.score-total {
    min-width: 3ch;
    text-align: center;
}

/* Old coins-bar replaced by bottom-bar */

.quick-joker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    border: 2px solid #6366f1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
    position: relative;
}

.quick-joker:hover:not(.disabled) {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    border-color: #818cf8;
}

.quick-joker.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qj-icon {
    font-size: 1.5rem;
}

.qj-name {
    font-size: 0.55rem;
    font-weight: 700;
    color: #e2e8f0;
    text-align: center;
    line-height: 1.1;
    max-width: 60px;
}

.qj-desc {
    font-size: 0.5rem;
    color: #a5b4fc;
    text-align: center;
}

.qj-cost {
    font-size: 0.7rem;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(0,0,0,0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-top: 0.15rem;
}

.shop-bar-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #a5b4fc;
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: rgba(99, 102, 241, 0.2);
    padding: 0.5rem 0.25rem;
    border-radius: 6px;
}

/* === CARD BOOSTER EFFECTS === */

/* Vowel boost effect - blue glow */
.letter-card.vowel-boosted {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6), 0 4px 15px rgba(0,0,0,0.2);
    border-color: #3b82f6;
}

.letter-card.vowel-boosted::before {
    content: '♦';
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.5rem;
    color: #60a5fa;
}

/* Consonant boost effect - green glow */
.letter-card.consonant-boosted {
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6), 0 4px 15px rgba(0,0,0,0.2);
    border-color: #22c55e;
}

.letter-card.consonant-boosted::before {
    content: '♣';
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.5rem;
    color: #4ade80;
}

/* Rare letter boost - flame effect */
.letter-card.rare-boosted {
    animation: flameGlow 1s ease-in-out infinite alternate;
}

@keyframes flameGlow {
    0% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.6), 0 0 30px rgba(251, 146, 60, 0.4);
        border-color: #ef4444;
    }
    100% {
        box-shadow: 0 0 25px rgba(251, 146, 60, 0.8), 0 0 40px rgba(239, 68, 68, 0.5);
        border-color: #fb923c;
    }
}

.letter-card.rare-boosted::after {
    content: '🔥';
    position: absolute;
    top: -8px;
    right: -4px;
    font-size: 0.7rem;
    animation: flameDance 0.5s ease-in-out infinite alternate;
}

@keyframes flameDance {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-2px) scale(1.1); }
}

/* Length bonus indicator */
.letter-card.length-boosted::before {
    content: '📏';
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.5rem;
}

/* === BOOSTER CARD CLICKABLE === */
.booster-card {
    cursor: pointer;
    position: relative;
}

.booster-card:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.booster-card:active {
    transform: translateY(-4px) scale(1.05);
}

/* === BOOSTER INFO TOOLTIP === */
.booster-tooltip {
    position: fixed;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 2px solid #6366f1;
    border-radius: 12px;
    padding: 1rem;
    max-width: 200px;
    z-index: 100000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: tooltipPop 0.2s ease-out;
}

@keyframes tooltipPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.booster-tooltip-icon {
    font-size: 2rem;
    text-align: center;
    display: block;
    margin-bottom: 0.5rem;
}

.booster-tooltip-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 0.25rem;
}

.booster-tooltip-desc {
    font-size: 0.85rem;
    color: #a5b4fc;
    text-align: center;
    line-height: 1.3;
}

.booster-tooltip-effect {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 0.75rem;
    color: #fbbf24;
    text-align: center;
}

.booster-tooltip-close {
    margin-top: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.booster-tooltip-close:active {
    transform: scale(0.98);
}

/* === COLOR-CODED SCORING === */

/* Vowel bonus - blue */
.score-vowel-bonus {
    color: #60a5fa !important;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
}

/* Consonant bonus - green */
.score-consonant-bonus {
    color: #4ade80 !important;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
}

/* Rare bonus - orange/fire */
.score-rare-bonus {
    color: #fb923c !important;
    text-shadow: 0 0 10px rgba(251, 146, 60, 0.6);
}

/* Length bonus - purple */
.score-length-bonus {
    color: #c084fc !important;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

/* Multiplier bonus - red */
.score-mult-bonus {
    color: #f87171 !important;
    text-shadow: 0 0 10px rgba(248, 113, 113, 0.6);
}

/* Lucky bonus - gold sparkle */
.score-lucky-bonus {
    color: #fbbf24 !important;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
    animation: luckyPulse 0.3s ease;
}

@keyframes luckyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Flat bonus - white */
.score-flat-bonus {
    color: #e2e8f0 !important;
    text-shadow: 0 0 8px rgba(226, 232, 240, 0.5);
}

/* Scoring effect label */
.score-effect-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-left: 0.25rem;
}

/* === BOOSTER SWAP MODAL === */

/* Swap indicator on shop items when at max */
.shop-choice.at-max {
    border-color: #f59e0b;
}

.swap-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Swap modal overlay - high z-index to appear above round overlay */
.swap-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

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

.swap-modal-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f0e2e 100%);
    border: 3px solid #6366f1;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.3);
    animation: modalSlideUp 0.3s ease;
}

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

.swap-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

/* New booster being acquired */
.swap-modal-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.swap-new-icon {
    font-size: 2rem;
}

.swap-new-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
}

.swap-new-desc {
    font-size: 0.7rem;
    color: #a7f3d0;
    line-height: 1.2;
}

/* Arrow indicator */
.swap-modal-arrow {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ef4444;
    margin: 0.5rem 0;
    letter-spacing: 0.05em;
}

/* Options grid */
.swap-modal-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

/* Individual swap option */
.swap-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.6rem;
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    border: 2px solid #6366f1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.swap-option:hover {
    transform: translateY(-4px);
    border-color: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.swap-option:active {
    transform: translateY(-2px) scale(0.98);
}

.swap-option-icon,
.swap-opt-icon {
    font-size: 1.5rem;
}

.swap-option-name,
.swap-opt-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.2;
}

.swap-option-desc,
.swap-opt-desc {
    font-size: 0.55rem;
    color: #c7d2fe;
    text-align: center;
    line-height: 1.2;
}

/* Cancel button */
.swap-cancel-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.swap-cancel-btn:hover {
    background: linear-gradient(135deg, #78716c 0%, #57534e 100%);
    transform: scale(1.02);
}

/* Make shop choices relative for swap indicator positioning */
.shop-choice {
    position: relative;
}

/* === XP NOTIFICATION === */
.xp-notification {
    position: fixed;
    z-index: 9999;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 20px;
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 15px rgba(251, 191, 36, 0.5),
        0 0 20px rgba(251, 191, 36, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.3s ease-out;
}

.xp-notification.show {
    opacity: 1;
    transform: translateY(0);
    animation: xpPulse 0.6s ease-out;
}

.xp-notification.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

@keyframes xpPulse {
    0% { transform: scale(0.8) translateY(10px); }
    50% { transform: scale(1.1) translateY(-5px); }
    100% { transform: scale(1) translateY(0); }
}

/* === STEP-BY-STEP TUTORIAL === */
.tutorial-modal {
    max-width: 420px !important;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tutorial-header h2 {
    margin: 0 !important;
}

.tutorial-step-indicator {
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.tutorial-step {
    display: none;
    animation: tutorialFadeIn 0.3s ease-out;
}

.tutorial-step.active {
    display: block;
}

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

.tutorial-step h3 {
    color: #fbbf24 !important;
    font-size: 1.1rem !important;
    margin: 0.75rem 0 0.5rem !important;
    padding: 0 !important;
    border: none !important;
}

.tutorial-step p {
    margin: 0 0 0.5rem !important;
    line-height: 1.5;
}

.tutorial-tip {
    font-size: 0.85rem !important;
    color: #60a5fa !important;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    margin-top: 0.5rem !important;
}

/* Tutorial Visual Demos */
.tutorial-visual {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

/* Step 1: Cards Demo */
.tutorial-cards {
    display: flex;
    gap: 4px;
}

.tutorial-card {
    width: 40px;
    height: 54px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    transition: all 0.2s;
}

.tutorial-card.selected {
    transform: translateY(-8px);
    border-color: #3b82f6;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.tutorial-arrow {
    font-size: 1.5rem;
    color: #fbbf24;
    margin: 0 0.75rem;
}

.tutorial-word-display {
    font-size: 1.25rem;
    font-weight: 800;
    color: #22c55e;
    letter-spacing: 0.1em;
}

/* Step 2: Score Demo */
.tutorial-score-demo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tutorial-chips, .tutorial-mult, .tutorial-total {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chip-label, .mult-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.chip-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #60a5fa;
}

.mult-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f472b6;
}

.tutorial-equals {
    font-size: 1.5rem;
    color: #94a3b8;
}

.total-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
}

/* Step 3: Target Demo */
.tutorial-target-demo {
    width: 100%;
    max-width: 200px;
}

.tutorial-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.tutorial-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 6px;
    transition: width 0.3s;
}

.tutorial-target-numbers {
    text-align: center;
    margin-bottom: 0.5rem;
}

.current-pts {
    font-size: 1.25rem;
    font-weight: 800;
    color: #22c55e;
}

.target-pts {
    font-size: 1rem;
    color: #94a3b8;
}

.tutorial-hands {
    text-align: center;
    color: #fbbf24;
    font-size: 0.9rem;
}

.hands-icon {
    margin-right: 0.25rem;
}

/* Step 4: Special Cards */
.tutorial-special-cards {
    display: flex;
    gap: 0.75rem;
}

.tutorial-card-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.tutorial-card.gold-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border-color: #f59e0b;
    position: relative;
}

.tutorial-card.foil-card {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    border-color: #3b82f6;
    position: relative;
}

.tutorial-card.holo-card {
    background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
    border-color: #10b981;
    position: relative;
}

.tutorial-card.poly-card {
    background: linear-gradient(135deg, #fce7f3 0%, #f9a8d4 100%);
    border-color: #ec4899;
    position: relative;
}

.tutorial-card .tut-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    background: #1e293b;
    color: #fbbf24;
}

.card-type-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Step 5: Boss Demo */
.tutorial-boss-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.boss-skull {
    font-size: 3rem;
    animation: bossGlow 1.5s ease-in-out infinite alternate;
}

@keyframes bossGlow {
    from { filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8)); }
}

.boss-challenge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.challenge-icon {
    font-size: 1.25rem;
}

.challenge-text {
    font-weight: 700;
    color: #ef4444;
}

.boss-desc {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Step 6: Shop Demo */
.tutorial-shop-demo {
    display: flex;
    gap: 1rem;
}

.shop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 90px;
}

.shop-item .item-icon {
    font-size: 1.5rem;
}

.shop-item .item-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.shop-item .item-effect {
    font-size: 0.7rem;
    color: #22c55e;
}

.shop-item.booster {
    border-color: rgba(251, 191, 36, 0.3);
}

.shop-item.upgrade {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Step 7: Progression Demo */
.tutorial-progression-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.progression-cycle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cycle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cycle-item.run {
    border-color: rgba(59, 130, 246, 0.4);
    animation: cyclePulse 2s ease-in-out infinite;
}

.cycle-item.xp {
    border-color: rgba(251, 191, 36, 0.4);
    animation: cyclePulse 2s 0.3s ease-in-out infinite;
}

.cycle-item.level {
    border-color: rgba(34, 197, 94, 0.4);
    animation: cyclePulse 2s 0.6s ease-in-out infinite;
}

@keyframes cyclePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.cycle-icon {
    font-size: 1.5rem;
}

.cycle-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
}

.cycle-arrow {
    font-size: 1.25rem;
    color: #64748b;
}

.progression-bonuses {
    display: flex;
    gap: 0.5rem;
}

.bonus-item {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 20px;
    color: #4ade80;
}

/* Tutorial Navigation */
.tutorial-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tutorial-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tutorial-btn svg {
    width: 16px;
    height: 16px;
}

.tutorial-next {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.tutorial-next:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
}

.tutorial-dots {
    display: flex;
    gap: 0.5rem;
}

.tutorial-dots .dot,
.onboarding-dots .dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-dots .dot:hover,
.onboarding-dots .dot:hover {
    background: rgba(255, 255, 255, 0.4);
}

.tutorial-dots .dot.active,
.onboarding-dots .dot.active {
    background: #fbbf24;
    transform: scale(1.2);
}

.tutorial-done {
    width: 100%;
    margin-top: 1rem !important;
}

/* === ONBOARDING OVERLAY === */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: radial-gradient(ellipse at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
    touch-action: pan-x pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.onboarding-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.onboarding-content {
    text-align: center;
    padding: 2rem;
    max-width: 360px;
}

.onboarding-step {
    display: none;
    animation: onboardingSlide 0.4s ease-out;
}

.onboarding-step.active {
    display: block;
}

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

.onboarding-visual {
    margin-bottom: 1.5rem;
}

.onboarding-logo {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.onboarding-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
}

.onboarding-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

.onboarding-content p {
    color: #94a3b8;
    font-size: 1rem;
    margin: 0;
}

.onboarding-tagline {
    font-size: 1.1rem !important;
    color: #fbbf24 !important;
}

/* Onboarding Cards Demo */
.onboarding-cards-demo {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.onboarding-card {
    width: 48px;
    height: 64px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 3px solid #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.onboarding-card.pop-1 { animation: cardPop 0.6s 0.1s ease-out both; }
.onboarding-card.pop-2 { animation: cardPop 0.6s 0.2s ease-out both; }
.onboarding-card.pop-3 { animation: cardPop 0.6s 0.3s ease-out both; }
.onboarding-card.pop-4 { animation: cardPop 0.6s 0.4s ease-out both; }
.onboarding-card.pop-5 { animation: cardPop 0.6s 0.5s ease-out both; }

@keyframes cardPop {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    70% { transform: scale(1.1) translateY(-15px); }
    100% { opacity: 1; transform: scale(1) translateY(-10px); }
}

/* Onboarding Score Demo */
.onboarding-score-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.75rem;
    font-weight: 800;
}

.ob-chips {
    color: #60a5fa;
    animation: obPulse 1s ease-in-out infinite;
}

.ob-mult {
    color: #f472b6;
}

.ob-equals {
    color: #94a3b8;
}

.ob-total {
    color: #fbbf24;
    animation: obPulse 1s 0.5s ease-in-out infinite;
}

@keyframes obPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Onboarding Boss Demo */
.onboarding-boss-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ob-boss-icon {
    font-size: 4rem;
    animation: obBossGlow 1.5s ease-in-out infinite alternate;
}

@keyframes obBossGlow {
    from { filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.5)); transform: scale(1); }
    to { filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.8)); transform: scale(1.05); }
}

.ob-boss-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ef4444;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* Onboarding Navigation */
.onboarding-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.onboarding-dots {
    display: flex;
    gap: 0.75rem;
}

.onboarding-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 12px;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.onboarding-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

.onboarding-btn:active {
    transform: translateY(0);
}

.onboarding-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile adjustments for tutorial */
@media (max-width: 400px) {
    .tutorial-modal {
        padding: 1.25rem !important;
    }

    .tutorial-visual {
        padding: 1rem;
        min-height: 80px;
    }

    .tutorial-card {
        width: 32px;
        height: 44px;
        font-size: 1rem;
    }

    .tutorial-special-cards {
        gap: 0.5rem;
    }

    .tutorial-card-type .tutorial-card {
        width: 36px;
        height: 48px;
    }

    .onboarding-card {
        width: 40px;
        height: 54px;
        font-size: 1.25rem;
    }
}
