/* 6Q嘉年华 · 情绪合成（2048 引擎） */

.game-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--q-surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.game-back {
  border: none;
  background: none;
  font-size: 22px;
  padding: 4px 8px 4px 0;
  color: var(--mp-green-3);
  cursor: pointer;
  line-height: 1;
}

.game-header-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  margin-right: 30px;
}

.game-emotion-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.game-emotion-tag--xi {
  background: #FAEEDA;
  color: #854F0B;
}

.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 10px;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.game-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-activity-boost {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #534ab7;
  background: linear-gradient(135deg, #eeedfe, #e0dcfc);
  border: 2px solid #534ab7;
  border-radius: 999px;
  padding: 6px 12px;
  letter-spacing: 0.2px;
}

.game-activity-boost[hidden] {
  display: none !important;
}

.game-toast {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #534ab7;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2.5px solid #fff;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  white-space: normal;
  text-align: center;
  max-width: 90%;
}

.game-toast.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.game-score-row {
  display: flex;
  gap: 10px;
}

.game-score-box {
  flex: 1;
  background: var(--q-surface);
  border-radius: var(--q-radius-sm);
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.game-score-box span {
  display: block;
  font-size: 11px;
  color: var(--q-text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.game-score-box strong {
  display: block;
  font-size: 22px;
  color: var(--mp-green-3);
  margin-top: 2px;
}

.game-score-box--cards {
  flex: 1.15;
}

.game-card-times {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-top: 2px;
}

.game-card-times strong {
  font-size: 24px;
  color: #534ab7;
  margin-top: 0;
}

.game-card-unit {
  font-size: 12px;
  font-weight: 800;
  color: #534ab7;
}

.game-card-meta {
  margin: 4px 0 0;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--q-text-muted);
}

.game-card-meta--total {
  margin-top: 2px;
  color: #7c6cf0;
}

.game-toolbar {
  display: flex;
  justify-content: flex-end;
}

.game-board-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  padding: 4px 0;
}

.game-board-wrap.is-swiping {
  cursor: grabbing;
}

.game-board-wrap.is-swiping .game-board {
  transform: scale(0.985);
  transition: transform 0.08s;
}

.game-board {
  position: relative;
  width: min(calc(100% - 8px), 340px);
  aspect-ratio: 1;
  background: #e8dcc8;
  border-radius: 14px;
  padding: 10px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(92, 184, 110, 0.15);
  transition: transform 0.12s ease;
}

.game-grid-bg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
}

.game-cell-bg {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 10px;
}

.game-tiles {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}

.game-tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  padding: 2px 4px;
  word-break: keep-all;
  transition: top 0.12s ease-in-out, left 0.12s ease-in-out;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.game-tile.is-new {
  animation: tile-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-tile.is-merged {
  animation: tile-merge 0.2s ease;
}

@keyframes tile-pop {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes tile-merge {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* 喜 · 琥珀色阶 */
.game-tile--2 { background: linear-gradient(145deg, #fff8eb, #faeEDA); color: #854F0B; }
.game-tile--4 { background: linear-gradient(145deg, #faeEDA, #f5d78a); color: #854F0B; }
.game-tile--8 { background: linear-gradient(145deg, #f5d078, #ef9f27); color: #fff; }
.game-tile--16 { background: linear-gradient(145deg, #ef9f27, #e08a10); color: #fff; }
.game-tile--32 { background: linear-gradient(145deg, #e08a10, #c87808); color: #fff; }
.game-tile--64 { background: linear-gradient(145deg, #d48806, #b87400); color: #fff; }
.game-tile--128 { background: linear-gradient(145deg, #ffc53d, #f5a623); color: #fff; }
.game-tile--256 { background: linear-gradient(145deg, #ffb020, #e8940a); color: #fff; }
.game-tile--512 { background: linear-gradient(145deg, #f59e0b, #d97706); color: #fff; }
.game-tile--1024 { background: linear-gradient(145deg, #ea580c, #c2410c); color: #fff; }
.game-tile--2048 { background: linear-gradient(145deg, #ffc53d, #ef9f27); color: #fff; box-shadow: 0 0 16px rgba(239, 159, 39, 0.55); }
.game-tile--super { background: linear-gradient(145deg, #ff4d4f, #cf1322); color: #fff; }

.game-controls {
  display: none;
}

/* ── 情绪合成等级表（游戏页） ── */
.game-level-table {
  --elt-accent: #5cb86e;
  --elt-soft: #f0f7f2;
  flex-shrink: 0;
  margin: 0;
  background: #fffef5;
  border: 3px solid #4a5048;
  border-radius: 18px;
  box-shadow: 0 4px 0 #4a5048;
  overflow: hidden;
}

.game-level-table-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 9px;
  background: linear-gradient(165deg, var(--elt-soft) 0%, #fffef5 72%);
  border-bottom: 2px dashed rgba(74, 80, 72, 0.14);
}

.game-level-table-emblem {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 2.5px solid #4a5048;
  background: linear-gradient(145deg, color-mix(in srgb, var(--elt-accent) 88%, #fff), var(--elt-accent));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(74, 80, 72, 0.28);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.game-level-table-head-text {
  min-width: 0;
  flex: 1;
}

.game-level-table-title {
  margin: 0;
  font-family: "ZCOOL KuaiLe", var(--q-font);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: #3d4a36;
  line-height: 1.2;
}

.game-level-table-sub {
  margin: 3px 0 0;
  font-size: 10px;
  font-weight: 700;
  color: #7a8472;
  line-height: 1.35;
}

.game-level-table-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
  padding: 10px 10px 8px;
  position: relative;
}

.game-level-table-body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  bottom: 12px;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--elt-accent) 35%, transparent) 18%,
    color-mix(in srgb, var(--elt-accent) 35%, transparent) 82%,
    transparent 100%
  );
  pointer-events: none;
}

.game-level-table-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.game-level-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 6px 4px 4px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(74, 80, 72, 0.1);
  box-shadow: 0 1px 0 rgba(74, 80, 72, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-level-row--goal {
  border-color: color-mix(in srgb, var(--elt-accent) 55%, #4a5048);
  background: linear-gradient(135deg, #fff 0%, var(--elt-soft) 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--elt-accent) 25%, transparent),
    0 2px 8px color-mix(in srgb, var(--elt-accent) 18%, transparent);
}

.game-level-step {
  flex: 0 0 32px;
  height: 24px;
  border-radius: 8px;
  border: 1.5px solid rgba(74, 80, 72, 0.14);
  color: color-mix(in srgb, var(--elt-accent) 70%, #4a5048);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.game-level-row--goal .game-level-step {
  border-color: color-mix(in srgb, var(--elt-accent) 45%, #4a5048);
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--elt-accent) 85%, #fff), var(--elt-accent)) !important;
  box-shadow: 0 1px 0 rgba(74, 80, 72, 0.2);
}

.game-level-word {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  color: #4a5048;
  line-height: 1.25;
  letter-spacing: 0.1px;
}

.game-level-row--goal .game-level-word {
  color: color-mix(in srgb, var(--elt-accent) 55%, #4a5048);
}

.game-level-goal {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #fff;
  background: var(--elt-accent);
  border: 1px solid rgba(74, 80, 72, 0.15);
  line-height: 1.2;
}

.game-level-table-foot {
  margin: 0;
  padding: 7px 12px 10px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #8a9488;
  background: rgba(247, 245, 239, 0.75);
  border-top: 1px solid rgba(74, 80, 72, 0.08);
}

/* 主题徽章字色微调 */
.game-level-table--xi .game-level-table-emblem { color: #fff; }
.game-level-table--nu .game-level-table-emblem { color: #fff; }
.game-level-table--ai .game-level-table-emblem { color: #fff; }
.game-level-table--ju .game-level-table-emblem { color: #fff; }

.game-dpad {
  display: none;
}

.game-hint {
  font-size: 12px;
  color: var(--q-text-muted);
  text-align: center;
}

.game-win-tag {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #fff7e6, #ffe7ba);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #d48806;
}

.game-win-tag.is-visible { display: flex; }

/* ── 视图切换：大厅 / 游戏互斥 ── */
.game-view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.game-view.is-active {
  display: flex;
}

.emotion-app {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #c8e4a8;
}

.ios-screen .emotion-app {
  overflow: hidden;
}

/* ── 选情绪大厅 · 游戏风 ── */
#view-lobby {
  position: relative;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.45) 0%, transparent 42%),
    radial-gradient(circle at 82% 8%, rgba(255, 248, 200, 0.35) 0%, transparent 38%),
    linear-gradient(180deg, #d4edba 0%, #b8d996 48%, #a8cf88 100%);
}

#view-lobby::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(74, 80, 72, 0.06) 1px, transparent 1px);
  background-size: 14px 14px;
  pointer-events: none;
  opacity: 0.55;
}

.lobby-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 42px 14px 10px;
  flex-shrink: 0;
}

.lobby-back {
  width: 36px;
  height: 36px;
  border: 2.5px solid #4a5048;
  border-radius: 12px;
  background: #fffef5;
  box-shadow: 0 3px 0 #4a5048;
  color: #4a5048;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.lobby-back:active { transform: translateY(2px); box-shadow: 0 1px 0 #4a5048; }

.lobby-header-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-right: 36px;
}

.lobby-header-deco {
  font-size: 10px;
  color: #e08a10;
  opacity: 0.85;
}

.lobby-title {
  margin: 0;
  font-family: "ZCOOL KuaiLe", var(--q-font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #3d4a36;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
}

.lobby-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 14px 8px;
  display: flex;
  flex-direction: column;
}

.lobby-hero {
  text-align: center;
  margin-bottom: 10px;
}

.lobby-subtitle {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #4a5048;
  line-height: 1.45;
}

.lobby-boost-hint {
  display: inline-block;
  margin: 8px auto 0;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  color: #534ab7;
  background: #fffef5;
  border-radius: 999px;
  border: 2px solid #534ab7;
  box-shadow: 0 2px 0 #534ab7;
}

.lobby-boost-hint[hidden] { display: none !important; }

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.lobby-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 132px;
  padding: 10px 8px 12px;
  border: 3px solid #4a5048;
  border-radius: 18px;
  background: #fffef5;
  box-shadow: 0 4px 0 #4a5048;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
}

.lobby-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 15px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
}

.lobby-card:active { transform: translateY(2px); box-shadow: 0 2px 0 #4a5048; }

.lobby-card.is-selected {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 #4a5048;
}

.lobby-card-boost {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 3;
  font-size: 8px;
  font-weight: 900;
  padding: 3px 6px;
  border-radius: 8px;
  background: #534ab7;
  color: #fff;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.lobby-card-art {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 84px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-card-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 3px 0 rgba(74, 80, 72, 0.12));
}

.lobby-qzai {
  transform: translateY(2px);
}

.lobby-card-name {
  position: relative;
  z-index: 1;
  font-family: "ZCOOL KuaiLe", var(--q-font);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  color: #3d4a36;
}

.lobby-card-desc {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #6b7562;
  text-align: center;
}

.lobby-card--xi { background: linear-gradient(165deg, #fff9e8 0%, #ffe8a8 100%); }
.lobby-card--xi.is-selected { border-color: #e08a10; box-shadow: 0 7px 0 #e08a10; }
.lobby-card--xi.is-selected:active { box-shadow: 0 2px 0 #e08a10; }

.lobby-card--nu { background: linear-gradient(165deg, #fff0ee 0%, #ffc9c4 100%); }
.lobby-card--nu.is-selected { border-color: #cf1322; box-shadow: 0 7px 0 #cf1322; }
.lobby-card--nu.is-selected:active { box-shadow: 0 2px 0 #cf1322; }

.lobby-card--ai { background: linear-gradient(165deg, #eef6ff 0%, #b8d8ff 100%); }
.lobby-card--ai.is-selected { border-color: #0958d9; box-shadow: 0 7px 0 #0958d9; }
.lobby-card--ai.is-selected:active { box-shadow: 0 2px 0 #0958d9; }

.lobby-card--ju { background: linear-gradient(165deg, #f6eeff 0%, #d9b8ff 100%); }
.lobby-card--ju.is-selected { border-color: #531dab; box-shadow: 0 7px 0 #531dab; }
.lobby-card--ju.is-selected:active { box-shadow: 0 2px 0 #531dab; }

.lobby-start-btn {
  position: relative;
  margin-top: auto;
  width: 100%;
  padding: 14px 20px;
  border: 3px solid #3d8f52;
  border-radius: 999px;
  background: linear-gradient(180deg, #7ed492 0%, #5cb86e 55%, #4aa85c 100%);
  color: #fff;
  font-family: "ZCOOL KuaiLe", var(--q-font);
  font-size: 18px;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 5px 0 #3d8f52, 0 8px 16px rgba(74, 168, 92, 0.35);
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s;
}

.lobby-start-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 3px 0 #3d8f52;
}

.lobby-start-btn:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #3d8f52;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.lobby-continue-btn {
  width: 100%;
  padding: 12px 16px;
  border: 3px solid #534ab7;
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f2ff 0%, #e8e0ff 100%);
  color: #534ab7;
  font-family: "ZCOOL KuaiLe", var(--q-font);
  font-size: 17px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 0 #534ab7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.12s ease;
}

.lobby-continue-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #534ab7;
}

.lobby-continue-btn[hidden] { display: none !important; }

.lobby-continue-meta {
  font-family: var(--q-font);
  font-size: 10px;
  font-weight: 700;
  opacity: 0.85;
}

.lobby-wallet {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #4a5048;
}

.lobby-wallet strong {
  color: #534ab7;
  font-size: 14px;
}

.lobby-wallet[hidden] { display: none !important; }

.lobby-settle-toast {
  margin: 8px 0 0;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #3d8f52;
  background: #eef9f0;
  border: 2px solid #5cb86e;
  border-radius: 12px;
}

.lobby-settle-toast[hidden] { display: none !important; }

.lobby-start-shine {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
  animation: lobby-shine 3.2s ease-in-out infinite;
}

@keyframes lobby-shine {
  0%, 70% { left: -40%; }
  100% { left: 120%; }
}

.lobby-dock {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 14px 10px;
  margin-top: 4px;
  background: linear-gradient(180deg, transparent, rgba(74, 80, 72, 0.06));
}

.lobby-dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: 2.5px solid #4a5048;
  border-radius: 14px;
  background: #fffef5;
  box-shadow: 0 3px 0 #4a5048;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: #4a5048;
  font-family: inherit;
  transition: transform 0.12s ease;
}

.lobby-dock-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4a5048;
}

.lobby-dock-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 旧大厅浮动条（已废弃） */
.lobby-rail { display: none !important; }

/* ── 游戏页独立全屏 ── */
#view-game {
  background: var(--q-bg);
}

.lobby-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 80;
}

.lobby-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.lobby-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(88%, 300px);
  height: 100%;
  background: #fffef5;
  border-left: 3px solid #4a5048;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 20px;
}

.lobby-drawer--wide { width: min(92%, 320px); }

.lobby-drawer.is-open { transform: translateX(0); }

.lobby-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lobby-drawer-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #4a5048;
}

.lobby-drawer-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
}

.lobby-drawer-note {
  margin: 0 0 10px;
  font-size: 11px;
  color: #888;
}

.lobby-drawer-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.history-empty {
  font-size: 12px;
  color: #888;
  text-align: center;
  padding: 24px 8px;
}

.history-empty[hidden] { display: none !important; }

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  padding: 10px 8px;
  border-bottom: 1px dashed rgba(74, 80, 72, 0.12);
}

.history-item-tag {
  grid-row: span 2;
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
}

.history-item-main {
  font-size: 12px;
  font-weight: 700;
  color: #4a5048;
}

.history-item-time {
  font-size: 10px;
  color: #888;
}

.history-item-cards {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #534ab7;
  margin-top: 2px;
}

.q-modal-card-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border: 2px solid rgba(74, 80, 72, 0.12);
  border-radius: 10px;
  overflow: hidden;
}

.q-modal-card-list[hidden] { display: none !important; }

.q-modal-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #4a5048;
  border-bottom: 1px dashed rgba(74, 80, 72, 0.1);
}

.q-modal-card-item:last-child { border-bottom: none; }

.q-modal-card-item strong {
  color: #534ab7;
  font-size: 13px;
  white-space: nowrap;
}

.q-modal-card-item em {
  font-style: normal;
  font-size: 10px;
  color: #888;
}

.q-modal-card-progress {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f2ff;
  border: 1.5px solid rgba(83, 74, 183, 0.18);
  font-size: 12px;
  line-height: 1.5;
  color: #4a5048;
  text-align: center;
}

.q-modal-card-progress strong {
  color: #534ab7;
  font-size: 14px;
}

.q-modal-card-next,
.q-modal-card-progress span {
  color: #666;
  font-size: 11px;
}

.rules-block { margin-bottom: 14px; }
.rules-block h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: #4a5048;
}
.rules-block p {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: #666;
}

.rules-table-wrap {
  overflow-x: auto;
  border: 2px solid #4a5048;
  border-radius: 8px;
  background: #fff;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.rules-table th,
.rules-table td {
  border: 1px solid rgba(74, 80, 72, 0.12);
  padding: 5px 4px;
  text-align: center;
  white-space: nowrap;
}

.rules-table th {
  background: #f5f0dc;
  font-weight: 800;
  color: #4a5048;
}

.rules-table td:first-child,
.rules-table th:first-child { background: #faf6eb; }

.game-emotion-tag--nu {
  background: #ffe7e6;
  color: #a8071a;
}

.game-emotion-tag--ai {
  background: #e6f4ff;
  color: #0958d9;
}

.game-emotion-tag--ju {
  background: #f9f0ff;
  color: #531dab;
}

/* 怒 · 红阶 */
.game-theme--nu .game-board { background: #f0d4d4; }
.game-theme--nu .game-tile--2 { background: linear-gradient(145deg, #fff1f0, #ffccc7); color: #a8071a; }
.game-theme--nu .game-tile--4 { background: linear-gradient(145deg, #ffccc7, #ffa39e); color: #a8071a; }
.game-theme--nu .game-tile--8 { background: linear-gradient(145deg, #ff7875, #f5222d); color: #fff; }
.game-theme--nu .game-tile--16,
.game-theme--nu .game-tile--32,
.game-theme--nu .game-tile--64 { background: linear-gradient(145deg, #f5222d, #cf1322); color: #fff; }
.game-theme--nu .game-tile--128,
.game-theme--nu .game-tile--256,
.game-theme--nu .game-tile--512 { background: linear-gradient(145deg, #ff4d4f, #a8071a); color: #fff; }
.game-theme--nu .game-tile--1024,
.game-theme--nu .game-tile--2048 { background: linear-gradient(145deg, #ff7875, #cf1322); color: #fff; box-shadow: 0 0 14px rgba(207, 19, 34, 0.45); }

/* 哀 · 蓝阶 */
.game-theme--ai .game-board { background: #d4e4f5; }
.game-theme--ai .game-tile--2 { background: linear-gradient(145deg, #e6f4ff, #bae0ff); color: #0958d9; }
.game-theme--ai .game-tile--4 { background: linear-gradient(145deg, #bae0ff, #91caff); color: #0958d9; }
.game-theme--ai .game-tile--8 { background: linear-gradient(145deg, #69b1ff, #1677ff); color: #fff; }
.game-theme--ai .game-tile--16,
.game-theme--ai .game-tile--32,
.game-theme--ai .game-tile--64 { background: linear-gradient(145deg, #4096ff, #0958d9); color: #fff; }
.game-theme--ai .game-tile--128,
.game-theme--ai .game-tile--256,
.game-theme--ai .game-tile--512 { background: linear-gradient(145deg, #1677ff, #003eb3); color: #fff; }
.game-theme--ai .game-tile--1024,
.game-theme--ai .game-tile--2048 { background: linear-gradient(145deg, #69b1ff, #0958d9); color: #fff; box-shadow: 0 0 14px rgba(9, 88, 217, 0.45); }

/* 惧 · 紫阶 */
.game-theme--ju .game-board { background: #e0d4f0; }
.game-theme--ju .game-tile--2 { background: linear-gradient(145deg, #f9f0ff, #efdbff); color: #531dab; }
.game-theme--ju .game-tile--4 { background: linear-gradient(145deg, #efdbff, #d3adf7); color: #531dab; }
.game-theme--ju .game-tile--8 { background: linear-gradient(145deg, #b37feb, #722ed1); color: #fff; }
.game-theme--ju .game-tile--16,
.game-theme--ju .game-tile--32,
.game-theme--ju .game-tile--64 { background: linear-gradient(145deg, #9254de, #531dab); color: #fff; }
.game-theme--ju .game-tile--128,
.game-theme--ju .game-tile--256,
.game-theme--ju .game-tile--512 { background: linear-gradient(145deg, #722ed1, #391085); color: #fff; }
.game-theme--ju .game-tile--1024,
.game-theme--ju .game-tile--2048 { background: linear-gradient(145deg, #b37feb, #531dab); color: #fff; box-shadow: 0 0 14px rgba(83, 29, 171, 0.45); }

.game-score-row .game-score-box strong { font-size: 18px; }

.q-modal-actions .q-btn { width: 100%; }
.q-modal-actions { gap: 8px; }

body.lobby-drawer-open { overflow: hidden; }

#q-app-root {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
