/* ================= v53: nothing resident over the table =================
   Real-device feedback (v52): the centre info panel sat on the
   far seat's pond and hid its discards, and the three top-band
   plates were wide enough to overlap each other (the middle
   plate covered the right plate's score). v53 structure: the
   stage is a vertical stack of bands in normal flow — a top
   band holding the three CPU chips in one equal-width row and
   the info strip under them, then the canvas, then a bottom
   band with your own plate. The canvas carries NO resident DOM
   at all: only the transient fx layer, the call buttons (the
   long-standing exception) and speech bubbles ever appear over
   it, so the wall, all four ponds, every hand row and every
   meld stay fully visible at any width. */
#table.stage-mode {
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px; overflow: hidden;
}
#stageTop { display: flex; flex-direction: column; gap: 5px; }
#stageBottom { display: flex; }
#stage3d { overflow: hidden; height: 524px; }

/* --- CPU chips: three equal columns, nothing overlaps --- */
#stageTop #seatPlates {
  position: static; inset: auto; z-index: auto;
  display: flex; gap: 6px; pointer-events: none;
}
#stageTop #seatPlates:empty, #stageTop #hudCenter:empty, #stageBottom #myPlate:empty { display: none; }
.char-plate.chip {
  flex: 1 1 0; min-width: 0; position: static; transform: none;
  flex-direction: row; align-items: center; gap: 5px;
}
.char-plate.chip .char-face { width: 52px; height: 57px; }
.char-plate.chip .face-wrap { position: relative; flex: 0 0 auto; display: block; }
.char-plate.chip .plate-body { min-width: 0; flex: 1 1 auto; padding: 3px 7px 4px; }
.char-plate.chip .plate-name { font-size: 13.5px; }
.char-plate.chip .plate-score { font-size: 14.5px; }
.char-plate.chip .ftag {
  position: absolute; z-index: 2; font-size: 8.5px; font-weight: 900; line-height: 1.55;
  padding: 0 3px; border-radius: 3px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.char-plate.chip .ftag.oya { top: 2px; right: 2px; background: #ffd34d; color: #241a02; }
.char-plate.chip .ftag.ri { top: 2px; left: 2px; background: var(--accent); color: #fff; }

/* --- info strip: the old centre panel's data, off the table --- */
#stageTop #hudCenter.v51 {
  position: static; transform: none; z-index: auto;
  flex-direction: row; align-items: center; justify-content: center;
  gap: 12px; padding: 3px 10px 4px; pointer-events: none;
  border-radius: 8px;
}
#stageTop #hudCenter .cp-left b { font-size: 18px; }
#stageTop #hudCenter .cp-sticks { font-size: 11px; }

/* --- your own plate: same plate, now in the bottom band --- */
#stageBottom #myPlate .char-plate.abs { position: static; }

/* ================= v105: your plate's info panel =================
   A small tappable panel riding on the right of YOUR plate
   (seat 0 only; the CPU plates are untouched). The plate
   itself is pointer-events:none — the panel opts back in, so
   only the panel answers taps and nothing else on the card
   changes behaviour. Pages cycle on tap; the dots under the
   content mark the current page. The only page is the pure
   score gaps (see infoPageDiffHTML). */
.info-panel {
  pointer-events: auto; cursor: pointer; font: inherit; text-align: left;
  flex: 0 1 auto; min-width: 0; margin-left: 2px;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  background: rgba(6,20,38,.88); border: 1.5px solid rgba(140,190,230,.55); border-radius: 8px;
  color: #eaf3fb; padding: 4px 8px 3px;
  box-shadow: inset 0 0 10px rgba(0,0,0,.45);
  -webkit-tap-highlight-color: transparent;
}
.info-panel:focus-visible { outline: 2px solid #ffd34d; outline-offset: 1px; }
.ip-row { display: flex; align-items: baseline; gap: 7px; line-height: 1.45; white-space: nowrap; }
.ip-name { font-size: 11px; font-weight: 900; color: #cfe3f2; }
.ip-diff { font-size: 12.5px; font-weight: 900; font-variant-numeric: tabular-nums; margin-left: auto; }
/* sign colours follow the settle screen's delta reading, from
   your side: a + gap means that opponent is ahead of you
   (red), a − gap means you are ahead (the gain blue), 0 level */
.ip-diff.behind { color: #ff6a5e; }
.ip-diff.ahead { color: #57b6ff; }
.ip-diff.even { color: #9db4a5; }
.ip-dots { display: flex; gap: 4px; justify-content: center; padding-top: 2px; }
.ip-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(190,220,245,.35); }
.ip-dot.on { background: #ffd34d; }
@media (max-width: 560px) {
  .info-panel { padding: 3px 6px 2px; border-radius: 7px; }
  .ip-name { font-size: 10.5px; }
  .ip-diff { font-size: 11.5px; }
  /* v105: the top bar now also carries the two sound chips —
     slim its pieces down so MENU / round / chips / 鳴き still
     share one row at phone width */
  .topbar.refbar { gap: 4px; padding: 4px 5px; }
  .topbar.refbar .btn-orange { padding: 4px 10px; font-size: 14px; }
  .topbar.refbar .sound-chip.icon-chip { width: 32px; }
  .topbar.refbar .naki-toggle.refskip { padding: 4px 8px; font-size: 13px; }
}

/* speech bubbles hug the canvas edges again (the centre panel
   they used to dodge is gone) */
#cpuBubble.bub2 { top: 8px; }

@media (max-width: 560px) {
  #table.stage-mode { padding: 5px 4px; gap: 5px; }
  /* v60: the band hugs the table — on phones the stage height
     is tied to its own width (canvas width = 100vw - 36px of
     wrap padding, table border and table padding) at the
     portrait camera's authored aspect 1.12, so the tall empty
     felt bands above the far row and below your hand are gone;
     the 500px / 66svh caps still guard short or wide viewports */
  #stage3d { height: 500px; height: min(500px, 66svh, calc((100vw - 36px) / 1.12)); }
  .char-plate.chip { gap: 4px; }
  .char-plate.chip .char-face { width: 36px; height: 40px; border-radius: 8px; }
  .char-plate.chip .plate-body { padding: 2px 4px 3px; border-radius: 6px; }
  .char-plate.chip .wind-badge { font-size: 9.5px; padding: 0 3px; }
  .char-plate.chip .plate-name { font-size: 11.5px; }
  .char-plate.chip .plate-score { font-size: 12.5px; }
  .char-plate.chip .plate-top { gap: 3px; }
  #stageTop #hudCenter.v51 { gap: 8px; padding: 2px 6px 3px; }
  #stageTop #hudCenter .cp-left { font-size: 11.5px; }
  #stageTop #hudCenter .cp-left b { font-size: 16px; }
  #stageTop #hudCenter .cp-sticks { font-size: 10px; gap: 7px; }
  #stageTop #hudCenter .cp-lbl { font-size: 9.5px; }
}

/* ================= v64: play log =================
   The log panel is a plain monospace block inside the usual
   overlay card, built to be copied and pasted into chat
   verbatim. (The on-screen yaochu count chip that used to
   sit in the status line was removed by user request; the
   count still lives in the log text for diagnostics.) */
.log-view {
  max-height: 46vh; overflow-y: auto; margin: 10px 0;
  background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; text-align: left;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-all;
}

@media (max-width: 560px) {
  #stage3d { height: 500px; height: min(500px, 62svh, calc((100vw - 36px) / 1.26)); }
}
