/* ============================================================
   Snuggle Zen — Cozy H5 Game Portal Stylesheet
   Theme: caramel, honey, pumpkin on cream
   Layout: mobile-first 2-col grid, no PC phone-frame (per
   yazhei 2026-08-27 template revision)
   ============================================================ */

:root {
  --c-caramel: #D4A373;
  --c-honey: #E9C46A;
  --c-pumpkin: #F4A261;
  --c-cream: #FAF3E0;
  --c-cream-2: #FFE8D6;
  --c-warm-brown: #5C3D2E;
  --c-soft-brown: #8B5E3C;
  --c-rose: #E76F51;
  --c-shadow: rgba(92, 61, 46, 0.12);
  --c-shadow-deep: rgba(92, 61, 46, 0.22);
  --c-card: #FFFBF1;
  --c-line: #F1E2C7;
  --c-text: #5C3D2E;
  --c-text-soft: #8B6F5C;
  --c-text-mute: #B69A82;
  --c-success: #6A9A5C;
  --c-link: #C97B4A;

  --grad-hero: linear-gradient(135deg, #FFE8D6 0%, #E9C46A 100%);
  --grad-cozy: linear-gradient(135deg, #D4A373 0%, #F4A261 100%);
  --grad-soft: linear-gradient(180deg, #FFFBF1 0%, #FFE8D6 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --shadow-soft: 0 4px 12px rgba(92, 61, 46, 0.08);
  --shadow-card: 0 6px 18px rgba(92, 61, 46, 0.10);
  --shadow-pop: 0 10px 30px rgba(92, 61, 46, 0.18);

  --grid-cols: 2;
  --max-w: 100%;

  --top-nav-h: 60px;
  --footer-h: 80px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-cream);
  color: var(--c-text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--c-cream);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 162, 97, 0.10), transparent 38%),
    radial-gradient(circle at 88% 72%, rgba(233, 196, 106, 0.12), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(212, 163, 115, 0.10), transparent 50%);
}

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

h1, h2, h3, h4 {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  color: var(--c-warm-brown);
  margin: 0 0 0.5em 0;
  letter-spacing: 0.2px;
  font-weight: 400;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p { margin: 0 0 0.8em 0; }

/* ===== Top Navigation (sticky) ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 241, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-line);
  height: var(--top-nav-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fredoka One', sans-serif;
  font-size: 18px;
  color: var(--c-warm-brown);
  text-decoration: none;
  flex-shrink: 0;
}
.topnav .brand:hover { text-decoration: none; }
.topnav .brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
}
.topnav .nav-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.topnav .pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-warm-brown);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.topnav .pill:hover { background: var(--c-cream-2); text-decoration: none; }
.topnav .pill.active {
  background: var(--grad-cozy);
  color: #FFFBF1;
  box-shadow: var(--shadow-soft);
}
.topnav .pill.ghost {
  border-color: var(--c-line);
}

/* ===== Main container ===== */
main {
  max-width: var(--max-w);
  margin: 0;
  padding: 16px 14px 100px;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* ===== Hero ===== */
.hero {
  background: var(--grad-hero);
  border-radius: var(--radius-xl);
  padding: 22px 20px 26px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 251, 241, 0.55), transparent 60%);
  border-radius: 50%;
  animation: breathe 6s ease-in-out infinite;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(244, 162, 97, 0.40), transparent 60%);
  border-radius: 50%;
  animation: breathe 7s ease-in-out infinite reverse;
}
.hero h1 {
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 6px 0;
  position: relative;
}
.hero p {
  font-size: 14px;
  color: var(--c-soft-brown);
  margin: 0 0 12px 0;
  position: relative;
}
.hero .hero-stats {
  display: flex;
  gap: 16px;
  position: relative;
  font-size: 12px;
  color: var(--c-warm-brown);
  font-weight: 700;
}
.hero .hero-stats span::before {
  content: "★ ";
  color: var(--c-pumpkin);
}
.hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  background: var(--c-warm-brown);
  color: #FFFBF1;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'Fredoka One', sans-serif;
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow-pop);
  position: relative;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.hero .hero-cta:hover {
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(92, 61, 46, 0.28);
}
.hero .hero-cta::after {
  content: "→";
  font-family: 'Nunito', sans-serif;
}

