/* theme.css
   Палитра SUdroch: чёрно-белая база, акценты — голубой и золотой.
   Все экраны (mainMenu, lobby, gameBoard, profile, friends) используют
   только эти переменные — никаких "случайных" цветов по месту.
*/

:root {
  --bg: #0c0e12;
  --panel: #14171d;
  --panel-hover: #1a1e26;
  --line-strong: #2a2f3a;
  --line: #1c2028;

  --fg: #e9ecf1;
  --muted: #7c8494;

  --blue: #4da3ff;
  --blue-dim: #2a4870;
  --gold: #d4af37;
  --gold-dim: #7a6420;

  --cell: #14171d;
  --cell-given: #1a1e26;
  --cell-peer: #1b2230;
  --cell-same: #21324a;
  --cell-sel: #2a4870;
  --mistake: #8a2f3a;

  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1.logo {
  font-size: 26px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0 0 4px;
}
.subtitle { color: var(--muted); font-size: 13px; margin-bottom: 28px; text-align: center; }

h2.screen-title {
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin: 0 0 18px;
  text-transform: uppercase;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
}

.field { margin-bottom: 14px; width: 100%; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
}
.field input[type="text"]:focus { outline: none; border-color: var(--blue); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row input[type="checkbox"] { accent-color: var(--blue); width: 16px; height: 16px; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}
.mode-option {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.mode-option.active { border-color: var(--gold); color: var(--gold); }

button.btn {
  background: var(--blue-dim);
  border: 1px solid var(--blue);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}
button.btn:hover { background: var(--blue); color: #06121f; }
button.btn:disabled { opacity: 0.4; cursor: not-allowed; }

button.btn-secondary {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
button.btn-secondary:hover { border-color: var(--fg); color: var(--fg); }

button.btn-gold {
  background: var(--gold-dim);
  border: 1px solid var(--gold);
  color: var(--gold);
}
button.btn-gold:hover { background: var(--gold); color: #1a1400; }

.btn-row { display: flex; gap: 10px; width: 100%; margin-top: 6px; }

.room-code {
  font-size: 32px;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-align: center;
  margin: 10px 0 18px;
  font-weight: 600;
}

.player-list { width: 100%; margin-bottom: 18px; }
.player-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.player-row .host-tag { color: var(--gold); font-size: 11px; }

/* ---- Игровая доска ---- */
.game-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
}
.hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 13px;
  color: var(--muted);
}
.hud b { color: var(--fg); }
.hud .score { color: var(--gold); }

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--line-strong);
  padding: 3px;
  border-radius: var(--radius);
  width: min(94vw, 460px);
  aspect-ratio: 1;
}
.box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.cell {
  background: var(--cell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}
.cell.given { color: var(--fg); background: var(--cell-given); cursor: default; }
.cell.peer { background: var(--cell-peer); }
.cell.same { background: var(--cell-same); }
.cell.selected { background: var(--cell-sel); color: #fff; }
.cell.mistake { background: var(--mistake) !important; color: #ffd9dc !important; }

.notes {
  position: absolute;
  inset: 6%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.notes span { font-size: clamp(7px, 1.6vw, 9px); color: var(--muted); display: flex; align-items: center; justify-content: center; }

.pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: min(94vw, 460px);
}
.pad button {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 12px 0;
  font-size: 16px;
  cursor: pointer;
}
.pad button:hover { border-color: var(--blue); }
.pad button.notes-active { border-color: var(--gold); color: var(--gold); }
.pad button.erase { grid-column: span 2; color: var(--muted); }

.opponents { width: 100%; }
.opponent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.opponent-bar {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.opponent-bar-fill { height: 100%; background: var(--blue); }

.nav-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 12px;
}
.nav-back:hover { color: var(--fg); }
