/* ── Variables ── */
:root {
    --sky-deep: #0a0e27;
    --sky-mid: #1a1040;
    --gold: #ffd700;
    --gold-warm: #ffb347;
    --gold-soft: #fff8e1;
    --text-primary: #f0e6d3;
    --text-secondary: #b8a99a;
    --focus-ring: #ffd700;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    /* A flung card sails 110vw to the right. Without this it stretches
       the viewport's scroll area to ~2.5x, and changing scroll bounds
       makes the browser re-raster the fixed starfield: every swipe blinks
       the stars out. clip (unlike hidden) creates no scroll area at all.
       Old browsers ignore it and fall back to body's overflow-x: hidden. */
    overflow-x: clip;
}

body {
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    background: var(--sky-deep);
    background: radial-gradient(ellipse at 50% 20%, var(--sky-mid) 0%, #0f0c29 50%, var(--sky-deep) 100%);
    color: var(--text-primary);
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    line-height: 1.6;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── Starfield ── */
.stars-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    will-change: opacity;
    animation: twinkle var(--dur, 4s) ease-in-out var(--del, 0s) infinite;
}

.star--glow {
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5), 0 0 8px rgba(255, 255, 255, 0.2);
}

@keyframes twinkle {
    0%, 100% { opacity: var(--lo, 0.2); }
    50% { opacity: var(--hi, 0.8); }
}

/* ── Shooting Stars ── */
.shooting-star {
    position: fixed;
    top: 10%;
    left: 0;
    width: 100px;
    height: 1.5px;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.08) 20%, rgba(255, 255, 255, 0.5) 70%, #fff 100%);
    border-radius: 1px;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transform: rotate(-35deg) translateX(-200px);
    animation: shoot 7s ease-in 5s infinite;
}

.shooting-star::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.7), 0 0 12px 4px rgba(255, 215, 0, 0.3);
}

.shooting-star:last-of-type {
    top: 25%;
    width: 70px;
    animation-delay: 14s;
    animation-duration: 9s;
}

@keyframes shoot {
    0% { transform: rotate(-35deg) translateX(-200px); opacity: 0; }
    4% { opacity: 1; }
    12% { opacity: 0.6; }
    18% { transform: rotate(-35deg) translateX(calc(100vw + 200px)); opacity: 0; }
    100% { transform: rotate(-35deg) translateX(calc(100vw + 200px)); opacity: 0; }
}

