:root {
  --bg: #0b1024;
  --surface: #141c3a;
  --surface-2: #1c2752;
  --border: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #b8c4e6;
  --pink: #ff5ca8;
  --cyan: #38bdf8;
  --yellow: #ffd84d;
  --green: #39ff6e;
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top left, rgba(255, 92, 168, 0.18), transparent 36%),
              radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 38%), var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left, 16px));
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 16, 36, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 58px; padding: 8px 0;
}
.brand {
  display: flex; align-items: center; gap: 9px; flex: 0 0 auto;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.15rem; color: #fff;
}
.brand-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.nav {
  display: flex; gap: 6px; align-items: center; font-size: 0.84rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); font-weight: 700; white-space: nowrap; padding: 6px 8px; border-radius: 8px; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 9px 15px; border-radius: 13px; font-weight: 800; font-size: 0.9rem;
  border: 2px solid var(--border); background: var(--surface-2); color: #fff;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--yellow); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-play {
  background: linear-gradient(135deg, var(--green), #22c55e);
  color: #052e16; border: none;
}
.btn-pink {
  background: linear-gradient(135deg, var(--pink), #f97316);
  color: #fff; border: none;
}
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: #fff; border: none;
}

.hero { padding: 30px 0 14px; text-align: center; }
.chip {
  display: inline-block; padding: 5px 13px; border-radius: 999px;
  background: rgba(57, 255, 110, 0.16); color: var(--green);
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
h1 {
  font-family: 'Outfit', sans-serif; font-size: clamp(1.7rem, 4.5vw, 3rem);
  margin: 10px 0 8px; line-height: 1.12;
}
.grad { background: linear-gradient(90deg, var(--yellow), var(--pink), var(--cyan)); -webkit-background-clip: text; color: transparent; }
.lead { color: var(--muted); max-width: 680px; margin: 0 auto 16px; font-size: 1rem; }

.ad-safe-slot {
  min-height: 98px;
  margin: 26px 0;
  border-radius: 18px;
}

.zz-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 98px;
  padding: 16px 22px;
  border-radius: 18px;
  text-decoration: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 24%, rgba(56, 189, 248, 0.22), transparent 42%),
    radial-gradient(circle at 14% 80%, rgba(232, 195, 90, 0.16), transparent 45%),
    linear-gradient(135deg, #050811 0%, #0b1221 55%, #121e3a 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.52);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.52), inset 0 1px 0 rgba(255, 243, 184, 0.16);
  transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.zz-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(248, 214, 109, 0.9);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.65), 0 0 26px rgba(56, 189, 248, 0.2);
  text-decoration: none;
}
.zz-left { display: flex; align-items: center; gap: 15px; min-width: 0; }
.zz-emblem { flex: 0 0 54px; border-radius: 14px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55)); }
.zz-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.zz-kicker {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; color: #38bdf8;
}
.zz-ad-pill {
  padding: 2px 6px; border-radius: 4px; font-size: 0.64rem; font-weight: 800;
  background: rgba(232, 195, 90, 0.18); color: #f8d66d; border: 1px solid rgba(212, 175, 55, 0.42);
}
.zz-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.zz-wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; font-size: 1.3rem; letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff3b8 0%, #e8c35a 48%, #c69228 85%, #9d6f15 100%);
  -webkit-background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75));
}
.zz-headline { color: #ffffff; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.98rem; }
.zz-sub { color: #cbd5e1; font-size: 0.84rem; }
.zz-cta-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.zz-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 12px; font-weight: 800; font-size: 0.86rem;
  color: #050811;
  background: linear-gradient(135deg, #fff3b8 0%, #e8c35a 55%, #c69228 100%);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.38); white-space: nowrap;
}
.zz-domain { font-size: 0.72rem; color: #94a3b8; font-weight: 600; letter-spacing: 0.03em; }
@media (max-width: 720px) {
  .zz-banner { flex-direction: column; align-items: flex-start; padding: 14px 15px; gap: 12px; }
  .zz-cta-wrap { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
}

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 18px; margin: 18px 0 32px; }
.game-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 11px;
  transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.38);
}
.game-card.playable { border-color: rgba(57, 255, 110, 0.45); }
.game-card.playable:hover {
  transform: translateY(-4px); border-color: var(--yellow);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.56);
}
.thumb {
  height: 124px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 3.1rem; font-weight: 900;
}
.thumb.runner { background: linear-gradient(135deg, #1d4ed8, #7c3aed); }
.thumb.breaker { background: linear-gradient(135deg, #be185d, #f97316); }
.thumb.memory { background: linear-gradient(135deg, #0f766e, #06b6d4); }
.thumb.planet { background: linear-gradient(135deg, #4338ca, #0ea5e9); }
.thumb.piano { background: linear-gradient(135deg, #0f172a, #7c3aed, #ec4899); }
.thumb.soon { background: linear-gradient(135deg, #1e293b, #334155); }

.meta-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(56, 189, 248, 0.16); color: var(--cyan); }
.pill.live { background: rgba(57, 255, 110, 0.16); color: var(--green); }
.pill.score { background: rgba(255, 216, 77, 0.16); color: var(--yellow); }

/* Native Mobile, iPad & Desktop Game Cabinet */
.game-shell {
  max-width: 840px; margin: 16px auto 28px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 22px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.5);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
body.arcade-expanded {
  overflow: hidden;
}
.game-shell.is-expanded,
.game-shell:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  max-width: 100%;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  background: #070b1a;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.game-shell.is-expanded canvas.stage {
  max-height: 76dvh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}
.hud {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.hud-stats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hud-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hud-box {
  background: var(--surface-2); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 7px 12px;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.92rem;
}
.hud-box span { color: var(--yellow); }

/* Unified Easy / Normal / Hard Difficulty & Level Bar */
.mode-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.seg-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.seg-btn {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: rgba(11, 16, 36, 0.85);
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.seg-btn:hover { border-color: var(--cyan); color: #fff; }
.seg-btn.active {
  background: rgba(57, 255, 110, 0.18);
  border-color: var(--green);
  color: var(--green);
}
.seg-btn.hard.active {
  background: rgba(255, 92, 168, 0.22);
  border-color: var(--pink);
  color: #f9a8d4;
}
.seg-btn.normal.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
}
.lvl-select {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 216, 77, 0.45);
  background: rgba(11, 16, 36, 0.92);
  color: var(--yellow);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
}

canvas.game-canvas {
  width: 100%; height: auto; display: block; border-radius: 16px;
  background: #060919; border: 2px solid rgba(56, 189, 248, 0.35);
  touch-action: none;
  max-height: 62dvh;
  object-fit: contain;
}

/* Native Mobile & iPad Touch Controller Dock */
.touch-dock {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.touch-dock.two-col {
  grid-template-columns: 1fr 1fr;
}
.touch-btn {
  min-height: 54px;
  border-radius: 16px;
  border: 2px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, rgba(28, 39, 82, 0.95), rgba(16, 24, 54, 0.98));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.touch-btn:active, .touch-btn.pressed {
  transform: scale(0.96);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.32), rgba(37, 99, 235, 0.45));
  border-color: var(--yellow);
}
.touch-btn.primary {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: #052e16;
  border-color: transparent;
}
.touch-slider {
  min-height: 54px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 216, 77, 0.45);
  background: rgba(11, 16, 36, 0.72);
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 10px;
  touch-action: none;
}

.flip-grid {
  display: grid; gap: 10px; margin: 14px auto; max-width: 560px;
}
.flip-card {
  aspect-ratio: 1 / 1; min-height: 58px; border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-size: clamp(1.5rem, 5vw, 2.3rem); color: #fff; font-weight: 800;
  cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.15s ease;
}
.flip-card.flipped { background: #1e293b; border-color: var(--yellow); transform: scale(1.03); }
.flip-card.matched { background: rgba(57, 255, 110, 0.22); border-color: var(--green); cursor: default; }

/* AdSense-Compliant Editorial Guide & FAQ Section */
.seo-guide {
  max-width: 840px; margin: 0 auto 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 22px;
}
.seo-guide h2 { font-family: 'Outfit', sans-serif; margin: 0 0 10px; font-size: 1.3rem; }
.seo-guide h3 { font-family: 'Outfit', sans-serif; margin: 16px 0 6px; font-size: 1.05rem; color: var(--yellow); }
.seo-guide p, .seo-guide li { color: var(--muted); font-size: 0.93rem; }
.seo-guide ul { padding-left: 20px; margin: 6px 0 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.guide-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }

.footer {
  border-top: 1px solid var(--border); padding: 24px 0 38px;
  color: var(--muted); font-size: 0.86rem;
}
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; align-items: center; }

@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .brand span:last-child { font-size: 1.02rem; }
  .game-shell { padding: 12px; margin: 10px auto 20px; border-radius: 18px; }
  .hud { gap: 8px; }
  .hud-box { padding: 6px 10px; font-size: 0.84rem; }
  .btn { min-height: 40px; padding: 7px 12px; font-size: 0.84rem; }
  .touch-dock { grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; }
  .touch-btn, .touch-slider { min-height: 52px; font-size: 0.88rem; }
  .seo-guide { padding: 16px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .game-shell { max-width: 760px; padding: 18px; }
  .touch-btn, .touch-slider { min-height: 58px; font-size: 1rem; }
}
