/* ============ RINGANOID — стили ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #05060f;
  --panel: rgba(16, 22, 44, 0.72);
  --panel-border: rgba(56, 140, 255, 0.25);
  --cyan: #38c8ff;
  --blue: #2e8fff;
  --magenta: #c44dff;
  --text: #cfe3ff;
  --dim: #6d84ad;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body {
  background:
    radial-gradient(1px 1px at 12% 20%, #ffffff55 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 12%, #ffffff44 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 66%, #ffffff33 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 84%, #ffffff44 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 40%, #ffffff2e 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 8% 62%, #ffffff30 50%, transparent 51%),
    radial-gradient(ellipse at 50% 50%, #0a1230 0%, var(--bg) 70%);
}

#stage {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  gap: 4px;
}

/* ---------- логотип ---------- */
.logo { text-align: center; line-height: 1; }
.logo-line1 {
  font-size: 15px;
  letter-spacing: 0.55em;
  color: #e8f2ff;
  text-shadow: 0 0 8px #38c8ff88;
}
.logo-line2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #2e8fff, #38c8ff 40%, #c44dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px #2e8fff66);
}

/* ---------- раскладка ---------- */
.layout {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
}

.panel-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 190px;
  flex-shrink: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 18px rgba(46, 143, 255, 0.08) inset;
}

.panel-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 10px;
  text-shadow: 0 0 6px #38c8ff66;
}

.stat { margin-bottom: 10px; }
.stat:last-child { margin-bottom: 0; }
.stat-label {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--cyan);
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #eaf4ff;
  text-shadow: 0 0 10px #38c8ff44;
  font-variant-numeric: tabular-nums;
}
.stat-value.hearts { color: #ff3d6e; text-shadow: 0 0 10px #ff3d6e88; font-size: 20px; letter-spacing: 0.1em; }

/* ---------- бонусы ---------- */
.powerup-list { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.pw-row { display: flex; align-items: center; gap: 8px; color: var(--text); }
.pw-ico {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  flex-shrink: 0;
  border: 1.5px solid;
}
.pw-multi { color: #38c8ff; border-color: #38c8ff; box-shadow: 0 0 8px #38c8ff66; }
.pw-wide  { color: #4dff88; border-color: #4dff88; box-shadow: 0 0 8px #4dff8866; }
.pw-slow  { color: #ffd24d; border-color: #ffd24d; box-shadow: 0 0 8px #ffd24d66; }
.pw-shield{ color: #ffb347; border-color: #ffb347; box-shadow: 0 0 8px #ffb34766; }

.fx-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #9fe08a; }
.fx-item { text-shadow: 0 0 6px #4dff8866; font-variant-numeric: tabular-nums; }

/* ---------- опции ---------- */
.opt-buttons { display: flex; gap: 8px; }
.opt-btn {
  width: 44px; height: 44px;
  font-size: 18px;
  background: rgba(10, 16, 34, 0.8);
  color: var(--cyan);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  cursor: pointer;
}
.opt-btn:hover { border-color: var(--cyan); box-shadow: 0 0 10px #38c8ff55; }

/* ---------- поле ---------- */
.board-wrap {
  position: relative;
  height: min(100%, 92vmin);
  aspect-ratio: 1;
  max-width: 100%;
}
#board {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* ---------- оверлей ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 16, 0.72);
  border-radius: 50%;
  backdrop-filter: blur(3px);
  z-index: 5;
}
.overlay.hidden { display: none; }
.overlay-box {
  text-align: center;
  padding: 28px 34px;
  background: rgba(10, 16, 36, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 0 40px #2e8fff33;
  max-width: 82%;
}
.overlay-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #2e8fff, #38c8ff 40%, #c44dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}
.overlay-text { font-size: 14px; line-height: 1.7; color: var(--text); margin-bottom: 18px; }

/* ---------- сетка управления в меню (как в RingFall) ---------- */
.controls-title {
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--cyan);
  text-shadow: 0 0 6px #38c8ff66;
}
.controls-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 16px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  color: #b8d4f5;
  text-align: left;
}
.controls-grid .keys {
  text-align: right;
  white-space: nowrap;
  color: #dfe9ff;
}
kbd {
  display: inline-block;
  min-width: 20px;
  padding: 3px 8px;
  margin: 0 1px;
  border-radius: 6px;
  background: #0d1c3d;
  border: 1px solid #2c4a86;
  border-bottom-width: 2px;
  color: #dfe9ff;
  font-family: "Segoe UI", monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 6px rgba(46, 143, 255, 0.25);
}
.menu-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--dim);
}
.overlay-btn {
  padding: 12px 38px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(90deg, #2e8fff, #38c8ff);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 20px #38c8ff77;
}
.overlay-btn:hover { filter: brightness(1.15); }
.overlay-btn.small { padding: 9px 18px; font-size: 13px; }

/* ---------- таблица рекордов / отправка ---------- */
.submit-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.name-input {
  width: 150px;
  padding: 9px 12px;
  font-size: 14px;
  color: #eaf4ff;
  background: rgba(10, 16, 34, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  outline: none;
}
.name-input:focus { border-color: var(--cyan); box-shadow: 0 0 10px #38c8ff44; }
.scores-list {
  margin: 12px auto 4px;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text);
}
.scores-list td { padding: 3px 10px; text-align: left; font-variant-numeric: tabular-nums; }
.scores-list tr:first-child td { color: #ffd24d; text-shadow: 0 0 8px #ffd24d66; }
.ov-note { font-size: 12px; color: var(--dim); margin-bottom: 12px; }
#ovExtra { margin-bottom: 6px; }
#submitResult { font-size: 13px; color: var(--text); min-height: 18px; }

/* ---------- мобильная раскладка ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; gap: 6px; }
  .panel-col { flex-direction: row; width: 100%; justify-content: center; }
  .panel { padding: 8px 10px; }
  .left-col .stats { display: flex; gap: 14px; }
  .stat { margin-bottom: 0; }
  .stat-value { font-size: 18px; }
  .right-col { display: none; }
  .board-wrap { height: auto; width: min(96vw, 70dvh); }
  .logo-line2 { font-size: 24px; }
}
