@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Pinyon+Script&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f6f3ed;
  --surface: #ffffff;
  --parchment: #faf5e8;
  --parchment-deep: #efe4cc;
  --ink: #242833;
  --muted: #5c606a;
  --navy: #242833;
  --slate: #313a47;
  --gold: #d4b16a;
  --gold-soft: #ead4a6;
  --gold-pale: #f7e8c8;
  --terracotta: #ad5328;
  --terracotta-dark: #8c3f1c;
  --crimson: #8f2d27;
  --sage: #5d7e64;
  --sage-bright: #498759;
  --border: #ddd5c7;
  --shadow: 0 12px 34px rgba(24, 30, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button, a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

button {
  background: #fff;
  border: 1px solid #c9c1b2;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

button:hover:not(:disabled) {
  background: #f2e8d5;
  border-color: #b7a88f;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}

.btn-primary:hover:not(:disabled) {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
}

.btn-gold {
  background: #f0d79d;
  color: #242833;
  border-color: #bc903c;
}

.btn-gold:hover:not(:disabled) {
  background: #e6c67c;
  border-color: #a67c2c;
}

.btn-danger {
  background: #8f2d27;
  color: #fff;
  border-color: #7c241f;
}

.btn-danger:hover:not(:disabled) {
  background: #73211c;
}

.btn-dark {
  background: var(--slate);
  color: #fff;
  border-color: #465063;
}

.btn-dark:hover:not(:disabled) {
  background: #3e4959;
}

/* Top site header matching the reference's crisp bar */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e1d9cc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px min(4vw, 48px);
  flex-wrap: wrap;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-crest {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #7a4b21;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.pill-gold {
  background: var(--gold-pale);
  color: #724115;
  border: 1px solid #e3c68a;
}

.pill-live {
  background: #e3f4e8;
  color: #1c6031;
  border: 1px solid #a8dab6;
}

.pill-wait {
  background: #fef3dc;
  color: #7a4c0b;
  border: 1px solid #e8ca85;
}

.pill-off {
  background: #eeeae3;
  color: #555962;
  border: 1px solid #d5cfc4;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill-live .pill-dot {
  box-shadow: 0 0 0 3px rgba(28, 96, 49, 0.22);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.2); }
}

.nav-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: #f3ede1;
  border-color: #dfd5c4;
}

/* Main container */
.page-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px min(3.5vw, 40px) 44px;
}

.eyebrow {
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #7a4c1d;
  margin: 0;
}

h1, h2, h3 {
  font-family: 'EB Garamond', Georgia, serif;
}

/* =========================================================
   LANDING PAGE (/)
   ========================================================= */
.hero-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  background: #2b2f29 url('/assets/hall-room.webp') center/cover no-repeat;
  margin-bottom: 26px;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 42px min(4vw, 48px) 34px;
  background: linear-gradient(180deg, rgba(16, 20, 24, 0.22) 0%, rgba(16, 20, 24, 0.78) 65%, rgba(16, 20, 24, 0.92) 100%);
  color: #fff;
}

.hero-overlay .eyebrow {
  color: #f3d7a0;
}

.hero-overlay h1 {
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.05;
  margin: 8px 0 10px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45);
}

.hero-overlay p {
  max-width: 700px;
  font-size: 16px;
  color: #ebe5d8;
  margin: 0;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}

.role-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 8px 24px rgba(24, 30, 38, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-card.featured {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.role-card h2 {
  font-size: 28px;
  margin: 2px 0;
  line-height: 1.15;
}

.role-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}

.code-join-form {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.code-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 2px solid #cfc5b3;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  background: var(--parchment);
  color: var(--ink);
}

.code-input:focus {
  border-color: var(--terracotta);
  outline: none;
}

.privacy-banner {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--sage);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
}

.privacy-banner strong {
  color: var(--ink);
}

/* =========================================================
   SMART BOARD DISPLAY (/board & /solo)
   ========================================================= */
.board-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.board-title-row h1 {
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.06;
  margin: 5px 0 4px;
}

