/* ===========================================================
   CruxWave — Vanilla CSS Design System
   Pure handwritten CSS. No framework. No reset library.
   =========================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- Tokens ---------- */
:root {
  --brand: #165DFF;
  --brand-700: #0E47CC;
  --brand-50: #EAF0FF;
  --aqua: #14C9C9;
  --orange: #FF7D33;
  --yellow: #FFC53D;
  --pink: #F25287;
  --purple: #8B5CF6;

  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --surface-2: #F1F3F8;
  --border: #E5E8EF;
  --text: #0F172A;
  --text-muted: #5B6478;
  --text-faint: #8A93A6;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 6px 18px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 40px rgba(15,23,42,.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --nav-h: 64px;
  --maxw: 1320px;
  --gap: 18px;

  --t-fast: 140ms cubic-bezier(.3,.7,.3,1);
  --t: 240ms cubic-bezier(.2,.7,.2,1);
}
[data-theme="dark"] {
  --bg: #0B0E16;
  --surface: #131826;
  --surface-2: #1B2030;
  --border: #232938;
  --text: #F1F4FA;
  --text-muted: #A6AFC2;
  --text-faint: #6F778A;
  --brand-50: #0F1B3A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 50px rgba(0,0,0,.55);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
}

::selection { background: var(--brand); color: #fff; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Top Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--aqua));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 14px rgba(22,93,255,.35);
  font-size: 15px; font-weight: 900;
}
.brand-name { font-size: 18px; }
.brand-name span { color: var(--brand); }
.nav-links { display: flex; gap: 6px; flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 8px 12px; border-radius: 10px; color: var(--text-muted);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: all var(--t-fast);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-50); color: var(--brand); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.search-wrap { position: relative; }
.search {
  width: 240px; height: 38px; padding: 0 14px 0 38px;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-pill); outline: none; transition: all var(--t-fast);
}
.search:focus { background: var(--surface); border-color: var(--brand); width: 300px; }
.search-wrap::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: currentColor; color: var(--text-faint);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M21 21l-4.3-4.3M11 19a8 8 0 110-16 8 8 0 010 16z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M21 21l-4.3-4.3M11 19a8 8 0 110-16 8 8 0 010 16z'/></svg>") center/contain no-repeat;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-pill);
  background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted);
  transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--brand-50); color: var(--brand); }

/* Search dropdown */
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-width: 80vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; max-height: 60vh; overflow: auto;
}
.search-results .res {
  display: flex; gap: 10px; padding: 8px; border-radius: 10px; align-items: center;
}
.search-results .res:hover { background: var(--surface-2); }
.search-results .res img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.search-results .res-title { font-weight: 600; font-size: 14px; }
.search-results .res-meta { font-size: 12px; color: var(--text-faint); }
.search-results .empty { padding: 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- Mobile nav ---------- */
.menu-btn { display: none; }
@media (max-width: 920px) {
  .nav-links { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px; gap: 4px; overflow: visible; }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 14px; }
  .menu-btn { display: grid; }
  .search { width: 160px; }
  .search:focus { width: 200px; }
}
@media (max-width: 560px) {
  .search-wrap { display: none; }
  .brand-name { display: none; }
  .nav-inner { justify-content: space-between; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text); font-weight: 600;
  transition: all var(--t-fast); border: 1px solid transparent;
}
.btn:hover { background: var(--border); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-700));
  color: #fff; box-shadow: 0 8px 20px rgba(22,93,255,.32);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(22,93,255,.4); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }

