/*
 * watch-boxes.css -- the Boxes WATCH LAYOUT on the web watch page (boxes-web-1, 2026-09-26).
 *
 * The web twin of the app's Boxes watch screen (mobile components/stream/BoxesWatchChrome.tsx):
 * a header over the stage, the composite with a target over every box, chat flush under (phone)
 * or beside (desktop) the stage without its "Live Chat" header row, and a Guests / Gift / More bar
 * under the composer. Markup: partials/watch-boxes.blade.php. Behaviour: public/js/watch-boxes.js.
 *
 * 🔴 EVERY PAGE-LEVEL RULE IS KEYED ON `html[data-xbx="on"]`, which watch-boxes.js sets only while
 * the channel is in an active Boxes session. Without it nothing here matches the watch page, so the
 * normal live page and the battle page are untouched. The `.xbx-*` classes exist only in nodes the
 * island mounts while in Boxes.
 *
 * NOT TAILWIND, AND NOT BUILT. Loaded as-is by the partial, so it never waits on `npm run build`
 * and no class depends on the scanner. The v2 tokens are read with fallbacks (they are declared
 * under html.xive-shell-v2 only). `-webkit-backdrop-filter` is written by hand here on purpose:
 * this file does not go through Lightning CSS (see the note at the top of shell-v2.css).
 *
 * Breakpoint: 1023px, the watch page's own compact/desktop switch (watch-compact.js).
 */