.board-title-row .subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.board-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#projector {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(24, 30, 38, 0.16);
  background: var(--navy);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--navy);
  color: #fff;
  padding: 12px 14px;
}

.toolbar button {
  font-size: 13px;
  padding: 7px 11px;
}

.toolbar .timer-block {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.toolbar #time {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.toolbar #count {
  font-size: 13px;
  color: #e6dbc5;
  font-weight: 600;
}

.classroom-stats {
  display: flex;
  gap: 10px;
  padding: 0 14px 12px;
  background: var(--navy);
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  font-size: 15px;
  font-weight: 700;
}

.stat-card strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

.stat-streak {
  background: var(--slate);
  color: #fff;
  border: 1px solid #495466;
}

.stat-best {
  background: #e9d2a1;
  color: var(--ink);
  border: 1px solid #d1b374;
}

.stat-strikes {
  background: #6c2521;
  color: #fff;
  border: 1px solid #a2423c;
}

.stat-reward {
  background: #274135;
  color: #eef8f1;
  border: 1px solid #406d57;
  font-size: 14px;
}

.stat-reward strong {
  font-size: 17px;
  font-family: 'EB Garamond', Georgia, serif;
}

/* INDEPENDENCE HALL STAGE */
#stage {
  position: relative;
  height: 510px;
  isolation: isolate;
  overflow: hidden;
  background: #3e4436 url('/assets/hall-room.webp') center 45%/cover no-repeat;
}

.stage-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 22, 24, 0.56) 0%, rgba(16, 22, 24, 0.04) 38%, rgba(16, 20, 16, 0.14) 75%, rgba(12, 14, 12, 0.72) 100%);
  pointer-events: none;
  z-index: 1;
}

.mission-hud {
  position: absolute;
  top: 20px;
  left: 26px;
  z-index: 6;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.mission-hud span {
  display: block;
  font-size: 11px;
  letter-spacing: 2.2px;
  color: #f4d8a1;
  font-weight: 800;
}

.mission-hud h2 {
  font-size: clamp(22px, 3vw, 35px);
  margin: 4px 0 0;
  line-height: 1.1;
}

/* Delegate Floor Layer */
#delegatesLayer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.colonist {
  position: absolute;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  transition: opacity 0.65s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
  will-change: transform, opacity;
  pointer-events: auto;
  cursor: pointer;
}

.colonist-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 100%;
}

.colonist-shadow {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 68%;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(10, 8, 6, 0.56) 0%, rgba(10, 8, 6, 0) 75%);
  pointer-events: none;
}

.colonist img {
  display: block;
  height: 184px;
  width: auto;
  user-select: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.38));
}

.colonist.flipped img {
  transform: scaleX(-1);
}

.colonist.entering {
  opacity: 0;
  transform: translate(-50%, -70%) scale(0.75);
}

.colonist.spotlight {
  z-index: 80 !important;
  filter: drop-shadow(0 0 18px rgba(247, 217, 146, 0.75));
}

.colonist-tag {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 28, 36, 0.88);
  color: #f6e4bc;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border: 1px solid rgba(212, 177, 106, 0.5);
}

.colonist:hover .colonist-tag,
.colonist.spotlight .colonist-tag {
  opacity: 1;
}

/* Scatter when loud alarm triggers! */
#stage.alarm .colonist {
  opacity: 0 !important;
  transform: translate(-50%, -40%) rotate(11deg) scale(0.65) !important;
  transition-duration: 0.55s;
}

/* Colonial Dance Keyframes */
.dancing .dance-shuffle { animation: danceShuffle 1.5s ease-in-out infinite; }
.dancing .dance-twist   { animation: danceTwist 1.4s ease-in-out infinite; }
.dancing .dance-hop     { animation: danceHop 1.3s ease-in-out infinite; }
.dancing .dance-jig     { animation: danceJig 1.2s ease-in-out infinite; }
.dancing .dance-slide   { animation: danceSlide 1.8s ease-in-out infinite; }
.dancing .dance-bounce  { animation: danceBounce 1.15s ease-in-out infinite; }

