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

  --bg-deep: #070a12;
  --bg-mid: #0f1629;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #e8edf5;
  --text-muted: #8b9cb3;
  --text-dim: #5c6d85;

  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.15);
  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.18);
  --rose: #fb7185;
  --amber: #fbbf24;

  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(45, 212, 191, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Consolas", "Liberation Mono", monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

body {
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(167, 139, 250, 0.22), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(45, 212, 191, 0.08), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(251, 113, 133, 0.06), transparent 40%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 48%, #05080f 100%);
  background-attachment: fixed;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
}

/* —— 通用页头 —— */
.page-header {
  margin-bottom: 22px;
}
.page-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}
.page-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, #c4d4e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-sub {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 36em;
}

.page h2:not(.page-title) {
  margin: 0 0 18px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* —— 卡片 —— */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.card p {
  margin: 0 0 12px;
  color: var(--text-muted);
}
.card p:last-of-type {
  margin-bottom: 0;
}

/* —— 按钮 —— */
.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  min-height: 46px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

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

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

.btn:focus-visible,
.game-tile:focus-visible,
.list-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(145deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-success {
  background: linear-gradient(145deg, #2dd4bf 0%, #0d9488 100%);
  color: #04120f;
}
.btn-success:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-danger {
  background: linear-gradient(145deg, #fb7185 0%, #e11d48 100%);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-gray {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn-gray:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* —— 大厅 —— */
.lobby-hero {
  margin-bottom: 28px;
}
.lobby-hero .page-title {
  font-size: 1.85rem;
}
.lobby-grid {
  display: grid;
  gap: 14px;
}

.lobby-category {
  margin-bottom: 32px;
}
.lobby-category:last-child {
  margin-bottom: 0;
}
.lobby-section-title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.lobby-section-title__main {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.lobby-section-title__sub {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  line-height: 1.4;
}
.lobby-category + .lobby-category .lobby-section-title {
  margin-top: 6px;
}

.game-tile {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 16px 16px 16px 14px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.game-tile:hover {
  border-color: rgba(45, 212, 191, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(45, 212, 191, 0.12);
}
.game-tile:active {
  transform: translateY(0);
}

.game-tile--muted {
  opacity: 0.72;
  border-style: dashed;
}
.game-tile--muted:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.game-tile__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--violet-dim), var(--accent-dim));
  border: 1px solid var(--border);
}

.game-tile__body {
  flex: 1;
  min-width: 0;
}
.game-tile__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.game-tile__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.game-tile__arrow {
  flex-shrink: 0;
  align-self: center;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.35);
}
.badge--soon {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.35);
}

/* —— 游戏内通用 —— */
.game-meta {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 14px !important;
}

.timer-display {
  margin: 8px 0 16px;
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 12vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.game-result {
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
}

/* 反应力信号灯（JS 会覆盖 background） */
#signal.game-signal {
  height: 220px;
  border-radius: var(--radius-md);
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  user-select: none;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 24px rgba(0, 0, 0, 0.35);
}

/* 摇一摇 · 力度条 */
.shake-meter {
  margin-bottom: 12px;
}
.shake-meter__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.shake-meter__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.shake-meter__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--border);
}
.shake-meter__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dd4bf, #a78bfa);
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.45);
  transition: width 0.07s ease-out;
  will-change: width;
}

