/* ============================================
   Kilian's Games — shared design system
   Playful, colorful, Poki-inspired
   ============================================ */
:root {
  --bg: #f3f4ff;
  --surface: #ffffff;
  --ink: #1e1b3a;
  --ink-soft: #5b5878;
  --brand: #6a5cff;
  --brand-deep: #4a3ce0;
  --accent: #ff5ca8;
  --sun: #ffcf3f;
  --mint: #2ed8a7;
  --sky: #38b6ff;
  --radius: 18px;
  --shadow: 0 4px 14px rgba(46, 38, 110, 0.10);
  --shadow-lift: 0 12px 28px rgba(46, 38, 110, 0.18);
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(90deg, #6a5cff 0%, #8a5cff 55%, #b05cff 100%);
  box-shadow: 0 2px 12px rgba(74, 60, 224, 0.35);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.45rem;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; transform: scale(1.03); transition: transform .15s; }
.logo svg { width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.logo .dot { color: var(--sun); }

.search-wrap { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search-wrap input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.search-wrap input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(255,207,63,0.6); }
.search-wrap .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: 0.5; pointer-events: none;
}

/* ---------- Category pills ---------- */
.cat-bar {
  background: rgba(255,255,255,0.12);
}
.cat-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.pill:hover { background: rgba(255,255,255,0.3); transform: translateY(-1px); text-decoration: none; }
.pill.active { background: var(--sun); color: var(--ink); }

/* ---------- Layout ---------- */
.page {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 60px;
  flex: 1;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 26px 16px 30px;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -1px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--ink-soft); font-weight: 600; margin-top: 6px; font-size: 1.05rem; }

/* ---------- Game grid ---------- */
.section-title {
  font-size: 1.25rem;
  font-weight: 900;
  margin: 26px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  display: block;
  color: var(--ink);
}
.game-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}
.game-card .thumb { aspect-ratio: 1 / 1; width: 100%; }
.game-card .thumb svg, .game-card .thumb img { width: 100%; height: 100%; display: block; }
.game-card .card-body { padding: 10px 14px 14px; }
.game-card .card-title { font-weight: 800; font-size: 1rem; }
.game-card .card-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand);
  background: #eeecff;
  padding: 2px 10px;
  border-radius: 999px;
}
.badge-new {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255,92,168,0.5);
}
.badge-hot { background: var(--sun); color: var(--ink); box-shadow: 0 2px 6px rgba(255,207,63,0.6); }

/* ---------- Game page ---------- */
.game-page-head { margin-bottom: 14px; }
.breadcrumbs { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--brand); }
.game-frame-wrap {
  background: #14122b;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  position: relative;
}
.game-frame-wrap iframe {
  width: 100%;
  height: min(72vh, 720px);
  min-height: 420px;
  border: 0;
  display: block;
  background: #14122b;
}
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #1e1b3a;
}
.game-toolbar .game-name { color: #fff; font-weight: 800; font-size: 1.05rem; margin-right: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  color: #fff;
  background: var(--brand);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(106,92,255,0.45); text-decoration: none; }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.sun:hover { box-shadow: 0 6px 16px rgba(255,207,63,0.55); }

.game-about {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-top: 24px;
}
.game-about h2 { font-size: 1.2rem; font-weight: 900; margin-bottom: 8px; }
.game-about h3 { font-size: 1rem; font-weight: 800; margin: 16px 0 6px; }
.game-about p, .game-about li { color: var(--ink-soft); font-weight: 600; }
.game-about ul { padding-left: 22px; margin: 6px 0; }

/* ---------- Ad slots (placeholders until AdSense approval) ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #ecebfa, #ecebfa 12px, #f5f4ff 12px, #f5f4ff 24px);
  border: 2px dashed #c9c5f2;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8d88c0;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 22px auto;
}
.ad-leaderboard { max-width: 728px; height: 90px; }
.ad-rect { max-width: 336px; height: 280px; }

/* ---------- Content pages ---------- */
.content-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 38px;
  max-width: 820px;
  margin: 0 auto;
}
.content-card h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 14px; }
.content-card h2 { font-size: 1.2rem; font-weight: 800; margin: 22px 0 8px; }
.content-card p, .content-card li { color: var(--ink-soft); font-weight: 600; margin-bottom: 10px; }
.content-card ul { padding-left: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: #1e1b3a;
  color: #b9b5dd;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 26px;
}
.footer-inner h4 { color: #fff; font-weight: 900; font-size: 0.95rem; margin-bottom: 10px; }
.footer-inner a { display: block; color: #b9b5dd; font-weight: 600; font-size: 0.9rem; padding: 3px 0; }
.footer-inner a:hover { color: var(--sun); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  padding: 16px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .search-wrap { order: 3; max-width: 100%; flex-basis: 100%; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .game-frame-wrap iframe { height: 62vh; min-height: 360px; }
  .content-card { padding: 24px 20px; }
}
