/* ============================================================
   Rocosta Play ΓÇö portal stylesheet
   ============================================================ */
:root {
  --bg: #0a0c12;
  --bg-soft: #141824;
  --card: #1a1f2e;
  --card-hover: #242b3f;
  --text: #f2f4fb;
  --text-dim: #9aa3b8;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-hot: #ff6b9d;
  --radius: 16px;
  --shadow: 0 12px 36px rgba(0, 0, 0, .5);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, .35);
  --header-h: 64px;
  --page-pad: clamp(12px, 2.2vw, 28px);
  --touch-min: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 92, 255, .18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 212, 255, .08), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--page-pad);
  width: 100%;
  background: rgba(10, 12, 18, .82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: .3px;
  white-space: nowrap;
}

.logo .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 18px;
}

.search-box {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: var(--bg-soft);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}

.search-box input:focus { border-color: var(--accent); }

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .5;
  pointer-events: none;
}

.header-spacer { flex: 1; }

/* ---------------- Category chips ---------------- */
.chips {
  display: flex;
  gap: 10px;
  padding: 18px var(--page-pad) 8px;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  --chip-accent: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--text-dim);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.chip .chip-emoji { font-size: 1.05rem; line-height: 1; }

.chip:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: color-mix(in srgb, var(--chip-accent) 45%, rgba(255, 255, 255, .15));
  transform: translateY(-1px);
}

.chip.active {
  background: linear-gradient(135deg, var(--chip-accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--chip-accent) 35%, transparent);
}

/* ---------------- Section titles ---------------- */
.section-title {
  width: 100%;
  margin: 14px 0 0;
  padding: 0 var(--page-pad);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-inline {
  margin: 0 0 12px;
  padding: 0;
}

.section-icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* ---------------- New / Fresh rails ---------------- */
.new-wrap,
.fresh-wrap {
  width: 100%;
  margin: 4px 0 0;
}

.section-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0;
  margin-left: 4px;
}

.new-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 180px);
  gap: 14px;
  overflow-x: auto;
  padding: 12px var(--page-pad) 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* ---------------- Mosaic + shared game cards ---------------- */
.mosaic-wrap {
  width: 100%;
  margin: 0 auto;
  padding: 10px var(--page-pad) 48px;
}

.mosaic {
  display: grid;
  /* Poki-like dense array of squares */
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}

/* Image-only discovery cards (no title/body overlays) */
.game-card {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow);
  outline: none;
  z-index: 2;
}

.game-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}

.game-card-media .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.game-card:hover .game-card-media .thumb {
  transform: scale(1.05);
}

/* Company logo as first grid square */
.game-card.logo-tile {
  box-shadow: none;
}

.game-card.logo-tile:hover,
.game-card.logo-tile:focus-visible {
  transform: scale(1.03);
}

.logo-tile-inner {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #7c5cff 0%, #5a3fd4 45%, #00d4ff 130%);
}

.logo-tile-mark {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .25));
  user-select: none;
}

.game-card.ad-tile {
  cursor: default;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.game-card.ad-tile:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.game-card.ad-tile .ad-placeholder,
.game-card.ad-tile.ad-slot {
  width: 100%;
  min-height: 100%;
  aspect-ratio: 1 / 1;
}

/* Screen-reader only (SEO / a11y without visible copy) */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Poki-style home chrome: search bar only + pure square mosaic */
.site-header-minimal {
  justify-content: center;
}

.site-header-minimal .search-box {
  flex: 1;
  max-width: 520px;
}

body.home-poki .ad-leaderboard {
  margin-top: 10px;
}

body.home-poki .mosaic-wrap {
  padding-top: 12px;
  padding-bottom: 32px;
}

body.home-poki .site-footer-minimal {
  padding: 16px var(--page-pad) 28px;
  text-align: center;
}

body.home-poki .site-footer-minimal .foot-inner {
  justify-content: center;
}

body.home-poki .site-footer-minimal .foot-link {
  color: var(--text-dim);
  opacity: .55;
  font-size: .8rem;
}

body.home-poki .site-footer-minimal .foot-link:hover {
  opacity: 1;
  color: var(--text);
}

body.home-poki .empty-state {
  font-size: 1.5rem;
  opacity: .4;
  padding: 40px 12px;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}

/* ---------------- Ad slots ---------------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: .8rem;
  overflow: hidden;
  min-height: 90px;
}

.ad-slot .ad-placeholder {
  text-align: center;
  padding: 12px;
  line-height: 1.5;
}

.ad-slot .ad-placeholder b {
  display: block;
  font-size: .7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .6;
}

.ad-leaderboard {
  width: 100%;
  margin: 16px 0 0;
  padding: 0 var(--page-pad);
}

.ad-leaderboard .ad-slot { height: 90px; }

/* ---------------- Player page ---------------- */
body.play-page {
  overscroll-behavior: none;
}

.play-layout {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px var(--page-pad);
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-areas:
    "main side"
    "related related";
  gap: 20px;
}

.play-main { grid-area: main; min-width: 0; }
.play-side { grid-area: side; }
.play-related { grid-area: related; }

.game-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: calc(100vh - var(--header-h) - 120px);
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  /* Keep page scroll from fighting the game surface */
  overscroll-behavior: contain;
  touch-action: manipulation;
}

