/* =========================================================================
   GG chrome · phone layout · WEEK60 (roomy 844 + iPhone-SE 667)
   ---------------------------------------------------------------------------
   Ported from mockups 72 (roomy) and 72se. Token-only · no literal 6-digit hex.

   Every selector is scoped under [data-layout="phone"] OR [data-layout="phone-se"]
   so this stylesheet cannot affect desktop / iPad. chrome/fit.js stamps the
   attribute on .viewport based on coarse-pointer + window size.

   The phone subtree (.ph-strip.ph-opp + .ph-strip.ph-you) is base-hidden via
   .ph-strip { display: none } and shown only when one of the two phone
   attributes is active — belt-and-suspenders so it never flashes on desktop
   before fit.js runs.

   Board-anchoring model (mockup 72 / 72se): the two strips pin to the
   aspect-locked .board-area box, not the viewport. Strip bottoms always meet
   the board bottom; the menu bar (right strip) and its empty twin (left
   strip) line up at the board's lower edge.
   ========================================================================= */

/* ===== Base hide of the phone subtree (other layouts never show it) ====== */
.ph-strip {
  display: none;
}

/* ===== Stage · phone design sizes ======================================== */
[data-layout="phone"] .stage {
  width: 844px;
  height: 390px;
}
[data-layout="phone-se"] .stage {
  width: 667px;
  height: 375px;
}

/* ===== Show the phone subtree on either phone tier (column flex) ========= */
[data-layout="phone"] .ph-strip,
[data-layout="phone-se"] .ph-strip {
  display: flex;
}

/* ===== Hide desktop / iPad subtrees on phone ============================= */
[data-layout="phone"] .opp-col,
[data-layout="phone"] .right-col,
[data-layout="phone"] .fs-toggle,
[data-layout="phone"] .bottom-strip,
[data-layout="phone"] .fab-menu,
[data-layout="phone-se"] .opp-col,
[data-layout="phone-se"] .right-col,
[data-layout="phone-se"] .fs-toggle,
[data-layout="phone-se"] .bottom-strip,
[data-layout="phone-se"] .fab-menu {
  display: none;
}

/* ===== Composition · viewport-filling centred group ======================
   Centres the board + the two strips inside the scaled stage; any slack
   becomes outer screen margin. .vp-grid covers the stage so the board sits
   in the middle and the strips glue to its left/right edges. */
[data-layout="phone"] .vp-grid,
[data-layout="phone-se"] .vp-grid {
  position: absolute;
  inset: 0;
  /* §4c FIX — drop the 845px height inherited from desktop.css .vp-grid.
     With inset:0 the stage already drives sizing; the inherited explicit
     pixel height wins, pushing the centred board below the visible fold.
     height:auto lets inset:0 own the box. */
  height: auto;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 0;
}

/* ===== Board · aspect-locked hero ========================================
   Roomy (844): HEIGHT-driven · 100% tall · max-width reserves 142px strips
   plus 8px gaps either side (142+8+142+8 = 300).
   SE (667):    WIDTH-driven  · 100%-212px wide (100+6+100+6 = 212) · capped
                at 100% height so the narrow 375 doesn't distort.
   The shared #bw rule below fills whichever the .board-area resolves to. */
/* §4b FIX-2 — board proportions SACRED. Each tier drives exactly ONE axis
   and lets aspect-ratio derive the other; NO max-* on the derived axis (a
   max on the derived axis would clamp it while the driver stayed fixed →
   ratio breaks → squish). 1500/1108 is sacred. */
[data-layout="phone"] .board-area {
  position: relative;
  height: 100%;
  aspect-ratio: 1500 / 1108;
  margin: 0 auto;
  flex: 0 0 auto;
}
[data-layout="phone-se"] .board-area {
  position: relative;
  width: calc(100% - 212px);
  aspect-ratio: 1500 / 1108;
  margin: 0 auto;
  flex: 0 0 auto;
}
[data-layout="phone"] #bw,
[data-layout="phone-se"] #bw {
  width: 100%;
  height: 100%;
}

