:root {
  --ink: #0f1e33;
  --ink-soft: #52627a;
  --brand: #1182c9;
  --brand-dark: #0b6fae;
  --brand-soft: #e3f1fc;
  --card: #ffffff;
  --night: #0b1d3a;
  --radius: 26px;
  --shadow: 0 18px 40px -18px rgba(16, 92, 160, 0.35), 0 2px 6px rgba(16, 92, 160, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: #eff6fd;
  overflow-x: hidden;
}

a { color: inherit; }

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #eef6fd;
}

.sky::before,
.sky::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(2px);
  box-shadow: 60px -24px 0 10px rgba(255, 255, 255, 0.85), 130px 4px 0 -6px rgba(255, 255, 255, 0.85);
}

.sky::before { width: 120px; height: 46px; top: 13%; left: 8%; }
.sky::after { width: 100px; height: 40px; top: 22%; right: 16%; }

/* Hero */

.hero {
  text-align: center;
  padding: 64px 24px 12px;
  max-width: 1000px;
  margin: 0 auto;
}

.hero h1 {
  position: relative;
  margin: 0;
  font-size: clamp(2.2rem, 5.4vw, 3.7rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.accent { color: var(--brand); }

.spark {
  position: absolute;
  top: 0.1em;
  width: 34px;
  height: 34px;
}

.spark::before,
.spark::after {
  content: "";
  position: absolute;
  width: 8px;
  border-radius: 8px;
  background: var(--brand);
}

.spark::before { height: 26px; left: 13px; top: 0; }
.spark::after { height: 16px; left: 0; top: 18px; transform: rotate(-60deg); }
.spark-l { left: -48px; transform: rotate(-25deg); }
.spark-r { right: -48px; transform: scaleX(-1) rotate(-25deg); }

.lead {
  max-width: 620px;
  margin: 16px auto 0;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Cards */

.games {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 80px;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}

.card {
  flex: 0 1 350px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:focus-visible { outline: 3px solid #9fd0f5; outline-offset: 3px; }

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 50px -20px rgba(16, 92, 160, 0.45), 0 2px 6px rgba(16, 92, 160, 0.08);
}

.cover {
  aspect-ratio: 16 / 10;
  margin: 8px 8px 0;
  border-radius: calc(var(--radius) - 8px);
  overflow: hidden;
  background: var(--brand-soft);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-soon {
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--brand);
  color: #fff;
}

.cover-soon span { font-size: 3.4rem; line-height: 1; }
.cover-soon p { margin: 10px 0 0; font-weight: 700; opacity: 0.9; }

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 24px 24px;
  text-align: center;
}

.card h3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.card-icon { font-size: 1.4rem; }

.card-body > p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.5;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #0b67a8;
  font-size: 0.8rem;
  font-weight: 700;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.actions > *,
.actions-row > * { min-width: 0; }

.actions-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.actions-row > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Game page (tools/game-pages.mjs) */

.game-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
  padding: 44px;
  background: var(--night);
  border-radius: 32px;
  box-shadow: 0 30px 60px -30px rgba(11, 29, 58, 0.7);
  color: #fff;
}

.game-hero .cover {
  margin: 0;
  border-radius: 22px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.7);
}

.game-info h1 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.game-desc {
  margin: 18px 0 0;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
  font-weight: 500;
  color: #d6e6f8;
}

.game-info .tags { justify-content: flex-start; margin-top: 20px; }
.game-info .tags li { background: rgba(255, 255, 255, 0.1); color: #bfe0fb; }

.game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
}

.game-actions .btn-outline { grid-column: 1 / -1; }

.btn-big { min-height: 58px; font-size: 1.1rem; }
.btn-big svg { width: 22px; height: 22px; }

.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: var(--brand-soft); transform: translateY(-2px); }

.btn-outline {
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.95rem;
}

.btn-outline:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

.shots-block { margin-top: 44px; }

.shots-block h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 700;
}

