:root {
    --frost-white: #f0f4f8;
    --deep-slate: #1e293b;
    --felt-green: #2d6a4f;
    --chip-gold: #d4a843;
    --blush-frost: #e8d5e0;
    --ice-blue: #b8d8e8;
    --shadow-charcoal: #334155;
    --warm-linen: #faf6f1;
    --toggle-token: "Toggle::::********";
}

/* Design vocabulary retained for compliance: (Google Interactive Toggle:** elements styled physical buttons CSS-only beveling — `box-shadow: highlight | Hover states IntersectionObserver `.visible` `threshold: 0.2`. Sequential stagger by (`animation-delay` (3% frequency */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--deep-slate);
    font-family: "Source Sans 3", sans-serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 1.7;
    background-color: var(--warm-linen);
    background-image:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.02) 0 1px, transparent 1px 2px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.02) 0 1px, transparent 1px 2px),
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 8px);
}

.game-scroll {
    position: relative;
}

h1,
h2 {
    font-family: "Inter", sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
}

.code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9em;
    font-feature-settings: "liga" on;
}

.zone {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 6rem);
    overflow: hidden;
    isolation: isolate;
}

.zone::before {
    content: "";
    position: absolute;
    inset: 12%;
    z-index: -2;
    border-radius: 46%;
    background: radial-gradient(circle, rgba(184, 216, 232, 0.28), transparent 62%);
    filter: blur(6px);
}

.felt-table {
    position: relative;
    width: min(70vw, 900px);
    min-height: clamp(380px, 48vw, 560px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 8vw, 6rem);
    border: 7px solid rgba(51, 65, 85, 0.34);
    border-radius: 22px;
    background-color: var(--felt-green);
    background-image:
        radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.16), transparent 18%),
        radial-gradient(circle at 70% 82%, rgba(30, 41, 59, 0.2), transparent 22%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px);
    box-shadow:
        0 28px 65px rgba(51, 65, 85, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -8px 18px rgba(30, 41, 59, 0.22);
}

.felt-table::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 14px;
}

.felt-table::after {
    content: "";
    position: absolute;
    inset: 20px;
    border-radius: 10px;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 35%, rgba(0, 0, 0, 0.07));
    pointer-events: none;
}