/* ── Ambient Glow ── */
.ambient-glow {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(700px, 90vw);
    height: 500px;
    background: radial-gradient(ellipse, rgba(155, 126, 189, 0.07) 0%, rgba(100, 80, 160, 0.03) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout ── */
main {
    max-width: 800px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ── Title ── */
h1 {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: clamp(2.25rem, 8vw, 3.75rem);
    font-weight: 700;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.2), 0 0 80px rgba(255, 215, 0, 0.08);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.9s ease-out 0.3s forwards;
}

/* ── Letter Hover Effects ── */
.letter {
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
    cursor: default;
}

/* M - Bright Purple */
.letter:nth-child(1):hover,
.letter:nth-child(1).is-lit {
    transform: translateY(-10px) scale(1.15);
    color: #c77dff;
    text-shadow: 0 0 10px rgba(199, 125, 255, 1), 0 0 25px rgba(199, 125, 255, 0.7), 0 0 50px rgba(199, 125, 255, 0.35);
}

/* a - Hot Pink */
.letter:nth-child(2):hover,
.letter:nth-child(2).is-lit {
    transform: rotate(15deg) scale(1.15);
    color: #ff69db;
    text-shadow: 0 0 10px rgba(255, 105, 219, 1), 0 0 25px rgba(255, 105, 219, 0.7), 0 0 50px rgba(255, 105, 219, 0.35);
}

/* g - Electric Blue */
.letter:nth-child(3):hover,
.letter:nth-child(3).is-lit {
    color: #69b3ff;
    text-shadow: 0 0 10px rgba(105, 179, 255, 1), 0 0 25px rgba(105, 179, 255, 0.7), 0 0 50px rgba(105, 179, 255, 0.35);
    animation: letterBounce 0.5s ease;
}

@keyframes letterBounce {
    0%, 100% { transform: translateY(-12px) scale(1.2); }
    50% { transform: translateY(-18px) scale(1.25); }
}

/* i - Bright Gold Sparkle */
.letter:nth-child(4):hover,
.letter:nth-child(4).is-lit {
    transform: translateY(-8px) scale(1.15);
    color: #ffe066;
    text-shadow: 0 0 12px rgba(255, 224, 102, 1), 0 0 30px rgba(255, 215, 0, 0.9), 0 0 60px rgba(255, 215, 0, 0.4);
}

/* c - Bright Teal */
.letter:nth-child(5):hover,
.letter:nth-child(5).is-lit {
    color: #4aeaaa;
    text-shadow: 0 0 10px rgba(74, 234, 170, 1), 0 0 25px rgba(74, 234, 170, 0.7), 0 0 50px rgba(74, 234, 170, 0.35);
    animation: letterWiggle 0.4s ease;
}

@keyframes letterWiggle {
    0%, 100% { transform: rotate(0deg) scale(1.15); }
    25% { transform: rotate(-10deg) scale(1.15); }
    75% { transform: rotate(10deg) scale(1.15); }
}

/* a - Coral */
.letter:nth-child(6):hover,
.letter:nth-child(6).is-lit {
    color: #ff6b7a;
    text-shadow: 0 0 10px rgba(255, 107, 122, 1), 0 0 25px rgba(255, 107, 122, 0.7), 0 0 50px rgba(255, 107, 122, 0.35);
    animation: letterPulse 0.5s ease;
}

@keyframes letterPulse {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.3); }
}

/* l - Lavender */
.letter:nth-child(7):hover,
.letter:nth-child(7).is-lit {
    transform: rotate(-15deg) scale(1.15);
    color: #c9a8f0;
    text-shadow: 0 0 10px rgba(201, 168, 240, 1), 0 0 25px rgba(201, 168, 240, 0.7), 0 0 50px rgba(201, 168, 240, 0.35);
}

/* D - Royal Blue */
.letter:nth-child(8):hover,
.letter:nth-child(8).is-lit {
    transform: translateY(-10px) scale(1.2);
    color: #6b8fff;
    text-shadow: 0 0 10px rgba(107, 143, 255, 1), 0 0 25px rgba(107, 143, 255, 0.7), 0 0 50px rgba(107, 143, 255, 0.35);
}

/* a - Rose */
.letter:nth-child(9):hover,
.letter:nth-child(9).is-lit {
    color: #ff4d8d;
    text-shadow: 0 0 10px rgba(255, 77, 141, 1), 0 0 25px rgba(255, 77, 141, 0.7), 0 0 50px rgba(255, 77, 141, 0.35);
    animation: letterShimmer 0.6s ease;
}

@keyframes letterShimmer {
    0% { transform: scale(1.15); filter: hue-rotate(0deg); }
    50% { transform: scale(1.25); filter: hue-rotate(25deg); }
    100% { transform: scale(1.15); filter: hue-rotate(0deg); }
}

/* d - Mint */
.letter:nth-child(10):hover,
.letter:nth-child(10).is-lit {
    transform: translateY(-9px) scale(1.18);
    color: #6ff0b7;
    text-shadow: 0 0 10px rgba(111, 240, 183, 1), 0 0 25px rgba(111, 240, 183, 0.7), 0 0 50px rgba(111, 240, 183, 0.35);
}

/* B - Vivid Purple */
.letter:nth-child(11):hover,
.letter:nth-child(11).is-lit {
    transform: translateY(-14px) scale(1.25);
    color: #a066e0;
    text-shadow: 0 0 12px rgba(160, 102, 224, 1), 0 0 30px rgba(160, 102, 224, 0.8), 0 0 60px rgba(160, 102, 224, 0.4);
}