/* ===== Strips · pinned to the board box ================================== */
[data-layout="phone"] .ph-strip,
[data-layout="phone-se"] .ph-strip {
  position: absolute;
  top: 3px;
  bottom: 5px;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
[data-layout="phone"] .ph-strip.ph-opp {
  right: 100%;
  margin-right: 8px;
  width: 142px;
}
[data-layout="phone"] .ph-strip.ph-you {
  left: 100%;
  margin-left: 8px;
  width: 142px;
}
[data-layout="phone-se"] .ph-strip.ph-opp {
  right: 100%;
  margin-right: 6px;
  width: 100px;
  gap: 5px;
}
[data-layout="phone-se"] .ph-strip.ph-you {
  left: 100%;
  margin-left: 6px;
  width: 100px;
  gap: 5px;
}

/* ===== Avatar card · avatar + corner flag + 2-line name (roomy base) ===== */
[data-layout="phone"] .ph-strip .pc-card,
[data-layout="phone-se"] .ph-strip .pc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  /* §4b FIX-1 — card absorbs strip slack so the fixed controls + menu
     always fit; avatar inside flexes (min-height:0 lets it shrink). */
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
/* §4d FIX-D3 — avatar↔name breathing room, per-tier. Shared rule above
   carries everything else; only gap differs (SE is height-tight). */
[data-layout="phone"] .ph-strip .pc-card {
  gap: 10px;
}
[data-layout="phone"] .ph-strip .pc-avatar {
  /* §4b FIX-1 — avatar fills card slack (height-driven) instead of forcing
     width:100% (= big square that pushed the menu off the strip). aspect-ratio
     keeps it square; max-width:100% caps the derived width to the strip. */
  flex: 1 1 auto;
  min-height: 0;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, var(--rd-avatar-grad-from), var(--rd-avatar-grad-to));
  border: 1px solid var(--rd-gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--rd-font-serif);
  font-size: 10px;
  color: var(--rd-cream-dim);
  text-align: center;
  line-height: 1.1;
  overflow: hidden;
  position: relative;
}
[data-layout="phone"] .ph-strip .pc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
[data-layout="phone"] .ph-strip .pc-flag {
  /* §4e — flag flows INLINE before the name (reopens the 2026-06-18
     top-right corner lock per Jay's playtest). Markup unchanged: the
     .pc-flag span already sits inside .pc-name-line, before the name. */
  width: 24px;
  height: 16px;
  border: 1px solid var(--rd-overlay-light-edge);
  border-radius: 2px;
  overflow: hidden;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 5px;
  line-height: 0;
  background: var(--rd-overlay-dark-soft);
}
[data-layout="phone"] .ph-strip .pc-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}
[data-layout="phone"] .ph-strip .pc-name-line {
  flex: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
  font-family: var(--rd-font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--rd-cream);
  font-size: 15px;
  line-height: 1.1;
  text-align: center;
}
[data-layout="phone"] .ph-strip .pc-name-line span:not(.pc-flag) {
  display: inline;
}

/* ===== Clock · roomy inline ("0:15 · 3:00") ============================= */
[data-layout="phone"] .ph-strip .pc-timer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--rd-overlay-dark-soft);
  border: 1px solid var(--rd-line);
  border-radius: 5px;
  padding: 5px 8px;
  font-family: var(--rd-font-body);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-layout="phone"] .ph-strip .pc-timer .pt-move {
  color: var(--rd-cream);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.05;
}
[data-layout="phone"] .ph-strip .pc-timer .pt-move.idle {
  color: var(--rd-cream);
}
[data-layout="phone"] .ph-strip .pc-timer .pt-bank {
  color: var(--rd-cream);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.05;
}
[data-layout="phone"] .ph-strip .pc-timer .pt-move::after {
  content: '·';
  color: var(--rd-cream-dim);
  margin-left: 6px;
  font-weight: 500;
}
[data-layout="phone"] .ph-strip .pc-timer.active {
  border-color: var(--rd-gold);
  box-shadow: 0 0 8px var(--rd-gold-glow), inset 0 0 0 1px var(--rd-line);
}
[data-layout="phone"] .ph-strip .pc-timer.active.warning {
  border-color: var(--rd-warn-red);
  box-shadow: 0 0 8px var(--rd-warn-red), inset 0 0 0 1px var(--rd-line);
  /* WEEK64 §4 T3 — subtle 1s opacity pulse during the bank≤20s window.
     Keyframe + reduced-motion override live in viewport.css (shared). */
  animation: ggClockPulse 1s ease-in-out infinite;
}
/* WEEK64 §4 T3 — phone live colour cycle on the active side. */
[data-layout="phone"] .ph-strip .pc-timer .pt-move.move-active  { color: var(--rd-gold); }
[data-layout="phone"] .ph-strip .pc-timer .pt-move.move-spent   { color: var(--rd-cream); }
[data-layout="phone"] .ph-strip .pc-timer .pt-bank.bank-warning { color: var(--rd-warn-red-bright); }