.game-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* Let the embedded game own gestures; reduces parent pan/zoom theft */
  touch-action: none;
}

.game-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
}

.game-bar h1 {
  margin: 0;
  font-size: 1.3rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-bar .cat-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { background: var(--card-hover); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.game-info {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 6px;
  line-height: 1.65;
  color: var(--text-dim);
}

.game-info h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--text);
}

.game-info .controls-line {
  margin-top: 10px;
  font-size: .9rem;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: 10px;
}

.play-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.play-side .ad-slot { min-height: 250px; }

.related h3 {
  margin: 4px 0 10px;
  font-size: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.related-grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.ad-below { margin-top: 16px; }

/* Fullscreen / immersive play */
.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  aspect-ratio: auto;
}

.game-frame-wrap:fullscreen iframe,
.game-frame-wrap:-webkit-full-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.immersive-exit {
  display: none;
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 8;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  align-items: center;
  justify-content: center;
  background: rgba(14, 16, 22, .82);
  border-color: rgba(255, 255, 255, .2);
}

body.play-immersive .immersive-exit {
  display: inline-flex;
}

/* Mobile / immersive CSS fullscreen (iOS-friendly) */
body.play-immersive.play-page {
  background: #000;
  /* Lock page rubber-band / overscroll while playing */
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
  touch-action: none;
}

body.play-immersive .play-header,
body.play-immersive .play-leaderboard,
body.play-immersive .play-side,
body.play-immersive .play-related,
body.play-immersive .game-info,
body.play-immersive .rate-bar,
body.play-immersive .ad-below,
body.play-immersive .site-footer,
body.play-immersive .anchor-ad {
  display: none !important;
}

body.play-immersive .play-layout {
  max-width: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  gap: 0;
}

body.play-immersive .play-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

body.play-immersive .game-frame-wrap {
  border-radius: 0;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  box-shadow: none;
  /* Notch / home-indicator: pad top so canvas edge isn't under status bar */
  padding-top: env(safe-area-inset-top, 0px);
  background: #000;
  touch-action: none;
}

body.play-immersive .game-frame-wrap iframe {
  /* Fill the content box below safe-area padding */
  top: env(safe-area-inset-top, 0px);
  height: calc(100% - env(safe-area-inset-top, 0px));
}

body.play-immersive .game-bar {
  position: relative;
  flex: 0 0 auto;
  z-index: 5;
  margin: 0;
  padding:
    8px max(12px, env(safe-area-inset-right, 0px))
    calc(8px + env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  background: rgba(10, 12, 18, .96);
  border-top: 1px solid rgba(255, 255, 255, .08);
  gap: 8px;
  /* Bottom chrome stays tappable above home indicator */
  min-height: calc(var(--touch-min) + 8px + env(safe-area-inset-bottom, 0px));
  touch-action: manipulation;
}

body.play-immersive .game-bar h1 {
  font-size: 0.95rem;
  flex: 1;
}

body.play-immersive .game-bar .cat-pill {
  display: none;
}

body.play-immersive .game-bar .btn {
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 28px var(--page-pad) 40px;
  color: var(--text-dim);
  font-size: .85rem;
}

.site-footer .foot-inner {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  justify-content: space-between;
}

/* ---------------- Featured hero ---------------- */
.hero {
  width: 100%;
  margin: 16px 0 0;
  padding: 0 var(--page-pad);
  position: relative;
}

.hero-card {
  position: relative;
  display: block;
  height: clamp(200px, 28vw, 320px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .08);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: heroDrift 12s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.04) translateX(0); }
  to   { transform: scale(1.1) translateX(-1.5%); }
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 12, 18, .92) 0%, rgba(10, 12, 18, .65) 45%, rgba(10, 12, 18, .1) 100%);
}