/* l - Light Lavender */
.letter:nth-child(12):hover,
.letter:nth-child(12).is-lit {
    transform: rotate(20deg) scale(1.15);
    color: #d4c4f0;
    text-shadow: 0 0 10px rgba(212, 196, 240, 1), 0 0 25px rgba(212, 196, 240, 0.7), 0 0 50px rgba(212, 196, 240, 0.35);
}

/* o - Sky Blue */
.letter:nth-child(13):hover,
.letter:nth-child(13).is-lit {
    color: #7dd8f0;
    text-shadow: 0 0 12px rgba(125, 216, 240, 1), 0 0 30px rgba(125, 216, 240, 0.8), 0 0 55px rgba(125, 216, 240, 0.4);
    animation: letterBubble 0.5s ease;
}

@keyframes letterBubble {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.28) translateY(-6px); }
}

/* g - Magenta */
.letter:nth-child(14):hover,
.letter:nth-child(14).is-lit {
    transform: scale(1.2);
    color: #e066d6;
    text-shadow: 0 0 12px rgba(224, 102, 214, 1), 0 0 30px rgba(224, 102, 214, 0.8), 0 0 55px rgba(224, 102, 214, 0.4);
}

/* ── Title Underline ── */
h1::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5) 15%, var(--gold) 50%, rgba(255, 215, 0, 0.5) 85%, transparent);
    border-radius: 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, white 12%, white 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, white 12%, white 88%, transparent 100%);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.15);
    animation: underlineDraw 1s ease-out 1.3s forwards, underlineGlow 3s ease-in-out 2.5s infinite;
}

@keyframes underlineDraw {
    to { width: 80%; }
}

@keyframes underlineGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.15);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.6), 0 0 28px rgba(255, 215, 0, 0.25);
    }
}

/* ── Entrance Animation ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Tagline ── */
.tagline {
    font-size: clamp(1.05rem, 3.5vw, 1.35rem);
    color: var(--text-secondary);
    margin-bottom: 0;
    padding: 0 1rem;
    font-weight: 400;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* ── Separator ── */
.separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.75rem 0 2.25rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.separator::before,
.separator::after {
    content: '';
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.25), transparent);
}

.separator span {
    color: var(--gold);
    font-size: 0.7rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    animation: starPulse 2.5s ease-in-out infinite;
    line-height: 1;
}

@keyframes starPulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ── Social Buttons ── */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: center;
}

@media (min-width: 640px) {
    .social-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
}

/* ── Social Link ── */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    color: #ffffff;
    text-decoration: none;
    padding: 0.9rem 1.75rem;
    border-radius: 14px;
    font-family: 'Nunito', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    min-width: 190px;
    min-height: 48px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.7s ease-out forwards;
}

.social-link:nth-child(1) { animation-delay: 1s; }
.social-link:nth-child(2) { animation-delay: 1.15s; }
.social-link:nth-child(3) { animation-delay: 1.3s; }

/* Shimmer sweep */
.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    transition: left 0.6s ease;
}

.social-link:hover::before {
    left: 100%;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.social-link:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.social-link:active {
    transform: translateY(-1px);
}

/* ── Platform Variants ── */
.social-link--facebook:hover {
    border-color: rgba(8, 102, 255, 0.45);
    box-shadow: 0 8px 30px rgba(8, 102, 255, 0.2), 0 0 0 1px rgba(8, 102, 255, 0.08);
}

.social-link--threads:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.social-link--instagram:hover {
    border-color: rgba(225, 48, 108, 0.45);
    box-shadow: 0 8px 30px rgba(225, 48, 108, 0.2), 0 0 0 1px rgba(225, 48, 108, 0.08);
}

/* ── Social Icons ── */
.social-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

.social-link span {
    min-width: 80px;
    text-align: left;
}

@media (min-width: 640px) {
    .social-link span {
        min-width: 0;
        text-align: center;
    }
}

/* ── Firework Particles ── */
.sparkle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
}

