/* ─────────────────────────────────────────────────────────────────────────────
   games/poker/assets/table.css — the table screen for the Fuego Poker Room
   tournament games (used with poker.css and table-ui.js).

   Mobile first: a portrait phone gets three opponents across the top of the
   oval, two at the lower corners, the board in the middle and your seat with
   big cards in the dock underneath. From 820px wide the oval turns landscape.
   ───────────────────────────────────────────────────────────────────────────── */
.ft-body { overflow: hidden; }
.ft-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
    background: radial-gradient(ellipse at 50% -10%, #2a0d1e 0%, var(--bg2) 38%, var(--bg1) 78%); }
.ft-app .fp-top { flex: none; padding: .45rem .7rem; gap: .5rem; }
.ft-app .fp-top-left { flex: 1 1 auto; min-width: 0; }
.ft-app .fp-top-right { flex: none; gap: .35rem; }
.ft-logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ft-app .fp-icon-btn { min-width: 36px; min-height: 34px; padding: .3rem .5rem; line-height: 1; }
.ft-main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
    overflow-x: hidden; overflow-y: auto; }

/* ── Stage: felt + seats in a grid ── */
.ft-stage { flex: 1 1 auto; min-height: 300px; display: flex; padding: 6px 6px 2px; --ft-ow: 28px; }
.ft-grid { position: relative; flex: 1 1 auto; min-width: 0; width: 100%; max-width: 1100px; margin: 0 auto; display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "lt t rt" "c c c" "lb hb rb"; align-items: center; justify-items: center; gap: 2px 4px; }
.ft-felt { position: absolute; left: 1%; right: 1%; top: 13%; bottom: 2%; border-radius: 50%; z-index: 0; pointer-events: none; }
.ft-mark { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); white-space: nowrap;
    font-family: 'Bebas Neue', sans-serif; letter-spacing: .3em; font-size: .9rem; color: rgba(255,255,255,.08); }

.ft-pos-t { grid-area: t; }
.ft-pos-lt { grid-area: lt; margin-top: 18px; }
.ft-pos-rt { grid-area: rt; margin-top: 18px; }
.ft-pos-lb { grid-area: lb; }
.ft-pos-rb { grid-area: rb; }
.ft-n4 .ft-pos-t, .ft-n2 .ft-pos-t { margin-top: 0; }

/* ── A seat ── */
.ft-seat { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px;
    width: 100%; max-width: 124px; min-width: 0; transition: opacity .25s, filter .25s; }
.ft-cards { display: flex; justify-content: center; align-items: flex-end; --fp-w: var(--ft-ow);
    min-height: calc(var(--ft-ow) * 1.4); }
.ft-cards .fp-card + .fp-card { margin-left: calc(var(--fp-w) * -0.42); }
.ft-cards .fp-card.fp-back + .fp-card.fp-back { margin-left: calc(var(--fp-w) * -0.6); }
.ft-cards .fp-card .fp-mid, .ft-cards .fp-card .fp-br { display: none; }
.ft-cards .fp-card .fp-tl { font-size: calc(var(--fp-w) * .4); top: 4%; left: 8%; }
.ft-cards .fp-card.fp-back::before { font-size: calc(var(--fp-w) * .4); }

.ft-plate { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0;
    padding: 3px 9px 3px 3px; border-radius: 999px;
    background: linear-gradient(180deg, rgba(22,24,44,.97), rgba(8,9,18,.97));
    border: 1px solid rgba(255,255,255,.14); box-shadow: 0 4px 14px rgba(0,0,0,.55);
    transition: box-shadow .2s, border-color .2s; }
.ft-ava { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-size: 15px; line-height: 1; background: rgba(255,255,255,.06); border: 2px solid var(--c, var(--neon)); }
.ft-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.ft-name { font-size: .68rem; font-weight: 700; color: #c9d1e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-stack { font-size: .8rem; font-weight: 800; color: var(--neon2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ft-dealer { position: absolute; top: -7px; right: -4px; width: 19px; height: 19px; border-radius: 50%;
    background: #fff; color: #1a1000; font: 900 10px/19px 'Rubik', system-ui, sans-serif; text-align: center;
    box-shadow: 0 0 0 2px var(--neon2), 0 2px 6px rgba(0,0,0,.6); }
.ft-dealer[hidden] { display: none; }

.ft-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px 5px; min-height: 18px; max-width: 100%; }
.ft-act { max-width: 100%; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.62);
    border: 1px solid rgba(255,255,255,.18); color: var(--text); font-size: .62rem; font-weight: 800;
    letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-act:empty { display: none; }
