:root {
    --felt-green: #1a2a1a;
    --felt-highlight: #2a3a2a;
    --card-face: #f0e8d8;
    --card-faceup: #f5f0e5;
    --card-back: #2a2a28;
    --card-border: #a09080;
    --pot-gold: #c4a050;
    --suit-red: #8a2a20;
    --suit-black: #1a1a18;
    --table-line: #4a6a4a;
    --active-text: #2a2420;
    --muted-text: #6a7a6a;
    --card-hatch: #3a3a38;

    /* Ellipse positions: 6 points, 60deg apart, on 35vw x 25vh ellipse centered at 50%/50% */
    --p0-x: 50%;  --p0-y: 12%;   /* top-center */
    --p1-x: 82%;  --p1-y: 28%;   /* top-right */
    --p2-x: 82%;  --p2-y: 72%;   /* bottom-right */
    --p3-x: 50%;  --p3-y: 88%;   /* bottom-center */
    --p4-x: 18%;  --p4-y: 72%;   /* bottom-left */
    --p5-x: 18%;  --p5-y: 28%;   /* top-left */
}

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

body {
    background-color: var(--felt-green);
    color: var(--active-text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.8rem, 0.95vw, 0.95rem);
    line-height: 1.6;
    overflow: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
}

/* Table scroll container */
.table-scroll {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
}

/* Each hand = 100vh */
.hand {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

/* Felt texture */
.felt-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--felt-green);
    filter: url(#felt);
    opacity: 0.05;
    z-index: 0;
}

/* Table ellipse */
.table-ellipse {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    z-index: 1;
    pointer-events: none;
}

/* Position markers */
.position-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--table-line);
    z-index: 2;
    transform: translate(-50%, -50%);
}

.pos-0 { left: var(--p0-x); top: var(--p0-y); }
.pos-1 { left: var(--p1-x); top: var(--p1-y); }
.pos-2 { left: var(--p2-x); top: var(--p2-y); }
.pos-3 { left: var(--p3-x); top: var(--p3-y); }
.pos-4 { left: var(--p4-x); top: var(--p4-y); }
.pos-5 { left: var(--p5-x); top: var(--p5-y); }

.folded {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fold-x {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: var(--table-line);
    line-height: 1;
}

/* Domain label */
.domain-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 0.95vw, 0.95rem);
    color: var(--muted-text);
    position: absolute;
    left: var(--p3-x);
    top: calc(var(--p3-y) + 20px);
    transform: translateX(-50%);
    z-index: 3;
}

/* Pot */
.pot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.pot-empty svg {
    width: 120px;
    height: 100px;
}

.pot-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pot-gold);
}

.pot-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    color: var(--pot-gold);
}

.pot-final {
    width: 160px;
    height: 120px;
    border: 1px solid var(--pot-gold);
    border-radius: 50%;
}

/* Cards - base */
.card {
    position: absolute;
    left: var(--pos-x);
    top: var(--pos-y);
    transform: translate(-50%, -50%) rotate(var(--rot));
    z-index: 4;
    border-radius: 4px;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card.dealt {
    opacity: 1;
}

/* Face-up card (standard) */
.card-face {
    width: 200px;
    min-height: 140px;
    background-color: var(--card-face);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--active-text);
}

/* Large card (psychology hand) */
.card-large {
    width: 280px;
    min-height: 180px;
}

/* Face-up with suit (counter hand) */
.card-faceup {
    width: 200px;
    min-height: 140px;
    background-color: var(--card-faceup);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--active-text);
}

/* Showdown cards */
.card-showdown {
    width: 320px;
    min-height: 220px;
    background-color: var(--card-faceup);
    border: 1px solid var(--card-border);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    color: var(--active-text);
}

/* Card backs (folded) */
.card-back {
    position: absolute;
    left: var(--pos-x);
    top: var(--pos-y);
    transform: translate(-50%, -50%) rotate(var(--rot));
    width: 160px;
    height: 110px;
    background-color: var(--card-back);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 3;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            transparent 5px,
            rgba(58, 58, 56, 0.3) 5px,
            rgba(58, 58, 56, 0.3) 6px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent 0px,
            transparent 5px,
            rgba(58, 58, 56, 0.3) 5px,
            rgba(58, 58, 56, 0.3) 6px
        );
}

/* Card typography */
.card-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(0.85rem, 1vw, 1rem);
    margin-bottom: 8px;
    color: var(--active-text);
}

.card-body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    line-height: 1.5;
    color: var(--active-text);
}

/* Suit symbols */
.suit {
    font-size: 12px;
    position: absolute;
    top: 8px;
    left: 10px;
}

.suit-red { color: var(--suit-red); }
.suit-black { color: var(--suit-black); }

/* Fold labels */
.fold-label {
    position: absolute;
    left: var(--pos-x);
    top: var(--pos-y);
    transform: translate(-50%, -50%);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--table-line);
    z-index: 2;
}

/* Connector lines (hidden by default, shown with JS) */
.connector-line {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    .table-scroll {
        scroll-snap-type: none;
    }

    .hand {
        height: auto;
        min-height: 100vh;
        padding: 40px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .table-ellipse,
    .position-marker,
    .fold-label,
    .card-back,
    .felt-texture {
        display: none;
    }

    .pot {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: 20px;
    }

    .card {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 320px;
        opacity: 1;
    }

    .domain-label {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
    }
}