/* 摇一摇舞台 */
.monkey-stage {
  height: clamp(300px, 56vh, 420px);
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.12) 0%, rgba(15, 22, 41, 0.9) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.12s ease, filter 0.12s ease;
}
.monkey-stage.monkey-stage--hit {
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(45, 212, 191, 0.35),
    0 0 28px rgba(45, 212, 191, 0.28);
  filter: saturate(1.15);
}
.monkey-wrap {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  pointer-events: none;
}
.monkey-char {
  display: block;
  font-size: clamp(40px, 8vw, 56px);
  line-height: 1;
  transform-origin: center bottom;
}
.monkey-char.monkey-char--wobble {
  animation: monkey-wobble 0.2s ease-out;
}
@keyframes monkey-wobble {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  30% {
    transform: rotate(-14deg) scale(1.1);
  }
  70% {
    transform: rotate(12deg) scale(1.08);
  }
}
.monkey-stage .pole {
  position: absolute;
  left: 50%;
  width: 16px;
  height: calc(100% - 24px);
  bottom: 12px;
  transform: translateX(-50%);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.07) 0 12px,
      rgba(0, 0, 0, 0.04) 12px 24px
    ),
    linear-gradient(90deg, #6b2f0e 0%, #9a4a17 22%, #c56c22 50%, #9b4b17 78%, #6a2e0d 100%);
  border-radius: 6px;
  border: 1px solid rgba(255, 220, 160, 0.18);
  box-shadow:
    inset -2px 0 4px rgba(0, 0, 0, 0.22),
    inset 2px 0 3px rgba(255, 230, 180, 0.2),
    0 2px 12px rgba(0, 0, 0, 0.35);
}
.monkey-stage .pole::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 24px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #e7b06f, #8f4415);
  border: 1px solid rgba(255, 229, 182, 0.35);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.monkey-stage .pole::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 28px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #8a3f13, #5f2608);
  border: 1px solid rgba(255, 214, 154, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* 色块大战棋盘 */
#board.color-war-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  min-height: 200px;
  padding: 12px;
  margin: 12px 0;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.rank-line {
  margin-top: 12px !important;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 抽奖转盘 */
.wheel-wrap {
  width: 100%;
  max-width: 300px;
  margin: 16px auto;
  padding: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(145deg, var(--surface-2), rgba(0, 0, 0, 0.2));
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
#wheel.lottery-canvas,
canvas.lottery-canvas {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 50%;
  background: transparent;
}

.list-link {
  display: block;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.list-link:hover {
  border-color: rgba(45, 212, 191, 0.4);
  transform: translateY(-1px);
}

.grid {
  display: grid;
  gap: 12px;
}

/* —— 记忆卡片 —— */
.memory-hud {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin: 16px 0 4px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}
.memory-stat {
  text-align: center;
  flex: 1;
  min-width: 0;
}
.memory-stat__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.memory-stat__value {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 4px 0;
  min-height: 100px;
}
.memory-board:empty::after {
  content: "点击下方「开始游戏」生成卡片";
  display: block;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 36px 12px;
  grid-column: 1 / -1;
}

.memory-card {
  perspective: 720px;
  padding: 0;
  border: none;
  background: transparent;
  width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--radius-sm);
}
.memory-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.memory-card:disabled {
  cursor: default;
}
.memory-card:disabled:not(.is-matched) {
  opacity: 0.55;
}

.memory-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.48s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-sm);
}
.memory-card.is-flipped .memory-card__inner,
.memory-card.is-matched .memory-card__inner {
  transform: rotateY(180deg);
}

.memory-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.memory-card__face--back {
  background: linear-gradient(145deg, var(--violet-dim), var(--surface-2));
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 800;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.memory-card__face--front {
  background: linear-gradient(160deg, rgba(51, 65, 85, 0.95), rgba(15, 23, 42, 0.98));
  transform: rotateY(180deg);
  font-size: clamp(1.3rem, 6vw, 2rem);
  line-height: 1;
  border: 1px solid var(--border-strong);
}
.memory-card.is-matched .memory-card__face--front {
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.18);
}

/* —— 数字拼图（滑块） —— */
.puzzle-hud {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin: 16px 0 4px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}
.puzzle-stat {
  text-align: center;
  flex: 1;
  min-width: 0;
}
.puzzle-stat__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.puzzle-stat__value {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin: 16px auto 8px;
  padding: 4px 0;
  min-height: 72px;
}
.puzzle-board:empty::after {
  content: "点击下方「开始游戏」打乱棋盘";
  display: block;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 40px 12px;
  grid-column: 1 / -1;
}

.puzzle-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
}
.puzzle-cell--empty {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border-strong);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}
.puzzle-cell--tile {
  padding: 0;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, var(--surface-2), rgba(15, 23, 42, 0.95));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 7vw, 2rem);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.puzzle-cell--tile:hover:not(.puzzle-cell--locked) {
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(45, 212, 191, 0.12);
}
.puzzle-cell--tile:active:not(.puzzle-cell--locked) {
  transform: scale(0.96);
}
.puzzle-cell--tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.puzzle-cell--tile.puzzle-cell--locked {
  cursor: default;
  opacity: 0.92;
}