.sparkle--out {
    animation: fireworkOut var(--dur, 0.7s) ease-out var(--del, 0s) forwards;
}

.sparkle--droop {
    animation: fireworkDroop var(--dur, 1s) ease-out var(--del, 0s) forwards;
}

.sparkle--twinkle {
    animation: fireworkTwinkle var(--dur, 0.6s) ease-out var(--del, 0s) forwards;
}

@keyframes fireworkOut {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    40% { opacity: 1; }
    100% { transform: translate(var(--tx, 10px), var(--ty, -10px)) scale(0); opacity: 0; }
}

@keyframes fireworkDroop {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    35% { transform: translate(calc(var(--tx, 10px) * 0.5), calc(var(--ty, -10px) * 0.5)) scale(0.85); opacity: 1; }
    100% { transform: translate(calc(var(--tx, 10px) * 0.75), calc(var(--ty, -10px) + var(--grav, 50px))) scale(0.15); opacity: 0; }
}

@keyframes fireworkTwinkle {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    25% { opacity: 0.25; }
    50% { transform: translate(calc(var(--tx, 10px) * 0.5), calc(var(--ty, -10px) * 0.5)) scale(0.7); opacity: 1; }
    75% { opacity: 0.15; }
    100% { transform: translate(var(--tx, 10px), var(--ty, -10px)) scale(0); opacity: 0; }
}

/* ── Shape Formation (fly out → hold → disperse) ── */
.sparkle--shape {
    animation: fireworkShape var(--dur, 1.4s) ease-out var(--del, 0s) forwards;
}

@keyframes fireworkShape {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0.9; }
    30% { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(1); opacity: 1; }
    100% { transform: translate(calc(var(--tx, 0px) * 1.8), calc(var(--ty, 0px) * 1.8)) scale(0); opacity: 0; }
}

/* ── Grand Finale Flash ── */
.firework-flash {
    position: fixed;
    pointer-events: none;
    z-index: 99;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.15) 40%, transparent 70%);
    animation: flashFade 0.6s ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes flashFade {
    0% { opacity: 1; width: 20px; height: 20px; }
    100% { opacity: 0; width: 240px; height: 240px; }
}

/* ── Views ── */
.view {
    display: none;
    max-width: 800px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}

.view.is-active {
    display: block;
    animation: fadeIn 0.35s ease-out;
}

main.view {
    display: none;
}

main.view.is-active {
    display: block;
}

/* ── Play CTA (landing) ── */
.play-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin: 1.5rem auto 0;
    padding: 1.15rem 2rem;
    max-width: 400px;
    width: 100%;
    text-decoration: none;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.09), rgba(255, 179, 71, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.28);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 0 24px rgba(255, 215, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.7s ease-out 1.45s forwards;
}

.play-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.08), transparent);
    transition: left 0.6s ease;
}

.play-cta:hover::before {
    left: 100%;
}

.play-cta:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.15), 0 0 0 1px rgba(255, 215, 0, 0.1);
}

.play-cta:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.play-cta:active {
    transform: translateY(-1px);
}

.play-cta__title {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
}

.play-cta__sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ── Utility ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.view--play {
    max-width: 520px;
    padding: 0.5rem 0 1rem;
}

/* ── Game Header Bar ── */
.game-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-family: 'Nunito', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.back-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 215, 0, 0.35);
    transform: translateY(-2px);
}

