/* OyunOyna.tr — Modern, Cocuk Dostu, Yuksek Kontrastli ve Sifir CLS Stil Dosyasi */
:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --ink: #0f172a;
  --ink-muted: #475569;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #f97316;
  --mint: #10b981;
  --pink: #ec4899;
  --sun: #facc15;
  --border: #dbeafe;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 30px rgba(37, 99, 235, 0.12);
  --target-size: 24px;
  --font-main: "Segoe UI Rounded", "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

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

html {
  font-family: var(--font-main);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  scroll-padding-top: calc(5.25rem + env(safe-area-inset-top, 0px));
}

body {
  margin: 0;
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
  background:
    radial-gradient(circle at 12% 4%, rgba(56, 189, 248, 0.16), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(244, 114, 182, 0.14), transparent 36%),
    var(--bg);
}

img, video, svg {
  max-inline-size: 100%;
  block-size: auto;
}

h1, h2, h3 {
  text-wrap: balance;
  line-height: 1.22;
  margin-block-start: 0;
}

p, li {
  text-wrap: pretty;
}

:where(a, code) {
  overflow-wrap: anywhere;
}

:where(a:any-link, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--brand-dark);
  outline-offset: 3px;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--brand-dark);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.wrap {
  inline-size: min(1240px, 100% - 2rem);
  margin-inline: auto;
}

/* --- Responsive Header & Popover Navbar --- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-block-end: 2px solid var(--border);
  padding-block-start: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  min-block-size: 4.25rem;
}

.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  letter-spacing: -0.02em;
}

.logo-badge {
  display: inline-grid;
  place-items: center;
  inline-size: 2.35rem;
  block-size: 2.35rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #ec4899);
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.logo-sub {
  color: var(--brand);
}

.site-nav {
  display: flex;
  align-items: center;
}

.menu-button {
  anchor-name: --menu-button;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.site-menu {
  list-style: none;
  margin: 0;
  padding: 0.75rem;
  position: fixed;
  inset: auto;
  inset-block-start: 4.65rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 1rem;
  inline-size: min(84dvw, 22rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin-block-start: 0.5rem;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.site-menu a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  inline-size: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  border-block-end: 3px solid transparent;
}

.site-menu a:hover {
  background: var(--surface-soft);
  color: var(--brand-dark);
}

.site-menu a[aria-current="page"] {
  background: #dbeafe;
  color: var(--brand-dark);
  border-block-end-color: var(--brand-dark);
  font-weight: 900;
}

.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.site-header.is-wide .site-menu a {
  inline-size: auto;
  padding: 0.45rem 0.72rem;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

.site-header.is-measuring * {
  transition: none !important;
}

/* --- Main Layout --- */
main {
  flex: 1 0 auto;
  padding-block: 1.5rem 3rem;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 52%, #ec4899 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 1rem + 2.2vw, 2.6rem);
  box-shadow: var(--shadow-md);
  margin-block-end: 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 820px) {
  .hero-inner {
    grid-template-columns: 1.4fr 0.9fr;
  }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 800;
  font-size: 0.88rem;
  margin-block-end: 0.75rem;
}

.hero h1 {
  font-size: clamp(1.65rem, 1.15rem + 2.2vw, 2.75rem);
  font-weight: 900;
  margin-block-end: 0.75rem;
}

.hero p {
  font-size: clamp(0.98rem, 0.92rem + 0.35vw, 1.12rem);
  margin-block: 0 1.2rem;
  color: rgba(255, 255, 255, 0.94);
  max-inline-size: 62ch;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.26);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-search-card {
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.hero-search-card label {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  margin-block-end: 0.45rem;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1 1 12rem;
  min-inline-size: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  border: 2px solid #cbd5e1;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.1rem;
  border-radius: 14px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: #ea580c;
}

.btn-soft {
  background: var(--surface-soft);
  color: var(--brand-dark);
  border-color: var(--border);
}

.btn-soft:hover {
  background: #dbeafe;
}

.age-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 0.85rem;
}

.age-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  background: var(--surface-soft);
  color: var(--ink);
  border: 2px solid var(--border);
}

.age-pill:hover,
.age-pill[aria-current="page"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* --- Category Filter Strip --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-block-end: 1.5rem;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}

.cat-chip:hover,
.cat-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

