  /* ===================== foundations ===================== */
  :root {
    --bg: #050908;
    --bg-2: #08110d;
    --panel: #0c1713;
    --panel-2: #101e18;
    --line: rgba(231, 201, 121, 0.16);
    --line-soft: rgba(255, 255, 255, 0.07);
    --gold: #e7c979;
    --gold-hot: #ffe6a0;
    --gold-dim: #a98b42;
    --cyan: #62e6d2;
    --text: #eaf0ea;
    --muted: #7f948a;
    --red: #e5484d;
    --felt-1: #176b50;
    --felt-2: #0c4a37;
    --felt-3: #07291f;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: "Avenir Next", "Segoe UI", "SF Pro Text", system-ui, -apple-system, sans-serif;
    --shadow-lg: 0 40px 90px rgba(0, 0, 0, 0.62);
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    color: var(--text);
    font-family: var(--sans);
    background:
      radial-gradient(1200px 700px at 50% -10%, rgba(27, 92, 70, 0.35), transparent 60%),
      radial-gradient(900px 600px at 100% 100%, rgba(231, 201, 121, 0.07), transparent 60%),
      radial-gradient(900px 600px at 0% 100%, rgba(98, 230, 210, 0.05), transparent 55%),
      linear-gradient(180deg, #07100c 0%, #050908 55%, #040706 100%);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
  }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 78%);
  }
  button, input { font-family: inherit; }
  button { cursor: pointer; }
  button:focus-visible, input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
  }
  [hidden] { display: none !important; }
  ::selection { background: rgba(231, 201, 121, 0.28); }

  /* ===================== app shell ===================== */
  #setupOverlay {
    background:
      radial-gradient(ellipse at 50% 38%, rgba(22, 78, 58, 0.32), transparent 58%),
      rgba(2, 6, 4, 0.62);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
  #app {
    position: relative;
    z-index: 1;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px 20px 18px;
    max-width: 1560px;
    margin: 0 auto;
  }

  /* ===================== top bar ===================== */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }
  .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .brand-mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(231, 201, 121, 0.35);
    color: var(--gold);
    font-size: 22px;
    background: linear-gradient(160deg, rgba(231,201,121,0.14), rgba(231,201,121,0.02));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 20px rgba(0,0,0,0.35);
    flex: 0 0 auto;
  }
  .brand h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: #f4f7f2;
    white-space: nowrap;
  }
  .brand p {
    margin: 4px 0 0;
    font-size: 8.5px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
  }
  .hud { display: flex; align-items: center; gap: 4px; }
  .hud-item {
    display: flex; flex-direction: column; gap: 3px;
    padding: 2px 15px;
    border-left: 1px solid var(--line-soft);
    min-width: 76px;
  }
  .hud-item:first-child { border-left: 0; }
  .hud-item span {
    font-size: 8px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted); font-weight: 700;
  }
  .hud-item b {
    font-size: 12px; font-weight: 700; color: var(--gold);
    font-variant-numeric: tabular-nums; letter-spacing: 0.03em;
    white-space: nowrap;
  }
  .hud-item b.cyan { color: var(--cyan); }
  .icon-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    display: grid; place-items: center;
    margin-left: 8px;
    transition: border-color .2s, background .2s;
  }
  .icon-btn:hover { border-color: rgba(231,201,121,0.4); background: rgba(231,201,121,0.07); }

  /* ===================== main layout ===================== */
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    min-height: 0;
  }
  .table-area {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 2px 0;
  }

  /* ===================== poker table ===================== */
  .table-shell {
    position: relative;
    width: min(100%, 990px);
    aspect-ratio: 1.68 / 1;
    max-height: 100%;
  }
  .table {
    position: absolute;
    inset: 10px 0;
    border-radius: 50%;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.1), transparent 12%),
      linear-gradient(180deg, #342917 0%, #1a140c 38%, #0b0905 100%);
    box-shadow:
      0 44px 90px rgba(0,0,0,0.66),
      0 8px 24px rgba(0,0,0,0.6),
      inset 0 2px 1px rgba(255,255,255,0.16),
      inset 0 -3px 6px rgba(0,0,0,0.8);
  }
  .table::before {
    content: "";
    position: absolute; inset: 7px;
    border-radius: 50%;
    border: 1px solid rgba(231, 201, 121, 0.35);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.5), inset 0 0 22px rgba(231,201,121,0.12);
    pointer-events: none;
  }
  .table::after {
    content: "";
    position: absolute; inset: 15px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
    pointer-events: none;
  }
  .felt {
    position: absolute;
    inset: 17px;
    border-radius: 50%;
    overflow: visible;
    background:
      radial-gradient(ellipse at 50% 34%, rgba(53, 170, 126, 0.34) 0%, rgba(20, 96, 71, 0.18) 38%, transparent 66%),
      radial-gradient(ellipse at 50% 48%, #146449 0%, #0c4a37 42%, #073225 72%, #041d16 100%);
    box-shadow:
      inset 0 0 54px rgba(0,0,0,0.58),
      inset 0 0 0 2px rgba(0,0,0,0.35),
      inset 0 3px 14px rgba(0,0,0,0.55);
  }
  .felt::before {
    content: "";
    position: absolute; inset: 7%;
    border-radius: 50%;
    border: 1px solid rgba(231, 201, 121, 0.13);
    box-shadow: 0 0 70px rgba(0,0,0,0.2) inset;
    pointer-events: none;
  }
  .felt::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 50%;
    background-image: repeating-linear-gradient(118deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 5px);
    opacity: 0.7;
    pointer-events: none;
  }
  .felt-brand {
    position: absolute;
    left: 50%; top: 24%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(231, 201, 121, 0.08);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
  }
  .felt-brand .spade { display: block; font-size: clamp(20px, 2.6vw, 34px); line-height: 1; }
  .felt-brand strong {
    display: block;
    font-family: var(--serif);
    font-size: clamp(24px, 4vw, 52px);
    letter-spacing: 0.34em;
    font-weight: 600;
    margin: 4px 0 2px 0.34em;
  }
  .felt-brand em {
    display: block; font-style: normal;
    font-size: clamp(6px, 0.75vw, 9px);
    letter-spacing: 0.62em;
    margin-left: 0.62em;
  }

  /* ===================== center cluster ===================== */
  .center {
    position: absolute;
    left: 50%; top: 45%;
    transform: translate(-50%, -50%);
    width: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 4;
    pointer-events: none;
  }
  .pot-pill {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 18px 7px;
    border-radius: 999px;
    border: 1px solid rgba(231, 201, 121, 0.32);
    background: linear-gradient(180deg, rgba(5, 12, 9, 0.72), rgba(3, 8, 6, 0.55));
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    min-width: 128px;
    justify-content: center;
  }
  .pot-label {
    font-size: 8.5px; font-weight: 800;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted); white-space: nowrap;
  }
  .pot-value {
    font-family: var(--serif);
    font-size: clamp(19px, 2.1vw, 27px);
    font-weight: 700;
    color: var(--gold-hot);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 22px rgba(231, 201, 121, 0.35);
    line-height: 1;
  }
  .community {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    --cw: clamp(40px, 4.4vw, 58px);
  }
  .table-msg {
    min-height: 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(234, 240, 234, 0.5);
    text-align: center;
    line-height: 1.5;
  }
  .summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: min(480px, 100%);
    padding: 10px 22px;
    border-radius: 14px;
    border: 1px solid rgba(231, 201, 121, 0.42);
    background:
      linear-gradient(180deg, rgba(231, 201, 121, 0.16), rgba(231, 201, 121, 0.04)),
      rgba(5, 12, 9, 0.75);
    box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: bannerIn 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
    text-align: center;
  }
  .summary b {
    font-family: var(--serif);
    font-size: clamp(14px, 1.55vw, 20px);
    letter-spacing: 0.01em;
    color: #fff8e4;
    line-height: 1.25;
    text-shadow: 0 0 26px rgba(231,201,121,0.25);
  }
  .summary span {
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
  }
  .summary-mobile { display: none !important; }

  /* ===================== cards ===================== */
  .card {
    position: relative;
    width: var(--cw, 54px);
    aspect-ratio: 5 / 7;
    flex: 0 0 auto;
    border-radius: calc(var(--cw, 54px) * 0.1);
    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,0.9), transparent 55%),
      linear-gradient(155deg, #fffdf7 0%, #f4f0e4 58%, #e3ddcb 100%);
    color: #141a18;
    box-shadow:
      0 calc(var(--cw, 54px) * 0.08) calc(var(--cw, 54px) * 0.2) rgba(0,0,0,0.38),
      inset 0 0 0 1px rgba(0,0,0,0.13),
      inset 0 1px 0 rgba(255,255,255,0.9);
    transform-origin: 50% 55%;
    user-select: none;
  }
  .card.red { color: #c62d40; }
  .card.black { color: #17201c; }
  .card .corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.86;
    font-family: var(--serif);
    font-weight: 800;
  }
  .card .corner.tl { top: 5%; left: 9%; }
  .card .corner.br { bottom: 5%; right: 9%; transform: rotate(180deg); }
  .card .corner b { font-size: calc(var(--cw, 54px) * 0.27); letter-spacing: -0.03em; }
  .card .corner i { font-style: normal; font-size: calc(var(--cw, 54px) * 0.2); margin-top: 1px; }
  .card .pip {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: calc(var(--cw, 54px) * 0.46);
    opacity: 0.92;
    padding-top: 4%;
    font-family: var(--serif);
  }
  .card.back {
    background:
      linear-gradient(145deg, #163248 0%, #0c2132 55%, #081722 100%);
    color: transparent;
    border: 1px solid rgba(231, 201, 121, 0.45);
    box-shadow: 0 calc(var(--cw, 54px) * 0.08) calc(var(--cw, 54px) * 0.2) rgba(0,0,0,0.4), inset 0 0 0 1px rgba(0,0,0,0.25);
    overflow: hidden;
  }
  .card.back::before {
    content: "";
    position: absolute;
    inset: 7%;
    border-radius: calc(var(--cw, 54px) * 0.045);
    border: 1px solid rgba(231, 201, 121, 0.32);
    background:
      repeating-linear-gradient(45deg, rgba(231, 201, 121, 0.09) 0 1px, transparent 1px 4px),
      repeating-linear-gradient(-45deg, rgba(231, 201, 121, 0.07) 0 1px, transparent 1px 4px);
  }
  .card.back::after {
    content: "♠";
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: calc(var(--cw, 54px) * 0.34);
    color: rgba(231, 201, 121, 0.62);
    text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  }
  .card-slot {
    width: var(--cw, 54px);
    aspect-ratio: 5 / 7;
    flex: 0 0 auto;
    border-radius: calc(var(--cw, 54px) * 0.1);
    border: 1px dashed rgba(234, 240, 234, 0.14);
    background: rgba(0, 0, 0, 0.09);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
  }
  .card.deal-in { animation: dealIn 0.42s cubic-bezier(0.18, 0.85, 0.3, 1.15) both; }

  /* ===================== seats ===================== */
  .seats { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
  .seat {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    transform: translate(-50%, -50%);
    width: 152px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s ease, filter 0.3s ease;
  }
  .seat.human {
    left: 50%;
    top: 88%;
    width: 200px;
    flex-direction: column-reverse;
    gap: 7px;
    z-index: 8;
  }
  .seat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    padding: 5px 11px 5px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
      linear-gradient(180deg, rgba(20, 35, 28, 0.94), rgba(6, 13, 10, 0.95));
    box-shadow: 0 10px 24px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.07);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    position: relative;
  }
  .seat.human .seat-top {
    min-width: 150px;
    padding: 6px 16px 6px 8px;
    border-color: rgba(231, 201, 121, 0.3);
    background:
      linear-gradient(180deg, rgba(32, 28, 16, 0.94), rgba(9, 13, 10, 0.96));
  }
  .avatar {
    width: 34px; height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid; place-items: center;
    position: relative;
    font-size: 17px;
    line-height: 1;
    background:
      radial-gradient(circle at 32% 24%, rgba(255,255,255,0.3), transparent 55%),
      radial-gradient(circle at 65% 80%, rgba(0,0,0,0.35), transparent 60%),
      var(--accent, #345);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  .seat.human .avatar { width: 42px; height: 42px; font-size: 21px; }
  .seat.active .seat-top {
    border-color: rgba(98, 230, 210, 0.85);
    box-shadow: 0 0 0 1px rgba(98, 230, 210, 0.55), 0 0 30px rgba(98, 230, 210, 0.28), 0 10px 24px rgba(0,0,0,0.4);
  }
  .seat.active .avatar { animation: turnPulse 1.5s ease-in-out infinite; }
  .seat.winner .seat-top {
    border-color: rgba(255, 226, 160, 0.95);
    box-shadow: 0 0 0 1px rgba(231, 201, 121, 0.7), 0 0 36px rgba(231, 201, 121, 0.42), 0 10px 24px rgba(0,0,0,0.4);
  }
  .seat.winner .avatar { animation: winnerGlow 1.3s ease-in-out infinite alternate; }
  .seat.folded { opacity: 0.52; filter: saturate(0.45); }
  .seat.out { opacity: 0.5; filter: saturate(0.5); }
  .seat.out .bet, .seat.out .bubble { display: none; }
  .seat.out .badges { opacity: 0.7; }

  .dealer-chip {
    position: absolute;
    left: -5px; bottom: -4px;
    width: 17px; height: 17px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-style: normal;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0;
    color: #241a06;
    background: radial-gradient(circle at 35% 28%, #fff3c2, #e7c979 45%, #a9842f 100%);
    border: 1px solid #fff0b0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.7);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4);
  }
  .dealer-chip.show { opacity: 1; transform: scale(1); }

  .who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .who .name {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #eef4ee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 94px;
  }
  .seat.human .who .name { font-size: 13px; max-width: 110px; }
  .who .stack {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .seat.human .who .stack { font-size: 12px; }
  .who .stack.low { color: #ff9a9d; }

  .badges {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    min-height: 0;
    max-width: 150px;
  }
  .badges:empty { display: none; }
  .badge {
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
  }
  .badge.sb, .badge.bb { color: #071512; background: rgba(98, 230, 210, 0.85); }
  .badge.dealer { color: var(--gold-hot); background: rgba(231, 201, 121, 0.12); border-color: rgba(231, 201, 121, 0.5); }
  .badge.fold { color: #f3d9d9; background: rgba(229, 72, 77, 0.25); border-color: rgba(229, 72, 77, 0.4); }
  .badge.allin { color: #1b1102; background: linear-gradient(180deg, #ffe6a0, #d8b355); border-color: #fff1bd; }
  .badge.win { color: #241a06; background: linear-gradient(180deg, #fff2c4, #e7c979); }

  .hole {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 48px;
    --cw: 34px;
    transition: opacity 0.25s;
  }
  .seat.human .hole { --cw: 60px; min-height: 84px; gap: 7px; }
  .seat.folded .hole { opacity: 0.5; }

  .bet {
    position: absolute;
    left: 50%;
    bottom: -21px;
    transform: translate(-50%, 4px);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 5px;
    border-radius: 999px;
    border: 1px solid rgba(231, 201, 121, 0.42);
    background: linear-gradient(180deg, rgba(28, 24, 13, 0.95), rgba(9, 12, 8, 0.95));
    color: var(--gold-hot);
    font-size: 9.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.2s, transform 0.25s;
    white-space: nowrap;
    pointer-events: none;
  }
  .bet::before {
    content: "";
    width: 10px; height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff3c2, #d8b355 45%, #8f6c1c 100%);
    border: 1px solid #f9e7a6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    flex: 0 0 auto;
  }
  .bet.show { opacity: 1; transform: translate(-50%, 0); }
  .seat.human .bet { bottom: auto; top: -26px; }

  .bubble {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translate(-50%, 4px);
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(231, 201, 121, 0.32);
    background: rgba(4, 10, 8, 0.94);
    color: var(--gold);
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.18s, transform 0.22s;
    pointer-events: none;
    z-index: 10;
  }
  .bubble.show { opacity: 1; transform: translate(-50%, 0); }

  /* ===================== sidebar ===================== */
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    width: 100%;
  }
  .panel {
    border-radius: 16px;
    border: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(16, 30, 24, 0.92), rgba(7, 14, 11, 0.94));
    box-shadow: 0 18px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
    overflow: hidden;
  }
  .log-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    flex: 0 0 auto;
  }
  .panel-head h2 {
    margin: 0;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .live-dot {
    display: flex; align-items: center; gap: 6px;
    font-size: 8px; letter-spacing: 0.18em; color: var(--muted);
    text-transform: uppercase;
  }
  .live-dot::before {
    content: "";
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    animation: blink 2.2s ease-in-out infinite;
  }
  .log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(231,201,121,0.22) transparent;
  }
  .log::-webkit-scrollbar { width: 8px; }
  .log::-webkit-scrollbar-thumb { background: rgba(231,201,121,0.18); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
  .log-entry {
    display: flex;
    gap: 7px;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.45;
    color: #b7c7be;
    animation: logIn 0.28s ease both;
  }
  .log-entry:nth-child(odd) { background: rgba(255,255,255,0.018); }
  .log-hand {
    flex: 0 0 auto;
    font-size: 8.5px;
    font-weight: 700;
    color: #4d6258;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
    min-width: 20px;
  }
  .log-text { min-width: 0; }
  .log-entry.meta .log-text {
    color: #6f8579;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 8.5px;
    font-weight: 700;
  }
  .log-entry.raise .log-text { color: var(--gold); font-weight: 700; }
  .log-entry.call .log-text { color: #c8d8cf; }
  .log-entry.fold .log-text { color: #8a7c6a; }
  .log-entry.win .log-text { color: var(--cyan); font-weight: 700; }
  .log-entry.out .log-text { color: #ff8a8e; }
  .log-entry.street .log-text { color: #9fb3a8; letter-spacing: 0.02em; }
  .log-entry.blind .log-text { color: #a99a76; }

  .legend-panel { flex: 0 0 auto; }
  .legend-panel summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .legend-panel summary::-webkit-details-marker { display: none; }
  .legend-panel summary::after {
    content: "+";
    font-size: 13px;
    color: var(--gold);
    line-height: 1;
  }
  .legend-panel[open] summary::after { content: "−"; }
  .legend-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
    padding: 0 16px 14px;
    font-size: 9.5px;
    color: #91a39a;
  }
  .legend-grid b { color: var(--gold); font-weight: 700; }
  .legend-grid span { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

  /* ===================== action bar ===================== */
  .actionbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 82px;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid var(--line-soft);
    background:
      linear-gradient(180deg, rgba(17, 31, 25, 0.94), rgba(6, 12, 9, 0.96));
    box-shadow: 0 -10px 40px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .actionbar.your-turn {
    border-color: rgba(231, 201, 121, 0.4);
    box-shadow: 0 0 34px rgba(231, 201, 121, 0.08), inset 0 1px 0 rgba(255,255,255,0.06);
  }
  .turn-info {
    min-width: 190px;
    max-width: 290px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--muted);
    letter-spacing: 0.02em;
    flex: 0 0 auto;
  }
  .turn-info b {
    color: var(--text);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    display: block;
    margin-bottom: 2px;
  }
  .turn-info .odds { color: var(--cyan); font-variant-numeric: tabular-nums; }
  .turn-info .thinking { color: var(--gold); }
  .thinking-dots::after {
    content: "";
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: dots 1.4s steps(4, end) infinite;
  }
  .controls {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .btn {
    position: relative;
    border: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    color: var(--text);
    border-radius: 12px;
    padding: 11px 16px;
    min-width: 88px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: transform 0.12s, border-color 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .btn kbd {
    font-family: var(--sans);
    font-size: 8px;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 3px;
    padding: 1px 4px;
    line-height: 1.1;
    letter-spacing: 0;
  }
  .btn:hover:not(:disabled) { transform: translateY(-1px); }
  .btn:active:not(:disabled) { transform: translateY(0) scale(0.985); }
  .btn:disabled { opacity: 0.28; cursor: not-allowed; }
  .btn.fold { color: #ff9a9d; border-color: rgba(229, 72, 77, 0.3); background: linear-gradient(180deg, rgba(229,72,77,0.14), rgba(229,72,77,0.04)); }
  .btn.fold:hover:not(:disabled) { border-color: rgba(229,72,77,0.6); box-shadow: 0 0 20px rgba(229,72,77,0.12); }
  .btn.call { color: #a9fff2; border-color: rgba(98, 230, 210, 0.35); background: linear-gradient(180deg, rgba(98,230,210,0.14), rgba(98,230,210,0.04)); }
  .btn.call:hover:not(:disabled) { border-color: rgba(98,230,210,0.7); box-shadow: 0 0 22px rgba(98,230,210,0.14); }
  .btn.raise, .btn.allin {
    color: #221806;
    border-color: rgba(255, 239, 186, 0.65);
    background: linear-gradient(180deg, #ffe9a6 0%, #e7c979 45%, #c8a24c 100%);
    box-shadow: 0 4px 14px rgba(231,201,121,0.18), inset 0 1px 0 rgba(255,255,255,0.6);
  }
  .btn.raise:hover:not(:disabled), .btn.allin:hover:not(:disabled) {
    box-shadow: 0 6px 22px rgba(231,201,121,0.32), inset 0 1px 0 rgba(255,255,255,0.7);
  }
  .btn.raise kbd, .btn.allin kbd { color: rgba(34,24,6,0.5); border-color: rgba(34,24,6,0.25); }
  .btn.allin { background: linear-gradient(180deg, #8ff8e9 0%, #62e6d2 50%, #2fb9a4 100%); border-color: rgba(183,255,246,0.65); }
  .btn.allin:hover:not(:disabled) { box-shadow: 0 6px 22px rgba(98,230,210,0.3); }
  .btn.next {
    margin-left: auto;
    min-width: 190px;
    color: #221806;
    border-color: rgba(255, 239, 186, 0.7);
    background: linear-gradient(180deg, #ffe9a6, #e7c979 50%, #c8a24c);
    box-shadow: 0 8px 26px rgba(231,201,121,0.2), inset 0 1px 0 rgba(255,255,255,0.65);
    animation: nextPulse 2.6s ease-in-out infinite;
  }
  .raise-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 178px;
    max-width: 240px;
    flex: 1 1 180px;
    padding: 5px 11px 6px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.22);
  }
  .raise-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .raise-top label {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
  }
  .amt-wrap {
    display: flex;
    align-items: center;
    gap: 1px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .amt-wrap input {
    width: 58px;
    background: none;
    border: none;
    color: var(--gold-hot);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    padding: 0;
    outline: none;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
  }
  .amt-wrap input::-webkit-outer-spin-button,
  .amt-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 14px;
    background: transparent;
    cursor: pointer;
    margin: 0;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(231,201,121,0.85), rgba(231,201,121,0.22));
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px; height: 13px;
    margin-top: -5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff8dd, #e7c979 55%, #a88430);
    border: 1px solid #fff3c4;
    box-shadow: 0 0 10px rgba(231,201,121,0.55), 0 1px 3px rgba(0,0,0,0.5);
  }
  input[type="range"]::-moz-range-track { height: 3px; background: rgba(231,201,121,0.4); border-radius: 99px; }
  input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 1px solid #fff3c4; border-radius: 50%; background: #e7c979; }
  input[type="range"]:disabled { opacity: 0.3; cursor: not-allowed; }
  .raise-box.disabled { opacity: 0.38; pointer-events: none; }

  /* ===================== overlays / modals ===================== */
  .overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
      radial-gradient(ellipse at 50% 35%, rgba(20, 65, 50, 0.34), transparent 55%),
      rgba(2, 6, 4, 0.74);
    backdrop-filter: blur(11px);
    -webkit-backdrop-filter: blur(11px);
    animation: fadeIn 0.28s ease both;
  }
  .modal {
    position: relative;
    width: min(505px, 100%);
    max-height: calc(100dvh - 44px);
    overflow-y: auto;
    padding: 30px 32px 26px;
    border-radius: 24px;
    border: 1px solid rgba(231, 201, 121, 0.28);
    background:
      radial-gradient(600px 260px at 100% 0%, rgba(231, 201, 121, 0.12), transparent 70%),
      linear-gradient(165deg, #101d17 0%, #0a130f 60%, #060c09 100%);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
    animation: modalIn 0.4s cubic-bezier(0.18, 0.9, 0.25, 1.08) both;
    scrollbar-width: thin;
    scrollbar-color: rgba(231,201,121,0.22) transparent;
  }
  .modal::before {
    content: "";
    position: absolute;
    top: -140px; right: -100px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(231,201,121,0.16), transparent 68%);
    pointer-events: none;
  }
  .modal-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
  }
  .modal-eyebrow::before { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
  .modal h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(32px, 5vw, 42px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: #f7f4e9;
  }
  .modal h2 em { color: var(--gold); font-style: italic; }
  .modal-sub {
    margin: 8px 0 0;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 38ch;
  }
  .field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    margin-top: 22px;
  }
  .field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
  .field.wide { grid-column: 1 / -1; }
  .field > span {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .field input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.11);
    background: rgba(3, 9, 6, 0.72);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .field input:hover { border-color: rgba(255,255,255,0.2); }
  .field input:focus { border-color: rgba(231,201,121,0.75); box-shadow: 0 0 0 3px rgba(231,201,121,0.11); }
  .money-input { position: relative; }
  .money-input i {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    font-size: 14px;
    font-weight: 800;
    color: var(--gold);
  }
  .money-input input { padding-left: 28px; }
  .seg {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .seg button {
    padding: 10px 0;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.11);
    background: rgba(3, 9, 6, 0.72);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    transition: all 0.18s;
    font-variant-numeric: tabular-nums;
  }
  .seg button:hover { border-color: rgba(231,201,121,0.45); color: var(--text); }
  .seg button.sel {
    color: #211706;
    border-color: transparent;
    background: linear-gradient(180deg, #ffe9a6, #e7c979 55%, #c8a24c);
    box-shadow: 0 4px 16px rgba(231,201,121,0.22), inset 0 1px 0 rgba(255,255,255,0.6);
  }
  .form-error {
    min-height: 17px;
    margin: 12px 0 4px;
    font-size: 10.5px;
    font-weight: 700;
    color: #ff8a8e;
    letter-spacing: 0.02em;
  }
  .primary-btn {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 240, 190, 0.7);
    background: linear-gradient(180deg, #ffe9a6 0%, #e7c979 48%, #c8a24c 100%);
    color: #211706;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(231,201,121,0.18), inset 0 1px 0 rgba(255,255,255,0.7);
    transition: transform 0.14s, box-shadow 0.2s;
  }
  .primary-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(231,201,121,0.28), inset 0 1px 0 rgba(255,255,255,0.75); }
  .primary-btn:active { transform: translateY(0) scale(0.995); }
  .primary-btn span { font-size: 15px; line-height: 1; }
  .modal-foot {
    margin-top: 14px;
    text-align: center;
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(127, 148, 138, 0.65);
  }

  /* end screens */
  .end-modal { text-align: center; width: min(460px, 100%); padding-top: 34px; }
  .end-icon {
    width: 84px; height: 84px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 40px;
    border: 1px solid rgba(231,201,121,0.35);
    background:
      radial-gradient(circle at 40% 30%, rgba(255,255,255,0.18), transparent 50%),
      linear-gradient(160deg, rgba(231,201,121,0.18), rgba(231,201,121,0.03));
    box-shadow: 0 0 44px rgba(231,201,121,0.14), inset 0 1px 0 rgba(255,255,255,0.14);
    animation: iconFloat 3s ease-in-out infinite;
  }
  .end-modal h2 { font-size: clamp(30px, 5vw, 40px); }
  .end-modal .modal-sub { margin: 9px auto 0; }
  .end-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 22px 0;
  }
  .end-stat {
    padding: 12px 8px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.22);
  }
  .end-stat b {
    display: block;
    font-family: var(--serif);
    font-size: 18px;
    color: var(--gold-hot);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
  }
  .end-stat span {
    display: block;
    margin-top: 4px;
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* ===================== animations ===================== */
  @keyframes dealIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.82) rotate(-6deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
  }
  @keyframes turnPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 0 0 0 rgba(98,230,210,0.35), inset 0 1px 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 0 0 6px rgba(98,230,210,0), inset 0 1px 0 rgba(255,255,255,0.2); }
  }
  @keyframes winnerGlow {
    from { box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 0 12px rgba(231,201,121,0.35), inset 0 1px 0 rgba(255,255,255,0.2); }
    to { box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 0 28px rgba(231,201,121,0.7), inset 0 1px 0 rgba(255,255,255,0.2); }
  }
  @keyframes bannerIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes logIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes modalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
  @keyframes dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
  }
  @keyframes nextPulse {
    0%, 100% { box-shadow: 0 8px 26px rgba(231,201,121,0.18), inset 0 1px 0 rgba(255,255,255,0.65); }
    50% { box-shadow: 0 8px 34px rgba(231,201,121,0.4), inset 0 1px 0 rgba(255,255,255,0.65); }
  }
  @keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }

  /* ===================== responsive ===================== */
  @media (max-width: 1180px) {
    .layout { grid-template-columns: minmax(0, 1fr) 268px; }
    .seat { width: 138px; }
    .seat.human { width: 184px; }
    .hole { --cw: 31px; }
    .seat.human .hole { --cw: 55px; }
    .who .name { max-width: 84px; }
    .btn { min-width: 78px; padding: 10px 12px; }
    .raise-box { min-width: 158px; }
  }
  @media (max-width: 980px) {
    body { overflow: auto; }
    #app { height: auto; min-height: 100dvh; padding: 12px 12px 16px; }
    .layout { grid-template-columns: 1fr; gap: 12px; }
    .sidebar { flex-direction: row; gap: 10px; }
    .log-panel { min-height: 150px; max-height: 190px; flex: 1; }
    .legend-panel { display: none; }
    .table-shell { width: min(100%, 760px); }
    .hud-item { min-width: 62px; padding: 2px 10px; }
    .brand h1 { font-size: 15px; }
    .brand p { display: none; }
    .actionbar { flex-wrap: wrap; gap: 10px; }
    .turn-info { min-width: 150px; max-width: 220px; }
    .controls { flex-wrap: wrap; }
    .raise-box { max-width: none; }
  }
  @media (max-width: 760px) {
    .topbar { gap: 8px; }
    .brand-mark { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
    .brand h1 { font-size: 12px; letter-spacing: 0.2em; }
    .hud { gap: 0; }
    .hud-item { min-width: 0; padding: 0 8px; }
    .hud-item span { font-size: 6.5px; letter-spacing: 0.12em; }
    .hud-item b { font-size: 10px; }
    .hud-item.stack-item { display: none; }
    .icon-btn { width: 30px; height: 30px; margin-left: 4px; font-size: 12px; }
    .table-shell { width: 100%; aspect-ratio: 1 / 1.16; }
    .table { inset: 6px 0; }
    .felt { inset: 11px; }
    .felt-brand { top: 22%; }
    .felt-brand strong { font-size: 24px; }
    .center { top: 45%; gap: 8px; width: 84%; }
    .community { --cw: 38px; gap: 4px; min-height: 54px; }
    .pot-pill { padding: 4px 13px 5px; min-width: 105px; gap: 7px; }
    .pot-value { font-size: 18px; }
    .table-msg { font-size: 8px; letter-spacing: 0.16em; }
    .summary { padding: 8px 12px; border-radius: 11px; }
    .summary b { font-size: 13px; }
    .summary span { font-size: 8px; letter-spacing: 0.1em; }
    .seat { width: 78px; gap: 3px; }
    .seat.human { width: 156px; top: 86%; gap: 5px; }
    .seat-top { min-width: 0; padding: 3px 6px 3px 4px; gap: 4px; border-radius: 8px; }
    .seat.human .seat-top { min-width: 118px; padding: 5px 11px 5px 6px; }
    .avatar { width: 22px; height: 22px; font-size: 11px; border-width: 1px; }
    .seat.human .avatar { width: 32px; height: 32px; font-size: 16px; }
    .who { gap: 0; }
    .who .name { font-size: 8.5px; max-width: 48px; }
    .who .stack { font-size: 8px; }
    .seat.human .who .name { font-size: 11px; max-width: 80px; }
    .seat.human .who .stack { font-size: 10px; }
    .dealer-chip { width: 13px; height: 13px; font-size: 6px; }
    .badge { font-size: 5.5px; padding: 1px 3px; letter-spacing: 0.05em; }
    .hole { --cw: 22px; gap: 2px; min-height: 32px; }
    .seat.human .hole { --cw: 50px; min-height: 70px; gap: 5px; }
    .bet { font-size: 7.5px; padding: 2px 6px 2px 4px; gap: 3px; bottom: -16px; }
    .bet::before { width: 7px; height: 7px; }
    .seat.human .bet { top: -20px; }
    .bubble { font-size: 6.5px; padding: 3px 6px; top: -23px; }
    .actionbar { padding: 10px 11px; min-height: 0; border-radius: 14px; position: sticky; bottom: 6px; z-index: 30; backdrop-filter: blur(10px); }
    .summary-mobile {
      display: flex !important;
      flex: 1 0 100%;
      width: 100%;
      max-width: none;
      padding: 8px 12px;
      gap: 3px;
      margin-bottom: 2px;
    }
    .summary-mobile b { font-size: 13px; }
    .summary-mobile span { font-size: 8px; letter-spacing: 0.1em; }
    .center > .summary { display: none !important; }
    .turn-info { width: 100%; max-width: none; min-width: 0; font-size: 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
    .turn-info b { font-size: 11px; margin: 0; }
    .controls { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 6px; }
    .btn { padding: 9px 6px; min-width: 0; font-size: 9.5px; border-radius: 9px; gap: 4px; }
    .btn kbd { display: none; }
    .btn.next { width: 100%; min-width: 0; margin-left: 0; }
    #btnFold { grid-column: 1; grid-row: 1; }
    #btnCall { grid-column: 2; grid-row: 1; }
    #btnAllIn { grid-column: 3; grid-row: 1; }
    .raise-box { grid-column: 1 / span 2; grid-row: 2; min-width: 0; max-width: none; }
    #btnRaise { grid-column: 3; grid-row: 2; }
    .sidebar { flex-direction: column; }
    .log-panel { max-height: 170px; min-height: 140px; }
    .modal { padding: 24px 20px 22px; border-radius: 18px; }
    .field-grid { gap: 10px; margin-top: 18px; }
    .field input { padding: 10px 12px; font-size: 13px; }
    .money-input input { padding-left: 26px; }
  }
  @media (max-width: 420px) {
    .seat { width: 72px; }
    .who .name { max-width: 42px; }
    .community { --cw: 33px; }
    .seat.human { width: 144px; }
    .seat.human .hole { --cw: 46px; }
    .hud-item { padding: 0 6px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
  }
  /* ===================== 3D STAGE ===================== */
  .stage-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
  }
  .stage {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(231, 201, 121, 0.16);
    background: #030706;
    box-shadow:
      0 30px 80px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  #scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
    z-index: 0;
  }
  #scene.dragging { cursor: grabbing; }
  .stage-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
      radial-gradient(ellipse at 50% 46%, transparent 34%, rgba(0, 0, 0, 0.28) 70%, rgba(0, 0, 0, 0.68) 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 18%, transparent 78%, rgba(0, 0, 0, 0.42) 100%);
  }
  .stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: 22px;
    box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.55);
  }
  .seat-layer {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    overflow: hidden;
  }

  /* seat labels projected from 3D */
  .seat3d {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 148px;
    pointer-events: none;
    transition: opacity 0.25s ease, filter 0.25s ease;
    will-change: left, top;
  }
  .seat3d .plate {
    display: flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    min-width: 112px;
    max-width: 148px;
    padding: 5px 10px 5px 5px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
      linear-gradient(180deg, rgba(19, 35, 28, 0.93), rgba(5, 12, 9, 0.95));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
  }
  .seat3d .plate::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 8px;
    height: 8px;
    background: rgba(7, 14, 11, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(-50%) rotate(45deg);
  }
  .seat3d .avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    line-height: 1;
    background:
      radial-gradient(circle at 32% 24%, rgba(255,255,255,0.3), transparent 55%),
      radial-gradient(circle at 65% 80%, rgba(0,0,0,0.35), transparent 60%),
      var(--accent, #345);
    border: 1.5px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  .seat3d .who {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .seat3d .name {
    font-size: 10.5px;
    font-weight: 800;
    color: #eef4ee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 92px;
    letter-spacing: 0.02em;
  }
  .seat3d .stack {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .seat3d .stack.low { color: #ff9a9d; }
  .seat3d .badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
  }
  .seat3d .badges:empty { display: none; }
  .seat3d .bet {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 4px;
    border-radius: 999px;
    border: 1px solid rgba(231, 201, 121, 0.4);
    background: rgba(4, 10, 8, 0.92);
    color: var(--gold-hot);
    font-size: 8.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }
  .seat3d .bet::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff3c2, #d8b355 45%, #8f6c1c 100%);
    border: 1px solid #f9e7a6;
  }
  .seat3d .bet.show { opacity: 1; transform: translateY(0); }
  .seat3d .bubble {
    position: absolute;
    top: -27px;
    left: 50%;
    transform: translate(-50%, 3px);
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(231, 201, 121, 0.32);
    background: rgba(4, 10, 8, 0.95);
    color: var(--gold);
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.18s, transform 0.22s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
  .seat3d .bubble.show { opacity: 1; transform: translate(-50%, 0); }
  .seat3d.active .plate {
    border-color: rgba(98, 230, 210, 0.85);
    box-shadow: 0 0 0 1px rgba(98, 230, 210, 0.5), 0 0 28px rgba(98, 230, 210, 0.3), 0 10px 24px rgba(0,0,0,0.42);
  }
  .seat3d.active .avatar { animation: turnPulse 1.5s ease-in-out infinite; }
  .seat3d.winner .plate {
    border-color: rgba(255, 226, 160, 0.95);
    box-shadow: 0 0 0 1px rgba(231, 201, 121, 0.7), 0 0 34px rgba(231, 201, 121, 0.42), 0 10px 24px rgba(0,0,0,0.42);
  }
  .seat3d.winner .avatar { animation: winnerGlow 1.3s ease-in-out infinite alternate; }
  .seat3d.folded { opacity: 0.5; filter: saturate(0.45); }
  .seat3d.out { opacity: 0.33; filter: saturate(0.35); }
  .seat3d.out .bet { display: none; }

  /* pot badge projected to the table */
  .pot-badge {
    position: absolute;
    left: 50%;
    top: 16px;
    z-index: 7;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 5px 16px 6px;
    border-radius: 12px;
    border: 1px solid rgba(231, 201, 121, 0.34);
    background:
      linear-gradient(180deg, rgba(6, 13, 10, 0.78), rgba(3, 8, 6, 0.66));
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .pot-badge .pot-label {
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.2;
  }
  .pot-badge .pot-value {
    font-family: var(--serif);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    line-height: 1.1;
    color: var(--gold-hot);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 18px rgba(231, 201, 121, 0.32);
  }
  .pot-badge .pot-sub {
    font-size: 6.5px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(127, 148, 138, 0.85);
    white-space: nowrap;
  }
  .pot-badge.final { border-color: rgba(231, 201, 121, 0.62); }
  .pot-badge.final .pot-label { color: var(--gold); }

  /* hero plate */
  .hero-plate {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 8px;
    border-radius: 14px;
    border: 1px solid rgba(231, 201, 121, 0.3);
    background:
      linear-gradient(180deg, rgba(31, 27, 16, 0.92), rgba(7, 12, 9, 0.94));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.25s, border-color 0.25s, box-shadow 0.25s;
  }
  .hero-plate .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #2a210d;
    background: radial-gradient(circle at 32% 24%, #fff3c2, #e7c979 48%, #a9842f 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }
  .hero-plate .who { display: flex; flex-direction: column; gap: 1px; }
  .hero-plate .name {
    font-size: 12px;
    font-weight: 800;
    color: #f4f1e6;
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-plate .stack {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
  }
  .hero-plate .stack.low { color: #ff9a9d; }
  .hero-plate .badges { display: flex; flex-wrap: wrap; gap: 3px; max-width: 120px; }
  .hero-plate .badges:empty { display: none; }
  .hero-plate .hero-bet {
    position: absolute;
    right: 9px;
    top: -12px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 4px;
    border-radius: 999px;
    border: 1px solid rgba(231, 201, 121, 0.4);
    background: rgba(4, 10, 8, 0.92);
    color: var(--gold-hot);
    font-size: 8px;
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .hero-plate .hero-bet::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff3c2, #d8b355 45%, #8f6c1c 100%);
    border: 1px solid #f9e7a6;
  }
  .hero-plate .hero-bet.show { opacity: 1; }
  .hero-plate.active {
    border-color: rgba(98, 230, 210, 0.8);
    box-shadow: 0 0 0 1px rgba(98, 230, 210, 0.42), 0 0 32px rgba(98, 230, 210, 0.24), 0 12px 30px rgba(0,0,0,0.45);
  }
  .hero-plate.folded { opacity: 0.56; filter: saturate(0.5); }
  .hero-plate.out { opacity: 0.32; filter: saturate(0.3); }
  .hero-plate.winner {
    border-color: rgba(255, 226, 160, 0.9);
    box-shadow: 0 0 0 1px rgba(231, 201, 121, 0.6), 0 0 36px rgba(231, 201, 121, 0.3), 0 12px 30px rgba(0,0,0,0.45);
  }

  /* stage summary */
  .stage > .summary {
    position: absolute;
    left: 50%;
    top: 8%;
    z-index: 20;
    width: min(520px, 90%);
    max-width: none;
    animation: bannerIn3d 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
  }
  @keyframes bannerIn3d {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  .stage-hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 9;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(3, 8, 6, 0.55);
    color: rgba(180, 198, 188, 0.65);
    font-size: 8.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    pointer-events: none;
    transition: opacity 0.8s;
    backdrop-filter: blur(5px);
  }
  .stage-hint.hidden { opacity: 0; }

  .stage-loading {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #030706;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: opacity 0.45s;
  }
  .stage-loading.done { opacity: 0; pointer-events: none; }
  .stage-loading span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(231, 201, 121, 0.2);
    border-top-color: var(--gold);
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .webgl-error {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 40%, rgba(30, 70, 55, 0.35), rgba(2, 6, 4, 0.92));
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
  }
  .webgl-error b { color: var(--text); font-family: var(--serif); font-size: 24px; font-weight: 600; }
  .webgl-error a { color: var(--gold); }

  .side-note {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: rgba(7, 14, 11, 0.66);
    color: var(--muted);
    font-size: 8.5px;
    line-height: 1.6;
    letter-spacing: 0.06em;
    text-align: center;
  }
  .side-note a { color: var(--gold); text-decoration: none; }
  .side-note a:hover { text-decoration: underline; }
  .brand .tag3d {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(98, 230, 210, 0.4);
    color: var(--cyan);
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.16em;
    vertical-align: 2px;
  }
  .seg.two { grid-template-columns: 1fr 1fr; }
  .quality-field { margin-top: 2px; }
  .quality-field .seg button { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
  .quality-note {
    font-size: 8px;
    line-height: 1.5;
    color: rgba(127, 148, 138, 0.75);
    letter-spacing: 0.04em;
  }
  .setup-link { color: var(--gold); text-decoration: none; }
  .setup-link:hover { text-decoration: underline; }

  @media (max-width: 980px) {
    .stage-wrap { height: 60vh; min-height: 380px; }
    .stage { border-radius: 18px; }
    .stage::after { border-radius: 18px; }
    .sidebar { flex-direction: column; }
    .log-panel { min-height: 150px; max-height: 190px; }
    .hero-plate { display: none; }
    .stage-hint { right: 10px; bottom: 10px; font-size: 7px; }
  }
  @media (max-width: 760px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    #app { width: 100%; max-width: 100vw; min-width: 0; }
    .topbar, .brand, .hud, .layout, .stage-wrap, .actionbar, .controls { min-width: 0; }
    #cameraBtn { display: none; }
    .brand .tag3d { display: none; }
    .brand h1 { font-size: 12px; letter-spacing: 0.16em; }
    .stage-wrap { height: 57vh; min-height: 360px; }
    .summary-mobile[hidden] { display: none !important; }
    .stage > .summary { display: none !important; }
    .seat3d { width: 80px; transform: translate(-50%, 0); }
    .seat3d .plate { min-width: 0; max-width: 80px; padding: 2px 4px 2px 3px; gap: 3px; border-radius: 8px; }
    .seat3d .avatar { width: 20px; height: 20px; font-size: 10px; border-width: 1px; }
    .seat3d .name { font-size: 7.5px; max-width: 46px; }
    .seat3d .stack { font-size: 7.5px; }
    .seat3d .badges { display: none; }
    #scene { touch-action: pan-y; cursor: default; }
    .seat3d .bet { font-size: 6.5px; padding: 1px 4px 1px 3px; gap: 2px; bottom: -14px; }
    .seat3d .bet::before { width: 6px; height: 6px; }
    .seat3d .bubble { display: none; }
    .side-note { display: none; }
    .pot-badge { padding: 3px 10px 4px; }
    .pot-badge .pot-value { font-size: 16px; }
    .pot-badge .pot-label { font-size: 6px; }
    .pot-badge .pot-sub { font-size: 5.5px; }
    .stage-hint { display: none; }
  }

  /* compact hero plate stays visible on phones */
  @media (max-width: 760px) {
    .hero-plate {
      display: flex;
      left: 10px;
      bottom: 10px;
      padding: 4px 9px 4px 5px;
      gap: 6px;
      border-radius: 10px;
    }
    .hero-plate .avatar { width: 28px; height: 28px; font-size: 15px; }
    .hero-plate .who { gap: 0; }
    .hero-plate .name { font-size: 10px; max-width: 84px; }
    .hero-plate .stack { font-size: 9.5px; }
    .hero-plate .badges { gap: 2px; max-width: 92px; }
    .hero-plate .badge { font-size: 5px; padding: 1px 2px; }
    .hero-plate .hero-bet { top: -10px; font-size: 6.5px; padding: 1px 4px 1px 3px; }
    .hero-plate .hero-bet::before { width: 6px; height: 6px; }
  }
  @media (max-width: 360px) {
    .hud-item:nth-child(2), .hud-item:nth-child(3) { display: none; }
    .hud-item.stack-item { display: flex; }
    .brand h1 { font-size: 11px; letter-spacing: 0.12em; }
    .btn { font-size: 8.5px; padding: 8px 4px; }
    .btn.allin { font-size: 8px; }
  }