html[data-xbx="on"] {
  --xbx-accent: var(--xv2-accent, #a855f7);
  --xbx-accent-soft: var(--xv2-accent-soft, rgba(168, 85, 247, 0.14));
  --xbx-accent-line: var(--xv2-accent-line, rgba(168, 85, 247, 0.28));
  --xbx-brand: linear-gradient(100deg, #ff2d78, #a855f7 55%, #3d7bff);
  --xbx-live-ring: linear-gradient(135deg, #ff2d78, #a24bff, #3d7bff);
  --xbx-glass: rgba(255, 255, 255, 0.06);
  --xbx-glass-line: rgba(255, 255, 255, 0.09);
  --xbx-panel: #121019;
  --xbx-panel-2: #1a1726;
  --xbx-text: #f5f5f7;
  --xbx-muted: #a1a1aa;
  --xbx-faint: #71717a;
  --xbx-rose: #ff4d6d;
  --xbx-heart: #ff2d55;
  --xbx-gift: #ff5c8d;
  /* The battle page's heart colour: its xbw-heart-btn / xbw-float-heart read this, and it is only
     declared on the battle page otherwise. */
  --xbw-heart: #ff4d6d;
  --xbx-mono: var(--xv2-mono, ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace);
  --xbx-stage-wash:
    radial-gradient(120% 80% at 20% 0%, rgba(124, 60, 220, 0.35), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(255, 45, 120, 0.22), transparent 60%),
    #07060e;
}

/* ── small pieces ─────────────────────────────────────────────────────────────────────────── */

.xbx-i12 { width: 12px; height: 12px; flex: none; }
.xbx-i13 { width: 13px; height: 13px; flex: none; }
.xbx-i14 { width: 14px; height: 14px; flex: none; }
.xbx-i15 { width: 15px; height: 15px; flex: none; }
.xbx-i16 { width: 16px; height: 16px; flex: none; }
.xbx-i18 { width: 18px; height: 18px; flex: none; }
.xbx-i20 { width: 20px; height: 20px; flex: none; }
.xbx-mono { font-family: var(--xbx-mono); font-variant-numeric: tabular-nums; }
.xbx-muted { color: var(--xbx-muted); }
.xbx-brand { color: #c084fc; }
.xbx-heart { color: var(--xbx-heart); fill: var(--xbx-heart); }
.xbx-gift { color: var(--xbx-gift); }
.xbx-rose { color: var(--xbx-rose); }
.xbx-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.xbx-avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9999px;
  background: #26223a;
  color: #d8b4fe;
  font-weight: 700;
  line-height: 1;
}
.xbx-avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xbx-avatar--24 { width: 24px; height: 24px; font-size: 11px; }
.xbx-avatar--32 { width: 32px; height: 32px; font-size: 13px; }
.xbx-avatar--38 { width: 38px; height: 38px; font-size: 16px; }
.xbx-avatar--48 { width: 48px; height: 48px; font-size: 20px; }

.xbx-tag {
  flex: none;
  padding: 2px 6px;
  border-radius: 6px;
  background: #27272f;
  color: var(--xbx-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.xbx-tag--host { background: #6d28d9; }

/* ── the header ───────────────────────────────────────────────────────────────────────────── */

.xbx-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--xbx-text);
}
.xbx-header__row { display: flex; align-items: center; gap: 10px; min-width: 0; }

.xbx-host { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; color: inherit; text-decoration: none; }
.xbx-host:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: 3px; border-radius: 12px; }
.xbx-host__ring { flex: none; padding: 2px; border-radius: 9999px; background: var(--xbx-live-ring); }
.xbx-host__ring .xbx-avatar { box-shadow: 0 0 0 2px #0b0a12; }
.xbx-host__text { display: flex; flex-direction: column; min-width: 0; }
.xbx-host__name { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.25; }
.xbx-verified { width: 15px; height: 15px; flex: none; color: #60a5fa; }
.xbx-host__followers { font-family: var(--xbx-mono); font-size: 11px; color: var(--xbx-muted); line-height: 1.4; white-space: nowrap; }

.xbx-follow {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9999px;
  background: var(--xbx-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.xbx-follow:hover { filter: brightness(1.1); }
.xbx-follow:active { transform: scale(0.97); }
.xbx-follow:disabled { opacity: 0.55; cursor: default; }
.xbx-follow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.xbx-follow__off { display: inline-flex; align-items: center; gap: 3px; }
.xbx-follow__on { display: none; }
.xbx-follow[data-following="1"] { width: 30px; padding: 0; background: var(--xbx-glass); box-shadow: inset 0 0 0 1px var(--xbx-glass-line); }
.xbx-follow[data-following="1"] .xbx-follow__off { display: none; }
.xbx-follow[data-following="1"] .xbx-follow__on { display: inline-flex; }

.xbx-header__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.xbx-gifters { display: flex; align-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.xbx-gifter { display: inline-flex; border-radius: 9999px; box-shadow: 0 0 0 2px #0b0a12; }
.xbx-gifter + .xbx-gifter { margin-left: -8px; }
.xbx-gifters:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: 3px; border-radius: 9999px; }

.xbx-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--xbx-glass);
  box-shadow: inset 0 0 0 1px var(--xbx-glass-line);
  font-size: 11px;
  color: var(--xbx-text);
  white-space: nowrap;
}

.xbx-header__meta { display: flex; align-items: center; gap: 8px; min-width: 0; }

.xbx-goal {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9999px;
  background: var(--xbx-accent-soft);
  box-shadow: inset 0 0 0 1px var(--xbx-accent-line);
  color: var(--xbx-text);
  cursor: pointer;
}
.xbx-goal:hover { background: rgba(168, 85, 247, 0.22); }
.xbx-goal:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: 2px; }
.xbx-goal { min-width: 0; white-space: nowrap; }
.xbx-goal__label { font-size: 12px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.xbx-goal__count { font-size: 12px; flex: none; }

/* ── the stage ────────────────────────────────────────────────────────────────────────────── */

.xbx-layer { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.xbx-picture { position: absolute; pointer-events: none; }
.xbx-catch { position: absolute; inset: 0; pointer-events: auto; }
.xbx-targets { position: absolute; inset: 0; pointer-events: none; }
/* The bar's ♥: phone widths only (the desktop heart is on the stage, in the letterbox). */
.xbx-bar__btn--heart:not([hidden]) { display: none; }
@media (max-width: 1023px) {
  .xbx-bar__btn--heart:not([hidden]) { display: flex; }
}

/*
 * DESKTOP stage heart: in the letterbox to the RIGHT of the 1080x1200 picture, so it can never sit on
 * a box (an open box's "Tap to Join" / "+" in the 6- and 9-box layouts included). The desktop player
 * is 16:9, so the portrait picture always leaves margin on both sides. Its hearts float up beside it.
 */
.xbx-heart-btn { left: calc(100% + 18px); right: auto; bottom: 18px; }
.xbx-hearts-float { left: calc(100% + 17px); right: auto; }
/* The picture is the size container the battle's floating hearts rise through (-100cqh). */
.xbx-picture { container-type: size; }
.xbx-heart-btn { z-index: 2; }

/* A gift celebrates inside its box: the battle's celebration (xbw-cele), sized to the box. */
.xbx-gift-slots { position: absolute; inset: 0; pointer-events: none; }
[data-xbx-gift-box] {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4%;
  overflow: hidden;
  pointer-events: none;
  container-type: size;
  border-radius: 12px;
}
[data-xbx-gift-box] .xbw-cele { max-width: 100%; max-height: 100%; }
[data-xbx-gift-box] .xbw-cele__art { height: 52cqh; }
[data-xbx-gift-box] .xbw-cele[data-kind='hero'] .xbw-cele__art { height: 68cqh; }
[data-xbx-gift-box] .xbw-cele__glyph { font-size: 38cqh; }
[data-xbx-gift-box] .xbw-cele[data-kind='hero'] .xbw-cele__glyph { font-size: 50cqh; }
[data-xbx-gift-box] .xbw-cele__line { font-size: 11px; padding: 2px 8px; }
[data-xbx-gift-box]:has(.xbw-cele[data-kind='compact']) { align-items: flex-end; }

.xbx-box {
  position: absolute;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.xbx-box:hover { box-shadow: inset 0 0 0 2px rgba(216, 180, 254, 0.55); }
.xbx-box:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #e879f9; }
.xbx-box__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: rgba(8, 8, 13, 0.55);
  color: #fff;
}
.xbx-box:hover .xbx-box__dot { background: rgba(8, 8, 13, 0.8); }
.xbx-box__join {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #e4e4e7;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.xbx-box:hover .xbx-box__join,
.xbx-box:focus-visible .xbx-box__join { opacity: 1; }

/* The composite's frame, not black bars: the compositor's own wash around the picture. */
html[data-xbx="on"] [data-testid="watch-player-shell"] { background: var(--xbx-stage-wash); }
html[data-xbx="on"] [data-testid="watch-player-shell"] video { background: transparent !important; }
/* The control bar stays pressable over the bottom boxes; its empty gradient does not eat clicks. */
html[data-xbx="on"] [data-testid="watch-player-shell"] [data-player-bar] { z-index: 31; pointer-events: none; }
html[data-xbx="on"] [data-testid="watch-player-shell"] [data-player-bar] button,
html[data-xbx="on"] [data-testid="watch-player-shell"] [data-player-bar] input { pointer-events: auto; }

/* The player's own LIVE / viewers badges: box 1 sits under them, and the count is in the header. */
html[data-xbx="on"] [data-testid="watch-player-shell"] .watch-player-badges { display: none !important; }

/* The rail's gifters strip: its top three are in the header now. */
html[data-xbx="on"] [data-watch-move="ticker"],
html[data-xbx="on"] [data-watch-compact-slot="ticker"] { display: none !important; }

/* Chat: no "Live Chat" header row (the viewer count is in the header). */
html[data-xbx="on"] [data-watch-move="chat"] > .watch-card-header { display: none !important; }

/* ── the bottom bar ───────────────────────────────────────────────────────────────────────── */

.xbx-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.xbx-bar__btn {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 12px;
  background: var(--xbx-glass);
  box-shadow: inset 0 0 0 1px var(--xbx-glass-line);
  color: var(--xbx-text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.xbx-bar__btn:hover { background: rgba(255, 255, 255, 0.1); }
.xbx-bar__btn:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: 2px; }
.xbx-bar__icon { position: relative; display: flex; height: 22px; align-items: center; }
.xbx-bar__badge {
  position: absolute;
  top: -4px;
  right: -13px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--xbx-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.xbx-bar__label { font-size: 11px; font-weight: 600; color: #c4c4cc; letter-spacing: 0.01em; }

/* ── sheets, cards and the More menu ──────────────────────────────────────────────────────── */

.xbx-overlay { position: relative; z-index: 1000; }
.xbx-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.55); animation: xbx-fade 0.16s ease-out; }
/* Phone More: only the strip above the sheet (the pane itself sits in the page's stacking context). */
.xbx-scrim[data-mode="pane"] { bottom: auto; height: 20svh; }

.xbx-sheet,
.xbx-menu {
  position: fixed;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  color: var(--xbx-text);
  background: var(--xbx-panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px -12px rgba(0, 0, 0, 0.7), 0 30px 80px -50px rgba(168, 85, 247, 0.55);
}
.xbx-sheet {
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  padding: 12px 18px 16px;
  border-radius: 20px;
  transform: translate(-50%, -50%);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: xbx-pop 0.16s ease-out;
}
.xbx-sheet--holder { width: min(320px, calc(100vw - 32px)); }
.xbx-sheet[data-anchored="1"] { transform: none; animation: xbx-fade 0.14s ease-out; }
.xbx-sheet__grab { display: none; }
.xbx-sheet__head { display: flex; align-items: center; gap: 12px; padding: 6px 0 10px; }
.xbx-sheet__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--xbx-accent-soft);
  box-shadow: inset 0 0 0 1px var(--xbx-accent-line);
  color: #d8b4fe;
}
.xbx-sheet__titles { flex: 1; min-width: 0; }
.xbx-sheet__title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.xbx-sheet__sub { margin: 2px 0 0; font-family: var(--xbx-mono); font-size: 12px; color: var(--xbx-muted); }
.xbx-close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--xbx-muted);
  cursor: pointer;
}
.xbx-close:hover { background: var(--xbx-glass); color: var(--xbx-text); }
.xbx-close:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: 1px; }

.xbx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--xbx-text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.xbx-row:hover { background: var(--xbx-glass); }
.xbx-row:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: -2px; }
.xbx-row > svg { color: var(--xbx-muted); }
.xbx-row > svg.xbx-gift { color: var(--xbx-gift); }
.xbx-cancel {
  margin-top: 8px;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--xbx-panel-2);
  color: var(--xbx-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.xbx-cancel:hover { background: #242033; }
.xbx-cancel:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: 2px; }

.xbx-holder__head { display: flex; align-items: center; gap: 12px; padding: 8px 0 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.xbx-holder__text { flex: 1; min-width: 0; }
.xbx-holder__namerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xbx-holder__name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.xbx-holder__meta { margin-top: 2px; font-size: 12px; color: var(--xbx-muted); }
.xbx-holder__rank { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--xbx-accent); }

.xbx-guests { display: flex; flex-direction: column; }
.xbx-guest {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--xbx-text);
  text-align: left;
  cursor: pointer;
}
.xbx-guest:hover:not(:disabled) { background: var(--xbx-glass); }
.xbx-guest:disabled { cursor: default; }
.xbx-guest:focus-visible { outline: 2px solid var(--xbx-accent); outline-offset: -2px; }
.xbx-guest__box { width: 16px; flex: none; text-align: center; font-size: 12px; color: var(--xbx-faint); }
.xbx-guest__empty {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px dashed #3f3f46;
  color: var(--xbx-faint);
}
.xbx-guest__name { flex: 0 1 auto; font-size: 15px; font-weight: 600; }
.xbx-guest[data-state="open"] .xbx-guest__name,
.xbx-guest[data-state="closed"] .xbx-guest__name { color: var(--xbx-faint); font-weight: 400; }
.xbx-guest__rank { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--xbx-accent); }
.xbx-guest__muted { display: flex; color: var(--xbx-faint); }
.xbx-guest__rank[hidden] + .xbx-guest__muted { margin-left: auto; }
.xbx-note { margin: 10px 0 0; font-size: 13px; color: var(--xbx-muted); text-align: center; }

.xbx-goals { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.xbx-goalcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--xbx-glass);
  box-shadow: inset 0 0 0 1px var(--xbx-glass-line);
}
.xbx-goalcard__head { display: flex; align-items: baseline; gap: 8px; }
.xbx-goalcard__label { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.xbx-goalcard__pct { font-size: 12px; color: #c084fc; }
.xbx-goalcard__track { height: 8px; border-radius: 9999px; background: #27272f; overflow: hidden; }
.xbx-goalcard__fill { height: 8px; border-radius: 9999px; background: var(--xbx-brand); }
.xbx-goalcard__scale { font-size: 13px; color: var(--xbx-muted); }
.xbx-goalcard__scale strong { color: var(--xbx-text); font-weight: 700; }
.xbx-goalcard__meta { font-size: 12px; color: var(--xbx-faint); }

.xbx-menu {
  width: 220px;
  padding: 6px;
  border-radius: 16px;
  animation: xbx-fade 0.12s ease-out;
}
.xbx-menu .xbx-row { min-height: 42px; font-size: 14px; }

.xbx-panehead { display: none; }

@keyframes xbx-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes xbx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xbx-up { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

/* ══ DESKTOP (≥1024px): the page keeps its structure, restyled ═══════════════════════════════ */

@media (max-width: 420px) {
  .xbx-header .xbx-goal > svg:last-child { display: none; }
  .xbx-header .xbx-goal__label { font-size: 11.5px; }
  .xbx-header .xbx-goal__count { font-size: 11px; }
}

@media (min-width: 1024px) {
  html[data-xbx="on"] .watch-shell-main > .xbx-header {
    margin-top: 4px;
    padding: 12px 16px;
    border-radius: 18px;
    background: var(--xbx-glass);
    box-shadow: inset 0 0 0 1px var(--xbx-glass-line);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
  }
  /* One row on a wide screen: the audience pills and the goal chip sit at the end of it. */
  html[data-xbx="on"] .watch-shell-main > .xbx-header { flex-direction: row; align-items: center; gap: 12px; }
  html[data-xbx="on"] .watch-shell-main > .xbx-header > .xbx-header__row { flex: 1 1 auto; }
  html[data-xbx="on"] .watch-shell-main > .xbx-header > .xbx-header__meta { flex: none; }
  html[data-xbx="on"] .watch-shell-main > .xbx-header .xbx-goal { margin-left: 4px; }
  html[data-xbx="on"] .xbx-header .xbx-host__name { font-size: 16px; }

  /* The rail's chat reads as one glass column, flush to its bar. */
  html[data-xbx="on"] .watch-shell-rail [data-watch-move="chat"] { padding-top: 4px; }
  html[data-xbx="on"] .watch-shell-rail [data-watch-move="chat"] > .xbx-bar { border-top: 1px solid rgba(255, 255, 255, 0.06); }
}

/* ══ PHONE / SMALL TABLET (≤1023px): the app's stacked layout ═════════════════════════════ */

@media (max-width: 1023px) {
  /* No tab row: chat is always the pane, and More opens the other panes as a sheet. */
  html[data-xbx="on"] .watch-compact .watch-compact__tabs { display: none !important; }

  html[data-xbx="on"] .watch-compact .watch-compact__player { background: transparent; overflow: visible; }
  html[data-xbx="on"] .watch-compact .watch-compact__player > .xbx-header { padding: 6px 12px 8px; }

  /*
   * The stage IS the 1080x1200 frame, as the app sizes it: the full width, capped so chat keeps
   * room (the app caps it at half the screen; the web also pays for its top bar and bottom nav).
   */
  html[data-xbx="on"] .watch-compact [data-testid="watch-player-shell"] {
    aspect-ratio: 1080 / 1200 !important;
    width: min(100%, calc(44svh * 1080 / 1200)) !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  html[data-xbx="on"] .watch-compact .watch-compact__player [data-watch-move="player"] {
    background: radial-gradient(70% 90% at 50% 0%, rgba(124, 60, 220, 0.3), transparent 70%), #07060e;
  }

  /* Chat flows straight on from the stage: no card, no header, the bar under the composer. */
  html[data-xbx="on"] .watch-compact [data-watch-move="chat"] {
    flex: 1 1 auto;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    /* No glass to blur behind, and a backdrop-filter would make this card the containing block of
       the gift sheet below (position: fixed resolves against it), trapping it inside the chat. */
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  html[data-xbx="on"] .watch-compact [data-watch-move="chat"] > .xbx-bar { padding-top: 2px; }

  /*
   * The composer's gift panel opens UPWARD inside the chat card (stream-studio.css), and the Boxes
   * chat pane is too short to hold it — it was clipped behind the stage. Here it rises from the
   * bottom edge as a sheet instead, like every other Boxes sheet. Same node, same open/close.
   */
  html[data-xbx="on"] .watch-compact [data-watch-gift-popover] {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: var(--xive-bottom-nav-height, 0px);
    z-index: 1001;
    max-height: 68svh;
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55), 0 -12px 40px rgba(0, 0, 0, 0.5);
    animation: xbx-up 0.2s ease-out;
  }

  .xbx-header .xbx-host__name { font-size: 15px; }

  /*
   * ONE composer row, as the app: identity, the field (GIF and emotes inside it), send. The gift
   * chip goes — Gift is in the bar under it, and opens the same panel (XiveWatchGifts.open) — and
   * the actions row joins the field's. Points, when the channel has them, stays on the row.
   * The actions row stops being the popovers' positioning context, so the points panel anchors
   * to the whole form (full width); the gift panel is already a bottom sheet here (above).
   */
  html[data-xbx="on"] .watch-compact [data-watch-chat-form] { padding-top: 6px; padding-bottom: 6px; }
  html[data-xbx="on"] .watch-compact [data-watch-chat-form] .xive-chat-composer-stack { flex-direction: row; align-items: center; gap: 6px; }
  html[data-xbx="on"] .watch-compact [data-watch-chat-form] .xive-chat-composer-row { flex: 1 1 auto; width: auto; }
  html[data-xbx="on"] .watch-compact [data-watch-chat-form] .xive-chat-composer-actions { flex: none; width: auto; position: static; }
  html[data-xbx="on"] .watch-compact [data-watch-chat-form] .xive-chat-composer-actions-gap,
  html[data-xbx="on"] .watch-compact [data-watch-chat-form] .xive-chat-gift-anchor { display: none !important; }

  /* The player's control row sits on the stage's bottom edge here: the heart rides above it. */
  /* No heart button on the phone stage: it would cover box 6's "Tap to Join". It is the bar's ♥;
     a double tap on the stage still sends one, and they float up the stage's right edge. */
  html[data-xbx="on"] .watch-compact .xbx-heart-btn { display: none !important; }
  html[data-xbx="on"] .watch-compact .xbx-hearts-float { right: 4px; bottom: 56px; height: 70%; }

  /* The header's second row on a narrow phone: the goal chip gives up its chevron, not its words. */
  .xbx-header__meta { gap: 6px; }
  .xbx-header .xbx-pill { padding: 0 7px; }
  .xbx-header .xbx-goal { padding: 0 10px; gap: 5px; }

  /* Sheets rise from the bottom edge. */
  .xbx-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 86svh;
    padding: 8px 18px max(18px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    transform: none;
    animation: xbx-up 0.2s ease-out;
  }
  .xbx-sheet--holder { width: 100%; }
  .xbx-sheet__grab { display: block; width: 36px; height: 4px; margin: 0 auto 8px; border-radius: 9999px; background: #3f3f46; }

  /* More: the page's own Creator / Gifters / About pane, lifted into a sheet under this head. */
  .xbx-panehead:not([hidden]) {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: 20svh;
    z-index: 1002;
    padding: 8px 12px 6px;
    border-radius: 22px 22px 0 0;
    background: var(--xbx-panel);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
    animation: xbx-up 0.2s ease-out;
  }
  .xbx-panehead__row { display: flex; align-items: center; gap: 6px; }
  .xbx-panehead__tabs { display: flex; flex: 1; min-width: 0; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .xbx-panehead__tabs::-webkit-scrollbar { display: none; }
  .xbx-ptab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #d4d4d8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .xbx-ptab[aria-selected="true"] { background: var(--xbx-accent-soft); border-color: rgba(216, 180, 254, 0.5); color: #fff; font-weight: 700; }

  html[data-xbx="on"][data-xbx-pane] .watch-compact .watch-compact__pane:not([data-watch-mobile-pane="stream"]):not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(20svh + 56px);
    bottom: 0;
    z-index: 1001;
    padding-bottom: calc(var(--xive-bottom-nav-height, 0px) + max(16px, env(safe-area-inset-bottom)));
    background: var(--xbx-panel);
    animation: xbx-up 0.2s ease-out;
  }
}
