:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #191b20;
  --panel-2: #20242b;
  --text: #f4f2ea;
  --muted: #b8bec9;
  --line: rgba(255, 255, 255, 0.12);
  --amber: #f7b84b;
  --teal: #2bd1c4;
  --red: #f05d5e;
  --green: #73d676;
  --violet: #a98bff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  font: inherit;
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.84);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.genre-filter,
.toolbar {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--amber), var(--red));
  color: #15110a;
  box-shadow: 0 8px 20px rgba(247, 184, 75, 0.22);
}

.nav {
  gap: 4px;
}

.nav a,
.genre-filter button,
.ghost-button,
.primary-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.nav a {
  padding: 9px 12px;
  color: var(--muted);
}

.nav a:hover,
.genre-filter button:hover,
.ghost-button:hover,
.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 17, 20, 0.94) 0%, rgba(16, 17, 20, 0.6) 42%, rgba(16, 17, 20, 0.16) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(16, 17, 20, 0.2) 28%, transparent 52%),
    url("./assets/hero-game-portal.png") center / cover;
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 92px) 0 120px;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  width: min(680px, 100%);
  margin: 14px 0 16px;
  font-size: clamp(2.55rem, 7vw, 6.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  width: min(560px, 100%);
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.65;
}

.hero-actions,
.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
}

.primary-button {
  background: var(--amber);
  color: #1c1304;
  font-weight: 800;
}

.ghost-button,
.icon-button,
.genre-filter button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.preview-strip {
  position: absolute;
  right: max(16px, calc((100vw - 1440px) / 2));
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 126px));
  gap: 10px;
  width: min(552px, calc(100% - 32px));
}

.mini-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 27, 32, 0.76);
  backdrop-filter: blur(16px);
  text-align: center;
}

.mini-tile strong {
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
}

.section {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: 0;
}

.section-header p {
  max-width: 860px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

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

.genre-card,
.game-card,
.info-card,
.info-panel {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  cursor: pointer;
  text-align: left;
}

.genre-card {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.info-card,
.info-panel {
  cursor: default;
}

.genre-card::after,
.game-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -42px;
  width: 130px;
  height: 130px;
  border-radius: 28px;
  background: var(--accent);
  opacity: 0.28;
  transform: rotate(18deg);
}

.genre-card h3,
.game-card h3,
.info-card h3 {
  position: relative;
  z-index: 1;
  margin: 12px 0 8px;
  font-size: 1.18rem;
}

.genre-card p,
.game-card p,
.info-card p,
.info-panel p,
.meta {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tile-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.35rem;
}

.toolbar {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.genre-filter {
  flex-wrap: wrap;
  gap: 8px;
}

.genre-filter button {
  padding: 9px 12px;
}

.genre-filter button.active {
  border-color: rgba(43, 209, 196, 0.58);
  background: rgba(43, 209, 196, 0.14);
  color: #b9fff8;
}

.game-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  min-height: 238px;
}

.game-top {
  position: relative;
  z-index: 1;
}

.game-actions {
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: space-between;
}

.compact-section {
  padding-top: 12px;
}

.info-panel {
  min-height: 0;
}

.info-panel h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.info-panel p + p {
  margin-top: 10px;
}

.info-page {
  min-height: calc(100svh - 68px);
}

.game-guide {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.game-guide h3 {
  margin: 0 0 8px;
}

.game-guide p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.game-guide p + p {
  margin-top: 8px;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-footer-brand span {
  color: var(--text);
  font-weight: 800;
  font-size: 0.95rem;
}

.site-footer-brand p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.site-footer nav a {
  color: var(--muted);
  padding: 4px 14px;
  transition: color 150ms ease;
}

.site-footer nav a:hover {
  color: var(--text);
}

.site-footer nav a + a {
  border-left: 1px solid var(--line);
}

.player-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100svh - 68px);
}

.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.player-top h2 {
  margin: 0;
}

.iframe-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0c0f;
  box-shadow: var(--shadow);
}

.iframe-frame iframe {
  display: block;
  width: 100%;
  height: min(82svh, 760px);
  min-height: min(620px, calc(100svh - 150px));
  border: 0;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

/* ── Landing page home ── */
.app-home {
  position: relative;
  min-height: calc(100svh - 68px);
  overflow: hidden;
}

/* Animated background blobs */
.lp-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.lp-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.lp-b1 {
  width: 560px;
  height: 460px;
  top: -80px;
  left: -100px;
  background: radial-gradient(circle, rgba(247, 184, 75, 0.22) 0%, transparent 68%);
  animation: lp-drift 15s ease-in-out infinite;
}

.lp-b2 {
  width: 500px;
  height: 520px;
  bottom: 60px;
  right: -80px;
  background: radial-gradient(circle, rgba(43, 209, 196, 0.18) 0%, transparent 68%);
  animation: lp-drift 20s ease-in-out infinite reverse;
}

.lp-b3 {
  width: 400px;
  height: 380px;
  top: 35%;
  right: 18%;
  background: radial-gradient(circle, rgba(169, 139, 255, 0.13) 0%, transparent 68%);
  animation: lp-drift 25s ease-in-out infinite 5s;
}

.lp-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 15%, rgba(0,0,0,0.6) 85%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 15%, rgba(0,0,0,0.6) 85%, transparent 100%);
}

