/* Kristapsmadeapp start page – styles (no framework). Each game card uses its own --accent colour. */
:root {
  --bg: #0f1117;
  --bg-2: #161a24;
  --panel: #1a1f2b;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f1f3f8;
  --muted: #a9b0c2;
  --brand: #f2a541;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --display: "Oswald", "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  color: var(--text); background: var(--bg);
}
body.has-cookie { padding-bottom: 88px; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 17, 23, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand__home { width: 22px; height: 22px; fill: currentColor; }
.socials { display: flex; gap: 6px; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}
.socials a:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.socials img, .socials svg { width: 20px; height: 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 1rem var(--sans); color: #1b1407; text-decoration: none; white-space: nowrap;
  background: var(--brand); border: 0; border-radius: 999px; padding: 12px 24px; cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn--ghost { color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.25); }
.btn--accent { color: #10131a; background: var(--accent); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 120px 0 128px; isolation: isolate; }
.hero__mosaic {
  position: absolute; inset: -40px; z-index: -1;
  display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 1fr; gap: 14px;
  transform: rotate(-6deg) scale(1.15);
  opacity: 0.6; filter: saturate(0.95);
}
.hero__mosaic img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.hero__mosaic img:nth-child(1) { grid-column: 1 / 3; }
.hero__mosaic img:nth-child(2) { grid-column: 3 / 5; }
.hero__mosaic img:nth-child(3) { grid-column: 5 / 7; }
.hero__mosaic img:nth-child(4) { grid-column: 1 / 4; }
.hero__mosaic img:nth-child(5) { grid-column: 4 / 7; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at center, rgba(15, 17, 23, 0.82) 0%, rgba(15, 17, 23, 0.55) 70%, rgba(15, 17, 23, 0.35) 100%),
    linear-gradient(180deg, rgba(15, 17, 23, 0.15) 60%, var(--bg));
}
.hero__inner { text-align: center; }
.hero__title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(3.4rem, 11vw, 7rem); line-height: 1; letter-spacing: 0.02em;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
.hero__lead { margin: 18px auto 0; max-width: 32ch; font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: #d6dae5; }
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Sections */
.section { padding: 80px 0; }
.section__title {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.1;
}

/* Game cards */
.games { margin-top: 36px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.game {
  --accent: var(--brand);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); border-top: 4px solid var(--accent);
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}
.game:hover { transform: translateY(-4px); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.game__media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.game__media > img:first-child { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.game:hover .game__media > img:first-child { transform: scale(1.04); }
.game__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55));
}
.game__icon {
  position: absolute; left: 18px; bottom: 16px; z-index: 1;
  width: 72px; height: 72px; border-radius: 18px; object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.game__icon--pixel { image-rendering: pixelated; }
.game__body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 26px; }
.game__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.game__tags span {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.game__title { font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.15; }
.game__title a { text-decoration: none; }
.game__title a:hover { color: var(--accent); }
.game__text { color: var(--muted); }
.game__actions { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.store {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s, border-color 0.2s;
}
.store:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.store img, .store svg { width: 20px; height: 20px; }

/* Featured card (Stone Guardian): image and text side by side */
.game--featured { grid-column: 1 / -1; flex-direction: row; }
.game--featured .game__media { flex: 1.35; aspect-ratio: auto; min-height: 340px; }
.game--featured .game__media::after { background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.45)); }
.game--featured .game__body { flex: 1; justify-content: center; padding: 36px 40px; }
.game--featured .game__title { font-size: 2.2rem; }
.game__logo {
  position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%;
  width: min(68%, 420px); height: auto;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.8));
}

/* Footer */
.footer { padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; background: var(--bg-2); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer__links { display: flex; gap: 22px; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--text); text-decoration: underline; }

/* Cookie notice */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 640px; margin-inline: auto;
  display: flex; align-items: center; gap: 18px; padding: 14px 16px 14px 22px; border-radius: 16px;
  background: rgba(26, 31, 43, 0.97); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: var(--shadow);
  font-size: 0.95rem;
}
.cookie[hidden] { display: none; }
.cookie p { flex: 1; color: var(--muted); }
.cookie .btn { padding: 9px 24px; }

/* Back to top */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.25); color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }
body.has-cookie .to-top { bottom: 100px; }

/* Responsive */
@media (max-width: 900px) {
  .games { grid-template-columns: 1fr; }
  .game--featured { flex-direction: column; }
  .game--featured .game__media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .game--featured .game__body { padding: 22px 24px 26px; }
  .game--featured .game__title { font-size: 1.75rem; }
}
@media (max-width: 640px) {
  .hero { padding: 80px 0 88px; }
  .hero__mosaic { grid-template-columns: repeat(2, 1fr); inset: -20px -80px; }
  .hero__mosaic img:nth-child(n) { grid-column: auto; }
  .hero__mosaic img:nth-child(5) { grid-column: 1 / -1; }
  .hero__actions { flex-direction: column; align-items: center; }
  .hero__actions .btn { width: min(100%, 320px); }
  .btn--ghost { font-size: 0.92rem; }
  .section { padding: 60px 0; }
  .game__icon { width: 60px; height: 60px; border-radius: 15px; }
  .game__body { padding: 20px 18px 22px; }
  .cookie { flex-direction: column; align-items: stretch; text-align: center; }
}
