/* The felt. Deep green surface, gold rail, cream markings.
   Nothing from the chrome system belongs in here except gold.

   The printed layout is one SVG drawn on a 1092 x 645 grid (index.php).
   Everything laid over it, click targets, dice, chips and the puck, is
   positioned in percent of that grid and sized in cqw, so the whole table
   scales as one piece. */

.felt {
    position: relative;
    background: var(--felt);
    border: 10px solid var(--felt-shadow);
    outline: 2px solid var(--gold);
    border-radius: 22px;
    padding: 14px 16px 16px;
    display: flex;
    align-items: stretch;
    gap: 14px;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45);
    color: var(--cream);
}

.felt-layout {
    position: relative;
    flex: 1;
    min-width: 0;
    aspect-ratio: 1092 / 645;
    container-type: inline-size;
}

.felt-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ---------- printed art ---------- */

.felt-art .ln {
    fill: none;
    stroke: rgba(245, 240, 232, 0.78);
    stroke-width: 2;
}

.felt-art .propbox { fill: rgba(5, 23, 12, 0.28); stroke-width: 2.5; }
.felt-art .passband { fill: rgba(5, 23, 12, 0.22); stroke-width: 2.5; }
.felt-art .ring { fill: none; stroke: var(--gold); stroke-width: 2; }
.felt-art .ring.bright { fill: rgba(5, 23, 12, 0.3); stroke: var(--gold-bright); stroke-width: 2.5; }
.felt-art .puck-rest { fill: none; stroke: rgba(201, 168, 76, 0.5); stroke-width: 1.5; stroke-dasharray: 4 3; }

.felt-art text {
    font-family: var(--body);
    fill: var(--cream);
    text-anchor: middle;
}

