/* ==========================================================================
   Best Zen Pets - Global Stylesheet
   Mobile-first, 2-col grid, sticky top nav, pet + zen theme
   ========================================================================== */

/* --- 1. CSS variables (theme tokens) --- */
:root {
  --color-primary: #FFB6B9;       /* sakura pink */
  --color-secondary: #FAE3D9;     /* cream */
  --color-accent: #BBDED6;        /* mint */
  --color-bg: #FFFAF0;            /* cream background */
  --color-ink: #4A4A4A;           /* soft black */
  --color-ink-soft: #7A7A7A;
  --color-line: #F0D9D0;
  --color-danger: #FF8A95;
  --color-success: #88C9A1;
  --color-warn: #F2B66B;

  --gradient: linear-gradient(135deg, #FFB6B9 0%, #FAE3D9 100%);
  --gradient-soft: linear-gradient(135deg, #FFE4E5 0%, #FFF8F1 100%);
  --gradient-cool: linear-gradient(135deg, #BBDED6 0%, #FAE3D9 100%);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 6px rgba(255, 182, 185, 0.18);
  --shadow-md: 0 8px 24px rgba(255, 182, 185, 0.22);
  --shadow-lg: 0 16px 40px rgba(255, 182, 185, 0.28);

  --nav-height: 64px;
  --grid-cols: 2;

  --font-title: 'Fredoka One', 'Quicksand', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- 2. Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-ink);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--color-ink); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 400;
  margin: 0 0 0.5em;
  color: var(--color-ink);
  line-height: 1.2;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* --- 3. Layout container (full width, no phone frame) --- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 0 12px 80px;
}
main > section { margin-top: 16px; }
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* --- 4. Top navigation (sticky) --- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--nav-height);
  padding: 0 14px;
  background: rgba(255, 250, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
  box-shadow: 0 2px 12px rgba(255, 182, 185, 0.08);
}
.top-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  color: var(--color-ink);
  white-space: nowrap;
}
.top-nav-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.top-nav-logo-text {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.top-nav-pills {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-nav-pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-secondary);
  color: var(--color-ink);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
}
.pill:hover { background: var(--color-primary); color: #fff; }
.pill.is-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 182, 185, 0.4);
}
.top-nav-search {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* --- 5. Hero / banner --- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 20px 26px;
  background: var(--gradient);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}
.hero::before { width: 120px; height: 120px; top: -40px; right: -30px; }
.hero::after { width: 80px; height: 80px; bottom: -20px; left: 30%; animation-delay: 1.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-14px) translateX(8px); }
}
.hero h1 {
  color: #fff;
  font-size: 1.7rem;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(74, 74, 74, 0.18);
}
.hero p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
  max-width: 80%;
}
.hero-emoji {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(-50%) rotate(-4deg); }
  50% { transform: translateY(-58%) rotate(4deg); }
}

/* --- 6. Section title --- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 12px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--color-ink);
}
.section-title::before {
  content: '';
  width: 5px;
  height: 22px;
  border-radius: 4px;
  background: var(--gradient);
  margin-right: 8px;
}
.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title-link {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  font-weight: 600;
  font-family: var(--font-body);
}
.section-title-link:hover { color: var(--color-primary); }

/* --- 7. Game card grid (always 2 columns) --- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 12px;
}
.game-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--color-ink);
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--color-ink);
}
.game-card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.game-card-thumb svg { width: 100%; height: 100%; }
.game-card-body {
  padding: 10px 12px 12px;
}
.game-card-title {
  font-size: 0.95rem;
  margin: 0 0 4px;
  font-family: var(--font-title);
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.78rem;
}
.game-card-rating {
  color: #F2B66B;
  letter-spacing: 1px;
  font-size: 0.85rem;
}
.game-card-rating em {
  color: var(--color-ink-soft);
  font-style: normal;
  font-size: 0.78rem;
  margin-left: 4px;
}
.game-card-stats {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--color-ink-soft);
}

/* --- 8. Category chips (horizontal scroll) --- */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-ink);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--color-line);
  transition: all 0.2s;
}
.chip:hover, .chip.is-active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* --- 9. Ad slots (AdX / AdSense) --- */
.ad-slot {
  margin: 16px auto;
  padding: 0;
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(45deg, #FFF5F0, #FFF5F0 8px, #FFE9DF 8px, #FFE9DF 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--color-ink-soft);
  font-size: 0.75rem;
  overflow: hidden;
}
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot--billboard { min-height: 250px; }
.ad-slot--rectangle { min-height: 250px; }
.ad-slot--halfpage { min-height: 600px; }
.ad-slot--mobile-leaderboard { min-height: 50px; }
.ad-slot-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--color-ink-soft);
}
.ad-slot-placeholder {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* --- 10. Anchor (sticky) bottom ad --- */
.ad-anchor {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--color-line);
  transition: transform 0.3s ease;
  transform: translateY(100%);
}
.ad-anchor.is-open { transform: translateY(0); }
.ad-anchor-inner {
  position: relative;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ad-anchor-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.65rem;
  color: var(--color-ink-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ad-anchor-close {
  position: absolute;
  top: 2px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-ink);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ad-anchor-close:hover { background: var(--color-primary); color: #fff; }
.ad-anchor-handle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 59;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.05em;
}

/* --- 11. Footer --- */
.site-footer {
  margin-top: 32px;
  padding: 24px 16px 20px;
  background: var(--gradient-soft);
  border-top: 1px solid var(--color-line);
  color: var(--color-ink);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}
.footer-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--color-ink);
}
.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  margin: 0;
}
.site-footer ul li {
  margin-bottom: 4px;
}
.site-footer ul a {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
}
.site-footer ul a:hover { color: var(--color-primary); }
.footer-bottom {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  padding-top: 12px;
  border-top: 1px solid rgba(255, 182, 185, 0.2);
}

