@font-face {
  font-family: "Lemon";
  src: url("/fonts/Lemon-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bungee";
  src: url("/fonts/Bungee-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0e1218;
  --bg-elev: #161c26;
  --bg-soft: #1c2430;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.68);
  --accent: #3ecf8e;
  --accent-2: #ff6b9d;
  --warn: #f0c14b;
  --font-display: "Lemon", "Trebuchet MS", sans-serif;
  --font-word: "Bungee", "Trebuchet MS", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body.portal {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(62, 207, 142, 0.12), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(255, 107, 157, 0.1), transparent 50%),
    linear-gradient(180deg, #121821 0%, var(--bg) 28%, #0b0e13 100%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-top {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 18, 24, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.portal-top__inner {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 64px;
  padding: calc(0.35rem + env(safe-area-inset-top, 0px)) 0 0.35rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.25rem;
}

.portal-brand img {
  width: clamp(60px, 9vw, 80px);
  height: auto;
}

.portal-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.portal-cats a,
.portal-side__nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease;
}

.portal-cats a:hover,
.portal-side__nav a:hover,
.portal-cats a.is-active,
.portal-side__nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.portal-search input {
  width: min(240px, 36vw);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  padding: 0.55rem 0.95rem;
  font: inherit;
  outline: none;
}

.portal-search input::placeholder {
  color: rgba(244, 241, 234, 0.45);
}

.portal-search input:focus {
  border-color: rgba(62, 207, 142, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.15);
}

.portal-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem 0 2.5rem;
}

.portal-side {
  position: sticky;
  top: 84px;
  align-self: start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 28, 38, 0.72);
}

.portal-side__label {
  margin: 0 0 0.55rem;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.45);
}

.portal-side__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.portal-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.portal-section-head {
  margin-bottom: 0.9rem;
}

.portal-section-head h1,
.portal-section-head h2,
.portal-about h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: 0.02em;
}

.portal-section-head p,
.portal-about p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.5;
}

.feature-banner {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: min(52vh, 420px);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  isolation: isolate;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  color: #472438;
}

.feature-banner__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.feature-banner__sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #51b0f2 0%, #87cbf3 45%, #c6e4f4 100%);
  pointer-events: none;
}

.feature-banner__clouds,
.feature-banner__birds,
.feature-banner__floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.feature-banner__clouds .cloud {
  position: absolute;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 0.58);
  animation: drift-y var(--speed) linear infinite;
  animation-delay: calc(var(--phase) * -1s);
  opacity: var(--alpha);
  filter: drop-shadow(0 8px 14px rgba(255, 255, 255, 0.25));
}

.feature-banner__clouds .cloud svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.feature-banner__clouds .cloud ellipse {
  fill: rgba(255, 255, 255, 0.95);
}

.feature-banner__birds .bird--live {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  transition: opacity 0.2s linear;
  pointer-events: none;
}

.feature-banner__birds .bird--live svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.feature-banner__float {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(40px, 7.5vw, 72px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(40, 20, 50, 0.18));
  animation: float-treat var(--speed, 5.5s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0.95;
}

.feature-banner__content {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 2.5rem));
  text-align: center;
  padding: 1.25rem 1rem;
  pointer-events: none;
}

.feature-banner__content a,
.feature-banner__content button {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

.feature-banner__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(71, 36, 56, 0.62);
}