/* ===== Pip · footprint icon + value ===================================== */
[data-layout="phone"] .ph-strip .pc-pip {
  /* WEEK76 §4b — DevTools geometry showed `align-items: baseline` left
     the 11px caption ~4.9px below the 15px number's optical centre.
     Switch back to `center` for true vertical-midline alignment. */
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--rd-overlay-dark-soft);
  border: 1px solid var(--rd-line);
  border-radius: 5px;
  padding: 5px 8px;
}
[data-layout="phone"] .ph-strip .pc-pip .pip-cap {
  /* §4b (WEEK78): translateY nudge removed — it only compensated for the
     profile .pp-label leak, now gone via the .pip-cap rename; caption
     aligns naturally (align-items:center + line-height:1). */
  font-family: var(--rd-font-body);
  color: var(--rd-cream-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 0;
  line-height: 1;
}
[data-layout="phone"] .ph-strip .pc-pip .pp-value {
  font-family: var(--rd-font-body);
  color: var(--rd-cream);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

/* ===== Score · labelled "Score to N" ==================================== */
[data-layout="phone"] .ph-strip .pc-score {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--rd-overlay-dark-soft);
  border: 1px solid var(--rd-line);
  border-radius: 5px;
  padding: 6px 4px;
}
[data-layout="phone"] .ph-strip .pc-score .ps-value {
  font-family: var(--rd-font-body);
  color: var(--rd-cream);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
[data-layout="phone"] .ph-strip .pc-score .ps-label {
  font-family: var(--rd-font-body);
  color: var(--rd-cream-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===== Menu bar · right strip; empty twin · left strip =================== */
[data-layout="phone"] .ph-strip .mb-bar {
  /* §4b FIX-1 — fixed-height item; .pc-card absorbs the slack so the menu
     sits at the strip bottom on any board height. .mb-empty matches the
     same height so the left strip's bottom aligns with the right. */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 40px;
  background: var(--rd-dark-veil-strong);
  border: 1px solid var(--rd-line-strong);
  border-radius: 6px;
  padding: 3px;
}
[data-layout="phone"] .ph-strip .mb-bar.mb-empty {
  /* §4d FIX-D2 — left twin reads as the score block, not the menu: subtle
     line + soft veil instead of the menu's gold-ish strong border + strong
     veil. Same height keeps the bottoms aligned. */
  justify-content: center;
  background: var(--rd-overlay-dark-soft);
  border-color: var(--rd-line);
}
[data-layout="phone"] .ph-strip .mb-bar .mb-btn {
  flex: 1 1 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rd-cream-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
[data-layout="phone"] .ph-strip .mb-bar .mb-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}
[data-layout="phone"] .ph-strip .mb-bar .mb-btn:hover,
[data-layout="phone"] .ph-strip .mb-bar .mb-btn:active {
  background: var(--rd-gold-hover-subtle);
  border-color: var(--rd-line-strong);
  color: var(--rd-cream);
}
[data-layout="phone"] .ph-strip .mb-bar .mb-btn.danger:hover,
[data-layout="phone"] .ph-strip .mb-bar .mb-btn.danger:active {
  background: var(--rd-red-tint);
  border-color: var(--rd-red-1);
  color: var(--rd-warn-red-bright);
}
[data-layout="phone"] .ph-strip .mb-bar .mb-btn.on {
  background: var(--rd-gold-fill);
  border-color: var(--rd-gold);
  color: var(--rd-gold);
}

/* ===== iPhone-SE overrides · only what differs from roomy ==============
   SE keeps every shared rule above (avatar card / pip / score block / menu
   layout) and only re-declares the SE-specific dimensions + the stacked
   clock layout. The board / strip pinning rules above are already scoped
   to BOTH phone attrs, so they don't need re-declaring here. */

[data-layout="phone-se"] .ph-strip .pc-card {
  gap: 6px;
}
[data-layout="phone-se"] .ph-strip .pc-avatar {
  /* §4b FIX-1 (SE) — same height-driven model as roomy; only border-radius
     + font-size differ on SE. */
  flex: 1 1 auto;
  min-height: 0;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, var(--rd-avatar-grad-from), var(--rd-avatar-grad-to));
  border: 1px solid var(--rd-gold);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--rd-font-serif);
  font-size: 9px;
  color: var(--rd-cream-dim);
  text-align: center;
  line-height: 1.1;
  overflow: hidden;
  position: relative;
}
[data-layout="phone-se"] .ph-strip .pc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
[data-layout="phone-se"] .ph-strip .pc-flag {
  /* §4e (SE) — flag flows INLINE before the name; same approach as
     the roomy rule, sized down a notch. */
  width: 20px;
  height: 13px;
  border: 1px solid var(--rd-overlay-light-edge);
  border-radius: 2px;
  overflow: hidden;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 4px;
  line-height: 0;
  background: var(--rd-overlay-dark-soft);
}
[data-layout="phone-se"] .ph-strip .pc-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}
[data-layout="phone-se"] .ph-strip .pc-name-line {
  flex: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
  font-family: var(--rd-font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--rd-cream);
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
}

/* SE clock · STACKED · hide the roomy `·` between move and bank ========== */
[data-layout="phone-se"] .ph-strip .pc-timer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--rd-overlay-dark-soft);
  border: 1px solid var(--rd-line);
  border-radius: 5px;
  padding: 4px 6px;
  font-family: var(--rd-font-body);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-layout="phone-se"] .ph-strip .pc-timer .pt-move {
  color: var(--rd-cream);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.05;
}
[data-layout="phone-se"] .ph-strip .pc-timer .pt-move.idle {
  color: var(--rd-cream);
}
[data-layout="phone-se"] .ph-strip .pc-timer .pt-bank {
  color: var(--rd-cream);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.05;
}
[data-layout="phone-se"] .ph-strip .pc-timer .pt-move::after {
  content: '';
  margin: 0;
}
[data-layout="phone-se"] .ph-strip .pc-timer.active {
  border-color: var(--rd-gold);
  box-shadow: 0 0 6px var(--rd-gold-glow), inset 0 0 0 1px var(--rd-line);
}
[data-layout="phone-se"] .ph-strip .pc-timer.active.warning {
  border-color: var(--rd-warn-red);
  box-shadow: 0 0 6px var(--rd-warn-red), inset 0 0 0 1px var(--rd-line);
  /* WEEK64 §4 T3 — subtle 1s opacity pulse during the bank≤20s window.
     Keyframe + reduced-motion override live in viewport.css (shared). */
  animation: ggClockPulse 1s ease-in-out infinite;
}
/* WEEK64 §4 T3 — phone-SE live colour cycle on the active side. */
[data-layout="phone-se"] .ph-strip .pc-timer .pt-move.move-active  { color: var(--rd-gold); }
[data-layout="phone-se"] .ph-strip .pc-timer .pt-move.move-spent   { color: var(--rd-cream); }
[data-layout="phone-se"] .ph-strip .pc-timer .pt-bank.bank-warning { color: var(--rd-warn-red-bright); }