/* --- Game Grid (Container Query Driven) --- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block: 1.6rem 1rem;
}

.section-head h2 {
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.85rem);
  font-weight: 900;
  margin: 0;
}

.section-count {
  font-weight: 800;
  color: var(--brand-dark);
  background: #dbeafe;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.86rem;
}

.games-container {
  container: games / inline-size;
}

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

@container games (inline-size > 56rem) {
  .games-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.game-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.game-card-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.game-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #e2e8f0;
  overflow: hidden;
}

.game-thumb-wrap img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.game-card-body {
  padding: 0.95rem 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.game-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--surface-soft);
  color: var(--brand-dark);
}

.tag-age {
  background: #fef3c7;
  color: #92400e;
}

.tag-2p {
  background: #fce7f3;
  color: #9d174d;
}

.game-card-title {
  font-size: 1.06rem;
  font-weight: 900;
  margin: 0;
  color: var(--ink);
}

.game-card-desc {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0;
  flex: 1 1 auto;
}

.game-play-cta {
  margin-block-start: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.52rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  margin-block-end: 1rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.breadcrumbs a {
  color: var(--brand-dark);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* --- Game Play Stage --- */
.game-page-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 980px) {
  .game-page-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}

.game-shell {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.game-shell:fullscreen {
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: 0;
  border: 0;
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(90deg, #eff6ff, #fdf2f8);
  border-block-end: 2px solid var(--border);
}

.game-toolbar > :not(button, input, select, textarea, a, [role="button"], label) {
  min-inline-size: 0;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid var(--border);
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--ink);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.game-stage-area {
  padding: 1rem;
  min-block-size: min(66dvh, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: #f8fafc;
}

.game-shell:fullscreen .game-stage-area {
  flex: 1 1 auto;
  background: #0f172a;
}

.game-canvas-wrap {
  inline-size: 100%;
  max-inline-size: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

canvas.oyun-canvas {
  display: block;
  inline-size: 100%;
  max-inline-size: 720px;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  border: 3px solid #cbd5e1;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  touch-action: none;
}

.oyun-mode-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.mode-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}

.mode-btn.is-active,
.mode-btn[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.dpad-controls {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 52px);
  gap: 0.4rem;
  justify-content: center;
  margin-block-start: 0.25rem;
}

.dpad-btn {
  border-radius: 14px;
  border: 2px solid #93c5fd;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.dpad-btn:active {
  background: var(--brand);
  color: #ffffff;
}

/* DOM Mini-Game Grids */
.memory-grid {
  display: grid;
  gap: 0.6rem;
  inline-size: 100%;
  max-inline-size: 560px;
}

.mem-card {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 3px solid #bfdbfe;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, background 0.16s ease;
}

.mem-card.is-open {
  background: #ffffff;
  color: var(--ink);
  border-color: #60a5fa;
}

.mem-card.is-matched {
  background: #dcfce7;
  border-color: #22c55e;
  color: var(--ink);
}

.sudoku-grid {
  display: grid;
  gap: 4px;
  inline-size: 100%;
  max-inline-size: 420px;
  background: #1e293b;
  padding: 6px;
  border-radius: 16px;
}

.sudoku-cell {
  aspect-ratio: 1 / 1;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.65rem);
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sudoku-cell.is-fixed {
  background: #e0f2fe;
  color: #0c4a6e;
  cursor: default;
}

.sudoku-cell.is-selected {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 3px #2563eb;
}

.sudoku-cell.is-error {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.board-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  inline-size: 100%;
  max-inline-size: 400px;
  background: #cbd5e1;
  padding: 0.6rem;
  border-radius: 18px;
  touch-action: none;
}

.tile-2048 {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(1.15rem, 0.9rem + 1vw, 1.75rem);
  background: #f1f5f9;
  color: var(--ink);
}

.xox-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  inline-size: 100%;
  max-inline-size: 360px;
}

.xox-cell {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 3px solid #bfdbfe;
  background: #ffffff;
  font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.2rem);
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.xox-cell.is-win {
  background: #dcfce7;
  border-color: #16a34a;
}

.c4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  inline-size: 100%;
  max-inline-size: 470px;
  background: #2563eb;
  padding: 0.65rem;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.c4-slot {
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 0;
  background: #eff6ff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.c4-slot.p1 {
  background: #ef4444;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22);
}

.c4-slot.p2 {
  background: #facc15;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}

.c4-slot.is-win {
  outline: 4px solid #ffffff;
}

.piano-keys {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem;
  inline-size: 100%;
  max-inline-size: 680px;
}

.piano-key {
  min-block-size: 170px;
  border-radius: 0 0 18px 18px;
  border: 3px solid rgba(15, 23, 42, 0.14);
  color: #ffffff;
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  padding-block-end: 0.85rem;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(15, 23, 42, 0.16);
  transition: transform 0.08s ease;
}

.piano-key.is-active {
  transform: translateY(4px) scale(0.98);
  filter: brightness(1.15);
}

.piano-key.is-hint {
  outline: 4px solid #0f172a;
  outline-offset: 2px;
}

@keyframes pulseHint {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.quiz-card {
  inline-size: 100%;
  max-inline-size: 620px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
  margin-block-start: 1rem;
}

.quiz-opt {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

.quiz-opt:hover {
  background: #dbeafe;
}

.quiz-opt.is-correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.quiz-opt.is-wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

.simon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  inline-size: 100%;
  max-inline-size: 360px;
}

.simon-pad {
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 4px solid rgba(15, 23, 42, 0.14);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  opacity: 0.82;
  transition: transform 0.1s ease, opacity 0.1s ease, filter 0.1s ease;
}

.simon-pad.is-lit {
  opacity: 1;
  filter: brightness(1.32);
  transform: scale(1.04);
  box-shadow: 0 0 28px rgba(15, 23, 42, 0.22);
}

.mole-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  inline-size: 100%;
  max-inline-size: 420px;
}

.mole-hole {
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  border: 3px solid #84cc16;
  background: radial-gradient(circle at 50% 72%, #713f12 0%, #422006 58%, #bef264 62%);
  font-size: clamp(2rem, 1.5rem + 2vw, 3.1rem);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.kbd-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  max-inline-size: 600px;
}

.kbd-key {
  min-inline-size: 38px;
  min-block-size: 42px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.kbd-key.is-good {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.kbd-key.is-bad {
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
}

.puzzle-grid {
  display: grid;
  gap: 0.45rem;
  inline-size: 100%;
  max-inline-size: 380px;
  background: #e2e8f0;
  padding: 0.55rem;
  border-radius: 18px;
}

.puzzle-tile {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 2px solid #93c5fd;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.puzzle-tile.is-empty {
  background: transparent;
  border: 2px dashed #94a3b8;
  cursor: default;
}

.paint-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.swatch {
  inline-size: 34px;
  block-size: 34px;
  border-radius: 999px;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #cbd5e1;
  cursor: pointer;
}

.swatch.is-active {
  box-shadow: 0 0 0 3px #0f172a;
  transform: scale(1.12);
}

/* --- Info Cards, Sidebar, Scrollable SEO Guide, FAQ --- */
.info-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-block-end: 1.15rem;
}

.info-card h2,
.info-card h3 {
  font-size: 1.15rem;
  font-weight: 900;
  margin-block-end: 0.65rem;
}

.parent-callout {
  background: #ecfdf5;
  border: 2px solid #a7f3d0;
  border-radius: 16px;
  padding: 0.95rem 1.05rem;
  color: #065f46;
}

.seo-guide-box {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-block: 2rem;
}

.seo-guide-scroll {
  max-block-size: 270px;
  overflow-y: auto;
  padding-inline-end: 0.5rem;
  transition: max-block-size 0.25s ease;
}

.seo-guide-scroll.is-expanded {
  max-block-size: none;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
  margin-block-start: 1rem;
}

.faq-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.15rem;
}

.faq-item h3 {
  font-size: 1.02rem;
  margin-block-end: 0.35rem;
}

.faq-item p {
  margin: 0;
  color: var(--ink-muted);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 1.1rem;
}

.blog-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}

.blog-card:hover {
  border-color: var(--brand);
}

/* --- Footer --- */
.site-footer {
  background: #0f172a;
  color: #e2e8f0;
  padding-block: 2.5rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
  margin-block-start: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.site-footer h2 {
  font-size: 1rem;
  color: #ffffff;
  margin-block-end: 0.65rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.site-footer a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  margin-block-start: 1.75rem;
  padding-block-start: 1.1rem;
  border-block-start: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  .piano-key.is-hint {
    animation: pulseHint 0.9s infinite alternate;
  }
  .lucky-spin {
    animation: luckyWiggle 0.35s ease-in-out infinite alternate;
  }
}

@keyframes luckyWiggle {
  from { transform: rotate(-2deg) scale(1); }
  to { transform: rotate(2deg) scale(1.03); }
}

/* --- Speed / Level Bar, Badges, Recent Games, New Mini-Games --- */
.level-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 1.1rem;
  background: #ffffff;
  border-block-end: 2px solid var(--border);
}

.level-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.level-label {
  font-weight: 900;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-inline-end: 0.25rem;
}

.level-pill {
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

.level-pill[aria-pressed="true"] {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

.level-pill[data-level="normal"][aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand-dark);
}

.level-pill[data-level="fast"][aria-pressed="true"] {
  background: #ea580c;
  border-color: #c2410c;
}

.fun-strip {
  display: grid;
  gap: 1rem;
  margin-block-end: 1.5rem;
}

@media (min-width: 860px) {
  .fun-strip {
    grid-template-columns: 1.15fr 1fr;
  }
}

.fun-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 0.65rem;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 800;
}

.badge-chip.is-earned {
  border-style: solid;
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.daily-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  background: linear-gradient(135deg, #fef3c7, #fce7f3);
  border: 2px solid #fbcfe8;
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
}

.recent-shelf {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-block-end: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-block-start: 0.65rem;
}

.recent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
}

.recent-pill:hover {
  background: #dbeafe;
  border-color: var(--brand);
}

.spot-grid {
  display: grid;
  gap: 0.5rem;
  inline-size: 100%;
  max-inline-size: 460px;
}

.spot-cell {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #ffffff;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.spot-cell.is-good {
  background: #dcfce7;
  border-color: #16a34a;
}

.spot-cell.is-bad {
  background: #fee2e2;
  border-color: #dc2626;
}

.schulte-grid {
  display: grid;
  gap: 0.45rem;
  inline-size: 100%;
  max-inline-size: 460px;
}

.schulte-cell {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 2px solid #93c5fd;
  background: #ffffff;
  color: var(--ink);
  font-size: clamp(1.15rem, 0.9rem + 1vw, 1.65rem);
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.schulte-cell.is-done {
  background: #dcfce7;
  border-color: #22c55e;
  color: #166534;
  opacity: 0.65;
}

.pixel-board {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  inline-size: 100%;
  max-inline-size: 400px;
  background: #cbd5e1;
  padding: 6px;
  border-radius: 14px;
  touch-action: none;
}

.pixel-cell {
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  border-radius: 3px;
  background: #ffffff;
  cursor: pointer;
  min-block-size: 0;
  min-inline-size: 0;
}

.rps-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-block: 0.85rem;
}

.rps-hand {
  font-size: clamp(3rem, 2.2rem + 2.5vw, 4.5rem);
  background: var(--surface-soft);
  border-radius: 20px;
  padding: 0.85rem;
  border: 2px solid var(--border);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

@media (forced-colors: active) {
  .site-menu a[aria-current="page"] {
    outline: 2px solid Highlight;
  }
}

/* --- Poki-Style Vibrant Featured Bento Grid --- */
.poki-bento-section {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 52%, #7c3aed 100%);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 0.9rem + 1.4vw, 1.85rem);
  margin-block-end: 1.75rem;
  box-shadow: var(--shadow-md);
  color: #ffffff;
}

.poki-bento-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 1rem;
}

.poki-bento-head h2 {
  margin: 0;
  font-size: clamp(1.28rem, 1rem + 1.1vw, 1.75rem);
  font-weight: 900;
  color: #ffffff;
}

.poki-bento-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  background: #facc15;
  color: #713f12;
  font-weight: 900;
  font-size: 0.84rem;
}

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

@media (min-width: 960px) {
  .poki-bento-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(175px, auto);
  }
  .poki-tile.is-hero {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.poki-tile {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  background: #0f172a;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.poki-tile:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: #fde047;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.34);
}

.poki-tile-link {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  position: relative;
  text-decoration: none;
  color: #ffffff;
}

.poki-tile-link img {
  inline-size: 100%;
  block-size: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.poki-tile.is-hero .poki-tile-link img {
  aspect-ratio: auto;
}

.poki-tile-overlay {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 0.7rem 0.85rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.88) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.poki-tile-title {
  font-weight: 900;
  font-size: 0.98rem;
  line-height: 1.2;
}

.poki-tile.is-hero .poki-tile-title {
  font-size: 1.28rem;
}

.poki-play-dot {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  inline-size: 2.2rem;
  block-size: 2.2rem;
  border-radius: 999px;
  background: #facc15;
  color: #713f12;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}