@keyframes danceShuffle {
  0%, 100% { transform: translateX(-5px) rotate(-2.5deg); }
  50%      { transform: translateX(5px) rotate(2.5deg) translateY(-4px); }
}
@keyframes danceTwist {
  0%, 100% { transform: skewX(-2deg) rotate(-3deg); }
  50%      { transform: skewX(2deg) rotate(3deg) translateY(-3px); }
}
@keyframes danceHop {
  0%, 100% { transform: translateY(0) scaleY(0.98); }
  45%      { transform: translateY(-10px) scaleY(1.02); }
  65%      { transform: translateY(-3px) rotate(2deg); }
}
@keyframes danceJig {
  0%, 100% { transform: translateX(-4px) rotate(-3deg) translateY(0); }
  25%      { transform: translateY(-7px) rotate(2deg); }
  50%      { transform: translateX(4px) rotate(3deg) translateY(0); }
  75%      { transform: translateY(-6px) rotate(-2deg); }
}
@keyframes danceSlide {
  0%, 100% { transform: translateX(-9px) rotate(-1.5deg); }
  50%      { transform: translateX(9px) rotate(1.5deg); }
}
@keyframes danceBounce {
  0%, 100% { transform: translateY(0) scaleY(0.96); }
  50%      { transform: translateY(-8px) scaleY(1.03); }
}

/* Meet the Delegate Parchment Card (left of stage) */
#arrivalContext {
  position: absolute;
  left: 22px;
  top: 96px;
  width: 230px;
  background: linear-gradient(180deg, #fcf6e6 0%, #f3e6ca 100%);
  border: 1px solid #d7be8f;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  z-index: 9;
  color: var(--ink);
  text-align: center;
  animation: cardIn 0.4s ease-out;
}

#arrivalContext[hidden] { display: none; }

#arrivalContext small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 800;
  color: #845424;
}

#arrivalContext b {
  display: block;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 24px;
  line-height: 1.15;
  margin-top: 3px;
}

#arrivalContext .ctx-colony {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #9e3d21;
  margin-bottom: 8px;
}

#mapSection {
  margin: 0 0 8px;
}

#mapSection svg {
  width: 118px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #cbb996;
  display: block;
  margin: 0 auto 4px;
}

#mapSection figcaption,
#signatureSection figcaption {
  font-size: 10px;
  letter-spacing: 1.1px;
  color: #6b6150;
  text-transform: uppercase;
}

#signatureSection {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid #dac8a2;
}

.sigWrap {
  overflow: hidden;
  animation: sigWipe 1.3s ease-out both;
}

.sigScript {
  font-family: 'Pinyon Script', 'Brush Script MT', cursive;
  color: #251d14;
  display: block;
  line-height: 1.15;
}

.sigFlourish {
  width: 130px;
  height: 14px;
  display: block;
  margin: -2px auto 2px;
}

@keyframes sigWipe {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Latest Arrival pill (top-right of stage) */
#arrivalBadge {
  position: absolute;
  top: 20px;
  right: 22px;
  z-index: 9;
  background: rgba(20, 30, 26, 0.84);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid rgba(212, 177, 106, 0.45);
  min-width: 175px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

#arrivalBadge[hidden] { display: none; }
#arrivalBadge small { display: block; font-size: 9px; letter-spacing: 1.8px; color: #edd19a; font-weight: 800; }
#arrivalBadge b { display: block; font-family: 'EB Garamond', Georgia, serif; font-size: 20px; line-height: 1.15; }
#arrivalBadge span { display: block; font-size: 12px; color: #d8d5cd; }
#arrivalBadge em { display: block; font-size: 12px; font-style: normal; color: #f2c87a; font-weight: 600; margin-top: 2px; }

/* Welcome / Start Overlay on Stage */
#welcomeOverlay {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: min(600px, 90%);
  background: rgba(250, 246, 236, 0.96);
  border: 2px solid #dfcca5;
  border-radius: 16px;
  padding: 28px 28px 24px;
  text-align: center;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.42);
  z-index: 12;
}