.felt-art .t-start { text-anchor: start; }
.felt-art .t-gold { fill: var(--gold); }
.felt-art .t-tiny { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; }
.felt-art .t-grp { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: 1px; fill: var(--gold-bright); }
.felt-art .t-pay { font-family: var(--mono); font-size: 13px; font-weight: 500; fill: var(--cream-dim); }
.felt-art .t-prop { font-size: 15px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.felt-art .t-num { font-family: var(--display); font-size: 64px; font-weight: 700; fill: var(--gold-bright); }
.felt-art .t-num.t-word { font-size: 33px; letter-spacing: 1px; }
.felt-art .t-dont { font-family: var(--display); font-size: 16px; font-weight: 500; font-style: italic; fill: var(--cream-dim); }
.felt-art .t-dont.t-dontbig { font-size: 26px; }
.felt-art .t-come { font-family: var(--display); font-size: 104px; font-weight: 700; letter-spacing: 6px; fill: var(--gold-bright); }
.felt-art .t-fieldn { font-family: var(--display); font-size: 28px; font-weight: 700; }
.felt-art .t-field { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: 4px; fill: var(--gold); }
.felt-art .t-big { font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.felt-art .t-bign { font-family: var(--display); font-size: 30px; font-weight: 700; fill: var(--gold-bright); }
.felt-art .t-pass { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 5px; }
.felt-art .t-circ { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; }
.felt-art .t-circbig { font-family: var(--display); font-size: 26px; font-weight: 700; }

/* Dice faces printed in the prop box and on the bars. */
.fdie rect { stroke: rgba(245, 240, 232, 0.35); stroke-width: 1; }
.fdie.hard rect { fill: var(--cream); }
.fdie.hard circle { fill: var(--ink); }
.fdie.one rect { fill: var(--loss); }
.fdie.one circle { fill: var(--cream); }
.fdie.bar rect { fill: var(--ink); }
.fdie.bar circle { fill: var(--cream-dim); }

/* ---------- fire tracker ---------- */

.medallion circle {
    fill: rgba(5, 23, 12, 0.6);
    stroke: var(--gold);
    stroke-width: 2;
    transition: fill 0.5s ease;
}

.felt-art .medallion .t-med {
    font-family: var(--display);
    font-size: 11px;
    font-weight: 700;
    fill: var(--cream-dim);
    transition: fill 0.5s ease;
}

.medallion.lit circle { fill: var(--gold-bright); }
.felt-art .medallion.lit .t-med { fill: var(--ink); }

.fire-closed .fire-art { opacity: 0.45; }

/* ---------- click targets ---------- */

.bet-area {
    position: absolute;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}

.bet-area.round { border-radius: 4.4cqw; }

.bet-area:hover {
    background: rgba(201, 168, 76, 0.16);
    box-shadow: inset 0 0 0 2px var(--gold);
}

.fire-closed #fireBetArea { cursor: default; }
.fire-closed #fireBetArea:hover { background: none; box-shadow: none; }

.bet-area.flash-win { animation: flashWin 0.55s ease; }
.bet-area.flash-loss { animation: flashLoss 0.55s ease; }

@keyframes flashWin {
    0%, 100% { background: rgba(63, 145, 66, 0); }
    40% { background: rgba(63, 145, 66, 0.6); }
}

@keyframes flashLoss {
    0%, 100% { background: rgba(156, 59, 46, 0); }
    40% { background: rgba(156, 59, 46, 0.55); }
}

/* ---------- dice ---------- */

.dice-area {
    position: absolute;
    left: 2.2%;
    top: 3.41%;
    display: flex;
    gap: 0.73cqw;
    pointer-events: none;
}

.die {
    width: 4.58cqw;
    aspect-ratio: 1;
    background: var(--cream);
    border-radius: 16%;
    position: relative;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.die.rolling { animation: diceTumble 0.45s ease; }

@keyframes diceTumble {
    0% { transform: rotate(0) translateY(0); }
    30% { transform: rotate(140deg) translateY(-8px) scale(0.92); }
    65% { transform: rotate(260deg) translateY(-3px) scale(1.05); }
    100% { transform: rotate(360deg) translateY(0); }
}

/* Pips: a 3x3 grid, game.js writes pip spans into it. */
.pips {
    position: absolute;
    inset: 13%;
    display: grid;
    grid-template: repeat(3, 1fr) / repeat(3, 1fr);
}

.pip {
    width: 56%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ink);
    place-self: center;
}

.roll-total {
    position: absolute;
    left: 13.5%;
    top: 3%;
    font-family: var(--display);
    font-weight: 700;
    font-size: 3.75cqw;
    line-height: 1.25;
    color: var(--gold-bright);
    pointer-events: none;
}

/* ---------- chips ---------- */

.chip-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Every chip is red. The number on it is the amount, the tag says what
   kind of bet it is when the position alone does not. */
.chip {
    position: absolute;
    width: 2.93cqw;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 1.01cqw;
    font-weight: 500;
    color: #fff;
    background: #b03a2e;
    border: 0.19cqw dashed rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.chip.drop { animation: chipDrop 0.3s ease; }

@keyframes chipDrop {
    0% { opacity: 0; transform: translate(-50%, -110%) scale(0.4); }
    65% { transform: translate(-50%, -47%) scale(1.12); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.chip-tag {
    position: absolute;
    left: 50%;
    bottom: 88%;
    transform: translateX(-50%);
    padding: 0 0.39cqw;
    border: 1px solid var(--ink);
    border-radius: 0.28cqw;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--body);
    font-size: 0.73cqw;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.5;
    white-space: nowrap;
}

/* ---------- the puck ---------- */

.puck {
    position: absolute;
    width: 3.64cqw;
    aspect-ratio: 1;
    border-radius: 50%;
    z-index: 5;
    transform: translate(-50%, -50%);
    transition: top 0.45s ease, left 0.45s ease;
    transform-style: preserve-3d;
    pointer-events: none;
}

.puck-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1cqw;
    letter-spacing: 1px;
    backface-visibility: hidden;
    transition: transform 0.4s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.55);
}

.puck-on {
    background: var(--cream);
    color: var(--ink);
    border: 0.33cqw solid var(--gold);
    transform: rotateY(180deg);
}

.puck-off {
    background: #111;
    color: var(--cream);
    border: 0.33cqw solid #2c2c2c;
    transform: rotateY(0deg);
}

.puck.on .puck-on { transform: rotateY(0deg); }
.puck.on .puck-off { transform: rotateY(180deg); }

/* ---------- bets on the felt, a column at the right end ---------- */

/* The column takes its height from the layout beside it and scrolls inside
   itself, so a long list of bets never makes the table taller. */
.felt-bets {
    position: relative;
    flex: 0 0 230px;
    border-left: 1px solid rgba(201, 168, 76, 0.35);
}

.felt-bets-scroll {
    position: absolute;
    inset: 0;
    padding-left: 12px;
    overflow-y: auto;
}

.felt-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
}

.felt-bets .exposure { min-height: 15px; color: var(--cream-dim); letter-spacing: 0; text-transform: none; }

.felt-bets .bet-list li {
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 6px 8px;
    border-color: rgba(245, 240, 232, 0.35);
    background: rgba(5, 23, 12, 0.35);
    color: var(--cream);
}

.felt-bets .bet-list .bname { flex: 1 1 auto; }
.felt-bets .bet-list .bamt { color: var(--gold-bright); }
.felt-bets .bet-list .off-tag { color: var(--cream-dim); border-color: rgba(245, 240, 232, 0.4); }

.felt-bets .bet-list .mini {
    border-color: rgba(245, 240, 232, 0.4);
    background: transparent;
    color: var(--cream);
}

.felt-bets .bet-list .mini:hover { border-color: var(--gold); background: transparent; color: var(--gold-bright); }
.felt-bets .bet-list .empty { border: none; background: none; padding-left: 0; color: var(--cream-dim); }
