:root {
  --bg-deep: #0b1016;
  --bg-panel: #141c25;
  --bg-panel-2: #1a2430;
  --bg-panel-3: #222e3d;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.22);

  --text-main: #eef3f8;
  --text-dim: #9aa9ba;
  --text-muted: #6c7c8e;

  --crt-orange: #ff5b36;
  --crt-amber: #ffb454;
  --crt-green: #3ddc84;
  --crt-red: #ff4b5c;
  --crt-cyan: #5bc8ff;

  --white-team-bg: #e7ecf2;
  --white-team-fg: #182029;
  --black-team-bg: #24313f;
  --black-team-fg: #eef3f8;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 91, 54, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(11, 16, 22, 0.86), rgba(11, 16, 22, 0.94)),
    url('/assets/table-bg.jpg');
  background-size: auto, auto, 280px;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: contain;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.app-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

/* ==================== Common Cards & Buttons ==================== */

.card {
  background: rgba(20, 28, 37, 0.94);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card + .card {
  margin-top: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.08s ease, opacity 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #ff633e, #e33d1b);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 91, 54, 0.35);
}

.btn-secondary {
  background: var(--bg-panel-3);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

.btn-success {
  background: linear-gradient(135deg, #27c26c, #179b52);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111;
}

.btn-danger {
  background: rgba(255, 75, 92, 0.16);
  border: 1px solid rgba(255, 75, 92, 0.45);
  color: #ff8e99;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.input, .textarea {
  width: 100%;
  background: rgba(9, 13, 18, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus, .textarea:focus {
  border-color: var(--crt-orange);
  box-shadow: 0 0 0 2px rgba(255, 91, 54, 0.2);
}

.textarea {
  resize: vertical;
  min-height: 82px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.pill-white {
  background: var(--white-team-bg);
  color: var(--white-team-fg);
}

.pill-black {
  background: #2f3f52;
  color: #eef3f8;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pill-orange {
  background: rgba(255, 91, 54, 0.18);
  color: #ff9d85;
  border: 1px solid rgba(255, 91, 54, 0.35);
}

.pill-green {
  background: rgba(61, 220, 132, 0.16);
  color: #6ef0a6;
  border: 1px solid rgba(61, 220, 132, 0.32);
}

.pill-red {
  background: rgba(255, 75, 92, 0.16);
  color: #ff949e;
  border: 1px solid rgba(255, 75, 92, 0.32);
}

/* ==================== Home View ==================== */

.home-screen {
  padding: 18px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #141c25;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.hero-console-strip {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 82px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-body {
  padding: 16px;
}

.hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-subtitle {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.home-token-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.home-token-row img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.row-gap {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.divider-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 6px 0;
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ==================== Sticky Top HUD ==================== */

.top-hud {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 19, 26, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 12px;
}

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

.hud-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 91, 54, 0.14);
  border: 1px solid rgba(255, 91, 54, 0.38);
  color: #ffab96;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.timer-pill {
  padding: 4px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 13px;
  background: rgba(61, 220, 132, 0.15);
  color: var(--crt-green);
  border: 1px solid rgba(61, 220, 132, 0.35);
}

.timer-pill.urgent {
  background: rgba(255, 75, 92, 0.22);
  color: #ff8e99;
  border-color: rgba(255, 75, 92, 0.55);
  animation: pulse 0.9s infinite;
}

.timer-pill.paused {
  background: rgba(255, 180, 84, 0.15);
  color: var(--crt-amber);
  border-color: rgba(255, 180, 84, 0.4);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ==================== Score Strip ==================== */

.score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.team-score-box {
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid transparent;
}

.team-score-box.white {
  background: rgba(231, 236, 242, 0.94);
  color: var(--white-team-fg);
}

.team-score-box.black {
  background: rgba(36, 49, 63, 0.96);
  color: var(--black-team-fg);
  border-color: rgba(255, 255, 255, 0.14);
}

.team-score-box.active-turn {
  box-shadow: 0 0 0 2px var(--crt-orange);
}

.score-team-name {
  font-size: 12px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.score-team-sub {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.72;
}

.token-counters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tok-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tok-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ==================== Main Content & Bottom Bar ==================== */

.page-content {
  flex: 1;
  padding: 12px 12px calc(76px + var(--safe-bottom));
}

.lobby-content {
  flex: 1;
  padding: 12px 12px calc(24px + var(--safe-bottom));
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  z-index: 45;
  background: rgba(13, 19, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 10px calc(6px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nav-tab {
  min-height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  position: relative;
}

.nav-tab.active {
  background: rgba(255, 91, 54, 0.16);
  color: #ffb09c;
  border: 1px solid rgba(255, 91, 54, 0.35);
}

.nav-tab-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 16%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crt-orange);
}

/* ==================== Lobby ==================== */

.team-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.team-card {
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-subtle);
}

.team-card.white {
  background: linear-gradient(180deg, rgba(235, 240, 246, 0.14), rgba(235, 240, 246, 0.05));
  border-color: rgba(235, 240, 246, 0.28);
}

.team-card.black {
  background: linear-gradient(180deg, rgba(46, 62, 80, 0.45), rgba(20, 28, 37, 0.7));
  border-color: rgba(91, 200, 255, 0.22);
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 14px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 54px;
}

.player-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 13px;
  font-weight: 600;
}

.player-chip .pill {
  padding: 1px 6px;
  font-size: 10px;
}

.player-chip.offline {
  opacity: 0.48;
}

.dot-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crt-green);
  flex-shrink: 0;
}

.dot-offline {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

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

.bank-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.bank-toggle.selected {
  background: rgba(255, 91, 54, 0.16);
  border-color: rgba(255, 91, 54, 0.55);
  color: #ffc2b3;
}

.bank-count {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.switch-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.switch-label {
  font-size: 14px;
  font-weight: 600;
}

.switch-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.seg-group {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 8px;
}

.seg-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}

.seg-btn.active {
  background: var(--crt-orange);
  color: #fff;
}

/* ==================== CRT Keyword Terminals (Real Sliced Assets) ==================== */

.crt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.crt-terminal {
  position: relative;
  width: 100%;
  aspect-ratio: 1171 / 1592;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  background: #1a232d;
}

.crt-terminal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.crt-screen-overlay {
  position: absolute;
  top: 17.6%;
  left: 10.2%;
  width: 79.6%;
  height: 36.2%;
  border-radius: 12px / 14px;
  background: radial-gradient(circle at 50% 45%, rgba(62, 10, 4, 0.92), rgba(20, 3, 2, 0.96));
  box-shadow: inset 0 0 18px rgba(255, 80, 38, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  text-align: center;
  overflow: hidden;
}

.crt-screen-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}

.crt-word-text {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: #fff0e8;
  text-shadow: 0 0 10px rgba(255, 95, 50, 0.85), 0 1px 2px rgba(0, 0, 0, 0.9);
  word-break: break-word;
  line-height: 1.18;
}

.crt-word-hidden {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 145, 110, 0.72);
}

.crt-slot-tag {
  position: absolute;
  top: 4px;
  left: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 160, 125, 0.78);
}

.crt-cracked-tag {
  position: absolute;
  bottom: 4px;
  right: 6px;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 75, 92, 0.85);
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
}

.crt-terminal.highlighted {
  box-shadow: 0 0 0 2px var(--crt-amber), 0 10px 24px rgba(255, 180, 84, 0.35);
}

/* ==================== Code Card & Laser Drive Card ==================== */

.code-peek-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
}

.code-card-frame {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  position: relative;
  cursor: pointer;
}

.code-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.code-peek-info {
  flex: 1;
  min-width: 0;
}

.laser-banner-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 125, 45, 0.1);
  border: 1px solid rgba(255, 145, 70, 0.35);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 12px;
}

.laser-card-thumb {
  position: relative;
  width: 84px;
  height: 83px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.laser-card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
}

.laser-card-lcd {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  color: #2b0900;
  line-height: 1.15;
  overflow: hidden;
}

.laser-banner-text {
  flex: 1;
  min-width: 0;
}

.laser-category-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffb876;
  margin: 2px 0 4px;
}

