/* 基础：深色主题、系统字体、顶栏 */
:root {
  --bg: #0d1014;
  --bg2: #151a20;
  --panel: #1a1d22;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f0efec;
  --text2: #c3c2b7;
  --muted: #8c8b84;
  --gold: #f5c451;
  --gold2: #c8932a;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #1c2530 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input, select { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.pos { color: #4ade80; }
.neg { color: #f87171; }

#app {
  position: relative;
  max-width: 430px;
  min-width: 320px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 18px;
  display: grid;
  place-items: center;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.1); }
.title { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-main { font-weight: 700; font-size: 16px; letter-spacing: 0.5px; white-space: nowrap; }
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2f855a, #1e5d3d);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}
body.play-mode .badge { background: linear-gradient(135deg, #c8932a, #8a5a12); }
.hand-no { font-size: 12px; color: var(--text2); white-space: nowrap; }

.toast {
  position: absolute;
  left: 50%;
  top: 60px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: rgba(16, 20, 26, 0.92);
  border: 1px solid rgba(245, 196, 81, 0.4);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  text-align: center;
  pointer-events: none;
}