/* --- 12. Detail page --- */
.detail-hero {
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.detail-hero h1 {
  font-size: 1.6rem;
  margin: 8px 0 4px;
}
.detail-hero p {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(74, 74, 74, 0.85);
}
.detail-hero-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.detail-hero-thumb svg { width: 100%; height: 100%; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.detail-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  border: 1px solid var(--color-line);
  color: var(--color-ink);
}
.detail-pill-icon { font-size: 1rem; }
.play-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-family: var(--font-title);
  color: #fff;
  background: var(--gradient);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 14px 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.play-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}
.detail-section {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
}
.detail-section h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.detail-section p { font-size: 0.95rem; }
.how-list {
  padding-left: 4px;
  margin: 0;
}
.how-list li {
  position: relative;
  padding: 8px 0 8px 32px;
  border-bottom: 1px dashed var(--color-line);
  font-size: 0.9rem;
}
.how-list li:last-child { border-bottom: none; }
.how-list li::before {
  content: counter(how);
  counter-increment: how;
  position: absolute;
  left: 0;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.how-list { counter-reset: how; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px;
  background: var(--color-secondary);
  color: var(--color-ink);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
}
.tag:hover { background: var(--color-primary); color: #fff; }

/* --- 13. Comments --- */
.comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-line);
}
.comment:last-child { border-bottom: none; }
.comment-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.85rem;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.comment-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-ink);
}
.comment-stars {
  color: #F2B66B;
  letter-spacing: 1px;
  font-size: 0.78rem;
}
.comment-text {
  font-size: 0.86rem;
  color: var(--color-ink);
  margin: 0 0 2px;
}
.comment-date {
  font-size: 0.72rem;
  color: var(--color-ink-soft);
}

/* --- 14. Play page (iframe host) --- */
.play-shell {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.play-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--gradient);
  color: #fff;
  height: 56px;
}
.play-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.play-title { font-family: var(--font-title); font-size: 1rem; }
.play-frame {
  flex: 1;
  border: none;
  background: #fff;
  width: 100%;
}
.play-anchor-bottom {
  flex-shrink: 0;
  padding: 8px;
  background: #fff;
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: center;
}

/* --- 15. Forms (contact) --- */
.form-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--color-ink);
}
.form-row input, .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 182, 185, 0.2);
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form-submit {
  display: inline-block;
  padding: 12px 28px;
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-pill);
  font-family: var(--font-title);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.form-submit:hover { transform: translateY(-2px); color: #fff; }
.form-status {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.form-status.is-success { background: rgba(136, 201, 161, 0.15); color: #4F7A5E; }
.form-status.is-error { background: rgba(255, 138, 149, 0.15); color: #A04050; }

/* --- 16. Legal page (privacy / terms) --- */
.legal-content {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}
.legal-content h2 {
  font-size: 1.05rem;
  margin-top: 18px;
  margin-bottom: 6px;
  color: var(--color-ink);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { margin: 0 0 10px; }
.legal-content ul {
  list-style: disc;
  padding-left: 22px;
  margin: 0 0 12px;
}
.legal-content ul li { margin-bottom: 4px; }

/* --- 17. 404 page --- */
.error-404 {
  text-align: center;
  padding: 60px 20px;
}
.error-404 h1 {
  font-size: 6rem;
  color: var(--color-primary);
  margin: 0;
  line-height: 1;
}
.error-404 p { font-size: 1.1rem; margin-bottom: 20px; }
.error-404 .play-cta { width: auto; padding: 14px 32px; display: inline-flex; }

/* --- 18. Loading & utility --- */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-ink-soft);
}
.loader-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  animation: pulse 1.2s ease-in-out infinite;
  margin-bottom: 10px;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 182, 185, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 16px rgba(255, 182, 185, 0); }
}
.muted { color: var(--color-ink-soft); }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.hidden { display: none !important; }

/* --- 19. Particle / floating decoration --- */
.particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle-field .p {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  animation: drift 8s linear infinite;
}
.particle-field .p:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.particle-field .p:nth-child(2) { left: 70%; top: 60%; width: 8px; height: 8px; animation-delay: 1s; }
.particle-field .p:nth-child(3) { left: 30%; top: 80%; width: 14px; height: 14px; animation-delay: 2.5s; }
.particle-field .p:nth-child(4) { left: 80%; top: 30%; width: 10px; height: 10px; animation-delay: 4s; }
.particle-field .p:nth-child(5) { left: 50%; top: 10%; width: 6px; height: 6px; animation-delay: 5.5s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(20px, -20px) scale(1.2); opacity: 1; }
  100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
}

