/* Общие стили всех игр: холст сцены, прицел, стартовый экран. */

:root {
  --accent: #5adcff;
  --go: #19c97a;
  --ink: #eaf4ff;
  --muted: #9db4cc;
  --panel: rgba(9, 13, 26, 0.78);
  --line: rgba(120, 200, 255, 0.28);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05070f;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#scene.playing { cursor: none; }

/* ---------- прицел для игры на экране ---------- */

#crosshair {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}
#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
#crosshair::before {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}
#crosshair::after {
  width: 5px;
  height: 5px;
  background: #ff4050;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* ---------- стартовый экран ---------- */

#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(5, 7, 15, 0.25) 0%, rgba(5, 7, 15, 0.72) 100%);
  transition: opacity 0.25s ease, visibility 0.25s;
}
#overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.panel {
  width: min(880px, 100%);
  margin: auto;
  padding: 28px 32px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

header { text-align: center; }

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}
h1 span { color: var(--accent); text-shadow: 0 0 28px rgba(90, 220, 255, 0.55); }

.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

h2, h3 {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
h3 { margin-top: 0; }

.actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.actions button {
  flex: 1;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.actions button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.15); }
.actions button.primary {
  background: linear-gradient(180deg, #2de08f, var(--go));
  border-color: #b9ffe0;
  color: #04131f;
}
.actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
  color: var(--ink);
}

#xr-note {
  margin: 10px 0 0;
  min-height: 1.3em;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.rules ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.45;
  color: #c9d9ea;
}
.rules li + li { margin-top: 6px; }

kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 12px;
}

footer {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
footer b { color: #ffe14d; font-size: 16px; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  .panel { padding: 20px 16px 16px; }
  .rules { grid-template-columns: 1fr; gap: 14px; }
  .actions { flex-direction: column; }
}