#welcomeOverlay[hidden] { display: none; }

.welcome-crest-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  margin: 6px 0 8px;
}

.welcome-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.welcome-btns button {
  padding: 11px 18px;
  font-size: 14px;
}

/* =========================================================
   LOUD-ROOM INTRUDER OVERLAY (KING GEORGE OR TEACHER'S FACE!)
   ========================================================= */
#intruderOverlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 28px 6%;
  background: radial-gradient(circle at center, rgba(112, 30, 24, 0.72) 0%, rgba(18, 12, 12, 0.86) 100%);
  animation: intruderBackdrop 0.35s ease-out;
}

#intruderOverlay[hidden] { display: none; }

@keyframes intruderBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.intruder-portrait-card {
  position: relative;
  width: 285px;
  max-width: 44vw;
  text-align: center;
  animation: royalEntrance 0.48s cubic-bezier(0.18, 0.9, 0.32, 1.15);
}

@keyframes royalEntrance {
  0%   { transform: translateY(80px) scale(0.7) rotate(-4deg); opacity: 0; }
  70%  { transform: translateY(-6px) scale(1.03) rotate(1deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}

.intruder-frame {
  position: relative;
  border-radius: 140px 140px 18px 18px;
  padding: 8px;
  background: linear-gradient(135deg, #f3d796 0%, #b58636 45%, #f7e1a7 75%, #8a5f1f 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
}

.intruder-frame img.intruder-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 132px 132px 12px 12px;
  background: #241b16;
}

/* Optional Royal Wig & Crown SVG overlay for custom teacher photos! */
.royal-wig-overlay {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  width: 116%;
  height: auto;
  aspect-ratio: 260 / 110;
  z-index: 6;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.58));
}

.royal-wig-overlay[hidden] { display: none; }

.intruder-nameplate {
  margin-top: -12px;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #7e2521 0%, #5c1815 100%);
  color: #fcecd0;
  border: 2px solid #d4b16a;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.intruder-speech {
  background: var(--parchment);
  border: 3px solid #d4b16a;
  border-radius: 16px;
  padding: 24px 26px;
  max-width: 360px;
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5);
  animation: royalEntrance 0.55s cubic-bezier(0.18, 0.9, 0.32, 1.15);
}

.intruder-speech .speech-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #9e2d24;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.intruder-speech blockquote {
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 31px;
  line-height: 1.18;
  font-weight: 700;
  color: #241914;
}

.intruder-speech p {
  margin: 12px 0 0;
  font-size: 14px;
  color: #5c5448;
}

.calm-progress-track {
  margin-top: 14px;
  height: 7px;
  border-radius: 999px;
  background: #dfd3ba;
  overflow: hidden;
}

.calm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--sage-bright);
  transition: width 0.12s linear;
}

/* Completion Banner (56/56 Signers) & Final Strike Overlay */
#signingBanner, #strikeEndBanner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 90%);
  background: rgba(250, 245, 232, 0.97);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  z-index: 25;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

#signingBanner[hidden], #strikeEndBanner[hidden] { display: none; }

#signingBanner strong {
  display: block;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 40px;
  color: var(--ink);
  margin: 4px 0;
}

#strikeEndBanner strong {
  display: block;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 32px;
  color: #84231e;
  margin: 8px 0;
}

#fireworksCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 18;
  pointer-events: none;
}

.stage-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e8d5ad;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
  pointer-events: none;
}

/* Soundbar below stage */
.soundbar {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  padding: 16px 22px;
  border-top: 1px solid #e6dfd2;
}

.soundbar b {
  font-size: 13px;
  white-space: nowrap;
  min-width: 125px;
}

.soundbar .target-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
}

.meter {
  flex: 1;
  height: 14px;
  position: relative;
  background: #eae4d9;
  border-radius: 999px;
  overflow: visible;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--sage);
  transition: width 0.08s linear, background-color 0.15s ease;
}

.meter-fill.loud {
  background: #b93b33;
}