/* —— 氛围场小游戏通用 —— */
.quiz-prog,
.quiz-timer {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.quiz-timer {
  font-family: var(--font-mono);
  color: var(--accent);
}
.quiz-question {
  margin: 14px 0 16px;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rhythm-stage {
  display: flex;
  justify-content: center;
  margin: 18px 0;
}
.rhythm-beat {
  width: min(200px, 55vw);
  height: min(200px, 55vw);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), transparent 45%),
    linear-gradient(145deg, var(--surface-2), rgba(0, 0, 0, 0.35));
  border: 2px solid var(--border-strong);
  box-shadow: inset 0 -20px 40px rgba(0, 0, 0, 0.35), 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: scale(calc(0.92 + var(--rhythm-phase, 0) * 0.14));
  transition: transform 0.05s linear;
}
.rhythm-beat--pulse {
  animation: rhythm-pop 0.22s ease-out;
}
@keyframes rhythm-pop {
  50% {
    box-shadow: 0 0 32px rgba(45, 212, 191, 0.35);
    border-color: rgba(45, 212, 191, 0.55);
  }
}
.rhythm-bigtap {
  width: 100%;
  margin-top: 6px;
  min-height: 54px;
  font-size: 1.05rem;
}

.scratch-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 16px auto;
  min-height: 170px;
}
.scratch-prize {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--amber);
  padding: 12px;
  pointer-events: none;
  z-index: 0;
}
.scratch-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  touch-action: none;
  cursor: grab;
}

.binary-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.binary-pick__btn {
  min-height: 64px;
  font-size: 1rem;
}

.undercover-setup .undercover-label,
.undercover-play .undercover-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.undercover-select {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 16px;
}
.undercover-word {
  margin: 18px 0;
  padding: 22px 16px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border-strong);
  color: var(--text);
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkin-input {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 16px;
}
.checkin-result {
  margin: 16px 0;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--violet-dim);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.danmaku-body {
  min-height: 100vh;
}
.dm-wall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.dm-row {
  position: absolute;
  right: -12px;
  white-space: nowrap;
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  animation: dm-fly 12s linear forwards;
  will-change: transform;
}
@keyframes dm-fly {
  from {
    transform: translateX(105vw);
  }
  to {
    transform: translateX(-105vw);
  }
}
.danmaku-bar {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
  padding-top: calc(12px + var(--safe-top));
}
.dm-field {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.dm-input {
  flex: 1;
  margin: 0;
}

.countdown-card .countdown-num {
  text-align: center;
  font-size: clamp(4rem, 22vw, 7rem);
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  margin: 8px 0 20px;
  background: linear-gradient(180deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.cd-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, transparent 55%);
}
.cd-fx--on .cd-burst {
  animation: cd-burst-anim 1.8s ease-out forwards;
}
.cd-burst {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  box-shadow:
    0 -80px 0 2px rgba(45, 212, 191, 0.8),
    56px -56px 0 1px rgba(251, 113, 133, 0.75),
    -56px -56px 0 1px rgba(251, 191, 36, 0.8),
    80px 0 0 1px rgba(167, 139, 250, 0.85),
    -80px 0 0 1px rgba(45, 212, 191, 0.7),
    56px 56px 0 1px rgba(251, 191, 36, 0.75),
    -56px 56px 0 1px rgba(251, 113, 133, 0.8),
    0 80px 0 2px rgba(167, 139, 250, 0.75);
}
.cd-burst--1 {
  animation-delay: 0s;
}
.cd-burst--2 {
  transform: rotate(45deg);
  animation-delay: 0.08s;
}
.cd-burst--3 {
  transform: rotate(22deg);
  animation-delay: 0.04s;
}
.cd-burst--4 {
  transform: rotate(-18deg);
  animation-delay: 0.12s;
}
@keyframes cd-burst-anim {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

/* —— 盲盒抽奖 —— */
.blind-pool-stat {
  font-size: 0.85rem !important;
  color: var(--text-dim) !important;
  margin-bottom: 14px !important;
}

.blind-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.blind-box {
  min-height: 96px;
  padding: 10px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--surface-2), rgba(15, 23, 42, 0.92));
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.blind-box--closed:hover {
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.blind-box--closed:active {
  transform: scale(0.97);
}
.blind-box--closed .blind-box__icon {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}
.blind-box--closed .blind-box__text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.blind-box--open {
  cursor: default;
  min-height: 110px;
}
.blind-box--open .blind-box__icon {
  font-size: 1.75rem;
}
.blind-box--open .blind-box__text {
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
}
.blind-box--win {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.2);
  background: linear-gradient(165deg, rgba(45, 212, 191, 0.12), var(--surface-2));
}
.blind-box--lose {
  opacity: 0.95;
}

.blind-box--disabled {
  cursor: not-allowed;
  opacity: 0.38;
  background: rgba(0, 0, 0, 0.35);
}
.blind-box--disabled .blind-box__text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

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

/* —— 贪吃蛇 —— */
.snake-scoreline {
  font-family: var(--font-mono);
  color: var(--accent) !important;
  margin-top: 4px !important;
}
.snake-stage {
  max-width: 300px;
  margin: 14px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}
.snake-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  background: #0c1222;
}
.snake-dpad {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  max-width: 220px;
  margin: 14px auto 0;
}
.snake-dpad__spacer {
  min-height: 1px;
}
.snake-dpad .snake-dir {
  min-height: 44px;
  padding: 8px;
  font-size: 1.1rem;
}

