/* Shared table UI: design tokens (docs/ux/table-v2-spec.md §3). Owner: UX lead (S0).
   Everything the tables share is a custom property on .tui, so a table can
   override a value on its own root without touching these files.
   Breakpoints (CSS can't name media queries; core.js has the same strings in TableUI.MQ):
     phone portrait  the default (no query)
     phone landscape (orientation: landscape) and (max-height: 500px)
     desktop/tablet  (min-width: 900px) and (min-height: 501px)            */
.tui {
  /* colours (the tables' own dark theme) */
  --tui-bg: #0c0e11;
  --tui-panel: #151a20;
  --tui-panel-2: #1b222a;
  --tui-line: #2a333d;
  --tui-text: #e7ecf1;
  --tui-muted: #8b97a4;
  --tui-accent: #4f8cff;
  --tui-gold: #e0a83a;
  --tui-good: #3fae6a;
  --tui-bad: #d04a4a;
  /* sizes */
  --tui-tap: 44px;          /* the smallest touch target */
  --tui-top-h: 44px;        /* seat strip (phone) */
  --tui-top-h-desk: 52px;   /* top bar (desktop) */
  --tui-me-h: 44px;         /* your strip (phone) */
  --tui-hand-h: 100px;      /* hand peek row (phone) */
  --tui-hand-h-land: 76px;  /* hand row (phone on its side) */
  --tui-dock-h: 60px;       /* action dock (phone) */
  --tui-rail-w: 300px;      /* left rail (desktop) */
  --tui-side-w: 340px;      /* right rail (desktop) */
  --tui-rail-w-land: 168px; /* left rail (phone on its side) */
  --tui-side-w-land: 150px; /* right rail (phone on its side) */
  --tui-card-w: 58px;       /* board card width: phone */
  --tui-card-w-land: 46px;
  --tui-card-max: 120px;
  --tui-hand-card-w: 66px;
  --tui-radius: 10px;
  --tui-gap: 6px;
}
@media (min-width: 900px) and (min-height: 501px) {
  .tui {
    --tui-card-w: clamp(76px, 5.6vw, 118px);
    --tui-hand-card-w: clamp(84px, 5.6vw, 112px);
  }
  .tui[data-seats="3"], .tui[data-seats="4"] { --tui-opp-card-w: clamp(56px, 3.6vw, 80px); }
  .tui[data-seats="5"], .tui[data-seats="6"] { --tui-opp-card-w: clamp(50px, 3vw, 70px); }
}
/* C21: a tablet held upright (600-899px wide, taller than a phone on its side) keeps the phone layout, but its cards grow with the
   width and are held back by the height, so a short window never gets bigger cards. Phones (<600px), a phone on its side and
   the desktop layout (900px and wider) are untouched. */
@media (min-width: 600px) and (max-width: 899px) and (min-height: 501px) {
  .tui {
    --tui-card-w: clamp(58px, min(8.5vw, 6.8vh), 76px);
    --tui-hand-card-w: clamp(66px, min(10vw, 8vh), 92px);
    --tui-hand-h: calc(var(--tui-hand-card-w) * 1.395 + 8px);
  }
}