.hero-body {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 520px;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  animation: heroIn .4s ease;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hero-body .badge {
  position: static;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.hero-title {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.15;
  text-wrap: balance;
}

.hero-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: .95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--text-dim);
}

.hero-meta .stars { color: #ffc14d; letter-spacing: 2px; }
.hero-meta .dot { opacity: .5; }

.hero-play { align-self: flex-start; margin-top: 6px; }

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 0;
}

.hero-dot {
  width: 22px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  background: var(--card);
  cursor: pointer;
  transition: background .2s, width .2s;
}

.hero-dot.active {
  width: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ---------------- Top played rail ---------------- */
.top-wrap {
  width: 100%;
  margin: 8px 0 0;
}

.top-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px var(--page-pad) 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.top-card {
  position: relative;
  flex: 0 0 210px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  padding: 8px 12px 8px 8px;
  transition: background .15s, transform .15s;
}

.top-card:hover { background: var(--card-hover); transform: translateY(-2px); }

.top-card .rank {
  font-size: 1.15rem;
  font-weight: 900;
  font-style: italic;
  min-width: 22px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.top-card img {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
}

.top-card .top-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-card .top-meta strong {
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-card .top-meta span {
  font-size: .75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------------- Rating widget (play page) ---------------- */
.rate-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 10px;
  flex-wrap: wrap;
}

.rate-stars { display: flex; gap: 2px; }

.rate-stars .star {
  background: none;
  border: 0;
  font-size: 1.45rem;
  line-height: 1;
  color: #3a415a;
  cursor: pointer;
  padding: 2px;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: transform .12s, color .12s;
}

.rate-stars .star.lit { color: #ffc14d; }
.rate-stars .star.mine { text-shadow: 0 0 10px rgba(255, 193, 77, .8); }
.rate-stars .star:hover { transform: scale(1.25); color: #ffd98a; }

.rate-info {
  color: var(--text-dim);
  font-size: .85rem;
  transition: color .3s;
}

.rate-info.flash { color: #ffc14d; }

/* ---------------- Pre-game ad break ---------------- */
.ad-break {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #141824 0%, #0a0c12 100%);
}

.ad-break.open { display: flex; }

.ad-break-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(480px, 86%);
  text-align: center;
}

.ad-break-label {
  margin: 0;
  color: var(--text-dim);
  font-size: .95rem;
}

.ad-break-label b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ad-break .ad-slot {
  width: 100%;
  min-height: 250px;
}

/* ---------------- Sticky anchor ad (mobile) ---------------- */
.anchor-ad {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(14, 16, 22, .95);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.anchor-ad .ad-slot { min-height: 54px; height: 54px; }

/* ---------------- Daily challenges ---------------- */
.daily-banner {
  width: 100%;
  margin: 14px 0 0;
  padding: 0 var(--page-pad);
}

.daily-banner a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(124, 92, 255, .25), rgba(0, 212, 255, .12));
  border: 1px solid rgba(124, 92, 255, .4);
  font-weight: 700;
  transition: border-color .15s, transform .15s;
}

.daily-banner a:hover { border-color: var(--accent-2); transform: translateY(-1px); }

.daily-banner .badge-chip {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 193, 77, .15);
  color: #ffc14d;
  font-size: .8rem;
  white-space: nowrap;
}

.daily-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--page-pad) 60px;
}

.daily-wrap h1 { margin: 0 0 4px; font-size: 1.7rem; }

.daily-sub { color: var(--text-dim); margin: 0 0 4px; }

.daily-progress { color: #ffc14d; font-weight: 700; margin: 0 0 18px; }

.daily-cards { display: flex; flex-direction: column; gap: 12px; }

.daily-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  padding: 10px 16px 10px 10px;
  transition: background .15s, transform .15s;
}

.daily-card:hover { background: var(--card-hover); transform: translateY(-2px); }

.daily-card img {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
}

.daily-card .daily-body { display: flex; flex-direction: column; min-width: 0; }
.daily-card .daily-body strong { font-size: 1rem; }
.daily-card .daily-body span { color: var(--text-dim); font-size: .85rem; }

.daily-card .daily-mark {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  font-weight: 800;
  flex: none;
}

.daily-card.done { opacity: .75; }
.daily-card.done .daily-mark { background: #1d4d33; color: #4ade80; }

.daily-note { color: var(--text-dim); font-size: .9rem; line-height: 1.6; margin-top: 22px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .play-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "related"
      "side";
  }
  .related-grid,
  .related-grid-dense {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  body.show-anchor .anchor-ad { display: block; }
  body.show-anchor { padding-bottom: 76px; }

  .hero-title { font-size: 1.35rem; }
  .hero-desc { -webkit-line-clamp: 2; font-size: .88rem; }
  .hero-body { padding: 18px 16px; max-width: 100%; }
  .hero-play { min-height: var(--touch-min); display: inline-flex; align-items: center; }
  .top-card { flex: 0 0 180px; min-height: var(--touch-min); }

  /* Compact play chrome so the iframe owns most of the viewport */
  body.play-page:not(.play-immersive) {
    /* Anchor ad already pads body when shown; avoid double bounce */
    overscroll-behavior-y: none;
  }
  body.play-page:not(.play-immersive) .play-layout {
    padding: 10px var(--page-pad) 16px;
    gap: 12px;
  }
  body.play-page:not(.play-immersive) .play-header {
    height: 52px;
  }
  body.play-page:not(.play-immersive) .play-header .btn {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
  }
  body.play-page:not(.play-immersive) .play-leaderboard {
    margin-top: 8px;
  }
  body.play-page:not(.play-immersive) .play-leaderboard .ad-slot {
    height: 60px;
  }

  .game-frame-wrap {
    aspect-ratio: auto;
    /* Larger default play area when not in immersive (exit-fullscreen path) */
    height: min(72vh, 72dvh);
    max-height: none;
  }
  .game-bar { flex-wrap: wrap; gap: 10px; }
  .game-bar h1 { flex-basis: 100%; font-size: 1.15rem; }
  .game-bar .btn {
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .rate-stars .star {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
  }
}

/* Phone landscape: maximize play surface, slim bottom bar */
@media (max-width: 960px) and (orientation: landscape) {
  body.play-page:not(.play-immersive) .play-leaderboard {
    display: none;
  }
  body.play-page:not(.play-immersive) .game-frame-wrap {
    height: min(82vh, calc(100dvh - 64px));
    max-height: none;
  }
  body.play-immersive .game-bar h1 {
    max-width: 28vw;
    font-size: 0.85rem;
  }
  body.play-immersive .game-bar {
    padding-top: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    min-height: calc(44px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
  }
  body.play-immersive .game-bar .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 640px) {
  /* Mobile: exactly 3 square thumbnails per row (Poki-style) */
  .mosaic {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .game-card {
    border-radius: 12px;
  }
  .new-rail {
    grid-auto-columns: minmax(132px, 46vw);
    gap: 12px;
  }
  .search-box { max-width: none; }
  .logo span.logo-text { display: none; }
  .chip {
    min-height: 42px;
    padding: 8px 14px 8px 10px;
    font-size: .85rem;
  }
  .game-card-body { min-height: 54px; padding: 8px 10px 10px; }
  .game-card-title { font-size: .86rem; }
  body.home-poki .mosaic-wrap {
    padding: 8px 10px 40px;
  }
  body.home-poki .site-header {
    height: 56px;
    padding: 0 10px;
  }
}

@media (max-width: 400px) {
  .hero-desc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero-body { animation: none; }
}
