:root {
  --bg: #f3f8ff;
  --surface: #ffffff;
  --surface2: #eef2fb;
  --line: #dde4f3;
  --text: #22264a;
  --muted: #6b7196;
  --orange: #ff7a2f;
  --pink: #ff4f8b;
  --purple: #7c5cff;
  --blue: #2fa8ff;
  --green: #22c06e;
  --yellow: #ffc83d;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(60, 72, 140, .14);
  --topbar: rgba(255, 255, 255, .88);
  --pill: rgba(255, 255, 255, .92);
  --glow1: #ffe9d6; --glow2: #e3dcff; --glow3: #d6f5ff;
}
:root[data-theme="dark"] {
  --bg: #121428;
  --surface: #1d2140;
  --surface2: #282d52;
  --line: #333a66;
  --text: #eef0ff;
  --muted: #a5abd0;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --topbar: rgba(22, 25, 50, .9);
  --pill: rgba(29, 33, 64, .92);
  --glow1: #2a1d3a; --glow2: #1f2350; --glow3: #13314a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }   /* no double-tap zoom */
a, button { -webkit-tap-highlight-color: transparent; }
body {
  background:
    radial-gradient(circle at 8% 12%, var(--glow1) 0, transparent 30%),
    radial-gradient(circle at 92% 8%, var(--glow2) 0, transparent 28%),
    radial-gradient(circle at 80% 90%, var(--glow3) 0, transparent 32%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: Fredoka, "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.hidden { display: none !important; }

/* ---- header ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(60, 72, 140, .08);
}
.logo { text-decoration: none; font-weight: 700; font-size: 1.9rem; letter-spacing: -.02em; display: flex; }
.logo span { display: inline-block; transition: transform .2s; }
.logo span:nth-child(1) { color: var(--orange); }
.logo span:nth-child(2) { color: var(--pink); }
.logo span:nth-child(3) { color: var(--purple); }
.logo span:nth-child(4) { color: var(--blue); }
.logo span:nth-child(5) { color: var(--green); }
.logo:hover span { transform: translateY(-3px) rotate(-6deg); }
.logo:hover span:nth-child(even) { transform: translateY(2px) rotate(6deg); }
.hud { display: flex; gap: 6px; }
.chip {
  background: var(--surface2); border-radius: 999px; padding: 5px 12px;
  font-weight: 600; white-space: nowrap; font-size: .95rem;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 18px 16px 48px; flex: 1; }

/* ---- buttons ---- */
.btn {
  appearance: none; border: 0; border-radius: 16px; padding: 12px 20px;
  font: inherit; font-weight: 600; font-size: 1.05rem; cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, #ff9a4d, var(--orange)); color: #fff;
  box-shadow: 0 4px 0 #d65a17;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d65a17; }
.btn.big { font-size: 1.3rem; padding: 14px 26px; }
.btn.secondary { background: var(--surface2); color: var(--text); box-shadow: 0 4px 0 #cdd5ea; }
.btn.ad { background: linear-gradient(180deg, #9b7bff, var(--purple)); box-shadow: 0 4px 0 #5536d6; }
.btn.ad2 { background: linear-gradient(180deg, #45bcff, var(--blue)); box-shadow: 0 4px 0 #1782cc; }
.btn.whatsapp { background: #25d366; box-shadow: 0 4px 0 #18a34c; }
.btn.small-btn { padding: 8px 14px; font-size: .95rem; }
.btn.two-line { flex-direction: column; gap: 0; padding-top: 10px; padding-bottom: 10px; line-height: 1.15; }
.btn.two-line .b-main { font-size: 1.35rem; font-weight: 700; }
.btn.two-line .b-sub { font-size: .8rem; font-weight: 500; opacity: .9; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---- home ---- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, #ff8a3d, #ff4f8b 45%, #7c5cff);
  color: #fff; border-radius: 28px; padding: 26px 28px; margin-bottom: 26px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14);
}
.hero::before { width: 220px; height: 220px; right: -60px; top: -80px; }
.hero::after { width: 140px; height: 140px; right: 160px; bottom: -70px; }
.hero h1 { margin: 0 0 6px; font-size: 2.2rem; }
.hero p { margin: 0; font-size: 1.1rem; opacity: .95; }
.hero-stats { display: flex; gap: 10px; position: relative; z-index: 1; flex: 0 1 400px; }
.hero-stat { background: rgba(255, 255, 255, .22); border-radius: 18px; padding: 10px 14px; text-align: center; flex: 1; min-width: 0; }
.hero-stat b { display: block; font-size: clamp(1.05rem, 4.2vw, 1.5rem); }
@media (max-width: 600px) { .hero-stats { flex: 1 1 100%; } .hero-stat { padding: 8px 6px; font-size: .8rem; } }
.section-title { margin: 0 0 14px; font-size: 1.4rem; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 18px; }
.tile {
  background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column;
}
.tile:hover { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 16px 32px rgba(60, 72, 140, .22); }
.tile:hover .t-main { transform: scale(1.12) rotate(-6deg); }
.thumb {
  position: relative; aspect-ratio: 4 / 3; min-height: 120px; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .55) 0, transparent 38%),
    linear-gradient(135deg, var(--c1), var(--c2));
}
.thumb::before, .thumb::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .18);
}
.thumb::before { width: 120px; height: 120px; left: -30px; bottom: -40px; }
.thumb::after { width: 70px; height: 70px; right: 14px; top: -20px; }
.thumb.has-art::before, .thumb.has-art::after { display: none; }
.t-art { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.tile:hover .t-art { transform: scale(1.06); }
.t-main { font-size: 5.2rem; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .22)); transition: transform .25s; z-index: 1; }
.t-side { position: absolute; font-size: 2.2rem; z-index: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .18)); animation: bob 2.4s ease-in-out infinite; }
.t-side.s1 { left: 12%; top: 14%; }
.t-side.s2 { right: 10%; bottom: 14%; animation-delay: .8s; }
.t-side.s3 { right: 14%; top: 12%; animation-delay: 1.4s; font-size: 1.8rem; }
.t-road { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 26px, transparent 26px 50px) center / 100% 6px no-repeat, rgba(40, 46, 80, .35); }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: #fff; color: var(--pink); font-weight: 700; font-size: .78rem;
  padding: 3px 10px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
}
.tile-body { padding: 12px 16px 16px; }
.tile-body h3 { margin: 0 0 2px; font-size: 1.3rem; }
.tile-body p { margin: 0; color: var(--muted); }
.tile-best { margin-top: 6px; font-size: .85rem; font-weight: 600; color: var(--purple); }
.tile.soon { opacity: .6; pointer-events: none; }
.tile.soon .thumb { filter: grayscale(.4); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(6deg); } }
@media (max-width: 600px) {
  .hero { padding: 20px; }
  .hero h1 { font-size: 1.7rem; }
  .logo { font-size: 1.6rem; }
}