.back-btn:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.game-count {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.count-num {
    display: inline-block;
    font-size: 1.05rem;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.count-num.pop {
    animation: countPop 0.35s ease;
}

@keyframes countPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ── The Deck ── */
.deck-area {
    position: relative;
    perspective: 1200px;
    /* Horizontal moves belong to the swipe handler; keep vertical native */
    touch-action: pan-y;
    /* Mouse drags must move the card, never select its text */
    -webkit-user-select: none;
    user-select: none;
    margin: 0 auto;
    text-align: center;
}

.deck-edge {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.035);
    pointer-events: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.deck-edge--a { transform: rotate(2deg) translateY(8px); }
.deck-edge--b { transform: rotate(-1.6deg) translateY(4px); }

/* While a card is being pulled away, the deck rises to meet the deal */
.deck-area.is-dragging .deck-edge--a {
    transform: rotate(1.2deg) translateY(5px);
    border-color: rgba(255, 255, 255, 0.18);
}

.deck-area.is-dragging .deck-edge--b {
    transform: rotate(-1deg) translateY(2px);
    border-color: rgba(255, 255, 255, 0.18);
}

/* ── Card Chassis ── */
.game-card {
    --ac: 255, 215, 0;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

/* Entrance animations are opt-in: only freshly dealt cards get one.
   A promoted peek card has none to restart, so it stays put. */
.game-card.deal-in {
    animation: dealIn 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.card--pick { --ac: 255, 107, 122; }
.card--talk { --ac: 201, 168, 240; }
.card--joke { --ac: 74, 234, 170; }
.card--emoji { --ac: 105, 179, 255; }

.game-card.deal-out {
    animation: dealOut 0.18s ease-in forwards;
}

@keyframes dealIn {
    from { opacity: 0; transform: translateY(32px) rotate(2deg) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@keyframes dealOut {
    to { opacity: 0; transform: translateY(-22px) rotate(-1deg) scale(0.98); }
}

.game-card.deal-back {
    animation: dealInBack 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-card.deal-out-back {
    animation: dealOutBack 0.18s ease-in forwards;
}

/* A flung card leaves the layout so its replacement deals in under it */
.game-card.is-flung {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    pointer-events: none;
}

/* The destination card peeks through with its real content mid-drag */
.game-card.is-under {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 0;
    pointer-events: none;
    animation: none;
}

@keyframes dealInBack {
    from { opacity: 0; transform: translateY(-28px) rotate(-1.5deg) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@keyframes dealOutBack {
    to { opacity: 0; transform: translateY(26px) rotate(1deg) scale(0.98); }
}

.flip-wrap {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.15, 0.2, 1);
}

.game-card.is-flipped .flip-wrap {
    transform: rotateY(180deg);
}

.card-face {
    position: relative;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.6rem 1.4rem 1.8rem;
    border-radius: 20px;
    border: 1px solid rgba(var(--ac), 0.26);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 0 34px rgba(var(--ac), 0.06);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}

.card-face--back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
}

/* ── Type Chip ── */
.card-chip {
    position: relative;
    overflow: hidden;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgb(var(--ac));
    padding: 0.36rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--ac), 0.35);
    background: rgba(var(--ac), 0.08);
}

.card-chip::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: translateX(-160%) skewX(-18deg);
    animation: chipGlint 0.9s ease-out 0.35s forwards;
}

@keyframes chipGlint {
    to { transform: translateX(300%) skewX(-18deg); }
}

/* ── Card Text ── */
.card-lead {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.card-text {
    font-size: clamp(1.2rem, 4.6vw, 1.5rem);
    font-weight: 700;
    line-height: 1.45;
    color: #f8f2e6;
}

/* Intro card footnote: the trust line, quieter than the lead */
.intro-meta {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    opacity: 0.75;
}

/* ── Intro card: a ticket, not a deck card ──
   Wears the landing CTA's gold glass so the gold thing you tapped and
   the gold card that greets you read as one object. The dashed inset
   ring is the admission-ticket wink behind "Deal me in". */
.card--intro .card-face {
    border-color: rgba(255, 215, 0, 0.45);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 179, 71, 0.05));
}

.card--intro .card-face::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 215, 0, 0.35);
    pointer-events: none;
}

.card-face--back .card-text {
    font-size: clamp(1.35rem, 5.2vw, 1.7rem);
}

/* ── Choice Option (WYR + Lightning) ── */
.card-opt {
    width: 100%;
    min-height: 58px;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #f8f2e6;
    font-family: 'Nunito', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 3.9vw, 1.15rem);
    line-height: 1.35;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, opacity 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.card-opt:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.card-opt:active {
    transform: scale(0.985);
}

.card-opt.is-picked {
    transform: scale(1.02);
    border-color: rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(255, 179, 71, 0.08));
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.16);
    color: var(--gold-soft);
}

