:root {
  color-scheme: dark;
  font-family: "Inter", "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #030003;
  --bg-gradient: radial-gradient(circle at 20% 20%, rgba(255, 0, 143, 0.25), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(255, 0, 0, 0.25), transparent 60%),
    linear-gradient(125deg, #050007, #09000f 45%, #030003 80%);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 0, 100, 0.4);
  --text: #fdf7ff;
  --text-dim: rgba(253, 247, 255, 0.6);
  --accent: #ff2f8a;
  --accent-2: #ff0033;
  --warn: #ff3030;
  --success: #32f7c1;
  --radius-xl: 36px;
  --radius-lg: 24px;
  --radius: 16px;
  --player-media-max-width: min(420px, 100%);
  --shadow-soft: 0 15px 50px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 30px 75px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

.laser-bg {
  background-size: 220% 220%;
  animation: bgShift 6s ease-in-out infinite;
}

.laser-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.2) 45%, rgba(80, 255, 200, 0.8) 50%, transparent 55%, transparent 100%),
    repeating-linear-gradient(180deg, rgba(80, 255, 200, 0.25) 0, rgba(80, 255, 200, 0.25) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: screen;
  opacity: 0.5;
  pointer-events: none;
  animation: laserSweep 6s linear infinite;
}

.player-body.laser-bg::after {
  display: none;
}

@keyframes bgShift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 60%;
  }
  100% {
    background-position: 0% 0%;
  }
}

@keyframes laserSweep {
  0% {
    transform: translateY(-100%);
  }
  50% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(100%);
  }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.is-hidden {
  display: none !important;
}

.muted {
  color: var(--text-dim);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
}

.input-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.app-shell {
  max-width: 1300px;
  width: 95%;
  margin: 0 auto;
  padding: 24px 24px 96px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 0, 143, 0.5), rgba(255, 0, 0, 0.35));
  box-shadow: var(--shadow-strong);
  min-height: 48px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.1;
}

.countdown-strip {
  width: 100%;
  margin-top: 12px;
}

.countdown-strip--top {
  margin: 0 0 16px;
}

.countdown-pill {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.countdown-pill[data-state="warn"] {
  border-color: rgba(255, 95, 95, 0.6);
  box-shadow: 0 0 25px rgba(255, 95, 95, 0.35);
}

.player-body .countdown-pill--player {
  border-color: rgba(var(--player-accent-rgb), 0.4);
  background: linear-gradient(135deg, rgba(var(--player-accent-rgb), 0.8), rgba(var(--player-accent-rgb), 0.4));
  color: var(--player-accent-contrast);
  box-shadow: 0 12px 28px rgba(var(--player-accent-rgb), 0.35);
}

.host-body .countdown-pill--host {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.85), rgba(0, 200, 255, 0.4));
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.lede {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  border-radius: 999px;
  padding: 12px 28px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 0, 120, 0.5);
  color: var(--text);
  background: linear-gradient(125deg, rgba(255, 0, 143, 0.85), rgba(255, 0, 0, 0.65));
  box-shadow: 0 20px 40px rgba(255, 0, 120, 0.4);
  backdrop-filter: blur(18px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 60px rgba(255, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-secondary {
  background: linear-gradient(120deg, rgba(255, 0, 0, 0.7), rgba(255, 0, 143, 0.4));
  border-color: rgba(255, 0, 0, 0.5);
}

.btn-warn {
  background: linear-gradient(120deg, rgba(255, 48, 48, 0.9), rgba(255, 0, 80, 0.5));
  border-color: rgba(255, 48, 48, 0.7);
}

.btn-danger {
  background: linear-gradient(120deg, rgba(255, 0, 0, 0.95), rgba(120, 0, 0, 0.8));
  border-color: rgba(255, 0, 0, 0.8);
  box-shadow: 0 20px 45px rgba(255, 0, 0, 0.35);
}

.btn-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.85rem;
  box-shadow: none;
}

.player-body .btn {
  background: linear-gradient(145deg, rgba(var(--player-accent-rgb), 0.95), rgba(var(--player-accent-rgb), 0.6));
  border-color: rgba(var(--player-accent-rgb), 0.6);
  color: var(--player-accent-contrast);
  box-shadow: 0 14px 30px rgba(var(--player-accent-rgb), 0.35);
}

.player-body .btn-secondary {
  background: rgba(var(--player-accent-rgb), 0.18);
  border-color: rgba(var(--player-accent-rgb), 0.45);
  color: #fff;
  box-shadow: 0 12px 24px rgba(var(--player-accent-rgb), 0.25);
}

.player-body .btn:disabled,
.player-body .btn-secondary:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
}

.rules-card summary,
.rejoin-card summary {
  list-style: none;
}

.rules-card[open] .rules-chevron,
.rejoin-card[open] .rules-chevron {
  transform: rotate(180deg);
}

.rules-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}

.rules-chevron {
  transition: transform 0.2s ease;
}

.rules-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 18px;
}

.rules-columns h3 {
  margin: 0 0 10px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.rules-columns ol {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.rules-columns ul {
  margin: 0 0 8px 18px;
  line-height: 1.5;
}

.rules-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.rules-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  background-size: 220% 220%;
  animation: panelGlow 6s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

.rules-panel:hover::after {
  opacity: 0.55;
}

.rules-panel--vs::after {
  background: linear-gradient(135deg, rgba(0, 180, 255, 0.4), rgba(255, 0, 128, 0.25));
}

.rules-panel--story::after {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.45), rgba(185, 0, 255, 0.35));
}

.rules-panel--docs::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 0, 200, 0.25));
}

.rules-panel--effects {
  padding: 0px 18px 12px;
  margin-top: 8px;
}

.rules-panel--effects h3 {
  margin: 0 0 4px;
}

.rules-panel--effects ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.rules-panel--effects p {
  margin: 0;
}

.rules-panel > * {
  position: relative;
  z-index: 1;
}

.rules-panel--vs h3 {
  color: #9fe0ff;
}

.rules-panel--story h3 {
  color: #ffc487;
}

.rules-panel--docs h3 {
  color: rgba(255, 255, 255, 0.85);
}

.rules-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.rules-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rules-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.rules-links a.doc-link--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.rules-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.host-tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.host-tip {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.25);
  padding: 18px 20px 18px 64px;
  min-height: 120px;
  display: flex;
  align-items: center;
}