.feature-banner__logo-heading {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.feature-banner__icon {
  width: clamp(88px, 16vw, 132px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 28px;
  box-shadow: 0 18px 30px rgba(40, 20, 50, 0.22);
}

.feature-banner__wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: 0.04em;
  line-height: 1.05;
  background: linear-gradient(90deg, #eb4770, #f2598c, #ffb8d1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.feature-banner__lede {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.45;
  font-weight: 600;
  color: rgba(71, 36, 56, 0.78);
}

.feature-banner .app-store-soon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.feature-banner__cta {
  position: relative;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(180deg, #ff6aa3 0%, #ff5294 42%, #f26bb8 100%);
  border: 2.4px solid #c73a72;
  box-shadow:
    0 14px 28px rgba(242, 89, 140, 0.35),
    inset 0 -7px 0 rgba(120, 20, 60, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s ease;
}

.feature-banner__cta:hover {
  transform: translateY(-2px);
}

.feature-banner__cta::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 46%;
  height: 58%;
  border-radius: 0 999px 0 70%;
  background: radial-gradient(
    ellipse 90% 80% at 88% 18%,
    rgba(255, 252, 245, 0.98) 0%,
    rgba(255, 250, 240, 0.72) 28%,
    rgba(255, 255, 255, 0.18) 52%,
    transparent 72%
  );
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 1;
}

.feature-banner__cta::after {
  content: "";
  position: absolute;
  top: 16%;
  right: 11%;
  width: 0.85rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.95);
  transform: rotate(-32deg);
  box-shadow: 0 0 6px 1px rgba(255, 252, 245, 0.7);
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 2;
}

@keyframes drift-y {
  from {
    transform: translateY(110%);
  }
  to {
    transform: translateY(-30%);
  }
}

@keyframes float-treat {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateY(-16px) rotate(7deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-banner__clouds .cloud,
  .feature-banner__float {
    animation: none !important;
  }
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.game-grid--row {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

a.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(62, 207, 142, 0.4);
}

.game-card.is-dimmed {
  opacity: 0.28;
  filter: grayscale(0.35);
  pointer-events: none;
}

.game-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0a0d12;
  overflow: hidden;
}

.game-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card__thumb--banner {
  background: #0a0d12;
}

.game-card__banner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.game-card__banner-glow {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

.game-card__banner-glow--2 {
  width: 48%;
  filter: blur(28px);
  opacity: 0.55;
  transform: translate(28%, -18%);
}

.game-card__banner-title {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 0.75rem;
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.game-card__thumb--spellcheck {
  background:
    radial-gradient(120% 90% at 20% 15%, rgba(124, 92, 255, 0.35), transparent 55%),
    radial-gradient(100% 80% at 85% 80%, rgba(56, 189, 248, 0.22), transparent 50%),
    linear-gradient(160deg, #1a1230 0%, #0d1018 55%, #12182a 100%);
}

.game-card__thumb--spellcheck .game-card__banner-glow {
  background: #7c5cff;
  transform: translate(-18%, 8%);
}

.game-card__thumb--spellcheck .game-card__banner-glow--2 {
  background: #38bdf8;
}

.game-card__thumb--spellcheck .game-card__banner-title {
  font-family: var(--font-word);
  letter-spacing: 0.12em;
}

.game-card__thumb--orc {
  background:
    radial-gradient(120% 90% at 75% 20%, rgba(62, 207, 142, 0.28), transparent 55%),
    radial-gradient(100% 80% at 15% 85%, rgba(180, 83, 9, 0.22), transparent 50%),
    linear-gradient(160deg, #0f1a14 0%, #0b100e 55%, #121a14 100%);
}

.game-card__thumb--orc .game-card__banner-glow {
  background: #3ecf8e;
  transform: translate(12%, 10%);
}

.game-card__thumb--orc .game-card__banner-glow--2 {
  background: #b45309;
  transform: translate(-30%, -22%);
}

.game-card__tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(14, 18, 24, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-card__soon {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(240, 193, 75, 0.92);
  color: #1b1406;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.game-card--soon {
  cursor: default;
}

.game-card--soon .game-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(14, 18, 24, 0.35));
  pointer-events: none;
}

.game-card__meta {
  padding: 0.85rem 0.9rem 1rem;
}

.game-card__meta h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.game-card[data-name="spellcheck"] .game-card__meta h3,
.game-card[data-name="spellcheck"] h3 {
  font-family: var(--font-word);
  letter-spacing: 0.02em;
}

.game-card__meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.portal-empty {
  margin: 1rem 0 0;
  color: var(--muted);
}

.portal-about {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 28, 38, 0.65);
}

.portal-about a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.portal-section.is-hidden,
.portal-hero.is-hidden {
  display: none;
}

@media (max-width: 960px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-side {
    display: none;
  }

  .feature-banner {
    aspect-ratio: 16 / 9;
    min-height: 280px;
  }
}

@media (max-width: 720px) {
  .portal-top__inner {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .portal-cats {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }

  .portal-search input {
    width: 100%;
  }

  .game-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: 1fr;
  }
}