/* ---------- Hero Carousel ---------- */
.hero {
  position: relative; margin: 22px auto; max-width: var(--maxw);
  padding: 0 22px;
}
.hero-track {
  position: relative; height: 420px; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-md);
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 700ms ease;
  display: grid; grid-template-columns: 1.05fr .95fr;
}
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-text { padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 16px; background: linear-gradient(135deg, #0B1330, #173A8A); color: #fff; }
.hero-eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #B7C8FF; font-weight: 700; }
.hero-title { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.hero-desc { color: #C6D2EE; font-size: 15px; max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 8px; }
.hero-img { position: relative; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #173A8A 0%, transparent 30%); }
.hero-dots { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.hero-dot { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.45); transition: all var(--t-fast); cursor: pointer; }
.hero-dot.active { width: 24px; background: #fff; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 99px; background: rgba(0,0,0,.4); color: #fff; display: grid; place-items: center; z-index: 3; backdrop-filter: blur(8px); }
.hero-arrow:hover { background: rgba(0,0,0,.65); }
.hero-arrow.prev { left: 16px; } .hero-arrow.next { right: 16px; }

@media (max-width: 860px) {
  .hero-track { height: 460px; }
  .hero-slide { grid-template-columns: 1fr; }
  .hero-img { display: none; }
  .hero-text { padding: 32px; }
}

/* ---------- Section ---------- */
.section { margin: 38px auto; max-width: var(--maxw); padding: 0 22px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title { font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; letter-spacing: -.01em; margin: 0; }
.section-sub { color: var(--text-muted); font-size: 14px; margin: 4px 0 0; }
.see-all { color: var(--brand); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.see-all:hover { gap: 8px; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-weight: 600; font-size: 13px; color: var(--text); transition: all var(--t-fast);
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip-emoji { font-size: 15px; }

/* category grid (homepage colorful tiles) */
.cat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.cat-tile {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius);
  padding: 16px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; transition: transform var(--t);
}
.cat-tile:hover { transform: translateY(-4px); }
.cat-tile .em { font-size: 38px; line-height: 1; }
.cat-tile .nm { font-weight: 800; font-size: 16px; }
.cat-tile .ct { font-size: 12px; opacity: .85; }

/* ---------- Game cards ---------- */
.cards {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all var(--t); display: block;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.card-thumb { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--surface-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-badge {
  position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 99px; letter-spacing: .04em;
}
.card-badge.hot { background: var(--orange); }
.card-badge.new { background: var(--aqua); }
.card-badge.top { background: var(--yellow); color: #523900; }

.badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: .04em;
  line-height: 1;
}
.badge.new { background: var(--aqua); }
.card-fav {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 99px;
  background: rgba(0,0,0,.4); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px);
  opacity: 0; transition: all var(--t-fast);
}
.card:hover .card-fav { opacity: 1; }
.card-fav.on { opacity: 1; background: var(--pink); }
.card-info { padding: 12px; }
.card-title { font-weight: 700; font-size: 14px; line-height: 1.3; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-faint); align-items: center; }
.card-rating { color: var(--yellow); font-weight: 700; }
.card-overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.85));
  opacity: 0; transition: opacity var(--t); padding: 12px; display: flex; align-items: end;
  color: #fff; font-size: 12px;
}
.card:hover .card-overlay { opacity: 1; }

/* card row (horizontal scroll) */
.row-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.row-scroll::-webkit-scrollbar { height: 8px; }
.row-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.row-scroll > .card { min-width: 200px; max-width: 200px; scroll-snap-align: start; }

/* ---------- Filters bar (catalog) ---------- */
.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 18px;
}
.toolbar select, .toolbar input[type="text"] {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2);
}
.toolbar .label { font-size: 12px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Footer ---------- */
.footer { margin-top: 60px; background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 48px 22px 22px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer ul a { color: var(--text-muted); font-size: 14px; }
.footer ul a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 22px; max-width: var(--maxw); margin: 0 auto; color: var(--text-faint); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.socials { display: flex; gap: 10px; }
.socials a { width: 34px; height: 34px; border-radius: 99px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted); }
.socials a:hover { background: var(--brand); color: #fff; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .section { padding: 0 16px; }
  .container { padding: 0 16px; }
}

@media (max-width: 720px) {
  .player-bar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .player-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .player-actions .action-btn {
    flex: 1;
    min-width: calc(50% - 3px);
    justify-content: center;
  }
}

/* ---------- Game detail page ---------- */
.play-wrap {
  display: grid; grid-template-columns: 1fr 340px; gap: 22px; margin: 22px auto; max-width: var(--maxw); padding: 0 22px;
}
.player {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16/10; box-shadow: var(--shadow-md);
}
.player iframe { width: 100%; height: 100%; border: 0; }
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.player-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .55; position: absolute; inset: 0; }
.player-cover .play-btn {
  position: relative; z-index: 2; padding: 16px 30px; border-radius: 99px;
  background: linear-gradient(135deg, var(--brand), var(--aqua)); color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 20px 40px rgba(22,93,255,.5); display: inline-flex; gap: 10px; align-items: center;
}
.player-bar {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-top: 12px;
}
.player-actions { display: flex; gap: 6px; }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-muted); font-weight: 600; font-size: 13px; transition: all var(--t-fast);
}
.action-btn:hover { background: var(--brand-50); color: var(--brand); }
.action-btn.on { background: var(--pink); color: #fff; }

.sidebar { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 99px; background: var(--brand-50); color: var(--brand); font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px auto; max-width: var(--maxw); padding: 0 22px; }
@media (max-width: 900px) {
  .play-wrap { grid-template-columns: 1fr; padding: 0 16px; }
  .detail-grid { grid-template-columns: 1fr; padding: 0 16px; }
}

.faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq-item:last-child { border-bottom: 0; }
.faq-q { font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-a { color: var(--text-muted); font-size: 14px; margin-top: 8px; display: none; }
.faq-item.open .faq-a { display: block; }

.list-tick { list-style: none; padding: 0; margin: 0; }
.list-tick li { position: relative; padding: 6px 0 6px 24px; font-size: 14px; color: var(--text-muted); }
.list-tick li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 12px; height: 12px; border-radius: 99px; background: var(--brand-50); border: 2px solid var(--brand); }
.list-tick.pros li::before { background: #DCFCE7; border-color: #16A34A; }
.list-tick.cons li::before { background: #FEE2E2; border-color: #DC2626; }

.achievement { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.achievement:last-child { border-bottom: 0; }
.ach-ico { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--yellow), var(--orange)); color: #fff; display: grid; place-items: center; font-size: 18px; box-shadow: 0 6px 12px rgba(255,125,51,.35); }
.achievement.locked .ach-ico { background: var(--surface-2); color: var(--text-faint); box-shadow: none; }
.ach-body { flex: 1; }
.ach-name { font-weight: 700; font-size: 14px; }
.ach-desc { font-size: 12px; color: var(--text-faint); }
.ach-status { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 99px; }
.achievement:not(.locked) .ach-status { background: #DCFCE7; color: #15803D; }
.achievement.locked .ach-status { background: var(--surface-2); color: var(--text-faint); }

/* ---------- Ranking ---------- */
.rank-tabs { display: flex; gap: 6px; padding: 6px; background: var(--surface); border-radius: 99px; border: 1px solid var(--border); width: fit-content; margin-bottom: 16px; }
.rank-tab { padding: 8px 18px; border-radius: 99px; font-weight: 600; font-size: 13px; color: var(--text-muted); }
.rank-tab.active { background: var(--brand); color: #fff; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: grid; grid-template-columns: 44px 64px 1fr auto auto; gap: 14px; align-items: center;
  padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all var(--t-fast);
}
.rank-row:hover { border-color: var(--brand); transform: translateX(2px); }
.rank-num { font-size: 22px; font-weight: 900; text-align: center; color: var(--text-faint); }
.rank-row:nth-child(1) .rank-num { color: var(--yellow); }
.rank-row:nth-child(2) .rank-num { color: #9CA3AF; }
.rank-row:nth-child(3) .rank-num { color: #B45309; }
.rank-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.rank-name { font-weight: 700; }
.rank-meta { font-size: 12px; color: var(--text-faint); }
.rank-score { font-weight: 700; color: var(--yellow); }

/* ---------- Series / Two-player headers ---------- */
.banner {
  position: relative; margin: 22px auto; max-width: var(--maxw);
  padding: 36px 26px; border-radius: var(--radius-lg); overflow: hidden;
  color: #fff;
}
.banner.two { background: linear-gradient(135deg, #FF7D33 0%, #F25287 100%); }
.banner.series { background: linear-gradient(135deg, #14C9C9 0%, #165DFF 100%); }
.banner.new { background: linear-gradient(135deg, #8B5CF6 0%, #165DFF 100%); }
.banner.dev { background: linear-gradient(135deg, #0F172A 0%, #165DFF 100%); }
.banner h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 8px; letter-spacing: -.02em; }
.banner p { margin: 0; max-width: 60ch; opacity: .9; }

.kid-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: linear-gradient(135deg, #DCFCE7, #BBF7D0); color: #14532D;
  border-radius: var(--radius); font-size: 13px; font-weight: 600;
  margin: 0 22px;
}
[data-theme="dark"] .kid-bar { background: linear-gradient(135deg, #064E3B, #065F46); color: #BBF7D0; }

/* ---------- About / Dev pages ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
}
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 22px; margin-bottom: 12px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 14px; }

.steps { counter-reset: step; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.step::before { counter-increment: step; content: counter(step); width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step h4 { margin: 4px 0 4px; }

.form-row { display: grid; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.form-row input, .form-row textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; outline: none; transition: border-color var(--t-fast);
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--brand); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 99px;
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: all var(--t); z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Loading ---------- */
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin 700ms linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Misc ---------- */
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-faint); }
.empty-state .em { font-size: 56px; }

@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.pop { animation: pop 280ms cubic-bezier(.3,.7,.3,1); }

/* page transitions */
main.page { animation: fade 280ms ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