.meter-target {
  position: absolute;
  top: -5px;
  height: 24px;
  width: 3px;
  border-radius: 2px;
  background: var(--ink);
  left: 25%;
  transition: left 0.12s ease;
}

.demo-bar {
  background: #e9dfc9;
  border: 1px solid #d5c5a5;
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.demo-bar[hidden] { display: none; }

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}

.note-box {
  background: #fff;
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: 10px;
  font-size: 14px;
}

.note-box b {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7d4d1d;
  margin-bottom: 6px;
}

/* Fullscreen / Immersive mode for Smart Boards */
body.immersive {
  overflow: hidden;
}

body.immersive .site-header,
body.immersive .board-title-row,
body.immersive .notes-grid {
  display: none;
}

body.immersive .page-main {
  max-width: none;
  padding: 0;
}

body.immersive #projector {
  position: fixed;
  inset: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

body.immersive #stage {
  flex: 1;
  height: auto;
}

/* =========================================================
   TEACHER CONTROL VIEW (/teacher)
   ========================================================= */
.teacher-top-bar {
  display: grid;
  grid-template-columns: 1.15fr 1.25fr;
  gap: 18px;
  margin-bottom: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 6px 22px rgba(24, 30, 38, 0.05);
}

.card h2 {
  font-size: 25px;
  margin: 4px 0 12px;
  line-height: 1.15;
}

.card h3 {
  font-size: 20px;
  margin: 0 0 10px;
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.room-code-badge {
  font-family: 'Inter', monospace;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  padding: 10px 18px;
  background: var(--navy);
  color: #f6dca3;
  border-radius: 12px;
  border: 2px solid var(--gold);
  user-select: all;
}

.live-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.mini-stat {
  background: var(--parchment);
  border: 1px solid #e3d6bc;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.mini-stat span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.mini-stat strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-top: 2px;
}

.teacher-columns {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  align-items: start;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

/* Intruder Face Studio */
.face-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0 16px;
}

.face-tile {
  position: relative;
  border: 2px solid #ded5c4;
  border-radius: 12px;
  padding: 7px;
  background: var(--parchment);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.face-tile:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.face-tile.selected {
  border-color: var(--terracotta);
  background: #fff4e4;
  box-shadow: 0 0 0 3px rgba(173, 83, 40, 0.2);
}

.face-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 8px;
  display: block;
}

.face-tile strong {
  display: block;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.2;
}

.face-tile small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.custom-face-box {
  background: linear-gradient(180deg, #fcf8ee 0%, #f5ebd5 100%);
  border: 1.5px solid #dcc495;
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}

.qr-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dfd4bf;
  border-radius: 10px;
}

.qr-panel[hidden] { display: none; }

.qr-svg-wrap {
  width: 164px;
  height: 164px;
  flex-shrink: 0;
  background: #fff;
  padding: 8px;
  border: 1px solid #d5cbb8;
  border-radius: 10px;
}

.qr-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.custom-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #a9d5b5;
  border-radius: 10px;
}

.custom-preview-row[hidden] { display: none; }

.custom-preview-row img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
}

/* Settings Form Grid */
.settings-group {
  border-top: 1px solid #ece4d6;
  padding-top: 14px;
  margin-top: 14px;
}

.settings-group:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink);
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #c9c0b0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--terracotta);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--terracotta);
}

.mode-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mode-pill {
  padding: 10px 8px;
  text-align: center;
  border-radius: 10px;
  border: 1.5px solid #d2c8b6;
  background: var(--parchment);
  font-size: 13px;
}

.mode-pill strong {
  display: block;
}

.mode-pill small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.mode-pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--gold);
}

.mode-pill.active small {
  color: #e6d1a4;
}

