:root {
  color-scheme: light;
  --paper: #f7f6ef;
  --ink: #17271f;
  --muted: #536258;
  --line: #d7dbcf;
  --surface: #fffef9;
  --filter: #eaece3;
  --forest: #14251c;
  --lime: #dcfa70;
  --display: 'Arial Black', 'Segoe UI Black', system-ui, sans-serif;
  --body: 'Segoe UI', system-ui, sans-serif;
}

[data-theme='dark'] {
  color-scheme: dark;
  --paper: #101a15;
  --ink: #f5f5e8;
  --muted: #b1beb3;
  --line: #34483a;
  --surface: #1c2a21;
  --filter: #24362b;
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; }
body.player-open { overflow: hidden; }
.hidden { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #9583ed; outline-offset: 4px; }

.container {
  width: min(1280px, calc(100% - 88px));
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid var(--line); }

.header-inner,
.header-actions,
.brand-lockup {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: 76px;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 11px;
  background: var(--lime);
  color: var(--forest);
  box-shadow: 0 3px 0 #94aa43;
  font: 900 28px/1 var(--display);
  transform: rotate(-8deg);
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.brand-text strong {
  font: 1000 23px/1 Nunito, var(--body);
  letter-spacing: -0.055em;
}

.brand-text span {
  color: var(--forest);
  background: #dac2ff;
  border-radius: 8px;
  padding: 4px 8px;
  transform: rotate(-4deg);
  font: 1000 16px/1 Nunito, var(--body);
  letter-spacing: -.04em;
  box-shadow: 0 2px 0 #a68acd;
}

.header-actions { gap: 24px; }

.header-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover,
.footer-inner a:hover { text-decoration: underline; text-underline-offset: 4px; }

.icon-btn {
  display: grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
}

.icon-btn:hover { background: var(--filter); }

.site-main { padding-block: 30px 64px; }

.spotlight { container-type: inline-size; margin-top: clamp(24px,3vw,41px); }
.app-layout:not([data-view=home]) :is(.hero-banner, .spotlight) { display: none; }
#spot-title {
  display: flex;
  align-items: center;
  gap: .32em;
  margin: 0 0 18px;
  font: 900 clamp(26px, 3.1vw, 46px)/1.08 var(--display);
  letter-spacing: -.06em;
}
#spot-title svg { width: .88em; height: .88em; transform: rotate(-10deg); }
.featured-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(12px,1.6cqw,22px); }
.feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: clamp(184px,23cqw,316px);
  padding: clamp(20px,2.7cqw,42px);
  border: 0;
  border-radius: clamp(18px,2cqw,27px);
  flex-direction: column;
  gap: clamp(5px,.72cqw,11px);
  color: #fffdf4;
  text-align: start;
  font-family: Nunito,var(--body);
  box-shadow: inset 0 1px 0 #ffffff28, 0 4px 10px #0c29320c;
}
.feature--dive {
  --feature-accent: #9af6ff;
  --play-color: #ffdc65;
  --play-edge: #da8d27;
  background: linear-gradient(90deg,#052a50f5 0%,#042f5dcc 37%,#00457a18 82%),url('./surface.webp') center 48% / cover;
}
.feature--drop {
  --feature-accent: #c7f3ad;
  --play-color: var(--lime);
  --play-edge: #8dba39;
  background: radial-gradient(ellipse at 70% 40%,#07522e,#00361f 50%,#09261e);
}
.feature::before,.feature::after { content: ''; position: absolute; z-index: -1; pointer-events: none; }
.feature--dive::after {
  inset: 10% 1% 9% 53%;
  background: url('./scout.webp') center / contain no-repeat;
  filter: drop-shadow(0 8px 7px #00295155);
}
.feature--drop::after {
  inset: 0 -11% 0 38%;
  background: url('./card-art/drop-8.webp') center / contain no-repeat;
  mask-image: radial-gradient(ellipse 49% 63%, #000 70%, transparent);
}
.feature--drop::before {
  inset: 0;
  background: radial-gradient(circle at 51% 23%, #ebffa477 0 2px,transparent 3px),
    radial-gradient(circle at 94% 38%,#f5ffc588 0 3px,transparent 4px),
    radial-gradient(circle at 45% 76%,#bcf28377 0 3px,transparent 4px);
}
.feature-kind { font-size: clamp(11px,1.08cqw,14px); color: var(--feature-accent); font-weight: 1000; text-transform: uppercase; letter-spacing: .115em; }
.feature strong { font: 1000 clamp(32px,4.5cqw,65px)/1 Nunito,var(--display); letter-spacing: -.065em; }
.feature-hook { font-size: clamp(13px,1.35cqw,18px); font-weight: 750; max-width: 54%; line-height: 1.3; }
.feature-play {
  display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  min-height: 46px; margin-top: clamp(9px,1.45cqw,22px); padding: 8px 23px;
  border-radius: 14px; box-shadow: 0 4px var(--play-edge); background: var(--play-color);
  color: #112819; font-size: 16px; font-weight: 1000;
}
.feature:active .feature-play { transform: translateY(3px); box-shadow: 0 1px var(--play-edge); }
@media (hover: hover) {
  .feature:hover .feature-play { filter: brightness(1.1); }
}
@media (prefers-reduced-motion: no-preference) {
  .feature--dive::after { animation: dive-swim 5s ease-in-out infinite; }
  .player-open .feature::after { animation-play-state: paused; }
  @keyframes dive-swim { 50% { transform: translateY(-4%) rotate(-4deg); } }
}
@container (max-width: 930px) {
  #spot-title { font-weight: 1000; font-size: clamp(25px,4.2cqw,34px); margin-block-end: 14px; }
  .feature-hook { display: none; }
  .feature-play { min-height: 44px; margin-top: 10px; font-size: 15px; padding-inline: 18px; }
  .feature { min-height: clamp(150px,22cqw,207px); padding: clamp(14px,2.4cqw,21px); }
}
@container (max-width: 610px) {
  .featured-pair { grid-template-columns: minmax(0,1fr); }
  .feature { min-height: clamp(146px,40cqw,186px); padding: 16px 5cqw 19px; }
  .feature strong { font-size: clamp(28px,9cqw,42px); }
  .feature-kind { font-size: 11px; }
  .feature--drop::after { inset: 0 -9% 0 41%; }
}

.hero-banner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 440px;
  overflow: hidden;
  border-radius: 25px;
  background: var(--forest);
  color: #fbf9ed;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 48px 0 53px clamp(34px, 4.15vw, 64px);
}

.hero-copy h1 {
  margin: 0;
  font: 900 clamp(49px, 5.45vw, 85px)/0.99 var(--display);
  letter-spacing: -0.075em;
}

.hero-copy .think { color: #d6b5ff; }
.hero-copy .grow {
  display: block;
  color: var(--lime);
}
.grow svg {
  width: .65em;
  height: .61em;
  margin-left: .17em;
  vertical-align: .18em;
}

.hero-copy p {
  max-width: 350px;
  margin: 23px 0 30px;
  color: #d3dbcf;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.53;
}

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

.browse-btn,
.featured-btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.browse-btn {
  background: var(--lime);
  color: var(--forest);
}

.browse-btn:hover { background: #ecffa9; }
.browse-btn span { font-size: 19px; line-height: 1; }

.featured-btn {
  border-color: #637168;
  background: transparent;
  color: #fbf9ed;
}

.featured-btn:hover { background: #2b4033; }

.play-icon {
  display: inline-block;
  width: 9px;
  height: 11px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 45%;
  background: linear-gradient(90deg, var(--forest), transparent 17%),
    url('./arcade-tiles.webp') center / cover no-repeat;
}

.games-library { container-type: inline-size; margin-top: 41px; scroll-margin-top: 24px; }

.catalog-header,
.catalog-title-group {
  display: flex;
  align-items: center;
}

.catalog-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-bottom: 16px;
}

.catalog-title-group {
  flex-wrap: wrap;
  gap: 8px 16px;
}

.catalog-title-group h2 {
  margin: 0;
  font: 900 clamp(28px, 3.1vw, 46px)/1.05 var(--display);
  letter-spacing: -0.065em;
}

.game-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-wrap {
  position: relative;
  width: min(100%, 232px);
}

.search-icon {
  position: absolute;
  top: 14px;
  left: 15px;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  top: 9px;
  left: 8px;
  width: 6px;
  height: 1.5px;
  transform: rotate(48deg);
  background: var(--muted);
  content: '';
}

#game-search {
  width: 100%;
  min-height: 42px;
  padding: 8px 13px 8px 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

#game-search::placeholder { color: var(--muted); opacity: 1; }

.filter-pills {
  display: grid;
  grid-template-columns: 1.1fr repeat(7, minmax(0, 1fr)) 1.24fr;
  gap: 8px;
  margin-bottom: 19px;
}

.filter-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  gap: 7px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: 900 15px/1.15 Nunito, var(--body);
  white-space: nowrap;
  transition: background 160ms ease;
}
.filter-pill svg {
  width: 21px;
  height: 21px;
  flex: none;
  stroke: #193127;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
@container (max-width: 1020px) {
  .filter-pill {
    flex-direction: column;
    gap: 5px;
    min-height: 69px;
    padding-inline: 1px;
    font-size: clamp(11px, 1.7cqw, 14px);
  }
}
@container (max-width: 690px) {
  .filter-pills { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .filter-pill {
    flex-direction: row;
    gap: clamp(3px, 1.2cqw, 7px);
    min-height: 44px;
    padding: 6px 2px;
    font-size: clamp(11px, 3.6cqw, 14px);
  }
  .filter-pill svg { width: clamp(16px, 5cqw, 20px); height: auto; }
}

.secondary-btn {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease;
}

.filter-pill:hover,
.secondary-btn:hover { background: var(--filter); }

.filter-pill.active {
  border-color: transparent;
  background: var(--ink);
  color: var(--paper);
}

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

.game-card {
  --card-color: #d1d0fc;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-card[data-game-id='drop-8'] { --card-color: #ffc383; }
.game-card[data-game-id='monster-munch'] { --card-color: #e5bafa; }
.game-card[data-game-id='rocket-stack'] { --card-color: #f9d58b; }
.game-card[data-game-id='dino-hatch'] { --card-color: #cce88e; }
.game-card[data-game-id='magnet-marbles'] { --card-color: #c5b8ff; }
.game-card[data-game-id='toy-seesaw'] { --card-color: #ffd388; }
.game-card[data-game-id='bubble-beats'] { --card-color: #ffc6e5; }
.game-card[data-game-id='rain-garden'] { --card-color: #afe4c4; }
.game-card[data-game-id='cloud-courier'] { --card-color: #ffd89f; }
.game-card[data-game-id='sky-safari'] { --card-color: #62e3f7; }
.game-card[data-game-id='sudoku-master'] { --card-color: #a8ebc3; }
.game-card[data-game-id='number-merge'] { --card-color: #dcfa70; }
.game-card[data-game-id='find-missing-number'] { --card-color: #add9fc; }

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--card-color) 42%, transparent);
}

.card-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.68;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  border-bottom: 4px solid var(--card-color);
  background: var(--forest);
}

.card-thumb-wrap img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px 14px 52px;
}

.card-badge {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.card-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.card-play {
  position: absolute;
  right: 11px;
  bottom: 11px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--card-color);
  color: var(--forest);
}

.card-play .play-icon { margin-left: 2px; }

.empty-state {
  padding: 38px 16px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.empty-state p { margin: 0 0 14px; }

.site-footer {
  padding-block: 20px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.footer-inner a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

/* Fullscreen Game Player Overlay */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  height: 100dvh;
  background: #050e0b;
  display: flex;
  flex-direction: column;
}

.player-bar {
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  background: #081913;
  border-bottom: 1px solid rgba(52, 211, 153, 0.26);
  color: #f0fdf7;
}

.player-bar-left,
.player-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.player-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #34d399;
}

.bar-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f0fdf7;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bar-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(52, 211, 153, 0.5);
}

.bar-btn-primary {
  background: #10b981;
  border-color: #34d399;
  color: #032116;
}

.bar-btn-primary:hover {
  background: #34d399;
}

.showbar-tab {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 4px 14px 6px;
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: rgba(8, 25, 19, 0.88);
  color: #a7f3d0;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
}

.player-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
  background: #050e0b;
}

#game-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

#game-iframe.is-loading { visibility: hidden; }
.arcade-loading.player-loading { position: absolute; z-index: 2; }
#player-loading-retry { min-block-size: 44px; margin-block-start: 12px; }

@media (max-width: 1100px) {
  .container { width: calc(100% - 56px); }
  .hero-banner { min-height: 395px; }
}

@media (max-width: 800px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-copy h1 { font-size: clamp(41px, 7.4vw, 61px); }
  .hero-copy { padding-block: 40px; }
  .hero-art { inset-inline-start: 39%; }
}

@media (max-width: 620px) {
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 67px; }
  .header-actions { gap: 12px; }
  .site-main { padding-block: 15px 42px; }
  .hero-banner { display: flex; min-height: 0; flex-direction: column; align-items: stretch; border-radius: 18px; }
  .hero-copy { padding: 28px 22px 0; }
  .hero-copy p { margin-block: 15px 19px; }
  .hero-actions { gap: 8px; }
  .browse-btn, .featured-btn { gap: 7px; padding-inline: 10px; font-size: 12px; }
  .hero-art {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 1.63;
    background-image: linear-gradient(var(--forest), transparent 14%), url('./arcade-tiles.webp');
    background-position: center, center 52%;
  }
  .games-library { margin-top: 29px; }
  .search-wrap { width: 100%; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding-inline: 11px; }
  .player-title-wrap, #player-hidebar-btn { display: none; }
}

@media (max-width: 370px) {
  .card-title { font-size: 15px; }
  .player-bar { gap: 7px; padding-inline: 8px; }
  .player-bar-right { gap: 6px; }
  .bar-btn { padding-inline: 8px; white-space: nowrap; }
}

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