/* Public event screen: left 70 % Arise Galaxy, right 30 % information panel (D-52, owner request; was 65 / 35 in scene-config#safeZone).
   Effects never cross the panel: the Galaxy canvas is sized to its own region and the panel is opaque with a 32 px
   margin. The Galaxy's sky is the space backdrop of assets/space (stage 15, D-36), drawn by every renderer tier; only the
   soft vignette below lies over it.
   The panel (stage 15, D-36) uses the phone's fonts (D-38): Electrolize for UI text, titles in Asleepytiming when
   licensed and Comfortaa until then (OD-23). Every state has the same top zone - the AriSkill Bingo sign, the sound
   button in the corner, then the round and "Live" over a hairline - and its content spread evenly below. The QR card
   keeps the sticker language (docs/art/sticker-art-direction.md: badge fill, white die-cut outline and shadow, lime
   label); the winner's "BINGO!" is the Blender badge (art/bingo-badge.webp). */
.public-screen {
  --pg-diecut: 5px;                     /* white die-cut width at venue scale (6 px at a 240 px Soul, scaled) */
  --pg-diecut-shadow: var(--sticker-shadow), 0 0 0 2px rgba(11, 16, 48, .35);
  --font-ui: "Electrolize", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-title: "Asleepytiming", "Comfortaa", "Electrolize", system-ui, sans-serif;
  --ui-font-sans: var(--font-ui); --font-sans: var(--font-ui); --font-display: var(--font-ui);
  letter-spacing: .01em;
}
html, body { height: 100%; margin: 0; overflow: hidden; }
body.public-screen { background: #070718; color: var(--ui-text); font-family: var(--ui-font-sans); font-size: var(--ui-fs-md); line-height: var(--ui-lh-normal); }

.screen { display: grid; grid-template-columns: 70fr 30fr; width: 100vw; height: 100vh; } /* D-52: 70 / 30 */

/* ---- Galaxy region ---- */
.galaxy { position: relative; overflow: hidden; background: #070718; contain: strict; isolation: isolate; }
.galaxy__canvas { position: absolute; inset: 0; display: block; }
/* Cluster count labels (Three renderer): DOM text over the canvas, clipped by the Galaxy region. */
.galaxy__labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.galaxy__label {
  position: absolute; left: 0; top: 0; margin-left: -40px; width: 80px; text-align: center; will-change: transform;
  color: var(--ui-text); font-size: 20px; font-weight: 600; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(7,7,24,.9), 0 0 2px rgba(7,7,24,.9);
  font-family: var(--font-display);
}
/* "Say hi" speech bubble (D-36): shown while a visiting Soul waves at the front; text from the player's phone. */
.galaxy__bubble {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform, opacity;
  max-width: var(--bubble-max, 380px); padding: .55em .8em; border-radius: 1.1em;
  background: #fdfcff; color: #221c4a; box-shadow: 0 .35em 1.2em rgba(7, 7, 24, .45);
  font-family: var(--ui-font-sans, var(--font-sans, system-ui, sans-serif)); font-size: var(--bubble-font, 26px); line-height: 1.25;
  overflow-wrap: anywhere; opacity: 0; transition: opacity .25s ease-out;
}
.galaxy__bubble b { font-weight: 800; color: #5b2bd6; }
.galaxy__bubble.is-on { opacity: 1; }
.galaxy__bubble::after {
  content: ""; position: absolute; bottom: -.5em; left: 1.1em; width: 1em; height: 1em; background: #fdfcff;
  transform: rotate(45deg); border-radius: .15em; box-shadow: .25em .25em .6em rgba(7, 7, 24, .18);
}
.galaxy__bubble[data-side="left"]::after { left: auto; right: 1.1em; }
.galaxy::after {
  content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 51% 48%, transparent 30%, rgba(7,7,24,.3) 74%, rgba(7,7,24,.72) 100%), linear-gradient(115deg, rgba(124,58,237,.08), transparent 44%, rgba(34,211,238,.05));
  box-shadow: inset 0 0 120px rgba(0,0,0,.5);
}

/* ---- Information panel (safe zone) ---- */
.panel {
  position: relative; display: flex; flex-direction: column; min-width: 0; height: 100vh;
  padding: 28px 32px 26px; box-sizing: border-box; gap: 16px;
  background: linear-gradient(165deg, rgba(23,18,55,.98), rgba(9,11,30,.99) 58%, #070718); border-left: 1px solid rgba(205,194,255,.28);
  box-shadow: inset 24px 0 64px -40px rgba(167,139,250,.55), -18px 0 80px rgba(0,0,0,.32);
}
/* The AriSkill Bingo sign (the phone's landing sign, D-41) heads the panel */
.panel__logo { display: block; flex: 0 0 auto; width: min(100%, 210px); height: auto; margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(5, 8, 30, .6)); }
.panel__main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
/* The round and the connection pill, over a hairline */
.panel__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ui-space-4); min-height: 40px; flex: 0 0 auto;
  padding-bottom: 14px; border-bottom: 1px solid rgba(205, 194, 255, .16);
}
.panel__event { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel__conn { font-size: 18px; min-height: 34px; transition: opacity var(--ui-duration-base, 200ms) ease; }
/* VM-04: the audience panel never loops an animation (motion-spec: only the Galaxy orbit and ambient glow loop). */
.panel__conn.pill--live::before { animation: none; }
/* The state's content, spread evenly over the height */
.panel__state { display: flex; flex-direction: column; justify-content: space-evenly; gap: 0; flex: 1 1 auto; min-height: 0; padding-top: 10px; }
.panel__eyebrow { margin: 0; font-family: var(--font-ui); font-size: 20px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-text-muted); }
.panel__headline { margin: 0; font-family: var(--font-title); font-size: 60px; line-height: var(--ui-lh-tight); font-weight: 400; letter-spacing: .01em; overflow-wrap: anywhere; }
.panel__headline--sm { font-size: 34px; line-height: var(--ui-lh-normal); color: var(--ui-text); }
.panel__body { margin: 0; font-size: 24px; }
.panel__muted { color: var(--ui-text-muted); }
.panel__countdown { margin: 0; font-family: var(--font-ui); font-size: clamp(48px, 6.6vh, 72px); line-height: 1; font-weight: 400; letter-spacing: .04em; }
.panel__countdown-label { font-size: 18px; margin-top: var(--ui-space-2); }
.panel__notice { margin: 0; padding: var(--ui-space-4) var(--ui-space-5); border-radius: var(--ui-radius-md); background: var(--ui-surface-2); border-left: 8px solid var(--ui-warning); font-size: 24px; font-weight: 600; }
.panel__notice--exhausted { border-left-color: var(--ui-info); }