/* Dialogs / Modals (56 Signer Roster, Report, Room Connect) */
dialog {
  border: 1px solid #d5c5a7;
  border-radius: 16px;
  padding: 24px 26px;
  width: min(760px, 94vw);
  max-height: 88vh;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

dialog::backdrop {
  background: rgba(16, 22, 32, 0.65);
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.dialog-head h2 {
  margin: 2px 0 0;
  font-size: 30px;
}

.roster-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.roster-filters input, .roster-filters select {
  flex: 1;
  min-width: 170px;
  padding: 9px 12px;
  border: 1px solid #c9c0b0;
  border-radius: 8px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.roster-card {
  border: 1px solid #dfd5c2;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.roster-card.arrived {
  border-color: var(--sage);
  background: #f1f8f2;
}

.roster-card img {
  height: 92px;
  width: auto;
  object-fit: contain;
}

.roster-card.waiting img {
  filter: grayscale(0.85) opacity(0.55);
}

.roster-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.roster-card small {
  font-size: 11px;
  color: var(--muted);
}

.roster-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.roster-card.arrived .roster-badge {
  background: #d8f1de;
  color: #1c5f30;
}

.roster-card.waiting .roster-badge {
  background: #efeae0;
  color: #6b675f;
}

/* =========================================================
   MOBILE PHONE UPLOAD PAGE (/upload)
   ========================================================= */
.upload-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.upload-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 12px 32px rgba(24, 30, 38, 0.08);
}

.upload-preview-circle {
  width: 210px;
  height: 210px;
  margin: 14px auto;
  border-radius: 50%;
  border: 5px solid var(--gold);
  background: var(--parchment);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.upload-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-btn-stack {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.upload-big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

/* Responsive Breakpoints */
@media (max-width: 1040px) {
  .teacher-top-bar,
  .teacher-columns,
  .notes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  #stage {
    height: 440px;
  }
  .colonist img {
    height: 132px;
  }
  #arrivalContext {
    display: none;
  }
  #intruderOverlay {
    flex-direction: column;
    gap: 14px;
  }
  .intruder-portrait-card {
    width: 185px;
  }
  .intruder-speech blockquote {
    font-size: 22px;
  }
  .live-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .face-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .room-code-badge {
    font-size: 26px;
    letter-spacing: 4px;
  }
  .soundbar {
    flex-wrap: wrap;
    gap: 10px;
  }
}


/* =========================================================
   V2 UPGRADE: PURE ROOM-ONLY SMART BOARD (/board)
   ========================================================= */
body.board-pure {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #14120f;
}

.board-pure-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #14120f;
}

.board-pure-stage {
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  min-height: 0;
  position: relative;
  background: #3e4436 url('/assets/hall-room.webp') center 44%/cover no-repeat !important;
}

body.board-pure .stage-shade {
  background: linear-gradient(
    180deg,
    rgba(14, 18, 20, 0.56) 0%,
    rgba(14, 18, 20, 0.08) 26%,
    rgba(14, 16, 14, 0.04) 72%,
    rgba(12, 11, 9, 0.72) 100%
  );
}

/* Classroom-facing translucent top HUD overlay inside the room */
.board-top-hud {
  position: absolute;
  top: 16px;
  left: 22px;
  right: 22px;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

body.board-pure .mission-hud {
  position: static;
  max-width: 48%;
}

body.board-pure .mission-hud span {
  font-size: 11px;
  letter-spacing: 2px;
  color: #f4d8a1;
}

body.board-pure .mission-hud h2 {
  font-size: clamp(20px, 2.05vw, 28px);
  margin-top: 3px;
}

.board-hud-pills {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  pointer-events: none;
}

.hud-pill {
  background: rgba(20, 22, 26, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 195, 130, 0.34);
  border-radius: 12px;
  padding: 7px 13px;
  color: #fff;
  min-width: 82px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.hud-pill[hidden] {
  display: none !important;
}

.hud-pill span {
  display: block;
  font-size: 9px;
  letter-spacing: 1.4px;
  font-weight: 800;
  color: #e9cfa0;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.hud-pill strong {
  display: block;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 22px;
  line-height: 1.05;
  color: #fffdf7;
  white-space: nowrap;
}

.hud-pill-timer {
  background: rgba(139, 47, 36, 0.82);
  border-color: rgba(244, 212, 148, 0.55);
  min-width: 92px;
}

.hud-pill-strikes {
  background: rgba(145, 34, 28, 0.85);
  border-color: rgba(255, 175, 165, 0.5);
}

.hud-pill-reward {
  background: rgba(34, 62, 43, 0.82);
  border-color: rgba(182, 226, 192, 0.45);
  max-width: 240px;
}

.hud-pill-reward strong {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Position Latest Arrival pill cleanly below the top-right glass HUD pills */
body.board-pure #arrivalBadge {
  top: 86px;
  right: 22px;
  z-index: 9;
  background: rgba(20, 22, 26, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 195, 130, 0.45);
}

/* Position Meet the Delegate / Special Guest card cleanly below top-left Mission HUD */
body.board-pure #arrivalContext {
  top: 112px;
  left: 22px;
  z-index: 9;
  max-width: 248px;
}

.guest-context-portrait {
  margin: 6px 0 8px;
  display: flex;
  justify-content: center;
}

.guest-context-portrait img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #c99d4a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ctx-fact {
  margin: 6px 0 8px;
  font-size: 12px;
  line-height: 1.38;
  color: #4b4338;
}