/* ===== Section header ===== */
.section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.section-h h2 {
  font-size: 18px;
  margin: 0;
  color: var(--c-warm-brown);
}
.section-h .more {
  font-size: 12px;
  color: var(--c-text-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Game grid 2-col ===== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.game-card {
  background: var(--c-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, box-shadow 200ms ease;
  position: relative;
  border: 1px solid var(--c-line);
}
.game-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow: var(--shadow-pop);
}
.game-card .cover {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--grad-cozy);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.game-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-card .cover .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(92, 61, 46, 0.78);
  color: #FFFBF1;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.game-card .cover .star {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 251, 241, 0.92);
  color: var(--c-warm-brown);
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.game-card .cover .star::before { content: "★"; color: var(--c-pumpkin); }
.game-card .meta {
  padding: 10px 10px 12px;
}
.game-card .meta h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 14px;
  line-height: 1.2;
  margin: 0 0 4px 0;
  color: var(--c-warm-brown);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card .meta .desc {
  font-size: 12px;
  color: var(--c-text-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.game-card .meta .stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-text-mute);
  font-weight: 700;
}
.game-card .meta .stats .plays::before { content: "▶ "; color: var(--c-pumpkin); }
.game-card .meta .stats .likes::before { content: "♥ "; color: var(--c-rose); }

/* ===== Category pills (horizontal scroll) ===== */
.cat-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-warm-brown);
  text-decoration: none;
  white-space: nowrap;
  transition: all 160ms ease;
}
.cat-pill:hover {
  background: var(--c-cream-2);
  text-decoration: none;
}
.cat-pill.active {
  background: var(--grad-cozy);
  color: #FFFBF1;
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}

/* ===== Page header (sub pages) ===== */
.page-head {
  background: var(--grad-soft);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--c-line);
}
.page-head h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.page-head p {
  color: var(--c-text-soft);
  font-size: 13px;
  margin: 0;
}

/* ===== Toolbar (filter / sort) ===== */
.list-toolbar {
  position: sticky;
  top: var(--top-nav-h);
  background: var(--c-cream);
  z-index: 50;
  padding: 8px 0 10px;
  border-bottom: 1px solid transparent;
  margin-bottom: 8px;
}
.list-toolbar.stuck {
  border-bottom-color: var(--c-line);
  background: rgba(250, 243, 224, 0.95);
  backdrop-filter: blur(8px);
}
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.toolbar-row .count {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-warm-brown);
}
.toolbar-row .sort-btn {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--c-warm-brown);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.toolbar-row .sort-btn::after {
  content: " ↓";
  color: var(--c-pumpkin);
}

/* ===== Loading / Spinner ===== */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--c-text-soft);
  font-size: 13px;
}
.loader .pulse {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--grad-cozy);
  margin-bottom: 12px;
  animation: pulse 1.4s ease-in-out infinite;
  box-shadow: var(--shadow-soft);
}

@keyframes pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes float-soft {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(0.5deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 400ms ease both; }

/* ===== Detail page ===== */
.detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.detail .game-cover {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grad-cozy);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-card);
}
.detail .game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail .game-cover .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(92, 61, 46, 0.18);
  backdrop-filter: blur(2px);
  cursor: pointer;
  text-decoration: none;
  transition: background 200ms ease;
}
.detail .game-cover .play-overlay:hover { background: rgba(92, 61, 46, 0.32); }
.detail .game-cover .play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #FFFBF1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--c-warm-brown);
  box-shadow: var(--shadow-pop);
  animation: float 2.4s ease-in-out infinite;
}
.detail .game-cover .play-btn::after { content: "▶"; margin-left: 4px; }