/* ---- game page ---- */
.game-page { display: flex; flex-direction: column; align-items: center; padding: 8px 8px 40px; flex: 1; overscroll-behavior: none; }
@media (max-width: 520px) {
  .game-page { padding: 6px 0 32px; }
  .stage { border-radius: 16px; }
  .howto { margin: 18px 12px 0; width: auto; }
}
.stage-wrap { width: 100%; display: flex; justify-content: center; }
.stage {
  position: relative; border-radius: 24px; overflow: hidden; background: #cdeeff;
  box-shadow: var(--shadow); user-select: none; -webkit-user-select: none;
}
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; -webkit-touch-callout: none; }
.stage-wrap:fullscreen { background: linear-gradient(160deg, #fff0e0, #e8e0ff 50%, #dff6ff); align-items: center; height: 100%; }
.stage-wrap:-webkit-full-screen { background: linear-gradient(160deg, #fff0e0, #e8e0ff 50%, #dff6ff); align-items: center; height: 100%; }
.stage-wrap:fullscreen .stage { border-radius: 0; }
.ghud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; justify-content: flex-end; pointer-events: none; }
.pill { background: var(--pill); border-radius: 999px; padding: 4px 12px; font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); border: 0; font: inherit; font-weight: 600; color: var(--text); }
.pill.pause, .pill.fs, .pill.snd { pointer-events: auto; cursor: pointer; min-width: 38px; min-height: 34px; }
.overlay {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; padding: 16px;
  background: rgba(255, 255, 255, .45); backdrop-filter: blur(4px);
}
.ov-card {
  background: var(--surface); color: var(--text); border-radius: 26px; padding: 22px 20px; width: min(330px, 100%);
  text-align: center; box-shadow: 0 14px 36px rgba(40, 50, 120, .25);
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
}
/* small screens (stage under 640 px tall): tighter screens so every button fits */
.stage.compact .overlay { padding: 10px; }
.stage.compact .ov-card { padding: 14px 14px; gap: 7px; border-radius: 22px; }
.stage.compact .ov-card h1, .stage.compact .ov-card h2 { font-size: 1.5rem; }
.stage.compact .ov-icon { font-size: 3rem; }
.stage.compact .o-score { font-size: 2.5rem; }
.stage.compact .btn.big { font-size: 1.1rem; padding: 10px 18px; }
.stage.compact .btn.two-line .b-main { font-size: 1.15rem; }
.stage.compact .btn { padding: 9px 16px; font-size: 1rem; }
.stage.compact .controls { font-size: .85rem; padding: 6px 8px; }
.ov-card h1, .ov-card h2 { margin: 0; font-size: 1.9rem; }
.ov-card p { margin: 0; }
.ov-icon { font-size: 4rem; line-height: 1; animation: bob 2s ease-in-out infinite; }
.controls { background: var(--surface2); border-radius: 14px; padding: 8px 10px; font-size: .92rem; color: var(--muted); }
.o-score { font-size: 3.4rem; font-weight: 700; line-height: 1; background: linear-gradient(90deg, var(--orange), var(--pink), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.o-coins { font-weight: 600; color: #c98a00; font-size: 1.15rem; }
/* levels: picker on the start screen, unlock panel, level-complete card */
.lv-box { display: flex; flex-direction: column; gap: 6px; }
.lv-box:empty { display: none; }
.lv-title { font-weight: 700; font-size: .95rem; }
.lv-pick { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; }
.lv-chip { flex: 0 0 auto; width: 46px; height: 52px; border-radius: 14px; border: 0; background: var(--surface2); color: var(--text); font: inherit; font-weight: 700; font-size: 1.1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.lv-chip small { font-size: .62rem; font-weight: 600; color: var(--muted); min-height: .8rem; }
.lv-chip.sel { background: linear-gradient(180deg, #ffb35c, var(--orange)); color: #fff; }
.lv-chip.sel small { color: #fff; }
.lv-chip.locked { font-size: .95rem; }
.lv-chip.locked:not(.buyable) { opacity: .45; }
.lv-chip.buyable { box-shadow: 0 0 0 2px var(--orange) inset, 0 3px 0 rgba(0,0,0,.08); }
.lv-chip.todo small { color: var(--orange); }
.lv-title.nudge { color: #fff; background: linear-gradient(90deg, var(--orange), var(--pink)); border-radius: 12px; padding: 6px 8px; animation: bob 1s ease-in-out 2; }
.lvtag { font-weight: 700; color: var(--purple); }
/* level progress: a slim line along the very top edge of the game, so it never covers anything */
.lvbar { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: rgba(0,0,0,.12); pointer-events: none; z-index: 2; }
.lvbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, var(--orange)); transition: width .25s; }
.ghud { flex-wrap: nowrap; top: 8px; gap: 5px; }
.ghud .pill { flex: 0 0 auto; white-space: nowrap; line-height: 1.25; }
.stage.compact .ghud { top: 5px; left: 6px; right: 6px; gap: 4px; }
.stage.compact .ghud .pill { padding: 2px 8px; font-size: .82rem; }
.stage.compact .pill.pause, .stage.compact .pill.fs, .stage.compact .pill.snd { min-width: 30px; min-height: 26px; }
.lv-buy { display: flex; flex-direction: column; gap: 8px; background: var(--surface2); border-radius: 16px; padding: 10px; }
.lv-need { background: #fff4d6; color: #8a5a00; border-radius: 12px; padding: 8px 10px; font-weight: 600; font-size: .92rem; }
:root[data-theme="dark"] .lv-need { background: #3a2f12; color: #ffd97a; }
.share-row { display: flex; gap: 8px; justify-content: center; }
.howto { width: min(480px, 100%); margin-top: 18px; background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow); }
.howto h2 { margin: 0 0 6px; font-size: 1.2rem; }
.howto ul { margin: 0; padding-left: 1.2em; color: var(--muted); }

/* ---- test ad screen (until Google ads are connected) ---- */
.test-ad { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; background: rgba(20, 24, 50, .85); display: grid; place-items: center; padding: 16px; }
.test-ad-box { background: #fff; border-radius: 22px; padding: 24px; text-align: center; width: min(320px, 100%); }
.test-ad-box .tag { display: inline-block; background: var(--yellow); border-radius: 8px; padding: 2px 10px; font-weight: 700; }
.test-ad-count { font-size: 3rem; font-weight: 700; color: var(--purple); }

.toast {
  position: fixed; left: 50%; top: 74px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 14px;
  font-weight: 600; z-index: 120; opacity: 0; transition: opacity .2s; pointer-events: none;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; }

footer.site { padding: 18px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 8px; }
.footer-links a { color: var(--muted); }

/* ---- navigation ---- */
.top-nav { display: flex; gap: 4px; margin-right: auto; margin-left: 10px; }
.top-nav a { text-decoration: none; font-weight: 600; padding: 6px 12px; border-radius: 12px; color: var(--muted); }
.top-nav a.on, .top-nav a:hover { color: var(--text); background: var(--surface2); }
.chip-link, .chip-btn { text-decoration: none; border: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.bottom-nav { display: none; }
@media (max-width: 380px) {
  .topbar { padding: 6px 10px; gap: 6px; }
  .logo { font-size: 1.45rem; }
  .hud { gap: 4px; }
  .chip { padding: 4px 8px; font-size: .85rem; }
  .chip-btn { display: none; }            /* dark mode stays available on the Profile page */
}
/* tablets in portrait (721-980 px): the header must fit in one row */
@media (min-width: 721px) and (max-width: 980px) {
  .top-nav { margin-left: 4px; gap: 0; }
  .top-nav a { padding: 6px 8px; font-size: .95rem; }
  .hud .chip:first-child, .chip-btn { display: none; }
}
/* a phone held sideways: a hint on the game's start screen */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) { .rotate-hint { display: block; } }
@media (max-width: 720px) {
  .top-nav { display: none; }
  .hud .chip:first-child { display: none; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--topbar); backdrop-filter: blur(10px); box-shadow: 0 -2px 12px rgba(60, 72, 140, .12);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; text-decoration: none; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 4px 0; border-radius: 12px; }
  .bottom-nav a span { font-size: 1.35rem; line-height: 1.2; }
  .bottom-nav a.on { color: var(--orange); background: var(--surface2); }
  body.has-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ---- home rows, chips, categories ---- */
.hero-text { position: relative; z-index: 1; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.row-head h2 { margin: 0; font-size: 1.35rem; }
.row-head a { font-weight: 600; color: var(--purple); text-decoration: none; }
.row-head .count { font-size: .8rem; background: var(--surface2); color: var(--muted); border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 8px 0; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; text-decoration: none; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 8px 14px; font-weight: 600; white-space: nowrap; }
.games.small { grid-template-columns: repeat(auto-fill, minmax(min(160px, 46%), 1fr)); gap: 12px; }
.tile.small .t-main { font-size: 3.4rem; }
.tile.small .t-side { font-size: 1.5rem; }
.tile.small .tile-body { padding: 8px 12px 12px; }
.tile.small .tile-body h3 { font-size: 1.05rem; }
.tile.small .tile-body p { font-size: .85rem; }
.page-title { font-size: 2rem; margin: 10px 0 6px; }
.page-lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; max-width: 760px; }
.cat-section { margin-bottom: 8px; }
.narrow-page { max-width: 820px; }
.narrow-page h2 { margin-top: 22px; }
.note { color: var(--muted); font-size: .9rem; }
.contact-mail { font-size: 1.3rem; font-weight: 600; }
.social-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 8px; }
.social { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 18px; border-radius: 16px; color: #fff; font-weight: 700; text-decoration: none; min-width: 150px; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.social small { font-weight: 500; opacity: .9; }
.social:hover { transform: translateY(-2px); }
.social.ig { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.social.tt { background: #111; }
.social.yt { background: #ff0000; }
.footer-social { margin-top: 6px; }

/* ---- daily challenge card ---- */
.daily-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--c1, #ffb03a), var(--c2, #ff4f8b)); color: #fff;
  border-radius: 24px; padding: 18px 22px; box-shadow: var(--shadow); margin-bottom: 8px;
}
.daily-card:empty { display: none; }
.dc-icon { font-size: 4rem; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .2)); }
.dc-body { flex: 1; min-width: 180px; }
.dc-body h2 { margin: 2px 0; font-size: 1.6rem; }
.dc-body p { margin: 2px 0; }
.dc-tag { font-weight: 700; font-size: .85rem; opacity: .9; text-transform: uppercase; letter-spacing: .05em; }
.daily-card .btn { background: #fff; color: var(--text); box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }

/* ---- game page info ---- */
.game-info, .similar { width: min(820px, 100%); margin-top: 20px; }
.game-info { background: var(--surface); border-radius: 22px; padding: 18px 22px; box-shadow: var(--shadow); }
.gi-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gi-head h1 { margin: 0; font-size: 1.9rem; }
.gi-meta { color: var(--muted); margin: 4px 0 8px; }
.gi-meta a { color: var(--purple); font-weight: 600; text-decoration: none; }
.game-info h2 { font-size: 1.2rem; margin: 18px 0 6px; }
.game-info p, .game-info li { color: var(--text); line-height: 1.6; }
.game-info ul { padding-left: 1.2em; margin: 0; }
.game-info details { border-top: 1px solid var(--line); padding: 8px 0; }
.game-info summary { cursor: pointer; font-weight: 600; }
.game-info details p { margin: 6px 0 0; color: var(--muted); }
.fav-btn { border: 2px solid var(--pink); background: transparent; color: var(--pink); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.fav-btn.on { background: var(--pink); color: #fff; }
@media (max-width: 520px) { .game-info, .similar { width: auto; margin-left: 12px; margin-right: 12px; } .game-info { padding: 14px 16px; } }
.ov-banner { background: #fff4d6; color: #8a5a00; border-radius: 12px; padding: 6px 10px; font-weight: 600; font-size: .92rem; }

/* ---- panels: leaderboard, profile, daily ---- */
.panel { background: var(--surface); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); margin: 16px 0; }
.panel h2 { margin: 0 0 10px; font-size: 1.25rem; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.table a { text-decoration: none; font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.stat-row div { background: var(--surface2); border-radius: 16px; padding: 10px; text-align: center; color: var(--muted); font-size: .85rem; }
.stat-row b { display: block; font-size: 1.5rem; color: var(--text); }
.pm-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.pm-top h2 { margin: 0; }
.pm-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--orange), var(--purple)); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.badge-card { background: var(--surface2); border-radius: 16px; padding: 12px; text-align: center; opacity: .55; display: flex; flex-direction: column; gap: 2px; }
.badge-card.on { opacity: 1; box-shadow: inset 0 0 0 2px var(--yellow); }
.badge-card span { font-size: 2rem; }
.badge-card small { color: var(--muted); font-size: .75rem; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-bottom: 12px; }
.field input { font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); max-width: 320px; }
.btn-row.left { justify-content: flex-start; }

/* ---- cookie notice / install bar ---- */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 560px; margin: 0 auto;
  background: var(--surface); color: var(--text); border-radius: 18px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.consent p { margin: 0; flex: 1; min-width: 200px; font-size: .92rem; }
body.has-bottom-nav .consent { bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 721px) { body.has-bottom-nav .consent { bottom: 12px; } }

/* dark mode touches */
:root[data-theme="dark"] .ov-banner { background: #3a2f12; color: #ffd97a; }
:root[data-theme="dark"] .overlay { background: rgba(10, 12, 30, .55); }
:root[data-theme="dark"] .btn.secondary { box-shadow: 0 4px 0 #14172e; }
:root[data-theme="dark"] .howto { background: var(--surface); }

/* ---- search, tags, weekly releases ---- */
.tile[data-release] { display: none !important; }           /* coming games stay hidden until their day */
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 4px 16px; margin: 0 0 18px; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.1rem; padding: 12px 0; color: var(--text); outline: none; }
.search-box:focus-within { box-shadow: 0 0 0 3px var(--purple), var(--shadow); }
.search-empty { color: var(--muted); padding: 8px 2px; }
.search-ov { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; background: rgba(20, 24, 50, .45); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12px; }
.search-panel { background: var(--bg, #f6f8ff); width: min(860px, 100%); max-height: calc(100% - 24px); overflow-y: auto; border-radius: 24px; padding: 16px; box-shadow: 0 20px 50px rgba(20, 24, 60, .35); }
.search-panel .search-box { margin-bottom: 12px; }
.search-close { border: 0; background: var(--surface2); color: var(--text); font: inherit; font-weight: 700; border-radius: 12px; padding: 6px 12px; cursor: pointer; }
.chip-search { font-size: 1rem; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.tag-chip { text-decoration: none; background: var(--surface2); color: var(--text); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.tag-chip:hover { background: var(--purple); color: #fff; }
.game-info .tag-chips { margin-top: 2px; }
.more-tags { margin-top: 30px; }
.page-title .count { font-size: .9rem; background: var(--surface2); color: var(--muted); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.coming-card { display: flex; align-items: center; gap: 16px; border-radius: 24px; padding: 18px 20px; margin: 0 0 8px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--c1), var(--c2)); box-shadow: var(--shadow); }
.coming-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -40px; top: -60px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.coming-card .cc-icon { font-size: 3.6rem; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .2)) blur(0); position: relative; }
.coming-card .cc-icon::after { content: "🔒"; position: absolute; right: -8px; bottom: -4px; font-size: 1.4rem; }
.coming-card .cc-body { flex: 1; min-width: 0; z-index: 1; }
.coming-card .cc-tag { display: inline-block; background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: .8rem; }
.coming-card h2 { margin: 4px 0 2px; font-size: 1.5rem; text-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.coming-card p { margin: 0; opacity: .95; }
.coming-card .cc-when { z-index: 1; text-align: center; background: rgba(255, 255, 255, .22); border-radius: 18px; padding: 8px 14px; font-weight: 600; font-size: .85rem; }
.coming-card .cc-when b { display: block; font-size: 1.6rem; line-height: 1.1; }
@media (max-width: 520px) { .coming-card { flex-wrap: wrap; } .coming-card .cc-when { flex: 1 1 100%; } }

/* browsers without aspect-ratio (iOS 14 and older): fixed card picture heights */
@supports not (aspect-ratio: 4 / 3) {
  .thumb { height: 180px; }
  .tile.small .thumb { height: 135px; }
}

/* tilt-to-steer switch on the start screen */
[data-tilt].on { background: linear-gradient(180deg, #9b7bff, var(--purple)); color: #fff; box-shadow: 0 4px 0 #5536d6; }
