/* Triple Take's table: the cards on their pane at the left, the trios and
   the dock at the right, on the room's structure (games/room/room.css),
   from the tokens in triple-take.css. Steadiness first: the cards are as
   big as the pane allows and never move unless three are taken (table.js
   fit); the dock keeps its place at the foot of the side column. */

/* ── the frame ───────────────────────────────────────────────────────── */
.felt.triple { position: relative; height: calc(100dvh - 2 * var(--frame)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.felt.triple.docked { grid-template-columns: minmax(0, 1fr) 320px; }
.triple .logdock { min-height: 0; display: flex; flex-direction: column; }
.triple .logdock:empty { display: none; }
.triple .logdock .gamelog { flex: 1; }
.triple .tablemain { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.triple .gamelog.drawer { position: absolute; z-index: 30; right: 14px; top: 64px; bottom: 24px; width: min(360px, calc(100% - 28px)); box-shadow: -10px 10px 30px rgba(23, 33, 49, .25); }
.triple .logbtn.on { background: var(--pick-tint); box-shadow: var(--pick-ring); }
.triple .bar .more svg { display: block; }
.triple .bar .title { font: var(--display-weight) var(--t-bar, 17px)/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.triple .tttwhere { font: 500 var(--t-bar, 17px)/1.2 var(--ui-font); color: var(--soft); }

.ttstage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 340px); gap: 18px; }
.ttboardcol { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.ttside { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.ttflex { flex: 1; }

/* ── the deck and the clock ─────────────────────────────────────────── */
.ttdeck { display: flex; align-items: center; gap: 14px; min-height: 32px; color: var(--soft); font-weight: 600; font-size: var(--t-note); }
/* (both lines the same height, so their middles line up whatever's in them) */
.ttdeck p { margin: 0; height: 28px; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ttclock { margin-left: auto !important; }
.ttfig { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.ttstack { position: relative; width: 34px; height: 24px; flex: none; }
.ttstack i { position: absolute; inset: 0; border-radius: 4px; background: #14358a; border: 1.5px solid #fff; box-shadow: 0 1px 2px rgba(23, 33, 49, .3); }
.ttstack i:nth-child(2) { transform: translate(3px, -3px); }
.ttstack i:nth-child(3) { transform: translate(6px, -6px); }

/* ── the pane and the cards ─────────────────────────────────────────── */
.ttpane { position: relative; flex: 1; min-height: 0; border-radius: 16px; background: var(--pane); border: 1px solid var(--pane-edge); display: grid; place-items: center; overflow: hidden; }
.ttboard { display: grid; grid-template-columns: repeat(var(--cols, 4), var(--cw, 160px)); gap: var(--gap, 14px); justify-content: center; align-content: center; padding: 8px; }
.ttboard .ttcard { width: var(--cw, 160px); }
.ttboard.frozen .ttcard:not(.wrong) { opacity: .55; }
.ttcard .ttkey { position: absolute; bottom: 4px; right: 6px; font: 700 10px/1 var(--ui-font); color: var(--soft); pointer-events: none; }

/* a deal (table.js deal): a card's place stays empty until it's down; on
   its way from the deck it's a card's back, the deck's blue */
.ttboard .ttcard.ttunseen { visibility: hidden; }
.ttback { box-sizing: border-box; border-radius: 8%/12.5%; background: #14358a; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(23, 33, 49, .3); }

/* the stage (announce.js) over the pane: the three cards of the moment */
.ttbanner .ttart { display: flex; gap: 10px; }
.ttbanner .ttart .ttcard { width: 96px; }

/* a trio's stage (table.js trioStage): the house's band, carrying only
   this. Its cards are played down one at a time, each at its --at, then
   who found it; so the band's own entrance for its art and words is set
   aside (the band itself still slides in and away as every stage does). */
.ttplayed .house-announce-text { display: none; }
.ttplayed .house-announce-art { opacity: 1 !important; transform: none !important; }
.ttplay { display: grid; grid-template-areas: "kick ." "cards who"; align-items: center; justify-content: center; column-gap: 28px; row-gap: 10px; }
.ttplay .ttkick { grid-area: kick; justify-self: center; margin: 0; font-size: var(--t-kicker, 12px); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .85; }
.ttplay .ttart { grid-area: cards; gap: 12px; }
.ttplay .ttart .ttcard { width: 120px; }
.ttplay .ttwho { grid-area: who; text-align: left; display: grid; gap: 4px; }
.ttfound { margin: 0; display: flex; align-items: center; gap: 12px; font: var(--display-weight) clamp(30px, 5.5vw, 52px)/1.1 var(--display); }
.ttfound svg { flex: none; }
.ttsat { margin: 0; max-width: 32ch; font-size: var(--t-lead, 16px); line-height: 1.4; }
@media (prefers-reduced-motion: no-preference) {
  .ttplayed .ttart .ttcard { animation: ttplaydown 300ms var(--at, 0ms) cubic-bezier(.3, .7, .3, 1.2) both; }
  /* (centered alone at first, by --shift (table.js); then aside, as who found it writes out to the right: D21) */
  .ttplayed .ttart, .ttplayed .ttkick { animation: ttaside 460ms var(--aside-at, 0ms) cubic-bezier(.45, 0, .2, 1) both; }
  .ttplayed .ttwho { animation: ttwrite 620ms calc(var(--at, 0ms) + 80ms) cubic-bezier(.3, .4, .2, 1) both; }
}
/* (reduced motion: nothing travels; each still appears at its moment, in order) */
@media (prefers-reduced-motion: reduce) {
  .ttplayed .ttart .ttcard, .ttplayed .ttwho { animation: ttappear 120ms var(--at, 0ms) ease-out both; }
}
@keyframes ttplaydown {
  from { opacity: 0; transform: translateY(-34px) rotate(-7deg) scale(1.15); }
  60% { opacity: 1; transform: translateY(3px) rotate(1deg) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes ttaside { from { transform: translateX(var(--shift, 0px)); } to { transform: none; } }
/* (written out: uncovered left to right, as a line of type is) */
@keyframes ttwrite { from { clip-path: inset(-8px 100% -8px 0); } to { clip-path: inset(-8px -8px -8px 0); } }
@keyframes ttappear { from { opacity: 0; } to { opacity: 1; } }

/* ── the side: trios each, and the dock ─────────────────────────────── */
.ttseats, .ttdock { background: var(--panel); border: var(--panel-edge); border-radius: var(--panel-radius); padding: 12px 14px; }
.tth { margin: 0 0 6px; font: var(--display-weight) var(--t-heading)/1.2 var(--display); color: var(--ink); }
.ttrows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ttrow { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; font-weight: 600; }
.ttrow.you { background: color-mix(in srgb, var(--turn) 10%, transparent); }
.ttname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttbot { font-size: 11px; font-weight: 700; border: 1px solid var(--soft); color: var(--soft); border-radius: 999px; padding: 0 6px; margin-left: 6px; }
.ttlvl { font-size: 12px; color: var(--soft); font-weight: 500; margin-left: 4px; }
.ttfrozen { font-size: 12px; font-weight: 700; color: var(--bad); }
.ttrow .ttfig { font-size: 22px; min-width: 1.4em; text-align: right; }
.ttunit { font-size: 12px; color: var(--soft); font-weight: 600; width: 34px; }
.ttdock { min-height: 104px; }
.ttdock.live { border: 2px solid var(--turn); }
.ttst { margin: 0; line-height: 1.4; }
.ttgo { color: var(--turn); }
.ttbad { color: var(--bad); }
.ttdockrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-bottom: 4px; }
.ttslots { display: flex; gap: 6px; }
.ttslots i { width: 26px; height: 18px; border-radius: 4px; border: 2px dashed var(--soft); box-sizing: border-box; }
.ttslots i.on { border: 2px solid var(--turn); background: color-mix(in srgb, var(--turn) 25%, transparent); }
.ttnote { font-size: var(--t-note); color: var(--soft); font-weight: 600; }
.ttclear { margin-left: auto; }
.ttchips { display: none; }

/* ── the result sheet's piles ───────────────────────────────────────── */
.ttresult { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ttresult li { display: flex; align-items: baseline; gap: 10px; padding: 6px 4px; border-top: 1px solid #dfe4ea; }
.ttresult li.won .ttrname { font-weight: 800; }
.ttrname { flex: 1; min-width: 0; font-weight: 600; }
.ttrname small { font-weight: 500; color: var(--soft); }
.ttpile { display: flex; flex: none; max-width: 40%; overflow: hidden; }
.ttpile i { width: 12px; height: 18px; border-radius: 3px; background: #fff; border: 1px solid #b9c3cf; margin-left: -6px; box-shadow: 0 1px 1px rgba(23, 33, 49, .15); flex: none; }
.ttpile i:first-child { margin-left: 0; }
.ttresult .ttfig { font-size: 20px; min-width: 1.4em; text-align: right; }
/* (a name and its count share a baseline; the mark and the pile sit in the row's middle) */
.ttresult li > svg, .ttresult .ttpile { align-self: center; }

/* ── a phone: the chips, the cards, the dock ────────────────────────── */
@media (max-width: 640px) {
  #app { padding: 0; }
  .felt.triple { height: 100dvh; gap: 0; }
  .triple .tablemain { gap: 6px; }
  .felt.triple .bar .tools { display: none; }
  .felt.triple .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .triple .tttwhere { display: none; }
  .ttstage { display: flex; flex-direction: column; gap: 8px; }
  .ttside { display: contents; }
  .ttchips { order: 1; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
  .ttchips:has(> :nth-child(5)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ttchip { height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--chip); border: var(--chip-edge); border-radius: var(--chip-radius); }
  .ttchip.you { border: 2px solid var(--turn); }
  .ttchip .ttfig { font-size: 19px; }
  .ttboardcol { order: 2; flex: 1; }
  .ttseats { display: none; }
  .ttflex { display: none; }
  /* (the dock as short as its two lines: the board takes the height, David's call of 2026-11-09) */
  .ttdock { order: 3; min-height: 0; padding: 8px 8px 8px 12px; display: flex; align-items: center; gap: 10px; }
  .ttdock .ttst { flex: 1; min-width: 0; }
  /* (one row: what to do, and Clear; your picks are the ringed cards, and the line says how many more) */
  .ttdockrow { margin: 0; padding: 0; flex: none; }
  .ttdockrow .ttslots, .ttdockrow .ttnote { display: none; }
  .ttlong { display: none; }
  /* (two lines kept for whatever it says, so the board doesn't change size under you as it changes) */
  .ttst { min-height: calc(2 * 1.4em); }
  .ttboard { padding: 0; }
  .felt.triple.alone .ttchips { display: none; }
  /* (a trio's stage on a phone: its three cards under the words, not squeezing them) */
  .ttbanner .house-announce-band { flex-direction: column; gap: 10px; }
  .ttbanner .ttart { gap: 8px; }
  .ttbanner .ttart .ttcard { width: 84px; }
  .ttplay { grid-template-areas: "kick" "cards" "who"; justify-items: center; }
  .ttplay .ttwho { text-align: center; justify-items: center; }
  .ttfound { font-size: 32px; gap: 10px; }
}

/* phones on their side: the cards at the left, the dock at the right */
@media (max-height: 520px) and (min-width: 560px) {
  #app { padding: 0; }
  .felt.triple { height: 100dvh; border: 0; border-radius: 0; gap: 0; }
  .felt.triple .bar .tools { display: none; }
  .felt.triple .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 32px; }
  .ttstage { grid-template-columns: minmax(0, 1fr) 240px; gap: 10px; }
  .ttdeck { min-height: 24px; }
  .ttseats { padding: 8px 10px; overflow: auto; }
}

@media (pointer: coarse) {
  .felt.triple .bar .btn { min-height: 44px; }
  .ttclear { min-height: 44px; }
}