.detail .info-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.detail .info-card h1 {
  font-size: 24px;
  margin: 0 0 4px;
}
.detail .info-card .subtitle {
  color: var(--c-text-soft);
  font-size: 14px;
  margin-bottom: 14px;
}
.detail .stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 16px;
}
.detail .stat-cell {
  text-align: center;
  padding: 10px 4px;
  background: var(--c-cream-2);
  border-radius: var(--radius-md);
}
.detail .stat-cell .v {
  font-family: 'Fredoka One', sans-serif;
  font-size: 18px;
  color: var(--c-warm-brown);
}
.detail .stat-cell .l {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--c-text-mute);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.detail .stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  color: var(--c-pumpkin);
  margin-bottom: 8px;
}
.detail .stars .num {
  color: var(--c-warm-brown);
  font-family: 'Fredoka One', sans-serif;
  margin-left: 6px;
  font-size: 14px;
}
.detail .stars::after {
  content: "★★★★★";
  letter-spacing: 2px;
  color: var(--c-pumpkin);
}
.detail .play-pill {
  display: block;
  width: 100%;
  background: var(--grad-cozy);
  color: #FFFBF1;
  font-family: 'Fredoka One', sans-serif;
  text-align: center;
  padding: 14px;
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  margin: 12px 0 6px;
  box-shadow: var(--shadow-pop);
  transition: transform 160ms ease;
}
.detail .play-pill:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 16px;
}
.tag {
  background: var(--c-cream-2);
  color: var(--c-warm-brown);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.how-to {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.how-to h2 { font-size: 18px; margin: 0 0 10px; }
.how-to ol {
  margin: 0;
  padding: 0 0 0 22px;
  font-size: 14px;
  color: var(--c-text);
}
.how-to ol li { margin-bottom: 6px; }
.how-to ol li::marker { color: var(--c-pumpkin); font-weight: 700; }

.desc-block {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 14px;
  box-shadow: var(--shadow-card);
}
.desc-block p { color: var(--c-text); font-size: 14px; margin: 0 0 8px; }

/* ===== Comments ===== */
.comments {
  margin-top: 18px;
}
.comments h2 { font-size: 18px; }
.comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-line);
}
.comment:last-child { border-bottom: 0; }
.comment .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}
.comment .body { flex: 1; min-width: 0; }
.comment .head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 13px;
}
.comment .name { font-weight: 700; color: var(--c-warm-brown); }
.comment .date { color: var(--c-text-mute); font-size: 11px; }
.comment .stars {
  font-size: 11px;
  color: var(--c-pumpkin);
  margin-bottom: 4px;
}
.comment .stars::after { content: "★★★★★"; letter-spacing: 1px; }
.comment .stars.s1::after { content: "★☆☆☆☆"; }
.comment .stars.s2::after { content: "★★☆☆☆"; }
.comment .stars.s3::after { content: "★★★☆☆"; }
.comment .stars.s4::after { content: "★★★★☆"; }
.comment .text {
  font-size: 13px;
  color: var(--c-text);
  line-height: 1.45;
  margin: 0;
}
.comment.top {
  background: var(--grad-soft);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--c-line);
  margin-bottom: 10px;
}
.comment.top .badge {
  background: var(--c-pumpkin);
  color: #FFFBF1;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

/* ===== Related games ===== */
.related {
  margin-top: 22px;
}
.related h2 { font-size: 18px; }

/* ===== Ad slots ===== */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  min-height: 90px;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(212, 163, 115, 0.06) 8px, rgba(212, 163, 115, 0.06) 16px), var(--c-card);
  border: 1px dashed var(--c-line);
  border-radius: var(--radius-md);
  color: var(--c-text-mute);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  position: relative;
}
.ad-slot::before {
  content: "AD";
  background: var(--c-cream-2);
  color: var(--c-warm-brown);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  position: absolute;
  top: 4px;
  left: 4px;
}
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot--rectangle { min-height: 250px; }
.ad-slot--halfpage { min-height: 300px; }
.ad-slot--billboard { min-height: 250px; }
.ad-slot--mobile-leaderboard { min-height: 100px; }

/* ===== Sticky bottom anchor (collapsed by default) ===== */
.anchor-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-card);
  border-top: 1px solid var(--c-line);
  box-shadow: 0 -4px 18px rgba(92, 61, 46, 0.10);
  z-index: 200;
  transform: translateY(0);
  transition: transform 280ms ease;
}
.anchor-ad.collapsed { transform: translateY(calc(100% - 38px)); }
.anchor-ad .anchor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 14px;
  font-size: 12px;
  color: var(--c-text-soft);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.anchor-ad .anchor-head .ad-label {
  background: var(--c-cream-2);
  color: var(--c-warm-brown);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  margin-right: 8px;
}
.anchor-ad .anchor-head .toggle {
  font-size: 18px;
  color: var(--c-warm-brown);
  transition: transform 280ms ease;
}
.anchor-ad.collapsed .anchor-head .toggle { transform: rotate(180deg); }
.anchor-ad .anchor-body {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-mute);
  font-size: 11px;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(212, 163, 115, 0.04) 8px, rgba(212, 163, 115, 0.04) 16px);
}
.anchor-spacer { height: 70px; }