/* SE pip / score sized down a notch ====================================== */
[data-layout="phone-se"] .ph-strip .pc-pip {
  /* WEEK76 §4b — mirror phone: align-items: center (not baseline) for
     true midline alignment of the 9px caption with the 13px number. */
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--rd-overlay-dark-soft);
  border: 1px solid var(--rd-line);
  border-radius: 5px;
  padding: 4px 6px;
}
[data-layout="phone-se"] .ph-strip .pc-pip .pip-cap {
  /* §4b (WEEK78): translateY nudge removed — it only compensated for the
     profile .pp-label leak, now gone via the .pip-cap rename; caption
     aligns naturally (align-items:center + line-height:1). */
  font-family: var(--rd-font-body);
  color: var(--rd-cream-dim);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 0;
  line-height: 1;
}
[data-layout="phone-se"] .ph-strip .pc-pip .pp-value {
  font-family: var(--rd-font-body);
  color: var(--rd-cream);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
[data-layout="phone-se"] .ph-strip .pc-score {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--rd-overlay-dark-soft);
  border: 1px solid var(--rd-line);
  border-radius: 5px;
  padding: 4px 3px;
}
[data-layout="phone-se"] .ph-strip .pc-score .ps-value {
  font-family: var(--rd-font-body);
  color: var(--rd-cream);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
[data-layout="phone-se"] .ph-strip .pc-score .ps-label {
  font-family: var(--rd-font-body);
  color: var(--rd-cream-dim);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* SE menu bar · smaller buttons ========================================== */
[data-layout="phone-se"] .ph-strip .mb-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  height: 34px;
  background: var(--rd-dark-veil-strong);
  border: 1px solid var(--rd-line-strong);
  border-radius: 6px;
  padding: 2px;
}
[data-layout="phone-se"] .ph-strip .mb-bar.mb-empty {
  /* §4d FIX-D2 (SE) — match the score block style; same height keeps bottoms
     aligned. */
  justify-content: center;
  background: var(--rd-overlay-dark-soft);
  border-color: var(--rd-line);
}
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn {
  flex: 1 1 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rd-cream-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn:hover,
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn:active {
  background: var(--rd-gold-hover-subtle);
  border-color: var(--rd-line-strong);
  color: var(--rd-cream);
}
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn.danger:hover,
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn.danger:active {
  background: var(--rd-red-tint);
  border-color: var(--rd-red-1);
  color: var(--rd-warn-red-bright);
}
[data-layout="phone-se"] .ph-strip .mb-bar .mb-btn.on {
  background: var(--rd-gold-fill);
  border-color: var(--rd-gold);
  color: var(--rd-gold);
}

/* WEEK66 §4b FIX-B3 — the WEEK66 [data-layout="phone"] /
   [data-layout="phone-se"] `.gc-modal-card.reactions` override blocks lived
   here and were DEAD: fit.js stamps `data-layout` on `.viewport`, but the
   `#m-reactions` popup mounts as a sibling of `.viewport` (outside .stage,
   per the modal pattern in index.html ~511) — so a descendant selector
   rooted on `[data-layout="phone"]` could never match it. Phone landscape
   was therefore using the unscoped desktop 520x538 card on a 360-tall
   viewport, clipping the top emoticon row + last presets (Jay playtest
   2026-06-19). The fix lives in desktop.css: a responsive base rule
   (`width: min(520px, calc(100% - 24px))` + `max-height: calc(100% - 16px)`
   + `overflow-y: auto`) plus a viewport-height-targeted compaction block.
   Both reach the modal regardless of where it mounts.

   KEPT below: all `.chat-balloon` / `.chat-balloons` rules. Those nodes
   live INSIDE `.viewport` (inside `.board-area`), so the [data-layout]
   selectors DO reach them and the rules work as intended. */

/* ===== WEEK66 §4c · phone-tier chat balloons (in the strip avatar slot) ===
   §4b shipped phone balloons in a `.chat-balloons` layer over the board.
   §4c moves them ONTO each player's avatar in the side strip (per Jay
   playtest 2026-06-19 — board-bottom balloons read as page chat rather
   than as speech; the avatar position carries the sender identity, so
   the balloon needs no `.from` name span either).

   index.html ships a `.chat-balloon-slot` as the FIRST child of each
   `.ph-strip` (opp + you). chrome/chat.js renderBalloon routes:
     own       → `.ph-strip.ph-you .chat-balloon-slot`
     incoming  → `.ph-strip.ph-opp .chat-balloon-slot`
   The slot sits absolute at the strip top (top:0; left/right:0) so
   balloons stack downward over the avatar. The strip is already
   `position: absolute` (line 110 above) — that's a positioned ancestor
   for the slot's absolute layout. pointer-events:none on the slot keeps
   it from blocking taps on the avatar card below. iPad still uses the
   board-area `.chat-balloons` layer this sprint (ipad.css). desktop
   never renders here — chat.js routes to the right-col panel. */
[data-layout="phone"] .chat-balloon-slot,
[data-layout="phone-se"] .chat-balloon-slot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  z-index: 40;
  overflow: visible;
}
[data-layout="phone"] .chat-balloon,
[data-layout="phone-se"] .chat-balloon {
  /* WEEK66 §4e FIX-E1 — bigger balloons. Jay show_widget pick (2026-06-20):
     phone font 12→16, padding 6/10→9/13, radius 12→13, img 56→52. SE bumps
     in the override below. */
  pointer-events: none;
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 13px;
  font-family: var(--rd-font-body);
  font-size: 16px;
  line-height: 1.35;
  color: var(--rd-cream);
  background: var(--rd-dark-veil-strong);
  border: 1px solid var(--rd-line-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  word-wrap: break-word;
  text-align: center;
  opacity: 1;
  transition: opacity 300ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
[data-layout="phone"] .chat-balloon.own,
[data-layout="phone-se"] .chat-balloon.own {
  background: var(--rd-gold-fill);
  border-color: var(--rd-gold);
}
[data-layout="phone"] .chat-balloon img,
[data-layout="phone-se"] .chat-balloon img {
  display: block;
  width: 52px;
  height: 52px;
  margin: 2px auto;
}
[data-layout="phone"] .chat-balloon.fade-out,
[data-layout="phone-se"] .chat-balloon.fade-out {
  opacity: 0;
}

/* SE-tier balloon size · slightly tighter than the roomy phone tier.
   §4e — font 11→15, padding 5/9→8/12, img 44→48. */
[data-layout="phone-se"] .chat-balloon {
  font-size: 15px;
  padding: 8px 12px;
}
[data-layout="phone-se"] .chat-balloon img {
  width: 48px;
  height: 48px;
}

/* ===== WEEK66 §4e FIX-E4 · per-click chat-button BLOCK effect (phone) =====
   chrome/chat.js signalBlocked(el) adds `.chat-blocked` to the clicked
   control for ~380ms when the player tries to send while their balloon is
   still up. The shared `@keyframes ggBlockShake` + `ggBlockGlyph` +
   reduced-motion overrides live in viewport.css (cross-tier — iPad reuses
   them). This block only carries the phone-scoped style rules: a warn-red
   border + the wobble animation + a brief 🚫 glyph anchored to the
   button. Scoped to phone/phone-se so desktop (which never enters the
   balloon path) is never touched at the style layer. position:relative is
   forced on the three control selectors so the absolute-positioned glyph
   anchors to the button. */
[data-layout="phone"] .mb-btn,
[data-layout="phone-se"] .mb-btn,
[data-layout="phone"] .emoticon-pick,
[data-layout="phone-se"] .emoticon-pick,
[data-layout="phone"] .preset-pick,
[data-layout="phone-se"] .preset-pick {
  position: relative;
}
[data-layout="phone"] .mb-btn.chat-blocked,
[data-layout="phone-se"] .mb-btn.chat-blocked,
[data-layout="phone"] .emoticon-pick.chat-blocked,
[data-layout="phone-se"] .emoticon-pick.chat-blocked,
[data-layout="phone"] .preset-pick.chat-blocked,
[data-layout="phone-se"] .preset-pick.chat-blocked {
  animation: ggBlockShake 0.35s ease;
  border-color: var(--rd-warn-red) !important;
}
[data-layout="phone"] .mb-btn.chat-blocked::after,
[data-layout="phone-se"] .mb-btn.chat-blocked::after,
[data-layout="phone"] .emoticon-pick.chat-blocked::after,
[data-layout="phone-se"] .emoticon-pick.chat-blocked::after,
[data-layout="phone"] .preset-pick.chat-blocked::after,
[data-layout="phone-se"] .preset-pick.chat-blocked::after {
  content: "🚫";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  animation: ggBlockGlyph 0.35s ease forwards;
  z-index: 5;
}
