/* card_size.css v2 (preview, 2026-10-18): ONE file = v2 desktop (uniform ~1.2x cards) + v2 phone (new).
   Replaces ../card_size.css. Load it LAST (after index.html's <style>, every static/*.css and felt.css).
   Phone   = portrait, width <= 520px (checked 360x780 / 390x844 / 430x932).
   Desktop = landscape, height >= 501px: all cards ~1.2x live (hero, backs, shown, board); seats/layout unchanged. Short landscape phones / portrait tablets: untouched.
   v2 phone idea: table, seats and cards scale as ONE system. Bigger portrait oval, compact seats that sit on the rail
   (round avatar + small name/stack pill + slim belt), cards sized to the felt.
   Phone seat positions also need the small posFor() change described in README (demo.html shows it). */

/* ================= PHONE (portrait) : v2 ================= */
@media (orientation:portrait) and (max-width:520px){
  :root{
    --cs-hero-w:50px; --cs-hero-h:70px; --cs-hero-f:23px;      /* hero hole cards: live 39x55 -> 50x70 */
    --cs-board-w:44px; --cs-board-h:62px; --cs-board-f:21px;   /* board: live 36x50 -> 44x62 */
    --cs-board-gap:3px;
    --cs-back-w:12px; --cs-back-h:17px;                        /* opponents' backs: live size */
    --cs-mini-w:22px; --cs-mini-h:31px; --cs-mini-f:11px;      /* shown cards at showdown */
    --cs-chip:14px;
  }
  /* bigger portrait table: oval uses almost the whole width and the full height between header and buttons */
  .rail{left:3%;right:3%;top:9%;bottom:11%;padding:16px}
  /* compact seat: round avatar on top, small name+stack pill under it, slim belt */
  .seat,#seats.many .seat{--sw:74px;--av:38px;--bh:9px;width:var(--sw)}
  .seat.me{--sw:84px;--av:42px;min-width:0}
  .seat .plate,#seats.many .seat .plate{flex-direction:column;align-items:center;gap:0;padding:0!important;width:var(--sw);
    background:none;border:0;box-shadow:none!important;animation:none!important}
  .seat .plate .avc{gap:0;position:relative;z-index:2}
  .seat .plate .avatar{border-width:2px}
  .seat .bstrip{display:none}
  .seat .plate .pi{width:100%;box-sizing:border-box;margin-top:-6px;padding:6px 3px 2px;align-items:center;text-align:center;
    background:linear-gradient(#2c2f35,#121316);border:1px solid #555;border-radius:7px;box-shadow:0 2px 5px #000b}
  .plate .nm,#seats.many .plate .nm{font-size:9.5px;text-align:center}
  .plate .st,#seats.many .plate .st{font-size:10.5px;text-align:center}
  .plate .st,.plate .nm{height:12px;line-height:12px}
  .plate .st .coin{width:10px;height:10px;margin-right:1px}
  .seat .bimg{margin:1px auto 0}
  .seat .blink{display:block;line-height:0}
  /* seat states move from the whole plate to the pill */
  .turn .plate .pi{border-color:#ffd75e;box-shadow:0 0 0 2px #ffd75e,0 0 8px #ffd75e}
  .seat.allin .plate .pi{border-color:#ff5a5a;box-shadow:0 0 0 2px #ff5a5a}
  .seat.elig .plate .pi{box-shadow:0 0 0 2px #E8B33A,0 0 10px #E8B33Aaa}
  .seat.potwin .plate .pi{box-shadow:0 0 0 3px #fff,0 0 14px #ffd76a}
  .seat.noted .plate .pi{box-shadow:0 0 0 2px var(--nc),0 0 6px var(--nc)}
  .seat.thinking .plate .pi{animation:thinkPulse 1.1s ease-in-out infinite;border-color:#d6af37}
  .seat .la{font-size:8.5px;height:10px;margin-top:0}
  .seat .aitag,.seat .plate .fc-tag{font-size:7.5px;padding:0 4px;right:-4px;bottom:auto;top:-3px;z-index:3}
  .bet{font-size:10px;gap:2px;padding:0 5px 0 1px}
  .bet .stack,.bet .stack img{width:var(--cs-chip)!important;height:var(--cs-chip)}
  .dealer{width:17px;height:17px;line-height:17px;font-size:10px}
  #gtype.res{white-space:normal;width:max-content;max-width:calc(100vw - 176px);line-height:15px}
}
/* full ring on phones: same seat, a touch smaller cards so the board clears the side seats' bets */
@media (orientation:portrait) and (max-width:520px){
  #tableWrap.many{--cs-board-w:41px;--cs-board-h:58px;--cs-board-f:20px;--cs-hero-w:46px;--cs-hero-h:64px;--cs-hero-f:21px}
  #seats.many .seat{--sw:70px;--av:34px}
  #seats.many .bet{font-size:9.5px;gap:1px;padding:0 3px 0 0;--cs-chip:12px}
  #tableWrap.many #center{top:46%!important}                     /* board sits in the free band between the upper and middle side seats' bets */
  #tableWrap.many #gtype{bottom:auto;top:100%;margin:3px 0 0}    /* game pill goes under the board */
}
/* PLO / 4+ hole cards on phones: always fanned so the hero cards stay between the two lower side seats' bets */
@media (orientation:portrait) and (max-width:520px){
  #mine:has(.card:nth-child(4)) .card+.card{margin-left:calc(var(--cs-hero-w) * var(--cs-fan,.4) * -1)!important}
  #mine:has(.card:nth-child(4)) .card+.card{box-shadow:-2px 0 4px #0006}
}
/* 360x780-class */
@media (orientation:portrait) and (max-width:520px) and (max-height:820px){
  :root{--cs-hero-w:46px;--cs-hero-h:64px;--cs-hero-f:21px;--cs-board-w:41px;--cs-board-h:58px;--cs-board-f:20px}
  #tableWrap.many{--cs-board-w:38px;--cs-board-h:53px;--cs-board-f:18px;--cs-hero-w:42px;--cs-hero-h:59px;--cs-hero-f:19px}
  .seat{--av:34px} #seats.many .seat{--sw:66px;--av:30px}
  #mine{--cs-fan:.46}
  #seats.many .seat.top .hole:not(.mini){bottom:auto!important;top:1px!important;left:0;transform:none;margin:0!important}  /* backs beside the avatar, clear of the header */
}
/* 430x932-class (live gives this phone desktop-size seats) */
@media (orientation:portrait) and (max-width:520px) and (min-height:900px){
  :root{--cs-hero-w:54px;--cs-hero-h:76px;--cs-hero-f:25px;--cs-board-w:48px;--cs-board-h:67px;--cs-board-f:22px}
  #tableWrap.many{--cs-board-w:45px;--cs-board-h:63px;--cs-hero-w:50px;--cs-hero-h:70px}
  .seat{--sw:80px;--av:42px} .seat.me{--sw:90px;--av:46px} #seats.many .seat{--sw:74px;--av:36px}
}

/* ================= DESKTOP (landscape, normal height) : v2 = one uniform ~1.2x bump over live, layout and plates unchanged ================= */
@media (orientation:landscape) and (min-height:501px){
  :root{
    --cs-hero-w:55px; --cs-hero-h:74px; --cs-hero-f:24px;      /* hero: live 46x62 -> 55x74 (x1.2) */
    --cs-board-w:43px; --cs-board-h:60px; --cs-board-f:20px;   /* board: live 36x50 -> 43x60 (x1.2) */
    --cs-board-gap:2px;
    --cs-back-w:17px; --cs-back-h:24px;                        /* opponents' backs: live 14x20 -> 17x24 (x1.2) */
    --cs-mini-w:26px; --cs-mini-h:36px; --cs-mini-f:13px;      /* shown cards: live 22x30 -> 26x36 (x1.2) */
  }
}

/* ================= shared wiring (only active where the variables are set) ================= */
@media (orientation:portrait) and (max-width:520px),(orientation:landscape) and (min-height:501px){
  #mine .card{width:var(--cs-hero-w);height:var(--cs-hero-h);line-height:var(--cs-hero-h);font-size:var(--cs-hero-f)}
  #mine{height:calc(var(--cs-hero-h) + 4px)}
  #mine.fan .card{margin-left:calc(var(--cs-hero-w) * -.3)!important}
  #board,#tableWrap.many #board{height:var(--cs-board-h);width:calc(5 * var(--cs-board-w) + 4 * var(--cs-board-gap));gap:var(--cs-board-gap)}
  #board .card,#tableWrap.many #board .card{width:var(--cs-board-w);height:var(--cs-board-h);line-height:var(--cs-board-h);font-size:var(--cs-board-f)}
  .seat .hole .back{width:var(--cs-back-w);height:var(--cs-back-h)}
  .seat .mini .card{width:var(--cs-mini-w);height:var(--cs-mini-h);line-height:var(--cs-mini-h);font-size:var(--cs-mini-f)}
}
/* shown cards of top seats (showdown) go under the seat (plate, hand name, cards) instead of up into the header */
@media (orientation:portrait) and (max-width:520px),(orientation:landscape) and (min-height:501px){
  .seat.top .hole.mini{top:100%!important;bottom:auto!important;margin:1px 0 0!important}
}
/* PLO showdown on phones: 4 shown cards overlap a little so side seats' hands stay on screen */
@media (orientation:portrait) and (max-width:520px){
  .seat .hole.mini:has(.card:nth-child(4)) .card+.card{margin-left:-7px}
}