@keyframes lp-drift {
  0%, 100% { transform: translate(0px, 0px) scale(1); }
  25%  { transform: translate(24px, -28px) scale(1.04); }
  50%  { transform: translate(-18px, 22px) scale(0.96); }
  75%  { transform: translate(28px, 12px) scale(1.03); }
}

/* Hero */
.lp-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(60px, 11vw, 108px) 16px clamp(44px, 6vw, 72px);
  max-width: 1000px;
  margin: 0 auto;
}

.lp-kicker {
  display: inline-block;
  margin-bottom: 22px;
  padding: 6px 16px;
  border: 1px solid rgba(247, 184, 75, 0.32);
  border-radius: 999px;
  background: rgba(247, 184, 75, 0.08);
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lp-wordmark {
  margin: 0 0 22px;
  font-size: clamp(3.2rem, 10vw, 7.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  padding-bottom: 0.25em;
  background: linear-gradient(135deg, #f4f2ea 15%, #f7b84b 52%, #2bd1c4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lp-tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.14rem);
  line-height: 1.7;
}

/* Game shelf */
.lp-shelf {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 56px;
}

.lp-shelf--browse {
  padding-top: 40px;
}

.lp-genre-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.lp-genre-tab {
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.lp-genre-tab:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
}

.lp-genre-tab.active {
  border-color: var(--tab-accent, var(--teal));
  background: rgba(255, 255, 255, 0.1);
  background: color-mix(in srgb, var(--tab-accent, var(--teal)) 14%, transparent);
  color: var(--text);
}

/* Policy page */
.lp-policy {
  max-width: 760px;
}

.lp-policy h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.lp-policy-meta {
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 0.84rem;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.lp-policy h3 {
  margin: 40px 0 14px;
  font-size: 1.06rem;
  font-weight: 800;
  color: var(--teal);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.lp-policy h4 {
  margin: 20px 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--amber);
}

.lp-policy p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.78;
}

.lp-policy ul {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.78;
}

.lp-policy li {
  margin-bottom: 7px;
}

.lp-policy a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lp-policy strong {
  color: var(--text);
  font-weight: 700;
}

.lp-policy-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 24px;
}

.lp-policy table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.lp-policy th,
.lp-policy td {
  padding: 11px 16px;
  border: 1px solid var(--line);
  text-align: left;
  line-height: 1.55;
}

.lp-policy th {
  background: var(--panel);
  font-weight: 700;
  color: var(--text);
}

.lp-policy td {
  color: var(--muted);
}

.lp-shelf-label {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 28px 8px;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.app-icon canvas {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: block;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.app-icon:hover canvas {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.app-icon:active canvas {
  transform: scale(0.92);
  transition-duration: 60ms;
}

.app-icon span {
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  width: 72px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .preview-strip,
  .grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-header,
  .toolbar,
  .player-top {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 22px 6px;
  }

  .app-icon canvas {
    width: 56px;
    height: 56px;
    border-radius: 13px;
  }

  .lp-hero {
    padding-bottom: 36px;
  }

  .lp-b1 { width: 320px; height: 280px; }
  .lp-b2 { width: 300px; height: 300px; }
  .lp-b3 { display: none; }

  .topbar {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding-inline: 12px;
  }

  .brand span:last-child {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-content {
    padding-bottom: 240px;
  }

  .preview-strip,
  .grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .preview-strip {
    left: 16px;
    right: 16px;
    bottom: 18px;
  }

  .section.player-shell {
    width: 100%;
    min-height: calc(100svh - 59px);
    padding: 12px;
    gap: 10px;
  }

  .player-top {
    gap: 10px;
  }

  .player-top h2 {
    font-size: 1.25rem;
  }

  .iframe-frame iframe {
    height: calc(100svh - 150px);
    min-height: 420px;
  }
}

/* ── Language selector ─────────────────────────────────────────── */
.lang-wrap {
  position: relative;
  z-index: 20;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 13px/1 system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease;
}
.lang-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.lang-btn[aria-expanded="true"] { background: rgba(255,255,255,0.08); color: var(--text); }

#langLabel {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 200px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  scrollbar-width: thin;
}
.lang-dropdown:not([hidden]) { display: block; }

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: start;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font: 14px/1.4 system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-option:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.lang-option.active { color: var(--amber); background: rgba(247,184,75,0.08); font-weight: 600; }

@media (max-width: 460px) {
  .lang-dropdown { right: -10px; width: 180px; }
  #langLabel { display: none; }
  .lang-btn { padding: 0 8px; }
}

/* ────────────────────────────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-actions a {
  color: var(--teal);
  text-decoration: none;
  font-size: 13px;
}

.cookie-actions a:hover {
  text-decoration: underline;
}

#cookie-accept {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: var(--amber);
  color: #1b0c05;
  font: 600 13px/1 inherit;
  cursor: pointer;
}

#cookie-accept:hover {
  opacity: 0.88;
}
