/* Delta - JGames.pl
 * Motyw: automat arkadowy - jeden swiat wizualny, celowo bez trybu jasnego.
 * Wszystkie kolory sa malowane jawnie, wiec strona trzyma sie na dowolnym tle hosta.
 */

:root {
  --ground: #06080e;
  --panel: #111725;
  --panel-2: #0a0e18;
  --rule: #1e2739;
  --rule-hi: #35425e;

  --amber: #ffd84d;
  --cool: #7fa8f0;
  --text: #c9d4e4;
  --muted: #78849a;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  background-image: radial-gradient(115% 70% at 50% -5%, #16203a 0%, #0a0e18 55%, var(--ground) 100%);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overscroll-behavior: none;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---------- marquee ---------- */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.top h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(19px, 5vw, 26px);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 216, 77, .3);
}

.top .back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px 8px 0;
  order: -1;
  white-space: nowrap;
}

.top .back:hover { color: var(--amber); }

.tools { display: flex; gap: 8px; }

.tools button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 8px 12px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}

.tools button:hover { background: #1a2233; border-color: var(--rule-hi); }
.tools button:active { transform: translateY(1px); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- strona glowna: galeria gier ---------- */
/* portal dostaje wiecej miejsca niz strona pojedynczej gry - zeby kafelki
   ukladaly sie w pelne rzedy, a nie zostawialy sierot na koncu */
.home #app {
  justify-content: flex-start;
  max-width: 980px;
}

.marquee {
  text-align: center;
  padding: 26px 0 6px;
}

.marquee h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(30px, 9vw, 52px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 26px rgba(255, 216, 77, .34);
}

.marquee h1 span { color: var(--cool); text-shadow: 0 0 22px rgba(127, 168, 240, .3); }

.tagline {
  margin: 12px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 14.5px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
  margin: 30px 0 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

a.tile:hover,
a.tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--amber);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

.tile-art {
  position: relative;
  display: block;
  background: var(--panel-2);
  border-bottom: 1px solid var(--rule);
}

.tile-art svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

/* ta sama kratka skanlinii co na ekranie gry */
.tile-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, .13) 0 1px,
      rgba(0, 0, 0, 0) 1px 4px);
}

.tile-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 15px 15px;
  flex: 1 1 auto;
}

.tile-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text);
}

.tile-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1 1 auto;
}

.tile-play {
  margin-top: 8px;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #06080e;
  background: var(--amber);
  padding: 7px 12px;
  border-radius: 4px;
}

a.tile:hover .tile-play { background: #ffe685; }

.tile-soon {
  border-style: dashed;
  opacity: .62;
}

.tile-soon .tile-name { color: var(--muted); }

/* ---------- kabina z ekranem ---------- */
#stage {
  position: relative;
  flex: 0 0 auto;
  min-height: 240px;
  height: min(74dvh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
}

body.touch #stage { height: min(58dvh, 560px); }

/* delikatna kratka skanlinii - jedyny ozdobnik, nad plansza */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, .16) 0 1px,
      rgba(0, 0, 0, 0) 1px 3px);
  mix-blend-mode: multiply;
}

#screen {
  display: block;
  image-rendering: pixelated;
  background: #000;
  box-shadow: 0 0 0 2px #0d1220, 0 10px 44px rgba(0, 0, 0, .85);
  touch-action: none;
}

/* ---------- sterowanie dotykowe ---------- */
#touch { display: none; }

body.touch #touch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 4px;
  touch-action: none;
}

.pad { display: flex; gap: 10px; align-items: center; }
.pad-right { gap: 12px; }
.thr { display: flex; flex-direction: column; gap: 8px; }

.key {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(180, 210, 255, .32);
  background: rgba(20, 30, 50, .55);
  color: #dce6f5;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.key.small { width: 44px; height: 44px; font-size: 15px; }

.key.fire {
  width: 74px;
  height: 74px;
  font-size: 12px;
  letter-spacing: .1em;
  border-color: rgba(255, 130, 110, .5);
  background: rgba(90, 25, 20, .58);
  color: #ffd6cf;
}

.key.on { background: rgba(120, 170, 255, .5); }
.key.fire.on { background: rgba(220, 70, 50, .7); }

/* ---------- opis ---------- */
.info {
  margin-top: 26px;
  display: grid;
  gap: 24px 36px;
  grid-template-columns: 1fr;
  font-size: 14.5px;
  align-items: start;
}

.block { display: flex; flex-direction: column; gap: 8px; max-width: 62ch; }

.info h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cool);
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.info ul { margin: 0; padding-left: 18px; color: var(--muted); }
.info li { margin: 2px 0; }
.info p { margin: 0; color: var(--muted); }
.info b { color: var(--text); font-weight: 600; }

.pts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.pts span { color: var(--muted); text-transform: uppercase; }
.pts b { color: var(--amber); font-weight: 700; }

footer {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
}

footer p { margin: 0; color: #626d80; max-width: 62ch; }
footer b { color: var(--muted); font-weight: 600; }

/* ---------- szerokie ekrany: opis w dwoch kolumnach ---------- */
@media (min-width: 640px) {
  .info { grid-template-columns: 1fr 1fr; }
  .info .span-all { grid-column: 1 / -1; }
}

/* ---------- maly ekran ---------- */
@media (max-width: 560px) {
  #app { padding: 10px 10px 28px; }
  #stage { height: min(80dvh, 640px); border-radius: 8px; }
  .info { font-size: 14px; }

  /* dwie kolumny zamiast jednej - inaczej pojedynczy kafelek zajmuje caly ekran */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
  .marquee { padding: 14px 0 2px; }
  .tile-meta { padding: 11px 12px 12px; gap: 4px; }
  .tile-name { font-size: 13px; }
  .tile-desc { font-size: 12px; }
  .tile-play { font-size: 10px; padding: 6px 10px; margin-top: 5px; }
}

/* ---------- pelny ekran ---------- */
#app:fullscreen {
  max-width: none;
  padding: 0;
  background: var(--ground);
}

#app:fullscreen .top,
#app:fullscreen .info,
#app:fullscreen footer { display: none; }

#app:fullscreen #stage,
body.touch #app:fullscreen #stage {
  flex: 1 1 auto;
  height: auto;
  border: 0;
  border-radius: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