/* —— 五子棋 —— */
.gomoku-hud {
  font-family: var(--font-mono);
  color: var(--accent) !important;
  margin-top: 4px !important;
}
.gomoku-stage {
  max-width: 300px;
  margin: 14px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}
.gomoku-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  cursor: pointer;
}

/* —— 中国象棋 —— */
.xiangqi-hud {
  font-family: var(--font-mono);
  color: var(--accent) !important;
  margin-top: 4px !important;
}
.xiangqi-stage {
  max-width: 360px;
  margin: 14px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}
.xiangqi-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  cursor: pointer;
  background: #deb887;
}

/* —— 左轮玩具枪 —— */
.revolver-msg {
  font-family: var(--font-mono);
  color: var(--accent) !important;
  margin-top: 6px !important;
  text-align: center;
}
.revolver-stage {
  position: relative;
  width: min(280px, 88vw);
  height: min(280px, 88vw);
  margin: 20px auto 8px;
}
.revolver-notch {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  z-index: 4;
  width: 28px;
  height: 22px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.revolver-notch__mark {
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 18px solid #f59e0b;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}
.revolver-cylinder {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #4a5568 0%, #4a5568 42%, #1e293b 43%, #0f172a 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.55);
  transition: transform 1.45s cubic-bezier(0.18, 0.85, 0.32, 1.02);
  z-index: 2;
}
.revolver-chamber {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.65);
  cursor: pointer;
  transform: rotate(calc(var(--i) * 60deg)) translateY(-76px) rotate(calc(var(--i) * -60deg));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.revolver-chamber:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.revolver-chamber::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.revolver-chamber--loaded::after {
  background: radial-gradient(circle at 35% 35%, #fde68a, #b45309);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.45),
    0 0 10px rgba(245, 158, 11, 0.45);
}
.revolver-chamber--barrel {
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.revolver-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #64748b, #1e293b 70%);
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.12);
  z-index: 3;
  pointer-events: none;
}
.revolver-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.revolver-actions .btn {
  flex: 1 1 calc(50% - 6px);
  min-width: 140px;
}

/* —— 现场投票 —— */
.vote-setup__title {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.vote-editors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.vote-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.vote-editor-input {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.vote-editor-input::placeholder {
  color: var(--text-dim);
}
.vote-editor-input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.vote-editor-del {
  flex-shrink: 0;
  padding: 8px 12px;
  min-height: 44px;
}
.vote-setup__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vote-total {
  text-align: center;
  font-family: var(--font-mono);
  color: var(--accent) !important;
  margin: 0 0 14px !important;
  font-size: 1.05rem;
}
.vote-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vote-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.vote-row__label {
  font-weight: 600;
  word-break: break-word;
}
.vote-row__count {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.vote-row__track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.vote-row__fill {
  height: 100%;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.28s ease-out;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.25);
}
.vote-row:nth-child(6n + 1) .vote-row__fill {
  background: linear-gradient(90deg, #2dd4bf, #14b8a6);
}
.vote-row:nth-child(6n + 2) .vote-row__fill {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
}
.vote-row:nth-child(6n + 3) .vote-row__fill {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}
.vote-row:nth-child(6n + 4) .vote-row__fill {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}
.vote-row:nth-child(6n + 5) .vote-row__fill {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}
.vote-row:nth-child(6n + 6) .vote-row__fill {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}
.vote-row__vote {
  width: 100%;
  min-height: 48px;
  font-weight: 600;
}
.vote-live__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.vote-live__actions .btn {
  flex: 1 1 calc(50% - 6px);
  min-width: 120px;
}
