/* Fulsar portal styles. Fonts: Fredoka (headings) and Nunito (text), SIL OFL 1.1
   (see /fonts/OFL-*.txt). */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fbf4e8;
  --bg-glow-1: rgba(255, 201, 74, 0.28);
  --bg-glow-2: rgba(255, 111, 97, 0.16);
  --surface: #fffdf8;
  --ink: #2f2538;
  --ink-soft: #6b5d72;
  --line: rgba(47, 37, 56, 0.12);
  --accent: #e2583c;
  --accent-ink: #ffffff;
  --gold: #ffb627;
  --chip: #f4eadb;
  --chip-ink: #5a4b60;
  --shadow: 0 1px 0 rgba(47, 37, 56, 0.06), 0 12px 32px -12px rgba(47, 37, 56, 0.28);
  --shadow-hover: 0 1px 0 rgba(47, 37, 56, 0.06), 0 22px 44px -14px rgba(47, 37, 56, 0.38);
  --radius: 22px;
  --heading: "Fredoka", "Nunito", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #16142c;
    --bg-glow-1: rgba(255, 182, 39, 0.14);
    --bg-glow-2: rgba(120, 104, 255, 0.18);
    --surface: #221f3d;
    --ink: #f6efe6;
    --ink-soft: #b9b0cc;
    --line: rgba(246, 239, 230, 0.12);
    --accent: #ff7a5c;
    --accent-ink: #1b1530;
    --chip: #2e2a50;
    --chip-ink: #d9d1ea;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 14px 34px -14px rgba(0, 0, 0, 0.7);
    --shadow-hover: 0 1px 0 rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.85);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 30rem at 12% -8%, var(--bg-glow-1), transparent 70%),
    radial-gradient(50rem 28rem at 100% 0%, var(--bg-glow-2), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ---- Header ------------------------------------------------------------ */
.top {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
}

.brand-mark circle:first-child,
.lost-mark circle:first-child {
  transform-origin: 32px 32px;
  animation: pulse 3.2s ease-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.9; transform: scale(0.72); }
  70%, 100% { opacity: 0; transform: scale(1.08); }
}

.brand-name {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--chip);
}

/* ---- Main -------------------------------------------------------------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero {
  padding: 56px 0 36px;
  max-width: 720px;
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--heading);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

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

.lead {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.45rem;
}

.count {
  min-width: 1.9em;
  padding: 0 0.55em;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-ink);
  font-family: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.9;
  text-align: center;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 26px;
}

/* ---- Game cards -------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card:has(.card-link:hover),
.card:has(.card-link:focus-visible) {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  border-radius: var(--radius);
}

.card-link:focus-visible {
  outline-offset: -3px;
}

.card-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--chip);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 18px 20px 20px;
}

.card-title {
  margin: 0;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
}

.card-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  text-wrap: pretty;
}

.chips {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips li {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.play,
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

.card-body .play {
  margin-top: 8px;
}

.play svg {
  width: 14px;
  height: 14px;
}

.card-soon {
  background: transparent;
  box-shadow: none;
  border: 2px dashed var(--line);
}

.soon-art {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 50%, var(--bg-glow-1), transparent 65%);
}

.soon-art svg {
  width: 30%;
  opacity: 0.85;
}

/* ---- Text pages -------------------------------------------------------- */
.prose {
  max-width: 760px;
  padding-top: 40px;
  padding-bottom: 24px;
}

.prose h1 {
  font-family: var(--heading);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 18px;
}

.prose h2 {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 32px 0 8px;
}

.prose li + li {
  margin-top: 8px;
}

.lost {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 60px;
  padding-bottom: 60px;
}

.lost-mark {
  width: 120px;
  height: 120px;
}

.lost h1 {
  font-family: var(--heading);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 18px 0 6px;
}

.lost .button {
  align-self: center;
}

/* ---- Footer ------------------------------------------------------------ */
.foot {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.foot p {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
  .top { padding: 16px 16px 0; }
  main { padding: 0 16px; }
  .foot { padding: 40px 16px 24px; }
  .hero { padding: 36px 0 28px; }
  .nav a { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .brand-mark circle:first-child,
  .lost-mark circle:first-child { animation: none; }
}
