* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #05060f;
  --panel-bg: rgba(10, 18, 40, 0.75);
  --panel-border: #1e3a6e;
  --accent: #2e8fff;
  --text-dim: #4d7fc4;
  --text-bright: #eaf4ff;
}

html, body {
  height: 100%;
}

body {
  background: radial-gradient(ellipse at 50% 30%, #0a1128 0%, var(--bg) 65%);
  color: var(--text-bright);
  font-family: "Segoe UI", "Arial", sans-serif;
  overflow: hidden;           /* у страницы-игры нет скролла */
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Фоновые декорации ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.decor {
  position: absolute;
  filter: blur(6px);
  opacity: 0.45;
}
.d1 { width: 130px; top: 4%;  right: 3%;  fill: #43c527; transform: rotate(18deg); }
.d2 { width: 150px; bottom: 8%; right: 5%; fill: #43c527; transform: rotate(-12deg); }
.d3 { width: 140px; bottom: 4%; left: 3%;  fill: #8e44e0; transform: rotate(9deg); }
.d4 { width: 90px;  top: 30%;  left: 2%;  fill: #8e44e0; transform: rotate(-20deg); }

/* ---------- Логотип ---------- */
.logo {
  position: absolute;
  top: 22px;
  left: 34px;
  z-index: 5;
  user-select: none;
  line-height: 0.95;
}
.logo-line1 {
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 0 #1a2c55, 0 0 18px rgba(46, 143, 255, 0.8);
}
.logo-line2 {
  font-size: 46px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ff4747, #ffb300, #3fd23f, #2e8fff, #b44bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(46, 143, 255, 0.55));
}

/* ---------- Основная раскладка ---------- */
.layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  z-index: 1;
}

.panel-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 180px;
}
.left-col  { align-items: stretch; }
.right-col { align-items: stretch; }

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 0 22px rgba(20, 60, 140, 0.35), inset 0 0 30px rgba(20, 50, 120, 0.15);
  text-align: center;
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(46, 143, 255, 0.7);
  margin-bottom: 8px;
}

.stats .stat { padding: 8px 0; }
.stats .stat + .stat { border-top: 1px solid rgba(46, 100, 190, 0.35); }
.stat-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(46, 143, 255, 0.6);
}
.stat-value {
  font-size: 27px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 12px rgba(160, 210, 255, 0.55);
}

#nextCanvas, #holdCanvas { display: block; margin: 0 auto; }

/* ---------- Игровое поле ---------- */
/* Круг занимает всю высоту окна и масштабируется вместе с ним */
.board-wrap {
  position: relative;
  height: min(calc(100vh - 16px), 62vw);
  aspect-ratio: 1 / 1;
}
#board { display: block; width: 100%; height: 100%; }

/* ---------- Кнопки опций ---------- */
.opt-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.opt-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--panel-border);
  background: radial-gradient(circle at 35% 30%, #14264d, #0a1430);
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 0 10px rgba(30, 90, 200, 0.4);
}
.opt-btn:hover {
  box-shadow: 0 0 18px rgba(46, 143, 255, 0.8);
  transform: scale(1.06);
}
.opt-btn:active { transform: scale(0.96); }

/* ---------- Оверлей (старт / пауза / конец игры / справка) ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 16, 0.72);
  border-radius: 50%;
  z-index: 4;
}
.overlay.hidden { display: none; }
.overlay-box {
  text-align: center;
  padding: 34px 44px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(30, 90, 220, 0.5);
  max-width: 480px;
}
.overlay-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 16px rgba(46, 143, 255, 0.9);
  margin-bottom: 14px;
}
.overlay-text {
  font-size: 16px;
  line-height: 1.7;
  color: #b8d4f5;
  margin-bottom: 20px;
}
.overlay-btn {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 12px 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #3f9dff, #1b5fd0);
  box-shadow: 0 0 20px rgba(46, 143, 255, 0.8);
  transition: transform 0.1s, box-shadow 0.15s;
}
.overlay-btn:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(70, 160, 255, 1); }
.overlay-btn:active { transform: scale(0.97); }
.overlay-btn.small { font-size: 15px; padding: 10px 20px; letter-spacing: 1px; }
.overlay-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ---------- Таблица рекордов ---------- */
.lb-save {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 16px 0 6px;
}
.lb-save input {
  width: 200px;
  padding: 10px 14px;
  font-size: 16px;
  color: #fff;
  background: rgba(5, 12, 30, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  outline: none;
}
.lb-save input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(46, 143, 255, 0.5);
}
.lb-note {
  font-size: 17px;
  color: #ffd66b;
  text-shadow: 0 0 10px rgba(255, 190, 60, 0.6);
}
.lb-table {
  margin: 12px auto 0;
  border-collapse: collapse;
  min-width: 320px;
  font-size: 15px;
  color: #d6e8ff;
}
.lb-table th {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(46, 100, 190, 0.5);
}
.lb-table th, .lb-table td {
  padding: 5px 12px;
  text-align: left;
}
.lb-table td:first-child, .lb-table th:first-child { text-align: right; color: var(--text-dim); }
.lb-table td:nth-child(3) { font-weight: 700; color: #fff; }
.lb-table tr.lb-me td {
  background: rgba(46, 143, 255, 0.22);
  color: #fff;
}
.lb-table tr.lb-me td:first-child { border-radius: 8px 0 0 8px; }
.lb-table tr.lb-me td:last-child { border-radius: 0 8px 8px 0; }
.lb-empty {
  margin-top: 12px;
  color: #9db8dd;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Выбор языка ---------- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 6px;
}
.lang-btn {
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
  color: #d6e8ff;
  background: rgba(10, 24, 55, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.lang-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(46, 143, 255, 0.5);
}
.lang-btn.active {
  border-color: var(--accent);
  background: rgba(46, 143, 255, 0.25);
  color: #fff;
  box-shadow: 0 0 14px rgba(46, 143, 255, 0.6);
}