.ctx-fact[hidden] {
  display: none !important;
}

/* Proportionate standing delegates on full-viewport Smart Board room */
body.board-pure .colonist img {
  height: clamp(160px, 24.5vh, 232px);
}

/* Custom Guest / Bonus Character Cameo & Golden Nameplate */
.colonist.custom-guest .guest-always-tag {
  opacity: 0.96;
  background: rgba(29, 25, 19, 0.88);
  color: #f9df9d;
  border: 1px solid rgba(229, 187, 99, 0.72);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.guest-cameo-standee {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
}

.guest-cameo-ring {
  width: clamp(92px, 12vh, 126px);
  height: clamp(92px, 12vh, 126px);
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #fce8a8 0%, #c89437 52%, #7c5215 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(255, 244, 214, 0.35);
  overflow: hidden;
}

.guest-cameo-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  filter: none !important;
}

.guest-ribbon-name {
  margin-top: -10px;
  z-index: 2;
  background: linear-gradient(180deg, #27221b 0%, #171410 100%);
  color: #f9e3ad;
  border: 1px solid rgba(226, 188, 108, 0.72);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42);
}

/* Stage footer fact ticker inside pure room */
body.board-pure .stage-foot {
  padding: 10px 22px;
  gap: 18px;
}

.stage-foot-fact {
  flex: 1;
  text-align: center;
  color: #f2e5c9;
  font-size: 12px;
  letter-spacing: 0.2px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

/* Bottom translucent dark classroom soundbar for pure /board */
.board-soundbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #1d1915 0%, #13110e 100%);
  border-top: 1px solid rgba(214, 180, 110, 0.26);
  color: #f3ead7;
  min-height: 52px;
  z-index: 12;
}

.board-soundbar b {
  font-size: 13px;
  white-space: nowrap;
  min-width: 122px;
  color: #f7e6c4;
}

.board-soundbar .meter {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.14);
}

.board-soundbar .meter-target {
  background: #f5d896;
  height: 22px;
  top: -5px;
}

.board-soundbar .target-label {
  font-size: 12px;
  color: #cfc4b0;
  white-space: nowrap;
  font-weight: 600;
}

.board-corner-utils {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.corner-status-btn,
.corner-fs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #dfd4be;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.corner-status-btn:hover,
.corner-fs-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
}

.corner-fs-btn {
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1;
}

.corner-status-btn .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8f969e;
  display: inline-block;
}

.corner-status-btn.dot-live .pill-dot {
  background: #4cd97b;
  box-shadow: 0 0 8px rgba(76, 217, 123, 0.75);
}

.corner-status-btn.dot-wait .pill-dot {
  background: #f0b94b;
}

.corner-status-btn.dot-off .pill-dot {
  background: #d96b63;
}