/* Waiting: the round and its timer, then the QR card - one centred column */
.panel__state--waiting { align-items: center; text-align: center; }
.panel__info { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.panel__state--waiting .panel__countdown-label { margin-top: 14px; }
/* "Scan to join" QR sticker card - badge fill, white die-cut outline + shadow, lime label (navy ink) */
.panel__join {
  display: flex; flex-direction: column; align-items: center; gap: 0; margin: 0; flex: 0 0 auto; align-self: center;
  padding: 12px 12px 10px; border-radius: 28px; background: var(--sticker-badge);
  border: var(--pg-diecut) solid var(--sticker-outline); box-shadow: var(--pg-diecut-shadow);
}
.panel__qr { width: min(22vh, 240px); height: min(22vh, 240px); box-sizing: content-box; padding: 10px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px rgba(11,16,48,.08); }
.panel__qr svg { display: block; width: 100%; height: 100%; }
.panel__scan {
  margin: 10px 0 0; padding: 2px 22px; border-radius: var(--ui-radius-pill); font-family: var(--font-ui); font-weight: 600; font-size: 24px; line-height: 1.3; letter-spacing: .02em;
  color: var(--sticker-navy); background: var(--sticker-aurora-lime); border: 3px solid var(--sticker-outline); box-shadow: 0 3px 8px rgba(5,8,30,.45);
}
.panel__previous { margin-top: 0; flex: 0 1 auto; min-height: 0; overflow: hidden; padding-top: var(--ui-space-2); }
.panel__list { list-style: none; margin: var(--ui-space-1) 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; font-size: 20px; line-height: 1.25; }
.panel__list li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Playing: two cards of the same width - the draw (the hero, centred) and the previous five draws. The screen never
   says a skill's kind (core / critical / optional). */
.panel__state--playing { align-items: stretch; }
.panel__current { display: flex; flex-direction: column; gap: 14px; }
.panel__draw {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 210px; text-align: center;
  padding: 20px 22px; background: linear-gradient(145deg, rgba(44,34,91,.88), rgba(15,19,47,.94)); border-width: 2px;
  border-color: rgba(205, 194, 255, .45); box-shadow: 0 0 24px rgba(167, 139, 250, .18); backdrop-filter: blur(18px);
}
.panel__draw-number { margin: 0; font-family: var(--font-ui); font-size: 28px; font-weight: 600; line-height: var(--ui-lh-tight); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.panel__skill { margin: 0; width: 100%; font-family: var(--font-title); font-size: var(--ui-fs-2xl); line-height: 1.08; font-weight: 400; letter-spacing: .01em; overflow-wrap: anywhere; }
.panel__matched { margin: 0; font-size: 26px; font-weight: 600; text-align: center; color: var(--ui-text-muted); }
.panel__recent-card { padding: 18px 24px 20px; border-radius: 22px; background: rgba(28, 22, 70, .55); border: 1px solid rgba(205, 194, 255, .18); }
.panel__recent-title { margin: 0 0 12px; }
.panel__recent { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 22px; }
.panel__recent-item { display: flex; align-items: center; gap: var(--ui-space-3); min-height: 32px; }
.panel__recent-item:first-child { color: var(--ui-text); }
.panel__recent-item:not(:first-child) { color: var(--ui-text-muted); }
.panel__recent-num { flex: 0 0 2.2ch; text-align: right; font-weight: 700; }
.panel__recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Winner: the Blender "BINGO!" badge, the names and the co-winner line as one centred group */
.panel__state--winner { justify-content: center; align-items: center; text-align: center; }
.panel__celebration { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: -20px; }
.panel__bingo-badge { margin: 0 0 8px; display: flex; justify-content: center; }
.panel__bingo-badge img { display: block; width: min(100%, 520px); height: auto; filter: drop-shadow(0 12px 28px rgba(5, 8, 30, .6)); }
.panel__winners { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.panel__winner { font-family: var(--font-title); font-size: 44px; font-weight: 400; line-height: var(--ui-lh-tight); letter-spacing: .01em; overflow-wrap: anywhere; }
.panel__cowinners { font-size: 22px; }
.m-winner-burst { animation: pg-burst var(--ui-duration-slow, 400ms) var(--ease-standard, ease) 1; }
@keyframes pg-burst { 0% { transform: scale(0.96); opacity: 0.6; } 60% { transform: scale(1.01); opacity: 1; } 100% { transform: scale(1); } }

/* Sound: one round icon button in the panel's top-right corner (turn sound on, then mute / unmute) */
.panel__sound-slot { position: absolute; top: 20px; right: 22px; z-index: 3; }
.panel__sound { width: 48px; height: 48px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: var(--ui-text); background: rgba(46, 34, 104, .72); border: 2px solid rgba(205, 194, 255, .45); box-shadow: 0 4px 12px rgba(5, 8, 30, .45); }
.panel__sound[hidden] { display: none; }
.panel__sound:hover { background: rgba(70, 52, 150, .8); }
.panel__sound:focus-visible { outline: 3px solid var(--ui-accent-strong); outline-offset: 3px; }
.panel__sound-icon { width: 26px; height: 26px; }
.panel__volume { width: 120px; min-height: 44px; accent-color: var(--ui-accent); }

/* Footer: the stale-data pill and the renderer mode, only while the data may be out of date. Sound captions go to
   screen readers only (#caption, visually hidden, D-36). */
.panel__footer { flex: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: var(--ui-space-3); min-height: 0; font-size: 20px; color: var(--ui-text-muted); }
.panel__footer:has(.panel__stale[hidden]) { display: none; }
.panel__status { display: flex; align-items: center; gap: var(--ui-space-2); flex: 0 0 auto; }
.panel__stale { font-size: 18px; min-height: 36px; }
.panel__mode { font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }

/* Narrow / portrait: stack (never expected at the venue, but the screen must stay usable) */
@media (max-width: 1100px) {
  .screen { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; }
  .panel { height: auto; padding: 16px; }
}
@media (prefers-contrast: more) {
  .panel { border-left: 2px solid var(--ui-text-muted); }
  .galaxy::after { background: radial-gradient(circle at 51% 48%, transparent 30%, rgba(7,7,24,.3) 74%, rgba(7,7,24,.72) 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .galaxy__bubble { transition: none; }
  .m-winner-burst { animation: none; }
}