.card-face.has-pick .card-opt:not(.is-picked) {
    opacity: 0.45;
    transform: scale(0.97);
}

/* ── OR Star (WYR) ── */
.or-star {
    position: relative;
    width: 46px;
    height: 46px;
    margin: 0.05rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.07);
    color: var(--gold);
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.or-star::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: radial-gradient(circle 2.5px at 50% 2px, var(--gold) 40%, transparent 70%);
    animation: orbit 6s linear infinite;
}

@keyframes orbit {
    to { transform: rotate(360deg); }
}

/* ── VS Badge (This or That) ──
   The house asset from the meme system: round badge, blue and red
   split, lightning bolt. Fixed colors on purpose — like the gold,
   it is the same badge everywhere the brand uses it. */
.vs-divider {
    position: relative;
    width: 42px;
    height: 42px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* Hard split, not a blend: the house style is cel-shaded edges */
    background: linear-gradient(105deg, #3b7dd8 50%, #e04848 50%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.vs-divider::after {
    content: '\26A1';
    position: absolute;
    top: -7px;
    right: -6px;
    font-size: 0.7rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

/* ── Table Talk ── */
.talk-seal {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: var(--gold);
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.card--talk .card-face::after {
    content: '';
    position: absolute;
    top: -60%;
    left: 0;
    width: 55%;
    height: 220%;
    background: linear-gradient(100deg, transparent, rgba(201, 168, 240, 0.08) 44%, rgba(255, 255, 255, 0.12) 50%, rgba(201, 168, 240, 0.08) 56%, transparent);
    transform: translateX(-240%) rotate(8deg);
    animation: foilSweep 9s ease-in-out infinite;
    pointer-events: none;
}

@keyframes foilSweep {
    0%, 72% { transform: translateX(-240%) rotate(8deg); }
    92%, 100% { transform: translateX(440%) rotate(8deg); }
}

/* ── Emoji Guess ── */
.emoji-clue {
    font-size: clamp(2.2rem, 10vw, 3.1rem);
    line-height: 1.3;
    letter-spacing: 0.14em;
    /* Emoji paint their own colors, so the accent has to glow from behind */
    filter: drop-shadow(0 0 16px rgba(var(--ac), 0.4));
}

/* ── Dad Joke Reveal ── */
.reveal-btn {
    margin-top: 0.35rem;
    padding: 0.85rem 1.7rem;
    min-height: 50px;
    border-radius: 14px;
    border: 1px solid rgba(var(--ac), 0.45);
    background: rgba(var(--ac), 0.09);
    color: rgb(var(--ac));
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.reveal-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--ac), 0.7);
    box-shadow: 0 6px 22px rgba(var(--ac), 0.16);
}

.reveal-btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.reveal-btn:active {
    transform: scale(0.97);
}

/* ── Control Row ── */
.ctrl-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    border-radius: 14px;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.ctrl-btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.ctrl-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.ctrl-btn--prev {
    padding: 0.8rem 1.15rem;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
}

.ctrl-btn--prev:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: rgba(255, 215, 0, 0.35);
    transform: translateY(-2px);
}

.ctrl-btn--prev:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Quiet by default: when the card has answers, the answers lead */
.ctrl-btn--next {
    flex: 1;
    max-width: 230px;
    padding: 0.85rem 1.8rem;
    font-size: 1.05rem;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
}

.ctrl-btn--next:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: rgba(255, 215, 0, 0.35);
}