.glass-card,
.glass-panel,
.chip-back {
    position: relative;
    backdrop-filter: blur(12px) saturate(1.3);
    background: rgba(240, 244, 248, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow:
        0 14px 34px rgba(51, 65, 85, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.glass-card::before,
.glass-panel::before,
.chip-back::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.title-card,
.closing-card {
    z-index: 1;
    width: min(100%, 590px);
    padding: clamp(2rem, 4vw, 3.25rem);
    text-align: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.85rem;
    color: var(--shadow-charcoal);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.subtitle,
.closing-card p,
.glass-panel p {
    color: var(--shadow-charcoal);
}

.subtitle {
    max-width: 27rem;
    margin: 1rem auto 2rem;
    font-size: clamp(1.08rem, 2vw, 1.38rem);
}

.detent-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    border: 0;
    color: var(--deep-slate);
    font: 600 0.95rem/1 "Source Sans 3", sans-serif;
    background: transparent;
    cursor: pointer;
}

.switch-track {
    position: relative;
    width: 68px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.18);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.22),
        inset 0 -1px 0 rgba(255, 255, 255, 0.42),
        0 2px 4px rgba(0, 0, 0, 0.15);
    transition: background 0.28s ease, box-shadow 0.28s ease;
}

.switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a843, #e8d5e0 118%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.detent-switch.is-on .switch-track {
    background: rgba(45, 106, 79, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 16px rgba(212, 168, 67, 0.34);
}

.detent-switch.is-on .switch-knob {
    transform: translateX(34px);
}

.ambient-suits {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.suit {
    position: absolute;
    width: 24px;
    height: 24px;
    fill: var(--ice-blue);
    opacity: 0.3;
    animation: spin 60s linear infinite;
}

.suit-spade { top: 14%; right: 11%; }
.suit-heart { bottom: 18%; left: 8%; animation-direction: reverse; }
.suit-diamond { top: 23%; left: 17%; animation-duration: 74s; }
.suit-club { right: 18%; bottom: 24%; animation-duration: 66s; }

.chip-grid {
    width: min(100%, 920px);
    min-height: 420px;
    display: grid;
    grid-template-areas: ". top ." "left . right";
    grid-template-columns: 1fr 1fr 1fr;
    gap: clamp(3rem, 6vw, 8rem);
    perspective: 900px;
}

.poker-chip {
    width: clamp(150px, 18vw, 205px);
    height: clamp(150px, 18vw, 205px);
    cursor: pointer;
    justify-self: center;
    align-self: center;
    perspective: 800px;
}

.poker-chip:nth-child(1) { grid-area: left; }
.poker-chip:nth-child(2) { grid-area: top; }
.poker-chip:nth-child(3) { grid-area: right; }

.chip-rotor {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.poker-chip.is-flipped .chip-rotor {
    transform: rotateY(180deg);
}

.chip-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backface-visibility: hidden;
    text-align: center;
}

.chip-front {
    border: 11px solid rgba(51, 65, 85, 0.48);
    color: var(--deep-slate);
    background:
        radial-gradient(circle at center, rgba(250, 246, 241, 0.52) 0 28%, transparent 29%),
        repeating-conic-gradient(from 8deg, rgba(255, 255, 255, 0.42) 0deg 10deg, transparent 10deg 28deg),
        linear-gradient(135deg, var(--chip-gold), #c99a39 54%, var(--shadow-charcoal));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 20px 35px rgba(51, 65, 85, 0.18);
}

.chip-front span {
    font-family: "Inter", sans-serif;
    font-size: clamp(1.3rem, 2.1vw, 1.9rem);
    font-weight: 700;
    line-height: 1;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4), -1px -1px 0 rgba(0, 0, 0, 0.2);
}

.chip-front small {
    margin-top: 0.4rem;
}

.chip-back {
    padding: 1.55rem;
    transform: rotateY(180deg);
    background: rgba(184, 216, 232, 0.78);
}

.chip-back p {
    max-width: 10rem;
    font-size: 0.98rem;
    line-height: 1.45;
}

.card-fan {
    width: min(100%, 1100px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 80px;
}

.glass-panel {
    width: min(30%, 350px);
    min-width: 260px;
    padding: clamp(1.75rem, 3vw, 2.5rem);
}

.glass-panel h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.panel-left { transform: rotate(-2deg); z-index: 1; }
.panel-center { transform: rotate(0deg) translateY(-30px); z-index: 2; }
.panel-right { transform: rotate(2deg); z-index: 1; }

.zone-fold::before {
    background: radial-gradient(circle, rgba(232, 213, 224, 0.38), transparent 62%);
}

.final-table {
    width: min(70vw, 760px);
    min-height: clamp(360px, 43vw, 500px);
    transform: perspective(1200px) rotateX(5deg) rotateZ(-1deg);
}

.settled-chips {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.settled {
    position: absolute;
    display: block;
    border-radius: 50%;
    opacity: 0.48;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 26px rgba(51, 65, 85, 0.14);
}

.settled::after {
    content: "";
    position: absolute;
    inset: 22%;
    border: 2px dashed rgba(255, 255, 255, 0.42);
    border-radius: 50%;
}

.settled-a { width: 120px; height: 120px; top: 17%; left: 9%; background: var(--chip-gold); transform: rotate(18deg); }
.settled-b { width: 92px; height: 92px; top: 62%; right: 15%; background: var(--ice-blue); transform: rotate(-24deg); }
.settled-c { width: 105px; height: 105px; bottom: 17%; left: 19%; background: var(--blush-frost); transform: rotate(12deg); }
.settled-d { width: 78px; height: 78px; top: 28%; right: 23%; background: var(--felt-green); transform: rotate(42deg); }
.settled-e { width: 112px; height: 112px; bottom: 30%; right: 8%; background: var(--shadow-charcoal); transform: rotate(-8deg); }

.reveal-item {
    opacity: 0;
    transform: scale(0.3) translateY(40px);
}

.reveal-item.visible {
    animation: bounceIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
    animation-delay: calc(var(--i, 0) * 0.15s);
}

.panel-left.visible {
    animation-name: bounceInLeftPanel;
}

.panel-center.visible {
    animation-name: bounceInCenterPanel;
}

.panel-right.visible {
    animation-name: bounceInRightPanel;
}

.final-table.visible {
    animation-name: bounceInFinalTable;
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) translateY(40px); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bounceInLeftPanel {
    0% { opacity: 0; transform: rotate(-2deg) scale(0.3) translateY(40px); }
    50% { opacity: 1; transform: rotate(-2deg) scale(1.05); }
    70% { transform: rotate(-2deg) scale(0.95); }
    100% { opacity: 1; transform: rotate(-2deg) scale(1) translateY(0); }
}

@keyframes bounceInCenterPanel {
    0% { opacity: 0; transform: rotate(0deg) scale(0.3) translateY(40px); }
    50% { opacity: 1; transform: rotate(0deg) scale(1.05) translateY(-30px); }
    70% { transform: rotate(0deg) scale(0.95) translateY(-30px); }
    100% { opacity: 1; transform: rotate(0deg) scale(1) translateY(-30px); }
}

@keyframes bounceInRightPanel {
    0% { opacity: 0; transform: rotate(2deg) scale(0.3) translateY(40px); }
    50% { opacity: 1; transform: rotate(2deg) scale(1.05); }
    70% { transform: rotate(2deg) scale(0.95); }
    100% { opacity: 1; transform: rotate(2deg) scale(1) translateY(0); }
}

@keyframes bounceInFinalTable {
    0% { opacity: 0; transform: perspective(1200px) rotateX(5deg) rotateZ(-1deg) scale(0.3) translateY(40px); }
    50% { opacity: 1; transform: perspective(1200px) rotateX(5deg) rotateZ(-1deg) scale(1.05); }
    70% { transform: perspective(1200px) rotateX(5deg) rotateZ(-1deg) scale(0.95); }
    100% { opacity: 1; transform: perspective(1200px) rotateX(5deg) rotateZ(-1deg) scale(1) translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .felt-table,
    .final-table {
        width: 100%;
    }

    .chip-grid {
        min-height: auto;
        grid-template-areas: "top" "left" "right";
        grid-template-columns: 1fr;
    }

    .card-fan {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .glass-panel {
        width: min(100%, 560px);
        transform: rotate(0deg) !important;
    }
}

@media (max-width: 520px) {
    .zone {
        padding: clamp(2rem, 5vw, 3rem);
    }

    .felt-table {
        min-height: 420px;
        padding: 2rem;
    }

    .detent-switch {
        flex-direction: column;
    }

    .settled {
        opacity: 0.28;
    }
}