/* ===== Footer ===== */
.footer {
  background: var(--c-warm-brown);
  color: #FFFBF1;
  padding: 26px 18px 24px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: 30px;
}
.footer h4 {
  color: #FFFBF1;
  font-family: 'Fredoka One', sans-serif;
  font-size: 15px;
  margin: 0 0 8px 0;
}
.footer .col {
  margin-bottom: 18px;
}
.footer p {
  color: rgba(255, 251, 241, 0.72);
  font-size: 13px;
  line-height: 1.5;
}
.footer a {
  color: #FFFBF1;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  font-size: 13px;
}
.footer a:hover { text-decoration: underline; color: var(--c-honey); }
.footer .legal {
  font-size: 11px;
  color: rgba(255, 251, 241, 0.55);
  border-top: 1px solid rgba(255, 251, 241, 0.12);
  padding-top: 14px;
  margin-top: 8px;
  text-align: center;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (min-width: 600px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* ===== Play page (iframe host) ===== */
.play-wrap {
  display: flex;
  flex-direction: column;
  background: var(--c-warm-brown);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  margin: 0 -8px;
}
.play-bar {
  background: var(--c-warm-brown);
  color: #FFFBF1;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.play-bar h1 {
  color: #FFFBF1;
  font-size: 15px;
  margin: 0;
}
.play-bar .back {
  color: #FFFBF1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 251, 241, 0.12);
}
.play-frame {
  width: 100%;
  height: 70vh;
  min-height: 480px;
  border: 0;
  display: block;
  background: var(--c-cream);
}
.play-loading {
  position: absolute;
  inset: 38px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-cream);
  z-index: 2;
  transition: opacity 400ms ease;
}
.play-loading.hidden { opacity: 0; pointer-events: none; }
.play-loading .pulse {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--grad-cozy);
  animation: pulse 1.4s ease-in-out infinite;
}
.play-meta {
  padding: 14px 16px;
  background: var(--c-card);
  color: var(--c-text);
}
.play-meta h2 { font-size: 16px; margin: 0 0 6px; }
.play-meta p { font-size: 13px; color: var(--c-text-soft); margin: 0; }

/* ===== 404 page ===== */
.error-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-top: 30px;
  box-shadow: var(--shadow-card);
}
.error-card .big {
  font-family: 'Fredoka One', sans-serif;
  font-size: 80px;
  color: var(--c-pumpkin);
  line-height: 1;
}
.error-card h1 { font-size: 22px; margin: 12px 0 8px; }
.error-card p { color: var(--c-text-soft); font-size: 14px; margin-bottom: 20px; }

/* ===== Privacy / Terms content blocks ===== */
.legal-doc {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  font-size: 14px;
  line-height: 1.65;
}
.legal-doc h2 {
  font-size: 18px;
  margin: 22px 0 8px;
}
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h3 {
  font-size: 15px;
  margin: 16px 0 6px;
  color: var(--c-warm-brown);
}
.legal-doc p { color: var(--c-text); margin-bottom: 10px; }
.legal-doc ul { padding-left: 22px; margin-bottom: 12px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--c-link); }

/* ===== Contact form ===== */
.contact-form {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-top: 12px;
}
.contact-form .field { margin-bottom: 12px; }
.contact-form label {
  display: block;
  font-size: 12px;
  color: var(--c-warm-brown);
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  border: 1px solid var(--c-line);
  background: var(--c-cream);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--c-text);
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: var(--c-caramel);
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.2);
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-cozy);
  color: #FFFBF1;
  font-family: 'Fredoka One', sans-serif;
  border: 0;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 160ms ease;
}
.contact-form .btn:hover { transform: translateY(-1px); }

.contact-info {
  background: var(--grad-soft);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 14px;
  font-size: 14px;
}
.contact-info strong { color: var(--c-warm-brown); }
.contact-info a { color: var(--c-link); }

