:root {
  --bg-0: #0b0f1a;
  --text: #eaf0ff;
  --muted: #98a3b7;
  --primary: #7c5cff;
  --primary-2: #ff6ad6;
  --glass: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.15);
  --black: #1a1a1a;
  --white: #fafafa;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 20% -10%, #151a2a 0%, #0b0f1a 60%);
  color: var(--text);
}
.hidden { display: none; }
.view { min-height: 100vh; position: relative; }

.bg-orb {
  position: absolute;
  filter: blur(60px);
  opacity: 0.45;
}
.orb-1 {
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7c5cff, rgba(124,92,255,0.1));
  left: -120px; top: -80px;
}
.orb-2 {
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle at 70% 40%, #ff6ad6, rgba(255,106,214,0.1));
  right: -180px; top: 20%;
}
.orb-3 {
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #43d9ad, rgba(67,217,173,0.12));
  left: 10%; bottom: -120px;
}

.login-view { display: grid; place-items: center; padding: 40px 20px; }
.login-card {
  width: 92vw; max-width: 860px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  border-radius: 24px;
  padding: 32px;
  backdrop-filter: blur(14px);
}
.mode-view { display: grid; place-items: center; padding: 40px 20px; }
.mode-card {
  width: 92vw; max-width: 720px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  border-radius: 24px;
  padding: 28px;
  backdrop-filter: blur(14px);
  display: grid; gap: 16px;
}
.mode-title { font-size: 24px; font-weight: 800; }
.mode-list { display: flex; gap: 12px; }
.mode-item { min-width: 180px; }
.mode-note { color: var(--muted); font-size: 13px; }
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.brand-mark {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 28px; letter-spacing: 4px;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  color: white;
  box-shadow: 0 12px 24px rgba(124,92,255,0.45);
}
.brand-text .title { font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.brand-text .subtitle { color: var(--muted); font-size: 14px; }
.login-form { display: grid; gap: 18px; margin-top: 8px; }
.input-group { display: grid; gap: 8px; }
.input-group label { color: var(--muted); font-size: 14px; }
.input-group input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.input-group input:focus {
  border-color: rgba(124,92,255,0.8);
  box-shadow: 0 0 0 4px rgba(124,92,255,0.25);
}
.primary-btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  color: white;
  font-weight: 700;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(124,92,255,0.35);
}
.primary-btn:active { transform: translateY(1px); }
.ghost-btn {
  padding: 10px 16px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}
.error-text { color: #ff6b6b; min-height: 24px; font-size: 14px; }
.login-footer { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: right; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.logo { font-weight: 800; letter-spacing: 2px; }
.controls { display: flex; gap: 12px; align-items: center; }
.controls select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.music-controls { display: flex; gap: 8px; align-items: center; }
.music-controls input[type="range"] {
  width: 120px;
  accent-color: var(--primary);
}
.music-controls select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.music-meta {
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-wrap {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  gap: 18px;
  padding: 18px;
}
.styles-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.06);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  height: min(86vh, 86vw);
}
.panel-title { font-weight: 800; letter-spacing: 1px; }
.style-list { display: grid; gap: 10px; }
.style-chip {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.style-chip.active {
  border-color: rgba(124,92,255,0.8);
  box-shadow: 0 0 0 3px rgba(124,92,255,0.25) inset;
}
.board {
  width: min(86vh, 86vw);
  height: min(86vh, 86vw);
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  position: relative;
  overflow: hidden;
}
.board.board-go {
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25);
}
.board.board-go .cell {
  border: 1px solid rgba(0,0,0,0.35);
}
.board.board-go::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 6px at 20% 20%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 80% 20%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 20% 80%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 80% 80%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 50% 50%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 50% 20%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 50% 80%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 20% 50%, rgba(0,0,0,0.45), transparent 7px),
    radial-gradient(circle 6px at 80% 50%, rgba(0,0,0,0.45), transparent 7px);
}
.board.theme-wood-classic {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.08), rgba(255,255,255,0.08)),
    repeating-linear-gradient(45deg, #c69c6d 0px, #c69c6d 6px, #d7a776 6px, #d7a776 12px),
    radial-gradient(200% 200% at 0% 0%, #e6b37a, #c8995b);
}
.board.theme-wood-dark {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.10), rgba(255,255,255,0.06)),
    repeating-linear-gradient(45deg, #8b5e34 0px, #8b5e34 6px, #a4713d 6px, #a4713d 12px),
    radial-gradient(200% 200% at 0% 0%, #a4713d, #6f4a27);
}
.board.theme-paper {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(0,0,0,0.05), rgba(255,255,255,0.06)),
    linear-gradient(180deg, #faf7f2, #efe9df);
}
.board.theme-neon {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,0.12), rgba(255,255,255,0.04)),
    linear-gradient(135deg, #111928, #1b1f3a);
}
.cell {
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  display: grid;
  place-items: center;
  transition: background 120ms ease;
}
.board.theme-wood-classic .cell:hover { background: rgba(0,0,0,0.06); }
.board.theme-wood-dark .cell:hover { background: rgba(0,0,0,0.08); }
.board.theme-paper .cell:hover { background: rgba(0,0,0,0.05); }
.board.theme-neon .cell:hover { background: rgba(124,92,255,0.18); }

.stone {
  width: 88%;
  height: 88%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15), 0 10px 18px rgba(0,0,0,0.35), inset 8px 8px 18px rgba(255,255,255,0.12);
}
.stone.black {
  background: radial-gradient(circle at 40% 35%, #2b2b2b, #0a0a0a);
}
.stone.white {
  background: radial-gradient(circle at 40% 35%, #ffffff, #d6d6d6);
}
.sidebar {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.06);
  display: grid; gap: 12px;
  height: min(86vh, 86vw);
}
.status { display: grid; gap: 8px; }
.legend { display: flex; gap: 8px; align-items: center; }
.online-panel {
  border-top: 1px dashed var(--border);
  margin-top: 8px;
  padding-top: 8px;
  display: grid; gap: 8px;
}
.online-row { display: flex; gap: 8px; align-items: center; }
.online-panel input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.online-toast {
  width: 100%;
  min-height: 22px;
  color: #ffb3b3;
  font-size: 13px;
}