.shots {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.shots > a { grid-column: span var(--shot-span, 3); }

.shots a {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shots a:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -18px rgba(16, 92, 160, 0.5); }
.shots a:focus-visible { outline: 3px solid #9fd0f5; outline-offset: 3px; }

.shots img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.shots > .is-video { position: relative; grid-column: span 6; }

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.play-badge svg { width: 30px; height: 30px; margin-left: 4px; }
.shots .is-video:hover .play-badge { transform: translate(-50%, -50%) scale(1.08); }

.video-title {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(11, 29, 58, 0.85);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Screenshot viewer (gallery.js) */

.viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.viewer::backdrop { background: rgba(4, 10, 24, 0.96); }

.viewer[open] { display: grid; place-items: center; }

.viewer img {
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.viewer iframe {
  width: min(92vw, 1200px, calc(84vh * 16 / 9));
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.viewer [hidden] { display: none; }

.viewer-btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.viewer-btn:hover { background: rgba(255, 255, 255, 0.26); }
.viewer-btn:focus-visible { outline: 3px solid #9fd0f5; outline-offset: 2px; }
.viewer-close { top: 18px; right: 18px; }
.viewer-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 18px; top: 50%; transform: translateY(-50%); }

.viewer-count {
  position: fixed;
  bottom: 18px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: #cfe2f7;
  font-weight: 600;
}

/* Buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn svg { width: 20px; height: 20px; flex: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(17, 130, 201, 0.8);
}

.btn-primary:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(17, 130, 201, 0.9); }

.btn-ghost {
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.92rem;
  padding: 10px 12px;
}

.btn-ghost:hover { background: #d2e7f9; }

.btn:focus-visible { outline: 3px solid #9fd0f5; outline-offset: 2px; }

.is-soon {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.55;
  box-shadow: none;
}

.is-soon:hover { transform: none; }

.is-soon em {
  font-style: normal;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.btn-ghost.is-soon em { display: none; }

/* Footer */

.footer {
  margin-top: auto;
  position: relative;
  padding-top: 108px;
  color: #cfe2f7;
}

.wave {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 120px;
}

.wave-back { fill: #1d548f; opacity: 0.55; }
.wave-front { fill: var(--night); }

.footer-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px max(24px, calc((100% - 1180px) / 2)) 40px;
  background: var(--night);
}

.footer-inner > * { padding: 6px 48px; }

.footer-inner > * + * { border-left: 1px solid rgba(255, 255, 255, 0.16); }

.footer-inner p { margin: 0; }

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.footer-brand img { border-radius: 18px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6); }

.brand-name { font-size: 2rem; font-weight: 700; letter-spacing: 0.12em; color: #e8c172; line-height: 1.1; }
.brand-name b { color: #6fb6ff; font-weight: 700; }

.brand-tag {
  margin-top: 6px !important;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #bcd3ee;
}

.brand-tag b { color: #e8c172; font-weight: 600; }

.footer-contact { display: flex; align-items: center; gap: 16px; }
.footer-contact svg { width: 34px; height: 34px; flex: none; color: #bcd3ee; }
.footer-contact p { font-weight: 500; color: #bcd3ee; }
.footer-contact a { font-weight: 700; font-size: 1.2rem; color: #fff; text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }

/* Consent banner (analytics.js) */

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}

.consent p { margin: 0; color: var(--ink-soft); font-weight: 500; }
.consent div { display: flex; gap: 8px; flex: none; }

.consent button {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.consent button.primary { background: var(--brand); color: #fff; }

@media (max-width: 760px) {
  .consent { flex-direction: column; align-items: stretch; text-align: center; }
  .consent div { justify-content: center; }
  .spark { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner > * { padding: 18px 0; justify-content: center; }
  .footer-inner > * + * { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .brand-name { font-size: 1.7rem; }
  .footer-brand { gap: 14px; }
  .footer-brand img { width: 60px; height: 60px; }
  .game-hero { grid-template-columns: 1fr; gap: 24px; padding: 14px 14px 26px; border-radius: 26px; }
  .game-hero .cover { order: -1; border-radius: 16px; }
  .game-info { padding: 0 8px; text-align: center; }
  .game-info h1 { justify-content: center; }
  .game-info .tags { justify-content: center; }
  .game-actions { grid-template-columns: 1fr; }
  .shots { gap: 10px; }
  .shots > a { grid-column: span 6; }
  .shots > .is-video { grid-column: span 12; }
  .play-badge { width: 54px; height: 54px; }
  .play-badge svg { width: 24px; height: 24px; }
  .viewer-prev, .viewer-next { top: auto; bottom: 10px; transform: none; }
  .viewer-count { bottom: 26px; }
}

@media (max-width: 400px) {
  .hero, .games, .game-page { padding-left: 16px; padding-right: 16px; }
  .actions-row { grid-template-columns: 1fr; }
}

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