/* Kosmosa Kebabnīca — stils. Portrets 540×960 virtuālais laukums.
   Fons tumši violets, kanva centrēta, pogas ≥48 px, touch-action none. */

/* Visam lapā — tumšs fons un centrēts saturs. */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0f0719;
  color: #f3c88b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  /* Lai telefons neveic dubultklikšķa tuvināšanu. */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Flex centrēšana gan horizontāli, gan vertikāli. */
body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Konteiners — kvadrāts, kas uztur 540:960 attiecību.
   Augstums ir maksimālais pieejamais, platums aprēķināts. */
#speles-konteineris {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, #2d0f3f 0%, #1b0d2e 60%, #0f0719 100%);
}

/* Portreta attiecības 540:960 = 9:16. Kanva uztur šo attiecību,
   bet nekad nepārsniedz pieejamo logu. */
#kanva {
  display: block;
  width: auto;
  height: 100%;
  aspect-ratio: 540 / 960;
  max-width: 100%;
  max-height: 100%;
  background: #1b0d2e;
  border-radius: 12px;
  box-shadow:
    0 0 0 2px #3a5f8c,
    0 0 32px rgba(255, 61, 153, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.6);
  cursor: crosshair;
  outline: none;
  /* Neļaujam pārlūkam skārienu laikā ritināt vai tuvināt. */
  touch-action: none;
  -webkit-touch-callout: none;
}

/* Fokusa kontūra — redzama tikai klaviatūras lietotājiem. */
#kanva:focus-visible {
  outline: 3px solid #ff3d99;
  outline-offset: 4px;
}

/* Uz ļoti šaura ekrāna (mobilais portrets) — kanva aizņem visu platumu. */
@media (max-aspect-ratio: 9 / 16) {
  #kanva {
    width: 100%;
    height: auto;
  }
}

/* Uz ļoti plata ekrāna — kanva paliek centrā, sānu dekors ir fona gradients. */
@media (min-aspect-ratio: 16 / 9) {
  #kanva {
    height: 100%;
    width: auto;
  }
}

/* Pogas, ja tādas parādīsies ārpus kanvas (piem., valodas pārslēgs). */
.poga {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 12px 20px;
  background: #2d0f3f;
  color: #f3c88b;
  border: 2px solid #d4a24a;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.poga:hover {
  background: #4a2a6a;
  border-color: #ff3d99;
}

.poga:active {
  transform: scale(0.97);
}

.poga:focus-visible {
  outline: 3px solid #ff3d99;
  outline-offset: 3px;
}

.poga[disabled] {
  background: #1e0a2c;
  color: #7a5a5a;
  border-color: #4a3a5a;
  cursor: not-allowed;
}

/* Notikumu paziņojums virs kanvas (ja vajadzēs HTML slāni). */
.pazinojums {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(27, 13, 46, 0.9);
  color: #ffe66d;
  border: 2px solid #ff3d99;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
}

/* Palīga klase — paslēpt redzami, bet paturēt lasītājiem. */
.paslepts {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respektē lietotāja "mazāk kustības" iestatījumu — izslēdzam pārejas. */
@media (prefers-reduced-motion: reduce) {
  #kanva {
    box-shadow: 0 0 0 2px #3a5f8c;
  }
  .poga {
    transition: none;
  }
}

/* Sākuma ekrāns ar pamācību — portāls zem spēles paskaidrojumus vairs nerāda. */
.starts { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 6, 24, 0.82); z-index: 5; }
.starts[hidden] { display: none; }
.starts__karte { width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 22px; border-radius: 18px; background: #1b1233; border: 2px solid #ff4fa3; color: #f3eaff; text-align: center; font-family: system-ui, sans-serif; }
.starts__karte h1 { margin: 0 0 8px; font-size: clamp(26px, 7vw, 38px); color: #ff8ccf; }
.starts__karte p { margin: 0 0 12px; color: rgba(243,234,255,0.75); font-size: 15px; line-height: 1.45; }
.starts__karte ol { text-align: left; margin: 0 0 16px; padding-left: 22px; font-size: 14px; line-height: 1.55; }
#poga-starts { min-height: 52px; width: 100%; border: 0; border-radius: 14px; background: #ff4fa3; color: #fff; font-size: 19px; font-weight: 800; cursor: pointer; }
#poga-starts:hover { background: #ff6ab3; }