/* ==================== Clue Inputs & Code Picker ==================== */

.clue-input-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.clue-digit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
  color: #ffb454;
}

.clue-secret-word {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: rgba(255, 91, 54, 0.22);
  border: 1px solid rgba(255, 91, 54, 0.45);
  padding: 2px 8px;
  border-radius: 6px;
}

.picker-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-clue-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.picker-clue-idx {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dim);
  flex-shrink: 0;
}

.picker-clue-val {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  word-break: break-word;
}

.digit-btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.digit-btn {
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 900;
  background: rgba(12, 18, 25, 0.85);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  transition: all 0.1s ease;
}

.digit-btn.selected {
  background: linear-gradient(135deg, #ff633e, #e33d1b);
  color: #fff;
  border-color: #ff9c82;
  box-shadow: 0 4px 12px rgba(255, 91, 54, 0.4);
}

/* ==================== Note Sheet & 4-Column Clue Ledger ==================== */

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

.ledger-col {
  background: rgba(10, 15, 21, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ledger-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--crt-amber);
}

.ledger-clues-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 42px;
}

.ledger-clue-item {
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.ledger-clue-round {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-round-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  margin-top: 8px;
}

.history-round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* ==================== Reveal / Result Boxes ==================== */

.reveal-grid {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}

.outcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 700;
}

.outcome-row.good {
  border-color: rgba(61, 220, 132, 0.45);
  background: rgba(61, 220, 132, 0.1);
  color: #8bf3b9;
}

.outcome-row.bad {
  border-color: rgba(255, 75, 92, 0.45);
  background: rgba(255, 75, 92, 0.12);
  color: #ffa2ac;
}

/* ==================== Modals & Toasts ==================== */

.toast-root {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(92vw, 460px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 28, 37, 0.96);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--crt-orange);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}

.toast.error {
  border-left-color: var(--crt-red);
}

.toast.success {
  border-left-color: var(--crt-green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 8, 12, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

@media (min-width: 520px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.qr-box {
  background: #f4f6f8;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 224px;
  height: 224px;
  margin: 10px auto;
}

.status-banner {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(91, 200, 255, 0.12);
  border: 1px solid rgba(91, 200, 255, 0.3);
  color: #b7e5ff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.event-feed {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
}

.event-item {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}