.host-tip__badge {
  position: absolute;
  left: 20px;
  top: 24px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff004c, #ff8e20);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(255, 64, 64, 0.4);
}

.host-tip__body h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.host-tip__body p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.4;
}

.rules-body ul {
  padding-left: 20px;
  margin: 0;
  color: var(--text-dim);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 32px;
  flex: 1;
  align-items: center;
  align-content: center;
  justify-items: stretch;
}

.scanner-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.scanner-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-card {
  position: relative;
  top: 0;
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.login-header .btn {
  height: 40px;
  padding: 0 16px;
}

.story-upload-card input[type="file"] {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}


.card {
  background: linear-gradient(150deg, rgba(20, 0, 20, 0.85), rgba(25, 0, 10, 0.65)),
    linear-gradient(145deg, rgba(255, 0, 143, 0.1), rgba(255, 0, 0, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(28px);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: -30% auto auto 60%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 70%);
  pointer-events: none;
  opacity: 0.6;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.card h3 {
  margin-top: 18px;
}

.pill-toggle {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.pill-toggle[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

input,
textarea,
select {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 12px 16px;
  background: var(--surface-strong);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px var(--accent-2);
}

.input-error {
  border-color: var(--warn) !important;
  box-shadow: 0 0 0 1px var(--warn) !important;
}

textarea {
  resize: vertical;
}

.field-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card form .btn,
.card form .btn-secondary,
.card form .btn-warn {
  margin-top: 12px;
}
.card form .host-controls-grid .btn,
.card form .host-controls-grid .btn-secondary,
.card form .host-controls-grid .btn-warn {
  margin-top: 0;
}
.card .host-controls-grid .btn,
.card .host-controls-grid .btn-secondary,
.card .host-controls-grid .btn-warn {
  margin-top: 0;
}
.card .host-controls-grid .btn,
.card .host-controls-grid .btn-secondary,
.card .host-controls-grid .btn-warn {
  margin-top: 0;
}

.rooms,
#packList,
#playerHistory,
#hostFoundList,
#roomsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#playerHistory {
  align-items: stretch;
}

.room-card__host {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.room-player-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.room-player-list button {
  flex-shrink: 0;
}

.admin-panel .admin-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-panel {
  margin-top: 32px;
}

.admin-panel--collapsed {
  display: none;
}

.admin-login-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-login-row.tight {
  align-items: flex-end;
}

.status-inline {
  margin-top: 8px;
  color: var(--success);
}
.admin-login-form {
  flex: 1;
  min-width: 260px;
}

.admin-login-form.compact label {
  margin-bottom: 8px;
}

.admin-login-form button {
  width: 100%;
}

.admin-logout-col {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: flex-end;
}

.admin-logout-col .btn {
  width: 100%;
}

.admin-broadcast form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.broadcast-field {
  flex: 1;
  border-radius: 12px;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.broadcast-field input {
  border: none;
  background: transparent;
  width: 100%;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.admin-broadcast .btn {
  margin-top: 0;
  padding: 14px 20px;
  border-radius: 12px;
  width: 100%;
}

.broadcast-submit {
  width: 100%;
}

.admin-panel .admin-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-list-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

.admin-list-actions .btn {
  margin-left: auto;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.pack-select-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: flex-end;
}

.pack-select-row .btn-sm {
  align-self: center;
}

.pack-meta {
  margin: 8px 0 16px;
  font-size: 0.9rem;
}

.pack-briefing {
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(12, 0, 20, 0.85), rgba(35, 0, 40, 0.9));
  border: 1px solid rgba(255, 0, 110, 0.35);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
}

.pack-briefing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 0, 100, 0.3), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.pack-briefing.animate::after {
  opacity: 1;
}

.pack-briefing__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255, 122, 172, 0.7);
  margin-bottom: 6px;
}

.pack-briefing h3 {
  margin: 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pack-briefing__text {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.4;
}

.pack-briefing.animate {
  animation: missionReveal 0.65s ease;
}

@keyframes missionReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.room-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.room-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 6px 0 10px;
}

.room-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.room-player-list {
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
}

.pill-warn {
  background: rgba(255, 136, 77, 0.3);
}

.status-badge {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* Host */
.host-body {
  background: var(--bg-gradient);
}

.host-body.host-light {
  --bg-gradient: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(135deg, #f5f0ff 0%, #fdf8ff 100%);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 1);
  --text: #0b0620;
  --text-dim: rgba(11, 6, 32, 0.6);
  --border: rgba(255, 64, 128, 0.3);
  color: var(--text);
}
.host-body.host-light .hero {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.2), rgba(0, 200, 255, 0.2));
  color: var(--text);
}
.host-body.host-light .panel {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.host-body.host-light .panel.grid-panel {
  background: transparent;
  border: 0;
}
.host-body.host-light .toast {
  background: rgba(255, 255, 255, 0.95);
  color: #0b0620;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.host-body.host-light .pill {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}
.host-body.host-light .countdown-pill--host {
  background: linear-gradient(135deg, rgba(0, 150, 255, 0.12), rgba(255, 0, 100, 0.15));
  color: var(--text);
}

.host-shell {
  min-height: 100vh;
  padding-bottom: 96px;
}

.host-hero {
  align-items: center;
}

.host-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.host-meta-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.host-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.token-text {
  display: block;
  font-size: 0.8rem;
}

.host-main {
  margin-top: 28px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.panel.grid-panel {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.host-controls-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.host-pack-label {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.host-pack-label strong {
  color: var(--text-bright);
}

.host-controls-grid label {
  width: 100%;
  margin: 0;
}

.host-controls-grid label input {
  width: 100%;
  margin: 0;
}

.host-controls-grid .btn,
.host-controls-grid .btn-secondary {
  width: 100%;
  margin: 0 !important;
  border-radius: var(--radius);
}

.host-controls-grid .btn + .btn,
.host-controls-grid .btn + .btn-secondary,
.host-controls-grid .btn-secondary + .btn,
.host-controls-grid .btn-secondary + .btn-secondary {
  margin-top: 8px !important;
}

@media (max-width: 640px) {
  .host-controls-grid {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .host-controls-grid label {
    margin-bottom: 0;
    width: 100%;
  }
  .host-controls-grid label input {
    display: block;
    width: 100%;
    margin: 0;
  }
  .host-controls-grid button {
    width: 100%;
    margin-top: 0;
    border-radius: var(--radius);
  }
  .host-controls-grid button + button {
    margin-top: 8px;
  }
}

.host-target-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.host-target-hint strong {
  color: #fff;
}

.host-player-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

@media (min-width: 768px) {
  .host-player-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (min-width: 1200px) {
  .host-player-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.host-player-card {
  padding: 14px 14px 38px;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2)),
    color-mix(in srgb, var(--player-card-color, rgba(255, 255, 255, 0.04)) 65%, rgba(6, 0, 12, 0.85));
  border: 1px solid color-mix(in srgb, var(--player-card-color, rgba(255, 255, 255, 0.1)) 55%, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 120px;
  position: relative;
}
.host-body.host-light .host-player-card,
.host-body.host-light .panel.codes-panel,
.host-body.host-light .codes-panel__body .code-card,
.host-body.host-light .hint-panel-wrapper,
.host-body.host-light .panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  color: #0b0620;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
}
.host-body.host-light .host-player-card span,
.host-body.host-light .codes-panel__body,
.host-body.host-light .code-card__story,
.host-body.host-light .code-card__meta {
  color: rgba(11, 6, 32, 0.7);
}

.host-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.host-player-score {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.host-player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.host-player-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.host-player-found,
.host-player-scans-label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.player-color-slot {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  pointer-events: none;
}

.player-color-pill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 0 4px rgba(255, 255, 255, 0.15),
    0 0 8px rgba(255, 255, 255, 0.2);
  position: relative;
  background: var(--badge-color, rgba(255, 255, 255, 0.2));
}

.player-color-pill::after {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--badge-color, rgba(255, 255, 255, 0.3)), transparent 60%);
  filter: blur(14px);
  opacity: 0.6;
  z-index: -1;
}

.player-color-pill--default {
  border-style: dashed;
  opacity: 0.5;
}

.player-color-pill:hover {
  transform: scale(1.05);
}

.host-player-card strong {
  font-size: 1rem;
}

.host-player-card span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.host-player-card .player-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-card strong {
  display: block;
  font-size: 1rem;
}

.player-card span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.player-actions {
  display: flex;
  gap: 8px;
}

.code-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.code-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: linear-gradient(145deg, rgba(35, 0, 35, 0.65), rgba(5, 0, 15, 0.8));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.code-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(255, 0, 120, 0.25);
}

.code-card--hint {
  animation: hintPulse 1.4s ease-in-out 2;
  border-color: rgba(255, 255, 255, 0.6);
}

@keyframes hintPulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
  }
}

.code-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.code-card__meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-left: 8px;
}

.code-card__payloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.code-card__payloads span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.code-card__payloads strong {
  font-size: 1rem;
}

.code-card__story {
  margin-bottom: 12px;
  color: var(--text-dim);
}

.code-card__media {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.code-card__media-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.code-card__audio,
.code-card__video {
  width: 220px;
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.code-card__video {
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.05);
}

.code-card__image {
  width: 140px;
  height: 140px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.code-card__image:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
}

.code-card textarea {
  width: 100%;
  min-height: 90px;
  margin-bottom: 12px;
}

.code-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.code-card__actions .btn {
  flex: 1;
  min-width: 160px;
}

@media (max-width: 640px) {
  .code-card__actions {
    flex-direction: column;
  }

  .code-card__actions .btn {
    width: 100%;
    min-width: 0;
  }
}

.code-card__helper {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px;
}

.code-card__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.code-card__tools button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 14px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-card__tools button:disabled {
  opacity: 0.4;
}

.code-card__actions .btn {
  flex: 1;
  min-width: 160px;
}

.code-card__helper {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px;
}

.hint-panel textarea {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  resize: vertical;
  min-height: 96px;
  margin-top: 8px;
}

.hint-current {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hint-status {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 8px;
}

.hint-story {
  color: var(--text-dim);
  margin-top: 6px;
  max-width: 420px;
}

.hint-base {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.92rem;
  margin-top: 6px;
}

.hint-requests {
  margin-top: 16px;
}

.hint-request-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hint-request {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, auto));
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.codes-panel {
  padding: 0;
}

.codes-panel summary {
  padding: 24px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.codes-panel summary::-webkit-details-marker {
  display: none;
}

.codes-panel__body {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.edit-hint {
  margin-top: -4px;
  font-size: 0.85rem;
}

.hint-panel-wrapper h3 {
  margin: 0 0 12px;
}

.hint-request.pending {
  border-color: rgba(255, 136, 77, 0.5);
  box-shadow: 0 0 20px rgba(255, 136, 77, 0.25);
}

.hint-request strong {
  font-size: 0.95rem;
}

.hint-request span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.request-status {
  text-transform: capitalize;
}

.hint-request small {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.found-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.found-entry {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
}

.host-body .found-entry[data-player-color="true"] {
  border-color: var(--found-entry-color, rgba(255, 255, 255, 0.25));
  background: linear-gradient(
      135deg,
      rgba(var(--found-entry-color-rgb, 255, 255, 255), 0.25),
      rgba(var(--found-entry-color-rgb, 255, 255, 255), 0.08)
    ),
    rgba(0, 0, 0, 0.2);
  box-shadow: 0 12px 32px rgba(var(--found-entry-color-rgb, 0, 0, 0), 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.found-entry--log {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.found-entry__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.found-entry__code {
  letter-spacing: 0.08em;
}

.found-entry__player {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.found-entry__meta--log {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(77, 208, 255, 0.15);
  border: 1px solid rgba(77, 208, 255, 0.3);
  font-weight: 600;
}

.chip-attention {
  background: rgba(255, 136, 77, 0.15);
  border-color: rgba(255, 136, 77, 0.4);
  box-shadow: 0 0 18px rgba(255, 136, 77, 0.35);
}

#hostFoundList li {
  list-style: none;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Player */
.player-body {
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  --player-accent: #ff4dd8;
  --player-accent-rgb: 255, 77, 216;
  --player-accent-contrast: #05070e;
  --player-accent-soft: rgba(255, 77, 216, 0.18);
  --player-accent-strong: rgba(255, 77, 216, 0.35);
  background:
    radial-gradient(1400px 900px at 15% 0%, rgba(var(--player-accent-rgb), 0.18), rgba(var(--player-accent-rgb), 0.04) 65%),
    radial-gradient(1200px 800px at 85% 0%, rgba(var(--player-accent-rgb), 0.12), rgba(var(--player-accent-rgb), 0.03) 70%),
    linear-gradient(160deg,
      rgba(var(--player-accent-rgb), 0.18) 0%,
      rgba(var(--player-accent-rgb), 0.32) 40%,
      rgba(var(--player-accent-rgb), 0.48) 100%);
  background-color: rgba(var(--player-accent-rgb), 0.25);
}

.player-main {
  display: grid;
  gap: 24px;
}

.card--hidden {
  display: none !important;
}

.player-body .player-card {
  border: 1px solid rgba(var(--player-accent-rgb), 0.3);
  box-shadow: 0 18px 36px rgba(var(--player-accent-rgb), 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(10, 6, 20, 0.85));
}

.player-body .player-card h2,
.player-body .card-label {
  color: #fff;
}

.player-body .broadcast-inline {
  border-color: var(--player-accent-soft);
  box-shadow: 0 12px 24px rgba(var(--player-accent-rgb), 0.18);
}

.player-body .story-card figure {
  border: 1px solid rgba(var(--player-accent-rgb), 0.25);
}

.story-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.story-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 4px;
}

.story-tab {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}

.story-tab.is-active {
  background: rgba(var(--player-accent-rgb, 255, 0, 153), 0.25);
  color: #fff;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.story-tab--highlight {
  box-shadow:
    0 0 18px rgba(var(--player-accent-rgb, 255, 0, 153), 0.8),
    inset 0 0 12px rgba(var(--player-accent-rgb, 255, 0, 153), 0.4);
  color: #fff;
  animation: storyTabPulse 1.2s ease-in-out infinite;
}

@keyframes storyTabPulse {
  0% {
    box-shadow:
      0 0 6px rgba(var(--player-accent-rgb, 255, 0, 153), 0.4),
      inset 0 0 4px rgba(var(--player-accent-rgb, 255, 0, 153), 0.2);
  }
  50% {
    box-shadow:
      0 0 20px rgba(var(--player-accent-rgb, 255, 0, 153), 0.9),
      inset 0 0 14px rgba(var(--player-accent-rgb, 255, 0, 153), 0.55);
  }
  100% {
    box-shadow:
      0 0 6px rgba(var(--player-accent-rgb, 255, 0, 153), 0.4),
      inset 0 0 4px rgba(var(--player-accent-rgb, 255, 0, 153), 0.2);
  }
}

.story-panels {
  margin-top: 12px;
}

.story-panel {
  display: none;
}

.story-panel.is-active {
  display: block;
}

.player-sticky-actions {
  position: sticky;
  bottom: 16px;
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(5, 0, 8, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.player-sticky-actions .btn {
  flex: 1 1 140px;
}

.player-body .hero-pill {
  background: linear-gradient(145deg, rgba(var(--player-accent-rgb), 0.95), rgba(var(--player-accent-rgb), 0.6));
  color: var(--player-accent-contrast);
  border: 1px solid rgba(var(--player-accent-rgb), 0.45);
  box-shadow: 0 12px 32px rgba(var(--player-accent-rgb), 0.35);
}

.player-body .hero-pill--status {
  border: 1px solid rgba(var(--player-accent-rgb), 0.25);
  box-shadow: 0 10px 28px rgba(var(--player-accent-rgb), 0.2);
}

.player-body .hero-pill--status.is-connected {
  background: rgba(var(--player-accent-rgb), 0.3);
  color: #fff;
}

.player-body .hero-pill--status.is-offline {
  border-color: rgba(255, 90, 90, 0.4);
}

.player-body .hero-pill--status.is-locked {
  border-color: rgba(255, 190, 70, 0.4);
}

.player-body .scan-overlay {
  border: 1px solid rgba(var(--player-accent-rgb), 0.18);
}

.player-body .scan-overlay--success {
  background: linear-gradient(135deg, rgba(var(--player-accent-rgb), 0.85), rgba(6, 8, 14, 0.85));
  text-shadow: 0 0 18px rgba(var(--player-accent-rgb), 0.7);
}

.player-body .scan-overlay--info {
  background: linear-gradient(135deg, rgba(var(--player-accent-rgb), 0.45), rgba(5, 5, 10, 0.85));
}

.player-body .scan-overlay--secret {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(210, 210, 210, 0.9));
  color: #080808;
  border-color: rgba(0, 0, 0, 0.25);
}
.hint-card .hint-copy {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.hint-card button {
  width: 100%;
}

.hint-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.hint-actions button {
  flex: 1 1 160px;
}

.hint-card--active {
  border: 1px solid rgba(255, 47, 138, 0.6);
  box-shadow: 0 0 25px rgba(255, 47, 138, 0.25);
}

.hint-card--active .hint-copy {
  color: #fff;
  font-weight: 600;
}

.player-body .hint-card--active {
  border: 1px solid var(--player-accent);
  box-shadow: 0 0 25px rgba(var(--player-accent-rgb), 0.3);
}

.hint-card--pulse {
  animation: hintPulsePlayer 1.2s ease-in-out 2;
}

@keyframes hintPulsePlayer {
  0% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
  }
}

.found-gallery {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.found-card {
  display: flex;
  gap: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
}

.player-body .found-card {
  border-color: var(--player-accent-soft);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.45), 0 12px 30px rgba(var(--player-accent-rgb), 0.2);
}

.found-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.found-card--vs {
  flex-direction: column;
  align-items: flex-start;
}

.found-card--vs .found-card__body {
  width: 100%;
}

.found-card--vs h3 {
  margin-top: 6px;
  margin-bottom: 4px;
}

.found-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.found-story {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
}

.found-media-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.found-media {
  flex: 1;
  min-width: 200px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.found-media audio,
.found-media video {
  width: 100%;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.4);
}

.found-media--video video {
  aspect-ratio: 16 / 9;
}

.player-body .found-media {
  border-color: rgba(var(--player-accent-rgb), 0.3);
  background: rgba(var(--player-accent-rgb), 0.08);
}

.polaroid {
  margin: 0;
  width: 150px;
  background: #fefefe;
  border-radius: 16px;
  padding: 10px 10px 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.polaroid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.2);
}

.polaroid__placeholder {
  width: 100%;
  height: 150px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.polaroid__label {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #111;
}

.player-body .polaroid__label {
  background: linear-gradient(145deg, rgba(var(--player-accent-rgb), 0.9), rgba(var(--player-accent-rgb), 0.55));
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--player-accent-contrast);
  box-shadow: 0 8px 16px rgba(var(--player-accent-rgb), 0.35);
}

.found-card__story-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.found-card__story-meta .pill {
  padding: 4px 12px;
  font-size: 0.75rem;
}

.player-body .found-card__story-meta .pill {
  background: rgba(var(--player-accent-rgb), 0.18);
  border-color: rgba(var(--player-accent-rgb), 0.4);
  color: #fff;
}

.player-body .pill-accent {
  background: linear-gradient(145deg, rgba(var(--player-accent-rgb), 0.95), rgba(var(--player-accent-rgb), 0.6));
  border: 1px solid rgba(var(--player-accent-rgb), 0.6);
  color: var(--player-accent-contrast);
  box-shadow: 0 10px 18px rgba(var(--player-accent-rgb), 0.4);
}

@media (max-width: 640px) {
  .found-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .found-card__body {
    align-items: center;
  }

  .code-card__media {
    flex-direction: column;
  }
}

.media-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.media-modal[hidden] {
  display: none;
}

.media-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.media-modal__dialog {
  position: relative;
  background: rgba(10, 0, 20, 0.9);
  padding: 12px 12px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  max-width: 90vw;
  width: min(520px, 90vw);
}

.media-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.media-modal__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.media-modal__figure img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.media-modal__figure figcaption {
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-size: 0.95rem;
}

.player-shell {
  min-height: 100vh;
  padding-bottom: 96px;
}

.player-hero {
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
  background:
    linear-gradient(145deg, rgba(var(--player-accent-rgb), 0.45), rgba(var(--player-accent-rgb), 0.1));
  border-radius: var(--radius);
  border: 1px solid rgba(var(--player-accent-rgb), 0.35);
  box-shadow: 0 18px 36px rgba(var(--player-accent-rgb), 0.2);
}

.player-hero-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-pill-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pill-row {
  width: 100%;
  display: grid;
  gap: 14px;
  align-items: stretch;
}

.pill-row + .pill-row {
  margin-top: 6px;
}

.pill-row.top-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pill-row.double-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pill-row.single-row {
  grid-template-columns: minmax(0, 1fr);
}

.pill-row.triple-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #111;
  font-weight: 600;
  justify-content: center;
  text-align: center;
  min-height: 38px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.hero-pill--status {
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
  padding: 6px 12px;
  min-height: 32px;
  font-size: 0.85rem;
}

.hero-pill--status.is-connected {
  background: rgba(57, 255, 205, 0.15);
  color: #32f7c1;
  box-shadow: 0 8px 18px rgba(50, 247, 193, 0.15);
}

.hero-pill--status.is-locked {
  background: rgba(255, 190, 70, 0.18);
  color: #ffcf66;
  box-shadow: 0 8px 18px rgba(255, 190, 70, 0.15);
}

.hero-pill--status.is-offline {
  background: rgba(255, 90, 90, 0.18);
  color: #ff7a84;
  box-shadow: 0 8px 18px rgba(255, 90, 90, 0.15);
}

.hero-pill--token::before,
.hero-pill--player::before {
  display: none;
}

.player-progress-count {
  font-size: 1.1rem;
  font-weight: 600;
}

.player-layout {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.player-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-card h2 {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.status-card h2 {
  margin-bottom: 4px;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.status-pill {
  flex: 1 1 120px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-pill span {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.status-pill strong {
  font-size: 1.1rem;
}

.status-line strong {
  font-size: 0.95rem;
  color: var(--text);
}

.status-card .status-line span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.story-card .story-copy {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.story-figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  max-width: var(--player-media-max-width);
}

.story-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.story-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.story-media-player {
  width: 100%;
  max-width: var(--player-media-max-width);
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: none;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-media-player audio,
.story-media-player video {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
}

.story-media-player--video video {
  aspect-ratio: 16 / 9;
}

.player-body .story-media-player {
  background: rgba(var(--player-accent-rgb), 0.06);
  box-shadow: inset 0 0 20px rgba(var(--player-accent-rgb), 0.12);
}

.story-media-player[hidden] {
  display: none !important;
}

.divider {
  opacity: 0.4;
  font-weight: 300;
}

.scan-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.scan-view {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  min-height: 240px;
  height: 280px;
}

#playerCameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  text-align: center;
  padding: 12px;
  transition: background 0.25s ease, opacity 0.25s ease;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 1;
}

.scan-overlay--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.scan-secret-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(3px);
  z-index: 3;
}

.scan-secret-cover[hidden] {
  display: none !important;
}

.scan-secret-cover img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.scan-overlay--warn {
  background: linear-gradient(135deg, rgba(150, 0, 0, 0.65), rgba(40, 0, 0, 0.85));
}

.scan-overlay--success {
  background: linear-gradient(135deg, rgba(30, 170, 90, 0.8), rgba(0, 60, 20, 0.85));
  text-shadow: 0 0 12px rgba(50, 255, 180, 0.75);
}

.scan-overlay--info {
  background: linear-gradient(135deg, rgba(255, 170, 0, 0.7), rgba(80, 40, 0, 0.85));
  text-shadow: 0 0 10px rgba(255, 220, 120, 0.8);
}

.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.grid-card {
  gap: 10px;
  align-items: center;
  text-align: center;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.grid-card .card-label {
  margin-bottom: 8px;
}

.grid-card .code-grid {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.player-card.grid-card {
  margin-bottom: 8px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  border: none;
  position: relative;
}

.player-card.grid-card::after {
  display: none;
}

.panel.grid-panel .card-label {
  margin-bottom: 12px;
}

.host-main .grid-panel .card-label {
  display: none;
}

.card-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.code-grid {
  display: grid;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 8px;
  gap: 4px;
}

.code-grid--ten,
.code-grid--host {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-auto-rows: 8px;
  align-items: center;
}

.code-grid--compact {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-auto-rows: 8px;
}

.code-square {
  width: 100%;
  height: 8px;
  min-height: 8px;
  border-radius: 6px;
  background: #050505;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.code-square--found {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--square-color, #00ff8a) 85%, #030303),
    color-mix(in srgb, var(--square-color, #00ff8a) 55%, #010101)
  );
  box-shadow: 0 0 14px color-mix(in srgb, var(--square-color, #00ff8a) 55%, transparent);
  border-color: var(--square-color, rgba(0, 255, 138, 0.65));
}

.code-square--preview {
  background: linear-gradient(145deg, rgba(255, 194, 73, 0.85), rgba(140, 60, 0, 0.85));
  box-shadow: 0 0 16px rgba(255, 194, 73, 0.35);
  border-color: rgba(255, 194, 73, 0.55);
}

.code-square--pending {
  background: #030303;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 0 6px rgba(0, 0, 0, 0.6),
    0 0 6px rgba(255, 255, 255, 0.3);
}

.code-square--mine {
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

  50% {
    transform: scale(0.96);
    box-shadow: 0 0 20px rgba(255, 0, 120, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 0, 80, 0.45);
  }
}

.token-card .pill {
  width: 100%;
  justify-content: center;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.tiny {
  font-size: 0.75rem;
}

.score,
.score-large {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.room-closed-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}

.room-closed-overlay[hidden] {
  display: none;
}

.room-closed-card {
  background: rgba(8, 0, 12, 0.95);
  padding: 32px;
  border-radius: var(--radius-lg);
  width: min(420px, 100%);
  box-shadow: var(--shadow-strong);
  text-align: center;
}

.room-closed-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.room-closed-actions .btn {
  min-width: 140px;
}

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

@media (max-width: 600px) {
  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 640px) {
  .player-body .player-shell {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  .player-body .hero,
  .player-body .countdown-strip,
  .player-body .player-card,
  .player-body .broadcast-inline,
  .player-body .story-card,
  .player-body .scan-card,
  .player-body .hint-card,
  .player-body .action-card,
  .player-body .history-card {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
  .player-body .player-card,
  .player-body .hero {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(10, 0, 14, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
  min-width: 220px;
  animation: toast-in 0.2s ease;
  color: #fff;
}

.toast--info {
  border-left: 4px solid var(--accent);
}

.toast--success {
  border-left: 4px solid #3cf5c7;
}

.toast--warn {
  border-left: 4px solid #ffaf50;
}

.toast--error {
  border-left: 4px solid var(--warn);
}
.host-body.host-light .toast--info {
  border-left-color: #ff3b8d;
}
.host-body.host-light .toast--success {
  border-left-color: #08c87f;
}
.host-body.host-light .toast--warn {
  border-left-color: #ff9c33;
}
.host-body.host-light .toast--error {
  border-left-color: #ff1744;
}

.toast__message {
  flex: 1;
}

.toast__close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

.toast__actions {
  display: flex;
  gap: 8px;
}

.toast--leaving {
  animation: toast-out 0.2s ease forwards;
}

.timeline-list {
  position: relative;
  list-style: none;
  margin: 12px 0 0;
  padding-left: 18px;
}

.timeline-item {
  margin-bottom: 14px;
  position: relative;
  padding-left: 12px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--player-accent, #ff4dd8);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 12px;
  bottom: -12px;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item__title {
  font-weight: 600;
}

.timeline-item__meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.timeline-media {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-media__figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  max-width: var(--player-media-max-width);
}

.timeline-media__image {
  display: block;
  width: 100%;
  height: auto;
}

.timeline-media__audio,
.timeline-media__video {
  width: 100%;
  max-width: var(--player-media-max-width);
}

@keyframes toast-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

.action-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.secret-field {
  margin-top: 10px;
}
.secret-field--optional {
  opacity: 0.9;
}

.secret-actions {
  margin-top: 8px;
}

.secret-actions .btn {
  width: 100%;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.action-status {
  margin-top: 8px;
}

.action-status--success {
  color: var(--success);
}

.action-status--warn {
  color: #ffaf50;
}

.action-status--error {
  color: var(--warn);
}

/* Scanner */
.card-wide {
  grid-column: span 2;
}

#packForm textarea {
  font-family: "JetBrains Mono", Consolas, monospace;
  min-height: 200px;
}

#packList .room-card {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

#packList .room-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
}

.pack-card__summary {
  list-style: none;
  cursor: pointer;
}

.pack-card__summary::-webkit-details-marker,
.pack-card__summary::marker {
  display: none;
}

.pack-card[open] {
  border-color: rgba(255, 255, 255, 0.25);
}

.pack-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.pack-card__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pack-card__title h3 {
  margin: 6px 0 4px;
}

.pack-card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.pack-card__description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  opacity: 0.9;
}

.pack-card__actions .btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.pack-items {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pack-items--compact .pack-item {
  background: rgba(0, 0, 0, 0.2);
}

.pack-item {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-item--summary {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pack-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-item__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pack-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
}

.pack-chip--code {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.pack-item__meta {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.pack-item__thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.pack-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.items-editor {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.items-editor__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.items-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.items-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pack-edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pack-edit-field.full {
  grid-column: 1 / -1;
}

.pack-edit-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.pack-edit-field input,
.pack-edit-field textarea {
  width: 100%;
}

.pack-edit-field .image-preview {
  margin-top: 6px;
  width: 100%;
  max-width: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pack-edit-field .image-preview img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.pack-edit-field textarea {
  min-height: 120px;
}

.pack-item__upload-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.pack-item__upload-controls .pack-edit-field {
  flex: 1;
  min-width: 180px;
}

.pack-item__upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.pack-item__upload-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

.pack-media-upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.pack-media-upload input[type="file"] {
  color: var(--text-dim);
}

.media-preview {
  margin-top: 6px;
  width: 100%;
  max-width: 240px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-preview audio,
.media-preview video {
  width: 100%;
  display: block;
}

.code-input {
  font-family: "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.08em;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.current-code {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.current-code .grid-two {
  margin-bottom: 0;
}

.points-input {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.points-input--inline {
  width: auto;
}

.points-input input {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.btn-icon {
  padding: 0 12px;
  font-size: 1.1rem;
  line-height: 1.4;
}

.current-code .story-field {
  display: none;
}

.current-code.story-enabled .story-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.current-code .story-field--global {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.current-code .story-asset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.story-field .field-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.story-asset-row .stacked {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-asset-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.story-asset-block--token {
  max-width: 240px;
}

.story-asset-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.story-asset-row .upload-btn-wrap {
  min-width: 160px;
  align-self: flex-end;
}

.story-thumb {
  min-width: 200px;
}

.story-thumb img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.story-asset-row button {
  width: 100%;
}

.story-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.story-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.story-media-block {
  flex: 1;
  min-width: 240px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.story-media-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-media-preview audio,
.story-media-preview video {
  width: 100%;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.story-media-preview video {
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.25);
}

.story-media-filename {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.story-asset-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

.current-code.story-enabled .story-field.story-hint {
  display: block;
}

.pack-docs {
  margin: 20px 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pack-docs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.pack-docs__token {
  max-width: 260px;
}

.pack-docs__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.doc-status {
  font-size: 0.8rem;
}

.pack-open-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.pack-open-select {
  flex: 2;
}

.pack-open-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.pack-open-row select {
  flex: 1;
}

.pack-open-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pack-dirty-indicator {
  font-size: 0.85rem;
  color: var(--warning);
}

.pack-form-shell {
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pack-form-shell--active {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.pack-form-empty {
  text-align: center;
  padding: 32px 16px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.1);
}

.pack-form-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.pack-form-shell form[hidden] {
  display: none;
}

.pack-form--dirty {
  border: 1px solid rgba(255, 170, 0, 0.4);
}

.mode-manager {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.mode-manager__list {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.mode-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.mode-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mode-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.15);
}

.mode-card--locked {
  opacity: 0.85;
}

.mode-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.mode-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 6px 0;
}

.mode-card__description {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.mode-card .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.mode-form {
  flex: 1 1 360px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  background: rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mode-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mode-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.mode-form[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.doc-directory {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-directory__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-directory__item {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-directory__item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.doc-directory__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.doc-chip:hover {
  background: rgba(255, 255, 255, 0.15);
}

.doc-chip--story {
  border-color: rgba(255, 0, 204, 0.35);
}

.doc-chip--vs {
  border-color: rgba(0, 255, 204, 0.35);
}

.doc-directory--empty .doc-directory__list {
  display: none;
}

.pack-meta-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.pack-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pack-mode-grid.single {
  max-width: 260px;
}

.step-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.code-workspace {
  position: relative;
  margin-top: 24px;
}

.code-workspace__body {
  position: relative;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.code-workspace__overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: rgba(5, 7, 15, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--text);
  z-index: 2;
}

.code-workspace__overlay p {
  font-weight: 600;
  max-width: 360px;
  margin: 0;
}

.code-workspace--locked .code-workspace__overlay {
  display: flex;
}

.code-workspace--locked .code-workspace__body {
  filter: blur(2px);
  opacity: 0.45;
  pointer-events: none;
}

.entry-base-fields {
  margin-bottom: 12px;
}

.raw-json {
  margin-top: 12px;
}

.raw-json textarea {
  width: 100%;
  margin-top: 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.foldout {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: visible;
}

.foldout summary {
  font-weight: 600;
}

.foldout[open] {
  padding: 16px;
  margin-top: 12px;
  background: rgba(6, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 45px rgba(3, 7, 12, 0.55);
  z-index: 2;
}

.foldout[open] summary {
  margin-bottom: 12px;
}

.app-shell [data-requires-auth] {
  display: none !important;
}

.app-shell.authenticated [data-requires-auth] {
  display: unset !important;
}

.app-shell.authenticated .scanner-card[data-requires-auth] {
  display: flex !important;
}

.app-shell.authenticated section.card[data-requires-auth]:not(.scanner-card) {
  display: block !important;
}

.scanner-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scanner-card[hidden] {
  display: none !important;
}

.scanner-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.scan-status {
  display: flex;
  gap: 16px;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.status-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(77, 208, 255, 0.2);
  border: 1px solid rgba(77, 208, 255, 0.4);
  font-weight: 600;
  color: var(--text);
}

.scan-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: stretch;
}

.scan-preview-shell {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  min-height: 280px;
  box-shadow: var(--shadow-soft);
}

#cameraVideo {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.scan-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.manual-entry {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.manual-entry label {
  flex: 1;
  margin-bottom: 0;
}

.upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  cursor: pointer;
  color: var(--text-dim);
  transition: border 0.2s ease, color 0.2s ease;
}

.upload-chip:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.scan-preview {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
}

.scan-preview ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.rejoin-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.app-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
}

.app-footer a {
  text-decoration: none;
}

.app-footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.color-picker {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 12px;
  background: rgba(7, 10, 20, 0.6);
  box-shadow: 0 18px 35px rgba(2, 5, 12, 0.6);
}

.color-picker__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.color-picker__header h3 {
  margin: 0;
  white-space: nowrap;
}

.color-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 10px;
  position: relative;
}

.color-tile {
  --swatch: #00ffff;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 0;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  background: var(--swatch);
  cursor: pointer;
  box-shadow:
    0 0 6px color-mix(in srgb, var(--swatch) 25%, transparent),
    0 0 14px color-mix(in srgb, var(--swatch) 35%, transparent),
    inset 0 0 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease, outline 0.2s ease;
  z-index: 0;
}

.color-tile::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: radial-gradient(circle, var(--swatch), transparent 55%);
  filter: blur(12px);
  opacity: 0.35;
  z-index: -1;
}

.color-tile .color-label {
  display: none;
}

.color-tile:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.color-tile--selected {
  box-shadow:
    0 0 14px color-mix(in srgb, var(--swatch) 45%, transparent),
    0 0 0 2px rgba(255, 255, 255, 0.45),
    inset 0 0 5px rgba(0, 0, 0, 0.35);
  transform: scale(1.04);
  z-index: 1;
}

.color-tile[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.legal-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff003c, #ff6a00);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 20px rgba(255, 0, 80, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.legal-link:hover,
.legal-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(255, 0, 80, 0.5);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.legal-table th,
.legal-table td {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
  font-size: 0.95rem;
}

.legal-table th {
  width: 160px;
  font-weight: 600;
  color: var(--text-dim);
  padding-right: 18px;
}

.legal-table tr:last-child th,
.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-check-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: center;
  margin-top: 12px;
}

.legal-check-grid label {
  display: contents;
}

.legal-check-grid span {
  font-size: 0.9rem;
  color: var(--text-body);
}

/* Utility */
@media (max-width: 820px) {
  .scan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .scan-panel .control-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .scan-panel .control-row .btn,
  .scan-panel .control-row .btn.btn-secondary {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }
}

@media (max-width: 700px) {
  .hero {
    padding: 32px;
  }
  .card::after {
    display: none;
  }
  .card-wide {
    grid-column: span 1;
  }
  .color-grid {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 6px;
  }
}

@media (max-width: 540px) {
  .app-shell {
    padding: 16px 12px 72px;
  }
  .scanner-card {
    padding: 18px;
  }
  .scan-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .scan-panel .control-row {
    flex-direction: column;
    gap: 8px;
  }
  .scan-panel .control-row .btn,
  .scan-panel .control-row .btn.btn-secondary,
  .scan-panel .manual-entry .btn {
    width: 100%;
  }
  .scan-panel label,
  .scan-panel input {
    width: 100%;
  }
  .scan-preview-shell video {
    max-height: 280px;
  }
  .grid-two.entry-base-fields {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
  }
  .current-code {
    padding: 16px;
  }
  .current-code .story-asset-row {
    flex-direction: column;
  }
  .points-input,
  .points-input--inline {
    width: 100%;
  }
  .pack-item__grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
  }
  .pack-item__upload-controls {
    flex-direction: column;
    gap: 12px;
  }
  .hero,
  .host-hero,
  .player-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }
  .player-pill-group {
    gap: 8px;
  }
  .pill-row.top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pill-row.single-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .pill-row.triple-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-pill {
    width: 100%;
  }
  .player-progress-pill {
    width: 100%;
    justify-content: flex-start;
  }
  .host-hero-actions,
  .player-hero-meta {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .host-hero-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .host-hero-buttons .btn,
  .host-controls-grid button {
    width: 100%;
  }
  .host-meta-block,
  .player-meta-block {
    width: 100%;
  }
  .color-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  .grid-two,
  .pack-select-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .pack-select-row label {
    width: 100%;
  }
  .host-controls-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .host-controls-grid label {
    margin-bottom: 0;
  }
  .host-controls-grid label input {
    margin: 0;
  }
  .host-controls-grid button {
    margin-top: 0;
  }
  .host-controls-grid button + button {
    margin-top: 6px;
  }
  .scan-actions {
    flex-direction: column;
  }
  .player-main,
  .host-main {
    display: flex;
    flex-direction: column;
  }
  .app-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .host-hero {
    padding: 12px;
    gap: 12px;
  }
  .host-hero-actions {
    background: rgba(0, 0, 0, 0.18);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }
  .host-meta-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    gap: 10px;
  }
  .host-meta-block .label {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
  }
  .host-meta-block .pill {
    margin-left: auto;
  }
  .host-hero-buttons {
    margin-top: 4px;
  }
  .host-hero-buttons .btn {
    width: 100%;
  }
  .host-hero-buttons .btn + .btn {
    margin-left: 0;
  }
}

@media (max-width: 400px) {
  .player-hero-top {
    flex-direction: column;
  }
  .player-progress-pill {
    justify-content: center;
  }
}
.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.login-header .btn {
  height: 40px;
  padding: 0 16px;
}
.scanner-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.scanner-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-card {
  position: relative;
  top: 0;
}
.host-main .grid-panel .code-grid {
  margin-left: auto;
  margin-right: auto;
}
.code-grid--host {
  display: grid;
  grid-template-columns: repeat(10, minmax(20px, 1fr));
  grid-auto-rows: 20px;
  gap: 8px;
  width: 100%;
  margin: 10px 0 0;
}

.code-grid--host,
#playerCodeGrid {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
}

.code-grid--host .code-square {
  width: 100%;
  aspect-ratio: 1/1;
  min-width: 20px;
  min-height: 20px;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.65);
}
.hero-pill--room,
.hero-pill--player,
.hero-pill--token {
  text-transform: none;
  letter-spacing: 0;
  justify-content: flex-start;
}
.broadcast-card,
.broadcast-panel,
.broadcast-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.broadcast-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.broadcast-pulse {
  animation: broadcastBlink 0.8s ease-in-out 3;
}

@keyframes broadcastBlink {
  0% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
  }
  40% {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
  }
}

.broadcast-message {
  font-size: 1rem;
  font-weight: 500;
}

.broadcast-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.broadcast-empty .broadcast-message {
  color: var(--text-dim);
  font-style: italic;
}

.broadcast-history {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.broadcast-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.broadcast-item__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.broadcast-item__message {
  font-weight: 500;
}

.broadcast-item__meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.broadcast-history--disabled {
  opacity: 0.5;
  pointer-events: none;
}
.rules-panel--docs::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 0, 200, 0.25));
}

.rules-panel > * {
  position: relative;
  z-index: 1;
}

@keyframes panelGlow {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 0%;
  }
}
.host-body.host-light .code-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.host-body.host-light .code-card__header,
.host-body.host-light .code-card__story,
.host-body.host-light .code-card__media {
  color: #0b0620;
}
.host-body.host-light .code-card .pill {
  background: rgba(0, 0, 0, 0.08);
  color: #0b0620;
}

/* ==================================================
   FIX: Pack-Karte Text wird abgeschnitten
   Gilt für Lobby + Scanner
   ================================================== */

/* Lobby: Pack Briefing */
.pack-briefing__text {
  white-space: pre-wrap !important;
  overflow: visible !important;
  max-height: none !important;
}

/* Scanner: Pack-Karte Beschreibung */
.pack-card__description {
  white-space: pre-wrap !important;
  overflow: visible !important;
  max-height: none !important;
  display: block !important;
}

/* Scanner: Story-Text innerhalb eines Pack-Items */
.pack-item__story-text {
  white-space: pre-wrap !important;
  overflow: visible !important;
  max-height: none !important;
  display: block !important;
}

.pack-item__media-player {
  margin-top: 6px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.pack-item__media-player audio,
.pack-item__media-player video {
  width: 100%;
  display: block;
}

/* Falls ein Eltern-Element abschneidet */
.pack-card,
.pack-item,
.pack-briefing {
  overflow: visible !important;
}