/* --- 20. Misc page elements --- */
.kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--color-secondary);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
  border: 1px solid var(--color-line);
}
.list-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 30;
  background: var(--color-bg);
  padding: 10px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-line);
}
.list-toolbar-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.list-toolbar-row::-webkit-scrollbar { display: none; }
.list-toolbar-row .chip { font-size: 0.82rem; padding: 6px 12px; }

.related-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.related-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  color: var(--color-ink);
}
.related-card:hover { color: var(--color-ink); transform: translateY(-2px); }
.related-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.related-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.tab-row {
  display: flex;
  gap: 4px;
  background: var(--color-secondary);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.tab-row .tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-ink);
  transition: all 0.2s;
}
.tab-row .tab.is-active {
  background: #fff;
  box-shadow: 0 2px 6px rgba(255, 182, 185, 0.2);
  color: var(--color-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge--accent { background: var(--color-accent); color: #fff; }
.badge--soft { background: var(--color-secondary); color: var(--color-ink); }

/* --- 21. List view - masonry (still 2 cols, no breakpoint) --- */
.masonry { columns: 2; column-gap: 12px; }
.masonry .game-card { break-inside: avoid; margin-bottom: 12px; }

/* --- 22. Animations utility --- */
.fade-in { animation: fadeIn 0.4s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.pop { animation: pop 0.3s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- 23. Responsive (small screens only) --- */
@media (max-width: 539px) {
  :root { --nav-height: 56px; }
  .top-nav { padding: 0 10px; gap: 8px; }
  .top-nav-logo-text { font-size: 0.95rem; }
  .pill { padding: 6px 10px; font-size: 0.78rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero-emoji { font-size: 48px; right: 10px; }
  .game-card-title { font-size: 0.88rem; }
  .game-card-stats { font-size: 0.68rem; }
  .list-toolbar { top: 56px; }
  .footer-grid { gap: 14px; }
  main { padding: 0 10px 90px; }
}
@media (min-width: 540px) {
  main { max-width: 720px; margin: 0 auto; }
  .site-footer { padding: 28px 20px 22px; }
}

/* --- 24. Game-specific helpers (used by iframe games) --- */
.game-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.game-stage * { box-sizing: border-box; }
.game-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.92), rgba(255,255,255,0.0));
  pointer-events: none;
}
.game-hud > * { pointer-events: auto; }
.game-hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.game-hud-btn {
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: var(--shadow-sm);
}
.game-hud-btn:hover { color: #fff; }
.game-toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 74, 74, 0.85);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 20;
  pointer-events: none;
  animation: toast-pop 0.3s ease both;
}
@keyframes toast-pop {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 250, 240, 0.95);
  padding: 24px;
  text-align: center;
}
.game-overlay h2 {
  font-family: var(--font-title);
  color: var(--color-ink);
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.game-overlay p {
  color: var(--color-ink-soft);
  margin-bottom: 18px;
}
.game-overlay .play-cta {
  width: auto;
  padding: 12px 32px;
  display: inline-flex;
}
.game-grid-bg {
  background: linear-gradient(180deg, #FFFAF0 0%, #FFE9DF 100%);
}
.game-bg-sky {
  background: linear-gradient(180deg, #BBDED6 0%, #FAE3D9 100%);
}
.game-bg-grass {
  background: linear-gradient(180deg, #BDE0FE 0%, #BBDED6 60%, #FAE3D9 100%);
}

/* --- 25. Soft scrollbar + selection --- */
::selection { background: rgba(255, 182, 185, 0.4); color: var(--color-ink); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }
