@import url('https://fonts.googleapis.com/css2?family=ZCOOL+QingKe+HuangYou&family=Noto+Sans+SC:wght@400;600;700&display=swap');

:root {
  --bg0: #071018;
  --bg1: #0d1c28;
  --ink: #e8f2f6;
  --muted: #8aa0ae;
  --cyan: #3ec9c0;
  --cyan-deep: #1a7a74;
  --crimson: #e06a4e;
  --crimson-deep: #8a3428;
  --gold: #d4b57a;
  --panel: rgba(10, 22, 32, 0.78);
  --line: rgba(212, 181, 122, 0.28);
  --font-display: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  --font-ui: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-ui);
  user-select: none;
}

.bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(62, 201, 192, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(224, 106, 78, 0.12), transparent 50%),
    linear-gradient(165deg, #08141e 0%, #0a1824 45%, #0c1018 100%);
  z-index: 0;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

#board {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.hud {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.hud * { pointer-events: auto; }

.top-bar {
  top: 0;
  left: 0;
  right: 0;
  padding: 22px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.brand {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-shadow: 0 0 28px rgba(62, 201, 192, 0.35);
}

.brand small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--muted);
  font-weight: 400;
}

.status-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  border-radius: 4px;
  min-width: 200px;
  text-align: right;
}

.status-pill .phase {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.2em;
}

.status-pill .turn {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
}

.bottom-bar {
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.side-card {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 14px 18px;
  border-radius: 4px;
  min-width: 150px;
}

.side-card.cyan { border-color: rgba(62, 201, 192, 0.45); }
.side-card.crimson { border-color: rgba(224, 106, 78, 0.45); text-align: right; }

.side-card .name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
}

.side-card.cyan .name { color: var(--cyan); }
.side-card.crimson .name { color: var(--crimson); }

.side-card .meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  font-family: var(--font-ui);
  border: 1px solid var(--line);
  background: rgba(16, 28, 38, 0.9);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.12em;
  font-size: 14px;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}

button.primary {
  background: linear-gradient(135deg, rgba(62, 201, 192, 0.35), rgba(26, 80, 90, 0.9));
  border-color: rgba(62, 201, 192, 0.55);
}

button.danger {
  background: linear-gradient(135deg, rgba(224, 106, 78, 0.3), rgba(80, 30, 28, 0.9));
  border-color: rgba(224, 106, 78, 0.5);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 16, 0.72);
  backdrop-filter: blur(10px);
}

.overlay.hidden { display: none !important; }

.menu-card {
  width: min(520px, 92vw);
  background: linear-gradient(160deg, rgba(14, 28, 40, 0.95), rgba(8, 16, 24, 0.98));
  border: 1px solid var(--line);
  padding: 36px 32px 28px;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.menu-card h1 {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 0.22em;
  text-align: center;
  margin-bottom: 8px;
}

.menu-card .tagline {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.28em;
  margin-bottom: 28px;
}

.rules {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-left: 2px solid rgba(62, 201, 192, 0.45);
  background: rgba(255, 255, 255, 0.02);
}

.menu-actions {
  display: grid;
  gap: 10px;
}

.menu-actions button { width: 100%; padding: 14px; font-size: 15px; }

.toast {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(8, 18, 26, 0.92);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.toast.show { opacity: 1; }

.online-panel .row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.online-panel .row button { flex: 1; }

.hint {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

@media (max-width: 720px) {
  .brand { font-size: 24px; letter-spacing: 0.12em; }
  .side-card { min-width: 110px; padding: 10px 12px; }
  .side-card .name { font-size: 18px; }
  .menu-card h1 { font-size: 36px; }
}