/* =========================================================
   V2 UPGRADE: TEACHER "ADD ANY COLONIST OR CHARACTER" STUDIO
   ========================================================= */
.guest-studio-card {
  border-color: #d9c7a3;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.guest-studio-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 18px;
}

.guest-subpanel {
  background: #faf6ed;
  border: 1px solid #e4d8c1;
  border-radius: 12px;
  padding: 14px 16px;
}

.guest-subpanel-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}

.guest-subpanel-title small {
  font-weight: 600;
  color: var(--muted);
}

.bonus-figures-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bonus-fig-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid #dcd0b8;
  border-radius: 10px;
  padding: 6px 9px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.bonus-fig-btn:hover {
  border-color: #c4953f;
  box-shadow: 0 4px 12px rgba(125, 77, 29, 0.12);
  transform: translateY(-1px);
}

.bonus-fig-btn.added {
  background: #f0f8f2;
  border-color: #8cc29c;
}

.bonus-fig-btn img {
  width: 34px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.bonus-fig-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bonus-fig-meta strong {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bonus-fig-meta small {
  font-size: 11px;
  color: #7d4d1d;
  font-weight: 600;
}

.bonus-fig-btn.added .bonus-fig-meta small {
  color: #1f6b39;
}

.signer-quick-row {
  display: grid;
  grid-template-columns: 0.9fr 1.25fr auto;
  gap: 8px;
  align-items: center;
}

.signer-quick-row input,
.signer-quick-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfc4ae;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.appearance-mode-bar {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 10px;
  background: #efe7d6;
  padding: 4px;
  border-radius: 9px;
}

.mode-tab {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #5c5346;
  cursor: pointer;
}

.mode-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.guest-sprite-picker {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  max-height: 152px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #dfd3bc;
  border-radius: 10px;
}

.sprite-pick-btn {
  border: 2px solid transparent;
  background: #f8f4ea;
  border-radius: 8px;
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
}

.sprite-pick-btn:hover {
  border-color: #d0ad68;
}

.sprite-pick-btn.selected {
  border-color: #a64924;
  background: #fff5e2;
  box-shadow: 0 0 0 2px rgba(166, 73, 36, 0.2);
}

.sprite-pick-btn img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.guest-photo-panel {
  background: #fff;
  border: 1px solid #dfd3bc;
  border-radius: 10px;
  padding: 10px 12px;
}

.guest-photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  background: #f2f8f3;
  border: 1px solid #b6d9be;
  border-radius: 8px;
}

.guest-photo-preview img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c99d4a;
}

.active-guests-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4d8c1;
}

.active-guests-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-guest-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d7c7a5;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.active-guest-chip img.chip-sprite {
  width: 28px;
  height: 36px;
  object-fit: contain;
}

.active-guest-chip img.chip-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c99d4a;
}

.active-guest-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.active-guest-info strong {
  font-size: 13px;
  color: var(--ink);
}

.active-guest-info small {
  font-size: 11px;
  color: var(--muted);
}

.guest-remove-btn {
  border: 1px solid #e2bdb8;
  background: #fff5f4;
  color: #9e2a23;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.guest-remove-btn:hover {
  background: #9e2a23;
  color: #fff;
}

.roster-drop-btn {
  margin-top: 4px;
  background: #f5ead3;
  border: 1px solid #cfb070;
  color: #6b3f14;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.roster-drop-btn:hover {
  background: #c89437;
  color: #fff;
}

@media (max-width: 980px) {
  .guest-studio-grid {
    grid-template-columns: 1fr;
  }
  .signer-quick-row {
    grid-template-columns: 1fr;
  }
  .guest-sprite-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .board-top-hud {
    flex-direction: column;
    gap: 8px;
  }
  body.board-pure .mission-hud {
    max-width: 100%;
  }
}

/* Ensure HTML [hidden] always wins over grid/flex rules in v2 panels */
.guest-sprite-picker[hidden],
.guest-photo-panel[hidden],
.guest-photo-preview[hidden],
.active-guests-wrap[hidden],
.qr-panel[hidden] {
  display: none !important;
}
