:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #0c111b;
  color: #f1f4fa;
  --muted: #a8b4c6;
  --border: #283446;
  --accent: #b4f379;
  --surface: #151e2c;
  --logic: #b4f379;
  --memory: #d0b8ff;
  --words: #86d9f4;
  --attention: #f5c797;
  --speed: #f8a9bb;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
ul { list-style: none; margin: 0; padding: 0; }
.shell { width: min(100% - 64px, 1160px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 2; top: 12px; left: 12px; background: var(--accent); color: #172214; padding: 10px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--border); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-inner { min-height: 66px; }
.header-inner nav a, .site-footer a { color: var(--muted); font-size: .875rem; font-weight: 600; }
.header-inner nav a:hover, .site-footer a:hover { color: var(--accent); }
.brand { font-size: 1.18rem; font-weight: 700; letter-spacing: -.045em; }
.brand-accent { color: var(--accent); }
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); }
.footer-inner { min-height: 70px; color: var(--muted); font-size: .875rem; }

.directory-hero {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(26px, 4.7vw, 62px);
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: radial-gradient(ellipse at 8% 10%, #233846 0%, transparent 70%), #111a28;
}
.hero-copy h1 { max-width: 11ch; font-size: clamp(3.05rem, 6.15vw, 5.6rem); letter-spacing: -.075em; line-height: .99; }
.hero-copy h1 span { color: var(--accent); }
.hero-copy p { margin-top: 21px; max-width: 39ch; line-height: 1.65; color: #c4cedb; }
.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  background: var(--accent);
  color: #142210;
  margin-top: 24px;
  padding: 12px 17px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
}
.primary-link:hover { background: #c9ffa0; }
.hero-games h2 { color: #ced8e7; font-weight: 600; font-size: .925rem; margin-bottom: 12px; }
.featured-grid { display: grid; gap: 8px; }
.featured-grid .game-card { background: #141e2ce8; }
.directory { margin-top: 56px; scroll-margin-top: 20px; }
.directory-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.directory-heading h2, .more-games h2 { font-size: clamp(1.6rem, 4vw, 2.15rem); letter-spacing: -.045em; }
.category-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.category-nav a { border: 1px solid var(--border); border-radius: 24px; padding: 7px 11px; color: var(--muted); font-size: .8rem; }
.category-nav a:hover { color: var(--accent); border-color: var(--accent); }
.category-group { margin-top: 26px; scroll-margin-top: 20px; }
.category-group > h3 { display: flex; gap: 9px; align-items: center; margin: 0 0 11px; font-size: 1.1rem; letter-spacing: -.024em; }
.category-dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; }
.logic { color: var(--logic); }
.memory { color: var(--memory); }
.words { color: var(--words); }
.attention { color: var(--attention); }
.speed { color: var(--speed); }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.game-card {
  display: flex;
  gap: 12px;
  min-height: 100%;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.game-card:hover { background: #1c2838; border-color: #5c7367; }
.game-logo { flex-shrink: 0; display: block; border-radius: 11px; object-fit: cover; background: #273548; }
.card-copy { flex: 1; min-width: 0; }
.card-copy h3, .card-copy h4 { font-size: .98rem; letter-spacing: -.02em; }
.card-copy p { font-size: .79rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.card-category { display: block; font-size: .7rem; margin-bottom: 3px; }
.card-arrow { color: var(--muted); align-self: flex-start; font-size: 1rem; }
.game-card:hover .card-arrow { color: var(--accent); }

.game-heading { padding-block: 26px 20px; }
.game-title-row { display: flex; align-items: center; gap: 14px; }
.game-title-row h1 { font-size: clamp(1.85rem, 4.3vw, 3.1rem); line-height: 1.06; letter-spacing: -.055em; }
.game-title-row p { color: var(--muted); margin-top: 7px; line-height: 1.5; }
.play-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(232px, 1fr); align-items: start; gap: 20px; }
.play-area { border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: #0f172a; }
.game-frame { display: block; width: 100%; height: clamp(680px, calc(100svh - 200px), 800px); border: 0; }
.game-notice { padding: 12px; color: var(--muted); }
.game-guide { padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.guide-category { display: inline-block; margin-bottom: 10px; font-size: .8rem; font-weight: 600; }
.guide-category:hover { text-decoration: underline; }
.game-guide h2 { font-size: 1.38rem; letter-spacing: -.03em; }
.game-guide ol { padding-left: 19px; margin: 13px 0 18px; }
.game-guide li, .game-tip p { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.game-guide li + li { margin-top: 10px; }
.game-tip { border-top: 1px solid var(--border); padding-top: 15px; }
.game-tip h3 { font-size: .9rem; margin-bottom: 5px; }
.more-games { margin-top: 32px; }
.more-games h2 { margin-bottom: 14px; }

@media (max-width: 960px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 710px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 56px; }
  .directory-hero { grid-template-columns: minmax(0, 1fr); margin-top: 20px; padding: 23px; }
  .hero-copy h1 { max-width: 14ch; }
  .directory { margin-top: 34px; }
  .play-layout { grid-template-columns: minmax(0, 1fr); }
  .game-heading { padding-block: 16px; }
  .game-title-row img { width: 48px; height: 48px; }
  .game-frame { height: clamp(680px, 85svh, 800px); }
  .site-footer { margin-top: 38px; }
}

@media (max-width: 485px) {
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .play-area { margin-inline: -16px; border-inline: 0; border-radius: 0; }
  .hero-copy p { font-size: .94rem; }
}