/* ===== Featured strip (large) ===== */
.featured-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.feature-card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--c-text);
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease;
}
.feature-card:hover {
  transform: translateX(4px);
  text-decoration: none;
}
.feature-card .thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--grad-cozy);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.feature-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-card .info { flex: 1; min-width: 0; }
.feature-card .info h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 15px;
  margin: 0 0 2px;
  color: var(--c-warm-brown);
}
.feature-card .info p {
  font-size: 12px;
  color: var(--c-text-soft);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feature-card .arrow {
  color: var(--c-pumpkin);
  font-size: 20px;
  flex-shrink: 0;
}

/* ===== Particles / floating bits ===== */
.floater {
  position: absolute;
  pointer-events: none;
  font-size: 22px;
  opacity: 0.5;
  animation: float-soft 4s ease-in-out infinite;
}
.floater.s1 { top: 8%; left: 6%; animation-delay: 0s; }
.floater.s2 { top: 18%; right: 10%; animation-delay: 0.8s; }
.floater.s3 { bottom: 18%; left: 12%; animation-delay: 1.4s; }
.floater.s4 { bottom: 8%; right: 8%; animation-delay: 2.1s; }

/* ===== Misc ===== */
.divider {
  height: 1px;
  background: var(--c-line);
  margin: 16px 0;
}
.text-center { text-align: center; }
.muted { color: var(--c-text-soft); }
.small { font-size: 12px; }
.spacer-sm { height: 12px; }
.spacer-md { height: 22px; }
.hide-mobile { display: none; }
.show-mobile { display: block; }

/* ===== Forms & buttons (generic) ===== */
button { font-family: inherit; }

.glow {
  position: relative;
  overflow: hidden;
}
.glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 251, 241, 0.3), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  pointer-events: none;
}

/* ===== Masonry (used on category) ===== */
.masonry {
  column-count: 2;
  column-gap: 12px;
}
.masonry .game-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 12px;
  break-inside: avoid;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  bottom: 90px;
  background: var(--c-warm-brown);
  color: #FFFBF1;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-pop);
  z-index: 300;
  opacity: 0;
  transition: transform 300ms ease, opacity 300ms ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== Modal ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(92, 61, 46, 0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--c-card);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.modal h3 { font-size: 18px; margin: 0 0 8px; }
.modal p { color: var(--c-text-soft); font-size: 13px; margin: 0 0 14px; }
.modal .btn-row { display: flex; gap: 10px; justify-content: center; }
.modal .btn {
  border: 0;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'Fredoka One', sans-serif;
  font-size: 13px;
  cursor: pointer;
}
.modal .btn-primary { background: var(--grad-cozy); color: #FFFBF1; box-shadow: var(--shadow-soft); }
.modal .btn-ghost { background: var(--c-cream-2); color: var(--c-warm-brown); }

/* ===== Cookie banner ===== */
.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 90px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  color: var(--c-text);
  z-index: 400;
  display: none;
}
.cookie-banner.show { display: block; animation: fadeIn 360ms ease both; }
.cookie-banner .row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cookie-banner .btn {
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: 'Fredoka One', sans-serif;
  font-size: 12px;
  cursor: pointer;
}
.cookie-banner .accept { background: var(--grad-cozy); color: #FFFBF1; }
.cookie-banner .reject { background: var(--c-cream-2); color: var(--c-warm-brown); }

/* ===== Utility ===== */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ===== Print ===== */
@media print {
  .topnav, .anchor-ad, .ad-slot, .footer { display: none !important; }
  body { background: white; color: black; }
}

/* ===== Tiny mobile (≤ 380px) ===== */
@media (max-width: 380px) {
  .topnav .pill { padding: 5px 10px; font-size: 12px; }
  .topnav .brand span { display: none; }
  .hero { padding: 18px 16px 22px; }
  .hero h1 { font-size: 22px; }
  .game-card .meta h3 { font-size: 13px; }
}

/* ===== Tablet / PC — keep mobile 2-col, do NOT add phone-frame ===== */
@media (min-width: 540px) {
  :root { --grid-cols: 2; }
  main { padding: 22px 24px 100px; }
  .topnav { padding: 0 28px; }
  .footer { padding: 36px 32px 32px; }
  .featured-strip { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .topnav .nav-pills { gap: 10px; }
}