/* Nothing to tap on the card, so moving on is the action */
.ctrl-btn--next.is-lead {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 179, 71, 0.07));
    color: var(--gold);
    animation: nextPulse 2.4s ease-in-out infinite;
}

.ctrl-btn--next.is-lead:hover {
    color: var(--gold);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 8px 28px rgba(255, 215, 0, 0.15);
}

@keyframes nextPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
    50% { box-shadow: 0 6px 22px rgba(255, 215, 0, 0.14); }
}

/* ── Footer Brand ──
   The brand chrome, translated to UI: a thin gold line that breaks
   at center for the wordmark. Same construction as the landing
   separator, same signature as the photo posts. */
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 2.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-brand__text {
    white-space: nowrap;
}

.footer-brand::before,
.footer-brand::after {
    content: '';
    flex: 0 1 52px;
    height: 1px;
}

/* One line breaking for the wordmark: solid at the break, fading outward */
.footer-brand::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.45));
}

.footer-brand::after {
    background: linear-gradient(270deg, transparent, rgba(255, 215, 0, 0.45));
}

.footer-brand a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 700;
}

.footer-brand a:hover {
    text-decoration: underline;
}

.footer-brand a:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    body {
        overflow: auto;
    }

    h1 {
        animation: fadeIn 0.5s ease-out forwards;
    }

    h1::after {
        animation: underlineDrawSimple 0.6s ease-out 0.5s forwards;
    }

    .tagline,
    .separator {
        animation: fadeIn 0.5s ease-out 0.3s forwards;
    }

    .social-link {
        animation: fadeIn 0.5s ease-out 0.4s forwards;
    }

    .social-link:nth-child(1),
    .social-link:nth-child(2),
    .social-link:nth-child(3) {
        animation-delay: 0.4s;
    }

    .shooting-star {
        display: none;
    }

    .star {
        animation: none !important;
    }

    .separator span {
        animation: none;
        opacity: 0.7;
    }

    .letter:hover,
    .letter.is-lit {
        transform: none !important;
        animation: none !important;
    }

    .letter:nth-child(n):hover,
    .letter:nth-child(n).is-lit {
        transform: none;
        animation: none;
    }

    .social-link {
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .social-link:hover,
    .social-link:active {
        transform: none;
    }

    .social-link::before {
        display: none;
    }

    .sparkle,
    .firework-flash {
        display: none;
    }

    .play-cta {
        animation: fadeIn 0.5s ease-out 0.5s forwards;
    }

    .play-cta::before {
        display: none;
    }

    .view.is-active {
        animation: none;
    }

    .game-card,
    .card-chip::after,
    .or-star::before,
    .count-num.pop,
    .ctrl-btn--next {
        animation: none !important;
    }

    .card--talk .card-face::after {
        display: none;
    }

    .flip-wrap {
        transition: none;
    }

    .card-opt.is-picked,
    .card-face.has-pick .card-opt:not(.is-picked) {
        transform: none;
    }

    .play-cta:hover,
    .play-cta:active,
    .card-opt:hover,
    .card-opt:active,
    .reveal-btn:hover,
    .reveal-btn:active,
    .ctrl-btn:hover,
    .ctrl-btn:active,
    .back-btn:hover {
        transform: none;
    }
}

/* ── Settled home ──
   The entrance choreography is a first-load performance. Once the game
   has been opened, home must never depend on those animations re-running
   (iOS Safari won't re-run them after a display toggle). */
body.is-settled h1,
body.is-settled .tagline,
body.is-settled .separator,
body.is-settled .social-link,
body.is-settled .play-cta {
    opacity: 1;
    animation: none;
}

body.is-settled h1::after {
    width: 80%;
    animation: underlineGlow 3s ease-in-out infinite;
}

/* Last in source on purpose: same specificity as the settled glow rule
   above, so order is what keeps reduced motion glow-free */
@media (prefers-reduced-motion: reduce) {
    body.is-settled h1::after {
        animation: none;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes underlineDrawSimple {
    to { width: 80%; }
}