.ft-act.is-long { text-transform: none; letter-spacing: 0; white-space: normal; text-align: center; line-height: 1.2; }
.ft-act.is-win { background: linear-gradient(45deg, #c98a00, #ffd166); color: #1a1000; border-color: transparent; }
.ft-bet { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 800; color: #fff;
    white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.ft-bet:empty { display: none; }
.ft-bet.is-won { color: var(--good); }

.ft-seat.is-turn .ft-plate, .ft-hero.is-turn .ft-plate { border-color: var(--neon2); animation: ftGlow 1.1s ease-in-out infinite alternate; }
@keyframes ftGlow {
    from { box-shadow: 0 0 0 2px rgba(255,209,102,.45), 0 0 10px rgba(255,209,102,.25); }
    to { box-shadow: 0 0 0 2px rgba(255,209,102,.95), 0 0 26px rgba(255,209,102,.65); }
}
.ft-seat.is-folded { opacity: .45; }
.ft-seat.is-out { opacity: .3; filter: grayscale(.85); }
.ft-seat.is-winner .ft-plate, .ft-hero.is-winner .ft-plate { border-color: var(--good);
    box-shadow: 0 0 0 2px rgba(50,210,150,.6), 0 0 24px rgba(50,210,150,.45); }
.ft-seat.is-allin .ft-stack { color: var(--bad); }

/* ── Middle of the table ── */
.ft-center { grid-area: c; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 5px; width: 100%; min-width: 0; padding: 4px 0; text-align: center; }
.ft-info { font-size: .6rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(233,241,255,.6);
    max-width: 92%; }
.ft-pot { min-height: 1.75em; padding: .18rem .8rem; border-radius: 999px; background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,209,102,.3); font-size: .82rem; font-weight: 800; white-space: nowrap; max-width: 96%;
    overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ft-pot:empty { visibility: hidden; }
.ft-pot strong { color: var(--neon2); }
.ft-pot small { color: #c9d1e6; font-size: .72rem; font-weight: 700; }
.ft-board { display: flex; align-items: center; justify-content: center; gap: 4px; --fp-w: min(46px, 11.6vw);
    min-height: calc(var(--fp-w) * 1.4); }
.ft-slot { flex: none; width: var(--fp-w); height: calc(var(--fp-w) * 1.4); border-radius: calc(var(--fp-w) * .1);
    border: 1.5px dashed rgba(255,255,255,.14); }
.ft-street { font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; letter-spacing: .14em; line-height: 1;
    color: rgba(255,209,102,.9); text-shadow: 0 0 18px rgba(255,90,31,.6); }
.ft-msg { min-height: 1.25em; max-width: 96%; font-size: .78rem; font-weight: 700; line-height: 1.25; color: var(--neon2);
    text-shadow: 0 1px 3px #000; }
.ft-herobet { grid-area: hb; z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 22px; }

/* ── Your seat (the dock) ── */
.ft-dock { flex: none; display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 760px; margin: 0 auto;
    padding: 4px 10px 6px; }
.ft-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ft-hero-row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.ft-hero-plate { flex: none; width: auto; max-width: 48%; }
.ft-handname { flex: 1 1 auto; min-width: 0; text-align: center; font-size: .84rem; font-weight: 800; color: var(--neon2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-hero-act { flex: none; max-width: 34%; }
.ft-hero.is-folded .ft-handname { color: var(--muted); }
.ft-hero-cards { display: flex; align-items: flex-end; justify-content: center; gap: 6px; --fp-w: 58px;
    min-height: calc(var(--fp-w) * 1.4 + 10px); padding-top: 8px; }
.ft-v-omaha .ft-hero-cards { --fp-w: 54px; }
.ft-v-draw .ft-hero-cards { --fp-w: min(58px, 15vw); }
.ft-v-stud .ft-hero-cards { --fp-w: min(44px, 11.4vw); gap: 4px; }
.ft-hero-cards .fp-card.ft-down { transform: translateY(6px); box-shadow: 0 0 0 2px rgba(154,163,187,.75), 0 5px 14px rgba(0,0,0,.45); }
.ft-hero-cards .fp-card.ft-down::after { content: 'down'; position: absolute; left: 50%; top: 3%; transform: translateX(-50%);
    padding: 1px 3px; border-radius: 3px; background: rgba(18,20,28,.75); color: #fff;
    font: 800 calc(var(--fp-w) * .15)/1 'Rubik', system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.ft-hero-cards .fp-card.ft-down.fp-win { transform: translateY(-4px); }

/* Draw: your cards become buttons; marked ones drop and say SWAP */
.ft-cardbtn { position: relative; appearance: none; -webkit-appearance: none; padding: 0; margin: 0; border: 0; background: none;
    cursor: pointer; border-radius: calc(var(--fp-w) * .1); touch-action: manipulation; }
.ft-cardbtn:focus-visible { outline: 2px solid var(--neon2); outline-offset: 3px; }
.ft-cardbtn:hover .fp-card { transform: translateY(-3px); }
.ft-cardbtn[aria-pressed="true"] .fp-card { transform: translateY(10px); opacity: .55;
    box-shadow: 0 0 0 3px var(--bad), 0 5px 14px rgba(0,0,0,.45); }
.ft-cardbtn[aria-pressed="true"]::after { content: 'Swap'; position: absolute; left: 50%; top: 55%; transform: translateX(-50%);
    padding: 2px 6px; border-radius: 4px; background: var(--bad); color: #fff; text-transform: uppercase;
    font: 900 .62rem/1.2 'Rubik', system-ui, sans-serif; letter-spacing: .06em; pointer-events: none; }
.ft-drawing .ft-hero-cards { padding-bottom: 10px; }

/* ── Action bar ── */
.ft-actions { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ft-sizes { display: flex; align-items: center; gap: 5px; min-width: 0; }
.ft-q { flex: none; min-height: 34px; padding: .35rem .55rem; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: var(--text);
    font: 700 .74rem 'Rubik', system-ui, sans-serif; touch-action: manipulation; white-space: nowrap; }
.ft-q:hover:not(:disabled) { border-color: var(--neon); }
.ft-q:disabled { opacity: .35; cursor: default; }
.ft-slider { flex: 1 1 auto; min-width: 60px; height: 30px; margin: 0; accent-color: var(--neon); cursor: pointer; }
.ft-slider:disabled { opacity: .35; cursor: default; }
.ft-buttons { display: grid; grid-template-columns: 1fr 1.25fr 1.45fr; gap: 6px; }
.ft-buttons .fp-btn { min-height: 48px; padding: .55rem .35rem; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-fold:not(:disabled) { background: linear-gradient(160deg, rgba(255,77,109,.22), rgba(0,0,0,.3)); }
.ft-call:not(:disabled) { background: linear-gradient(160deg, rgba(50,210,150,.22), rgba(0,0,0,.3)); }
.ft-fixed .ft-sizes { display: none; }
.ft-actions.is-drawing .ft-sizes, .ft-actions.is-drawing .ft-buttons { display: none; }
.ft-drawbar { display: flex; align-items: center; gap: 10px; }
.ft-drawbar[hidden] { display: none; }
.ft-draw-hint { flex: 1 1 auto; min-width: 0; font-size: .82rem; color: #c9d1e6; }
.ft-draw { flex: none; min-width: 150px; min-height: 48px; }

/* ── Hand log (one line; tap to open) ── */
.ft-log { position: relative; flex: none; display: flex; align-items: center; gap: 8px;
    padding: 4px 10px calc(4px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.38); }
.ft-log-toggle { flex: none; cursor: pointer; padding: .2rem .6rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.05); color: var(--text); font: 700 .72rem 'Rubik', system-ui, sans-serif; }
.ft-log-toggle::after { content: ' \25B4'; }
.ft-log.is-open .ft-log-toggle::after { content: ' \25BE'; }
.ft-log-list { flex: 1 1 auto; min-width: 0; height: 1.35em; margin: 0; padding: 0; list-style: none; overflow: hidden;
    font-size: .74rem; line-height: 1.35; color: #aab3c9; }
.ft-log-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-log:not(.is-open) .ft-log-list li:not(:last-child) { display: none; }
.ft-log.is-open .ft-log-list { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 40; height: auto;
    max-height: min(52vh, 360px); overflow-y: auto; padding: 8px 12px; border-radius: 12px; background: rgba(10,12,24,.97);
    border: 1px solid rgba(255,90,31,.3); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.ft-log.is-open .ft-log-list li { white-space: normal; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ft-log-list li.is-hand { color: var(--neon2); font-weight: 700; }
.ft-log.is-open .ft-log-list li.is-hand { margin-top: 6px; }

/* ── Start / end screens ── */
.ft-app a.fp-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ft-rules { max-width: 480px; margin: .7rem auto .4rem; padding-left: 1.2rem; text-align: left; color: #c9d1e6; font-size: .88rem; line-height: 1.5; }
.ft-rules li + li { margin-top: .25rem; }
.ft-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; margin: .9rem 0 .2rem; }
.ft-opt-group { display: inline-flex; align-items: center; gap: .3rem; }
.ft-opt-group > span { margin-right: .25rem; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ft-opt { min-width: 44px; min-height: 38px; padding: .35rem .7rem; border-radius: 9px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: var(--text);
    font: 800 .85rem 'Rubik', system-ui, sans-serif; }
.ft-opt[aria-pressed="true"] { background: linear-gradient(45deg, #cc3300, #ff5a1f); border-color: transparent; }
.ft-opt:focus-visible, .ft-q:focus-visible, .ft-log-toggle:focus-visible, .ft-slider:focus-visible { outline: 2px solid var(--neon2); outline-offset: 2px; }
.ft-record { min-height: 1em; font-weight: 700; color: var(--neon2) !important; }
.ft-record:empty { display: none; }
.ft-keys { font-size: .78rem !important; color: var(--muted) !important; }
.ft-end-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0 .4rem; }
.ft-end-stats div { padding: .6rem .3rem; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); }
.ft-end-stats b { display: block; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ft-end-stats span { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; letter-spacing: .04em; color: var(--neon2); }
.ft-newbest { display: inline-block; margin: .3rem 0; padding: .25rem .9rem; border-radius: 999px; font-weight: 900;
    background: linear-gradient(45deg, #c98a00, #ffd166); color: #1a1000 !important; animation: ftPop .5s cubic-bezier(.2,.9,.3,1.4) both; }
.ft-newbest[hidden] { display: none; }
.ft-wins:empty { display: none; }
@keyframes ftPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Phones ── */
@media (max-width: 600px) {
    .ft-buttons .fp-kbd, .ft-draw .fp-kbd { display: none; }
    .ft-app .fp-top { padding: .4rem .5rem; }
    .ft-app .fp-back-link { padding: .3rem .55rem; }
}
@media (max-width: 359px) {
    .ft-q { padding: .35rem .4rem; font-size: .7rem; }
    .ft-buttons .fp-btn { font-size: .82rem; }
}
@media (max-height: 640px) and (max-width: 819px) {
    .ft-hero-cards { --fp-w: 50px; }
    .ft-v-stud .ft-hero-cards { --fp-w: min(40px, 11.4vw); }
    .ft-stage { min-height: 280px; }
}

/* ── Wide screens: landscape oval, opponents along the top and sides ── */
@media (min-width: 820px) {
    .ft-stage { --ft-ow: 40px; padding: 10px 16px 4px; }
    .ft-grid { grid-template-columns: repeat(5, minmax(0, 1fr));
        grid-template-areas: ". lt t rt ." "lb c c c rb" ". . hb . ."; gap: 6px 10px; }
    .ft-felt { left: 6%; right: 6%; top: 17%; bottom: 5%; }
    .ft-mark { font-size: 1.2rem; bottom: 12%; }
    .ft-pos-lt, .ft-pos-rt { margin-top: 0; }
    .ft-seat { max-width: 172px; gap: 3px; }
    .ft-ava { width: 38px; height: 38px; font-size: 20px; }
    .ft-name { font-size: .78rem; }
    .ft-stack { font-size: .92rem; }
    .ft-act { font-size: .68rem; }
    .ft-bet { font-size: .82rem; }
    .ft-info { font-size: .68rem; }
    .ft-pot { font-size: .95rem; }
    .ft-board { --fp-w: 62px; gap: 7px; }
    .ft-street { font-size: 2.3rem; }
    .ft-msg { font-size: .9rem; }
    .ft-dock { flex-direction: row; align-items: flex-end; justify-content: center; gap: 24px; max-width: 1060px; padding: 6px 18px 10px; }
    .ft-hero { flex: 0 1 auto; }
    .ft-hero-row { min-width: 280px; }
    .ft-actions { flex: 0 1 480px; }
    .ft-hero-cards { --fp-w: 74px; gap: 8px; }
    .ft-v-omaha .ft-hero-cards, .ft-v-draw .ft-hero-cards { --fp-w: 66px; }
    .ft-v-stud .ft-hero-cards { --fp-w: 56px; gap: 6px; }
    .ft-log.is-open .ft-log-list { left: auto; right: 12px; width: 440px; }
}
@media (min-width: 820px) and (max-height: 700px) {
    .ft-hero-cards { --fp-w: 60px; }
    .ft-v-stud .ft-hero-cards { --fp-w: 48px; }
    .ft-board { --fp-w: 54px; }
}
@media (prefers-reduced-motion: reduce) {
    .ft-seat.is-turn .ft-plate, .ft-hero.is-turn .ft-plate { animation: none; box-shadow: 0 0 0 2px rgba(255,209,102,.9), 0 0 18px rgba(255,209,102,.5); }
    .ft-newbest { animation: none; }
}
