:root{
  /* Theme variables (overridden by Game.applyTheme) */
  --bg1:#041b1c;
  --bg2:#062e2f;
  --bg3:#0b0f1a;

  --text:#ecf5f4;
  --muted:rgba(236,245,244,0.65);

  --accent:#2ee8c3;
  --accent-rgb: 46,232,195;
  --accent-soft:#CFF9F1;

  --glass:rgba(255,255,255,0.08);
  --glass-border:rgba(255,255,255,0.16);
}

*{ box-sizing:border-box; }
html, body{
  width:100%;
  height:100%;
  overflow:hidden; /* no browser scroll */
}

body{
  position:fixed;
  inset:0;
  margin:0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
  overscroll-behavior:none;
  overscroll-behavior-y:none;
  touch-action:none;
}

/* Background layers (unique look per theme without external images) */
body::before{
  content:"";
  position:fixed;
  inset:-40px;
  z-index:-2;
  pointer-events:none;
  background:
    radial-gradient(1000px 600px at 10% 10%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(900px 700px at 90% 20%, rgba(var(--accent-rgb),0.18), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(255,255,255,0.05), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  filter: saturate(1.05);
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:0.25;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.06) 0,
      rgba(255,255,255,0.06) 1px,
      transparent 1px,
      transparent 10px
    );
  mix-blend-mode: overlay;
}

button, select, input{
  -webkit-user-select:none;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

a{ color: inherit; }

/* Effects canvas must be under UI */
#fxCanvas{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
}

/* App layout */
#app{
  position:relative;
  z-index:1;
  height:100dvh;
  width:100%;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

/* Glass blocks */
.glass{
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 30px rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}

/* Header */
.topbar{
  width: min(980px, 94vw);
  margin: calc(10px + env(safe-area-inset-top)) auto 8px;
  padding: 12px 16px;
  display: flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex: 0 0 auto;
}
.app-title{ font-weight:800; letter-spacing:.03em; }
.stat{ display:flex; gap:12px; align-items:center; font-weight:600; white-space:nowrap; }

/* Brand block (icon + title) */
.app-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}
.brand-icon{
  width:32px;
  height:32px;
  object-fit:contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.45));
}

/* Screens: internal scroll, no browser scroll */
.screen{
  flex: 1 1 auto;
  min-height:0;               /* required for scroll in flex */
  width:100%;
  display:none;
  overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: 10px 10px 14px;
}
.screen.active{ display:block; }

.wrap{ width:min(980px,94vw); margin:0 auto; }
.center{ text-align:center; }

/* Bottom nav */
.bottom-nav{
  width: min(980px, 94vw);
  margin: 8px auto calc(8px + env(safe-area-inset-bottom));
  padding: 8px 10px;
  display:flex;
  justify-content:space-around;
  align-items:center;
  flex: 0 0 auto;
}
.bottom-nav .tab{
  background:transparent;
  border:0;
  padding:8px;
  opacity:.75;
  border-radius: 12px;
}
.bottom-nav .tab.active{ opacity:1; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.12) inset; }
.bottom-nav .tab img{ width:24px; height:24px; display:block; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }

/* Cards & rows */
.cards{ display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap:10px; }
.row{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:center; }

.opt{
  padding:10px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.section-title{ margin: 6px 0 10px; }
.caption{ color: var(--muted); }

/* Buttons */
.btn{
  appearance:none;
  position:relative;
  overflow:hidden;
  border:1px solid rgba(var(--accent-rgb),.45);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
  color: #fff;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  transition: transform .12s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(1px) scale(.98); }
.btn[disabled]{ opacity:.5; pointer-events:none; }

.btn.big{ padding:16px 18px; font-size:18px; width:100%; }
.btn.mini{ padding:8px 10px; font-size:12px; border-radius:10px; }

.btn.solid{
  background: radial-gradient(120% 180% at 0% 0%, rgba(var(--accent-rgb),.28), rgba(var(--accent-rgb),.05));
  border-color: rgba(var(--accent-rgb),.65);
  color:#fff;
  text-shadow:none;
}

.btn.danger{
  border-color: rgba(255,107,107,.55);
  background: radial-gradient(120% 180% at 0% 0%, rgba(255,107,107,.22), rgba(255,255,255,.02));
  color: #ffe7e7;
}

/* Badges for boosters */
.badge{
  display:inline-block;
  margin-left:6px;
  padding:2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 11px;
  font-weight: 800;
}

/* Selects */
.opt select{
  flex: 1 1 170px;
  min-width: 170px;
  appearance:none;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.18);
  color:var(--text);
  padding:8px 34px 8px 10px;
  border-radius:10px;
}
.opt select:focus{
  outline:none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15);
}

/* Arrow only on select rows (fix: no more arrows everywhere) */
.select-opt{ position:relative; }
.select-opt::after{
  content:'';
  position:absolute;
  right:12px;
  top:50%;
  width:10px;
  height:10px;
  margin-top:-5px;
  border-right:2px solid var(--text);
  border-bottom:2px solid var(--text);
  transform:rotate(45deg);
  opacity:.6;
  pointer-events:none;
}

/* Quiz */
.quiz-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.qimg{ padding:6px; border-radius:12px; margin-bottom:8px; }
.qimg img{ display:block; max-width:100%; border-radius:8px; }
.question{ padding:12px; border-radius:12px; margin-bottom:8px; font-weight:600; }
.answers{ display:grid; grid-template-columns:1fr; gap:8px; }
.answer{ padding:10px; border-radius:10px; text-align:left; color:#fff !important; text-shadow:0 1px 2px rgba(0,0,0,.5); }
.answer.correct{ outline:2px solid #42e9bf; }
.answer.wrong{ outline:2px solid #ff6b6b; }
.answer{ transition: opacity .15s ease; }
.quiz-tools, .quiz-buys{ margin-top:8px; }
.lives-timer{ margin-top:6px; text-align:center; }
#timer{ font-variant-numeric: tabular-nums; }

/* Campaign: make Start Level visible and comfortable */
.start-level-wrap{ margin: 0 auto 14px; }
.start-level{ max-width: 560px; }

/* Quiz: big NEXT button above boosters */
.quiz-next-row{ margin-top: 6px; margin-bottom: 6px; }
.btn.next-big{
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  font-size: 18px;
  border-radius: 14px;
}

/* After answering: hide boosters/buys to avoid wasting them */
#quiz.answered #quizTools,
#quiz.answered #quizBuys{
  display:none;
}

/* Season */
.season-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.season-line{ height:8px; border-radius:8px; background:rgba(255,255,255,.1); overflow:hidden; width:180px; }
.season-line i{ display:block; height:8px; background: linear-gradient(90deg, rgba(var(--accent-rgb),.8), rgba(var(--accent-rgb),.3)); }

/* Season tabs (Free / Premium) */
.season-tabs{ margin-top: 8px; }
.season-tab{ display:none; }
.season-tab.active{ display:block; }
.season-pass{ margin: 6px 0 10px; }

/* Rewards */
.reward{ padding:12px; border-radius:12px; border:1px solid rgba(255,255,255,.12); display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.reward .btn{ margin-left:auto; }

/* Claim buttons: readable on mobile */
.claim-btn{ font-size: 16px; padding: 12px 18px; font-weight: 800; }
.btn.mini.claim{ font-size: 14px; padding: 10px 12px; border-radius: 12px; }

/* Result screen buttons */
#result .row.center{ margin-top: 14px; gap: 12px; }
#result .result-btn{ min-width: 160px; font-size: 16px; padding: 12px 16px; }

/* Tabs */
.tabs{ display:flex; gap:6px; margin-bottom:8px; flex-wrap:wrap; }
.tabs .tab-btn{ border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.06); color:var(--text); border-radius:8px; padding:6px 10px; cursor:pointer; }
.tabs .tab-btn.active{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15); }

/* Leaders */
.lb-list{ margin:0; padding-left:18px; }
.lb-note{ margin-top:6px; color:var(--muted); }

/* Shop */
.shop-tabs{ margin-bottom:10px; }
.shop-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap:10px; }
.shop-card{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:10px; border-radius:12px; flex-wrap:wrap; }
.shop-card .it-ico{ width:28px; height:28px; object-fit:contain; flex: 0 0 auto; }
.shop-card .shop-left{ display:flex; gap:10px; align-items:center; flex: 1 1 200px; min-width: 0; }
.shop-card .shop-right{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; }
.shop-card b{ overflow:hidden; text-overflow:ellipsis; }
.shop-price{ display:flex; align-items:center; gap:6px; white-space:nowrap; }
.price-ico{ width:16px; height:16px; object-fit:contain; opacity:.9; }

/* Achievements progress */
.ach-progress{
  height:8px;
  border-radius:8px;
  background: rgba(255,255,255,.1);
  overflow:hidden;
  margin-top:8px;
}
.ach-progress i{
  display:block;
  height:8px;
  width:0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb),.8), rgba(var(--accent-rgb),.3));
}

/* Modal */
.modal{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.45); z-index:10; }
.modal.hidden{ display:none; }
.modal-inner{ width:min(460px,90vw); padding:18px; border-radius:16px; text-align:center; }
.modal-actions{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:12px; }
.auth-dialog-info{ text-align:left; margin-top:8px; }
.auth-dialog-intro{ margin:0 0 8px; }
.auth-dialog-list{ margin:0; padding-left:20px; display:grid; gap:6px; }

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(560px, 92vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.toast.hidden{ display:none; }

/* Campaign ring */
.ring{ position:relative; width:220px; height:220px; margin:10px auto 16px; }
.ring-glow, .ring-pulse{ position:absolute; inset:0; border-radius:100%; }
.ring-glow{ background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb),0.22), transparent 60%); filter: blur(4px); }
.ring-pulse{ border: 1px solid rgba(255,255,255,.10); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ transform: scale(1); opacity:.55; } 50%{ transform: scale(1.05); opacity:.28; } }

.ring-center{ position:absolute; inset:22px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.level-number{ font-size:52px; font-weight:800; }
.kicker{ color:var(--muted); }

/* Small screens tweaks */
@media (max-width: 520px){
  .cards{ grid-template-columns: 1fr; }
  .topbar{ padding: 10px 12px; }
  .stat{ gap: 10px; font-size: 14px; }
}


/* Booster help icon */
.help-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  margin-left:6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.45);
  color:#fff;
  font-weight:800;
  font-size:12px;
  line-height:1;
  background: rgba(255,255,255,.08);
  cursor:pointer;
  transition: transform .12s ease;
}
.help-icon:hover{ background: rgba(255,255,255,.14); }


/* ===== Home (Main menu) ===== */
.home-hero{
  position:relative;
  overflow:hidden;
  padding:0;
  border-radius:18px;
  margin: 4px 0 12px;
}
.home-hero-banner{
  width:100%;
  height:auto;
  display:block;
  /* keeps the banner consistent on different screen sizes */
  aspect-ratio: 26 / 10;
  object-fit:cover;
}
.home-hero-fx{
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(800px 260px at 65% 30%, rgba(var(--accent-rgb),0.25), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.40));
  mix-blend-mode: screen;
  opacity: .9;
}

/* Home screen sparkle layer */
.home-sparkles{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}

.home-sparkles .sparkle{
  position:absolute;
  width: var(--s, 10px);
  height: var(--s, 10px);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(.4);
  animation: sparkleTwinkle var(--d, 3.2s) ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(var(--accent-rgb), .35));
}
.home-sparkles .sparkle::before,
.home-sparkles .sparkle::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width: 100%;
  height: 22%;
  background: rgba(255,255,255,.92);
  border-radius: 999px;
  transform: translate(-50%,-50%);
}
.home-sparkles .sparkle::after{
  transform: translate(-50%,-50%) rotate(90deg);
}

@keyframes sparkleTwinkle{
  0%, 100%{ opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(.35); }
  40%{ opacity: .95; transform: translate(-50%, -50%) rotate(45deg) scale(1); }
  62%{ opacity: .2; transform: translate(-50%, -50%) rotate(45deg) scale(.6); }
}

/* Tap burst */
.home-sparkles .sparkle.burst{
  animation: sparkleBurst .85s ease-out forwards;
}
@keyframes sparkleBurst{
  from{ opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1); }
  to{
    opacity: 0;
    transform:
      translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      rotate(45deg)
      scale(.18);
  }
}

/* Owl speech bubble */
.owl-bubble{
  position:absolute;
  left: 62%;
  top: 10%;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 18, 26, .70);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
  box-shadow: 0 14px 28px rgba(0,0,0,.35);
  opacity: 0;
  transform: translate(-10%, 6px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events:none;
  z-index: 2;
}
.owl-bubble::after{
  content:"";
  position:absolute;
  left: 18px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: rgba(18, 18, 26, .70);
  border-left: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
  transform: rotate(45deg);
  backdrop-filter: blur(10px);
}
.owl-bubble.show{
  opacity: 1;
  transform: translate(-10%, 0) scale(1);
}

/* Info cards */
.home-info{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
@media (max-width: 520px){
  .home-info{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-info .info-card:last-child{ grid-column: 1 / -1; }
}

.info-card{
  color:#fff;
  display:block;
  width:100%;
  border: 1px solid rgba(255,255,255,.12);
  text-align:left;
  padding: 12px 12px 10px;
  border-radius: 14px;
  cursor:pointer;
  transition: transform .12s ease;
  min-height: 86px;
}
.info-card:hover{ transform: translateY(-1px); }
.info-card:active{ transform: translateY(0); }

.info-top{
  display:flex;
  align-items:center;
  gap: 8px;
}
.info-ico{
  width: 18px;
  height: 18px;
  opacity: .95;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
}
.info-label{
  font-size: 12px;
  color: rgba(255,255,255,.75);
  letter-spacing: .2px;
}
.info-main{
  margin-top: 6px;
   color:#fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}
.info-sub{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.mini-progress{
  margin-top: 8px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,.10);
  overflow:hidden;
}
.mini-progress i{
  display:block;
  height:100%;
  width: 0%;
  background: rgba(var(--accent-rgb), .75);
}
.home-hero-owl{
	min-height: 160px;
  position:absolute;
  left: -2%;
  bottom: -18%;
  width: clamp(170px, 42vw, 320px);
  aspect-ratio: 600 / 438;
  border:0;
  padding:0;
  background: transparent;
  cursor:pointer;
  transition: transform .12s ease;
  pointer-events:auto;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 22px 36px rgba(0,0,0,.55));
  animation: heroFloat 3.8s ease-in-out infinite;
  overflow:hidden;
  z-index: 5;
}
.home-hero-owl .owl-strip{
  height:100%;
  width:auto;
  display:block;
  user-select:none;
  pointer-events:none;
  will-change: transform;
  transform: translateX(0);
  /* Slower base loop: should feel "alive", not like fast blinking */
  animation: owlFrames 4.6s steps(18) infinite;
}

.home-hero-owl.excited{
  animation: heroFloat 3.8s ease-in-out infinite, owlWiggle .65s ease-in-out 1;
}
.home-hero-owl.excited .owl-strip{
  animation-duration: 2.1s;
}

@keyframes owlFrames{
  from{ transform: translateX(0); }
  to{ transform: translateX(-94.4444%); } /* (frames-1)/frames for 18 frames */
}
@keyframes owlWiggle{
  0%{ transform: translateY(0) rotate(0deg) scale(1); }
  25%{ transform: translateY(-6px) rotate(-4deg) scale(1.02); }
  55%{ transform: translateY(2px) rotate(3deg) scale(1.01); }
  100%{ transform: translateY(0) rotate(0deg) scale(1); }
}

/* Dust particles that "settle" on UI buttons */
.dust{
  position:absolute;
  left:0; top:0;
  width:6px; height:6px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255, 210, 120, .75) 45%, rgba(255,255,255,0) 70%);
  opacity:.95;
  filter: blur(.1px) drop-shadow(0 0 8px rgba(255,210,120,.35));
  transform: translate(var(--dx,0px), var(--dy,0px)) scale(var(--sc,1));
  animation: dustFall var(--dur, 900ms) ease-out forwards;
  pointer-events:none;
  z-index: 9;
}
@keyframes dustFall{
  0%{ opacity:0; transform: translate(var(--dx,0px), calc(var(--dy,0px) - 14px)) scale(calc(var(--sc,1) * .9)); }
  18%{ opacity:.95; }
  100%{ opacity:0; transform: translate(var(--dx,0px), var(--dy,0px)) scale(calc(var(--sc,1) * 1.08)); }
}

/* Magical sheen when dust lands */
.btn.sheen::after{
  content:'';
  position:absolute;
  inset:-40% -60%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.32) 45%, rgba(255,255,255,0) 70%);
  transform: translateX(-120%);
  opacity:0;
  pointer-events:none;
  border-radius: inherit;
}
.btn.sheen{
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}
.btn.sheen::after{
  animation: btnSheen 650ms ease-out 1;
}
/* Magical sheen when dust lands (info cards too) */
.info-card.sheen::after{
  content:'';
  position:absolute;
  inset:-40% -60%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.28) 45%, rgba(255,255,255,0) 70%);
  transform: translateX(-120%);
  opacity:0;
  pointer-events:none;
  border-radius: inherit;
}
.info-card.sheen{
  position: relative;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}
.info-card.sheen::after{
  animation: btnSheen 650ms ease-out 1;
}

@keyframes btnSheen{
  0%{ transform: translateX(-120%); opacity:0; }
  30%{ opacity:1; }
  100%{ transform: translateX(120%); opacity:0; }
}

/* Settings sliders */
.opt input[type="range"]{
  width: 180px;
  accent-color: rgba(var(--accent-rgb), .85);
}

/* Layered parallax scene inside Home hero */
.home-hero{ position:relative; overflow:hidden; }
.home-hero-layers{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
}
.home-hero-banner{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  transform: translate(calc(var(--px, 0px) * .60), calc(var(--py, 0px) * .60)) scale(1.03);
  filter: saturate(1.02);
}
.home-hero-mist{
  position:absolute;
  inset:-10% -10% -10% -10%;
  background:
    radial-gradient(closest-side at 25% 35%, rgba(255,255,255,.10), rgba(255,255,255,0) 65%),
    radial-gradient(closest-side at 75% 55%, rgba(255,255,255,.08), rgba(255,255,255,0) 62%),
    radial-gradient(closest-side at 55% 20%, rgba(255,255,255,.06), rgba(255,255,255,0) 60%);
  opacity: .65;
  transform: translate(calc(var(--px, 0px) * .92), calc(var(--py, 0px) * .92));
  filter: blur(10px);
  mix-blend-mode: screen;
}
.home-hero-glow{
  position:absolute;
  inset:0;
  background:
    radial-gradient(closest-side at 60% 35%, rgba(255, 210, 120, .16), rgba(255,210,120,0) 70%),
    radial-gradient(closest-side at 45% 70%, rgba(140, 190, 255, .08), rgba(140,190,255,0) 68%);
  opacity:.8;
  transform: translate(calc(var(--px, 0px) * .35), calc(var(--py, 0px) * .35));
  pointer-events:none;
}
.wand-trail{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index: 3;
  opacity: 0;
  transition: opacity .25s ease;
}
body[data-screen="menu"] .wand-trail{ opacity: .95; }

/* Parallax for the owl itself (slightly stronger than banner) */
/* Owl parallax is applied via CSS variables consumed by keyframes (see heroFloat/owlWiggle) */

@media (prefers-reduced-motion: reduce){
  .home-hero-owl, .home-hero-owl .owl-strip{ animation: none !important; }
}
@keyframes heroFloat{
  0%{ transform: translateY(0) rotate(-1deg); }
  50%{ transform: translateY(-10px) rotate(1deg); }
  100%{ transform: translateY(0) rotate(-1deg); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .home-hero-owl{ animation:none; }
}

/* Menu buttons with icons */
.menu-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.menu-btn .btn-icon{
  width:20px;
  height:20px;
  display:block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
/* Actions grid */
.home-actions{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}
@media (min-width: 680px){
  .home-actions{ grid-template-columns: 1fr 1fr; }
}

/* Menu-specific neutral background using provided art (blurred) */
body[data-screen="menu"]::before{
  background:
    url('assets/ui/home_bg.webp') center/cover no-repeat,
    linear-gradient(160deg, var(--bg1), var(--bg2));
  background-position: calc(50% + var(--bgx, 0px)) calc(50% + var(--bgy, 0px)), center;
  filter: saturate(1.0);
}
body[data-screen="menu"]::after{ opacity:0.12; }


/* Floating stars canvas on Home (menu) */
.home-stars{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:2;
  opacity:0;
  transition: opacity .25s ease;
}
body[data-screen="menu"] .home-stars{ opacity:0.65; }
@media (prefers-reduced-motion: reduce){
  .home-stars{ display:none; }
}


/* Owl overlays for wink/smile (triggered by JS) */
.home-hero-owl{ position:relative; }
.home-hero-owl .owl-overlay{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  opacity:0;
  transform: translateZ(0);
  transition: opacity .12s ease;
  pointer-events:none;
}
.home-hero-owl.wink .owl-strip,
.home-hero-owl.smile .owl-strip{ opacity:0; }
.home-hero-owl.wink .owl-wink{ opacity:1; }
.home-hero-owl.smile .owl-smile{ opacity:1; }
@media (prefers-reduced-motion: reduce){
  .home-hero-owl .owl-overlay{ transition:none; }
}

/* ===== 2026 polish pass: home screen + header ===== */
.topbar{
  border-radius: 20px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 14px 30px rgba(0,0,0,.34);
}
.app-title{
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .02em;
}
.brand-icon{
  width: 34px;
  height: 34px;
}
.stat{
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stat-pill{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.stat-pill-lives{
  background: linear-gradient(180deg, rgba(var(--accent-rgb),.26), rgba(255,255,255,.05));
  border-color: rgba(var(--accent-rgb),.28);
}
.stat-ico{
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
.stat-pill b{
  font-size: 14px;
  line-height: 1;
}

.home-hero{
  min-height: clamp(220px, 30vw, 330px);
  margin: 6px 0 14px;
  border-radius: 22px;
  border-color: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 20px 40px rgba(0,0,0,.32);
}
.home-hero::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,10,18,.10) 0%, rgba(7,10,18,0) 22%, rgba(7,10,18,0) 100%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 26%);
  z-index: 1;
}
.home-hero-banner{
  transform: translate(calc(var(--px, 0px) * .52), calc(var(--py, 0px) * .52)) scale(1.045);
  filter: saturate(1.05) contrast(1.02);
  transform-origin: center center;
}
.home-hero-mist{
  opacity: .72;
  filter: blur(12px);
}
.home-hero-fx{
  z-index: 2;
  background:
    radial-gradient(700px 240px at 63% 36%, rgba(255, 219, 132, .18), transparent 56%),
    radial-gradient(520px 220px at 80% 18%, rgba(161, 190, 255, .11), transparent 52%),
    linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,.34));
}
.home-hero-copy{
  position: absolute;
  right: 4.2%;
  top: 12.5%;
  z-index: 4;
  width: min(44%, 390px);
  pointer-events: none;
  text-align: left;
}
.hero-kicker{
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(14,16,28,.42);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-title{
  margin: 0;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: .96;
  font-weight: 900;
  letter-spacing: -.03em;
  text-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.hero-sub{
  margin: 10px 0 0;
  max-width: 34ch;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  line-height: 1.35;
  text-shadow: 0 4px 18px rgba(0,0,0,.32);
}
.hero-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.hero-chip{
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(14,16,28,.38);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 18px rgba(0,0,0,.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.home-info{
  gap: 12px;
  margin: 12px 0 16px;
}
.info-card{
  position: relative;
  overflow: hidden;
  min-height: 98px;
  border-radius: 16px;
  padding: 13px 13px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 28px rgba(0,0,0,.26);
}
.info-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.12), rgba(255,255,255,0) 36%);
  pointer-events: none;
}
.info-card:hover{
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), .34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 32px rgba(0,0,0,.30);
}
.info-top{
  gap: 10px;
}
.info-ico{
  width: 18px;
  height: 18px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
}
.info-label{
  color: rgba(255,255,255,.78);
  font-weight: 600;
}
.info-main{
  margin-top: 8px;
  font-size: 22px;
}
.info-sub{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.75);
}
.mini-progress{
  margin-top: 10px;
  height: 7px;
}
.mini-progress i{
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .92), rgba(255, 219, 132, .68));
}

.home-actions{
  gap: 12px;
}
@media (min-width: 640px){
  .home-actions{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.menu-card{
  justify-content: flex-start;
  gap: 12px;
  min-height: 82px;
  padding: 14px 52px 14px 14px;
  text-align: left;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 28px rgba(0,0,0,.28);
}
.menu-card::after{
  content: '›';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  font-weight: 300;
  color: rgba(255,255,255,.78);
}
.menu-card:hover{
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 34px rgba(0,0,0,.34);
}
#btnCampaign,
#btnMarathon{
  min-height: 88px;
}
#btnDailyChallenge{
  grid-column: 1 / -1;
}
#btnCampaign{
  background: linear-gradient(180deg, rgba(72, 159, 255, .18), rgba(255,255,255,.05));
}
#btnMarathon{
  background: linear-gradient(180deg, rgba(255, 193, 88, .18), rgba(255,255,255,.05));
}
#btnQuick{
  background: linear-gradient(180deg, rgba(105, 222, 195, .15), rgba(255,255,255,.05));
}
#btnThemes{
  background: linear-gradient(180deg, rgba(181, 134, 255, .16), rgba(255,255,255,.05));
}
#btnDailyChallenge{
  background: linear-gradient(180deg, rgba(255, 120, 157, .16), rgba(255,255,255,.05));
}
.btn-icon-wrap{
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 16px rgba(0,0,0,.18);
}
.menu-btn .btn-icon{
  width: 22px;
  height: 22px;
  margin: 0;
}
.btn-copy{
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.btn-copy > span{
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
}
.btn-copy small{
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.25;
}

.home-hero-owl{
  left: 0.5%;
  bottom: -9%;
  width: clamp(150px, 28vw, 250px);
  min-height: 0;
  z-index: 5;
  animation: heroFloatEnhanced 3.8s ease-in-out infinite;
}
.home-hero-owl .owl-strip{
  max-width: none;
  animation: owlFramesFixed 4.8s steps(17, end) infinite;
  transform: translate3d(0,0,0);
}
.home-hero-owl.excited{
  animation: heroFloatEnhanced 3.8s ease-in-out infinite, owlWiggleEnhanced .65s ease-in-out 1;
}
.home-hero-owl.excited .owl-strip{
  animation-duration: 2.35s;
}
@keyframes owlFramesFixed{
  from{ transform: translate3d(0,0,0); }
  to{ transform: translate3d(-94.4444%,0,0); }
}
@keyframes heroFloatEnhanced{
  0%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(0) rotate(-1deg); }
  50%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(-10px) rotate(1deg); }
  100%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(0) rotate(-1deg); }
}
@keyframes owlWiggleEnhanced{
  0%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(0) rotate(0deg) scale(1); }
  25%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(-6px) rotate(-4deg) scale(1.02); }
  55%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(2px) rotate(3deg) scale(1.01); }
  100%{ transform: translate(calc(var(--px, 0px) * .14), calc(var(--py, 0px) * .14)) translateY(0) rotate(0deg) scale(1); }
}
.owl-bubble{
  z-index: 6;
}

@media (max-width: 760px){
  .home-hero-copy{
    width: min(52%, 290px);
    right: 4%;
    top: 9%;
  }
  .hero-title{
    font-size: clamp(26px, 7vw, 34px);
  }
  .hero-sub{
    font-size: 12px;
  }
  .home-hero-owl{
    width: clamp(136px, 34vw, 200px);
    left: -1%;
    bottom: -7%;
  }
}
@media (max-width: 560px){
  .topbar{
    gap: 8px;
    padding: 10px 12px;
  }
  .app-title{
    font-size: 18px;
  }
  .brand-icon{
    width: 30px;
    height: 30px;
  }
  .stat{
    gap: 6px;
  }
  .stat-pill{
    padding: 6px 9px;
    min-height: 32px;
  }
  .stat-pill b{
    font-size: 13px;
  }
  .home-hero{
    min-height: 208px;
  }
  .home-hero-copy{
    width: min(58%, 245px);
    top: 8%;
  }
  .hero-sub{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-chips{
    display: none;
  }
  .btn-copy > span{
    font-size: 16px;
  }
  .btn-copy small{
    font-size: 11px;
  }
  .info-main{
    font-size: 20px;
  }
}


/* ===== Release v7: hero CTA, focus cards, navigation polish ===== */
:where(.btn, .info-card, .focus-card, .bottom-nav .tab, .home-hero-owl){
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:where(.btn, .info-card, .focus-card, .bottom-nav .tab, .home-hero-owl):focus-visible{
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 0 5px rgba(var(--accent-rgb), .32), 0 18px 34px rgba(0,0,0,.28);
}
.btn[disabled]{
  opacity: .44;
  filter: saturate(.72);
}

.home-hero-copy{
  width: min(48%, 430px);
  top: 10.5%;
  right: 4.5%;
  z-index: 6;
  pointer-events: auto;
}
.hero-sub{
  max-width: 36ch;
  color: rgba(255,255,255,.92);
}
.hero-benefits{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top: 13px;
}
.hero-benefit{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding: 7px 10px;
  border-radius:999px;
  background: rgba(10,14,26,.44);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-benefit b{
  color:#fff;
  font-size: 14px;
}
.hero-actions{
  display:flex;
  gap:10px;
  align-items:stretch;
  margin-top: 14px;
}
.hero-actions .btn{
  min-height: 72px;
  border-radius: 16px;
}
.hero-play-btn,
.hero-side-btn{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:4px;
  text-align:left;
}
.hero-play-btn{
  flex: 1 1 0;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 16px 30px rgba(0,0,0,.30);
}
.hero-play-btn > span,
.hero-side-btn > span{
  font-size: 17px;
  font-weight: 900;
  line-height: 1.05;
}
.hero-play-btn small,
.hero-side-btn small{
  font-size: 12px;
  color: rgba(255,255,255,.78);
  line-height: 1.2;
}
.hero-side-btn{
  flex: 0 0 164px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  border-color: rgba(255,255,255,.15);
}
.hero-footnote{
  margin-top: 10px;
  max-width: 38ch;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  line-height: 1.35;
  text-shadow: 0 4px 16px rgba(0,0,0,.24);
}

.home-focus-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.focus-card{
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align:left;
  padding: 14px;
  min-height: 124px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 14px 30px rgba(0,0,0,.26);
}
.focus-card::before{
  content:'';
  position:absolute;
  inset:0;
  background: linear-gradient(125deg, rgba(255,255,255,.12), rgba(255,255,255,0) 38%);
  pointer-events:none;
}
.focus-card:hover{
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), .32);
}
.focus-top{
  display:flex;
  align-items:center;
  gap:10px;
}
.focus-ico{
  width:18px;
  height:18px;
  padding:8px;
  border-radius:12px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.20));
}
.focus-label{
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 700;
}
.focus-main{
  margin-top: 10px;
  color:#fff;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 850;
}
.focus-sub{
  margin-top: 8px;
  color: rgba(255,255,255,.74);
  font-size: 12px;
  line-height: 1.35;
}
.focus-card .mini-progress{
  margin-top: 12px;
}
.focus-card .mini-progress i{
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .95), rgba(255, 214, 117, .72));
}

.info-card,
.menu-card,
.focus-card{
  transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease, background .18s ease;
}
.menu-card:hover,
.menu-card:focus-visible{
  border-color: rgba(var(--accent-rgb), .34);
}
.menu-card:active,
.info-card:active,
.focus-card:active,
.bottom-nav .tab:active{
  transform: translateY(1px) scale(.985);
}
.menu-card small{
  max-width: 28ch;
}

.bottom-nav{
  margin: 10px auto calc(10px + env(safe-area-inset-bottom));
  padding: 10px 12px;
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 34px rgba(0,0,0,.26);
}
.bottom-nav .tab{
  position:relative;
  min-width: 44px;
  min-height: 44px;
  display:grid;
  place-items:center;
  opacity:.82;
  border-radius: 14px;
  transition: transform .12s ease, opacity .12s ease, background .16s ease, box-shadow .16s ease;
}
.bottom-nav .tab::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  opacity:0;
  transition: opacity .16s ease;
}
.bottom-nav .tab:hover::before,
.bottom-nav .tab.active::before{
  opacity:1;
}
.bottom-nav .tab.active{
  opacity:1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(var(--accent-rgb), .18), 0 12px 24px rgba(0,0,0,.20);
}
.bottom-nav .tab.active img{
  transform: translateY(-1px) scale(1.05);
}
.bottom-nav .tab img{
  position:relative;
  transition: transform .14s ease;
}

.home-hero-owl{
  left: 0.4%;
  bottom: -6%;
  width: clamp(156px, 29vw, 248px);
}
.home-hero-owl .owl-strip{
  width:100%;
  height:100%;
  object-fit:contain;
  transform:none !important;
  animation:none !important;
  opacity:1;
}
.home-hero-owl.excited .owl-strip{
  animation:none !important;
}

@media (max-width: 760px){
  .home-hero-copy{
    width: min(62%, 315px);
    right: 4%;
    top: 8%;
  }
  .hero-benefit{
    font-size: 11px;
    padding: 6px 9px;
  }
  .hero-actions{
    flex-wrap:wrap;
  }
  .hero-side-btn{
    flex: 1 1 100%;
  }
}
@media (max-width: 620px){
  .home-focus-grid{
    grid-template-columns: 1fr;
  }
  .home-hero{
    min-height: 232px;
  }
  .home-hero-copy{
    width: min(66%, 276px);
  }
  .hero-play-btn > span,
  .hero-side-btn > span{
    font-size: 15px;
  }
  .focus-main{
    font-size: 17px;
  }
}
@media (max-width: 520px){
  .hero-benefits{
    gap:6px;
  }
  .hero-footnote{
    max-width: 26ch;
  }
  .home-info{
    gap: 10px;
  }
  .menu-card{
    min-height: 76px;
  }
  .menu-card .btn-copy > span{
    font-size: 16px;
  }
}
@media (max-width: 420px){
  .home-hero-copy{
    width: min(68%, 240px);
  }
  .hero-sub{
    font-size: 11px;
  }
  .hero-benefit{
    min-height: 28px;
  }
  .hero-actions .btn{
    min-height: 64px;
  }
}

/* ===== Release v8: mobile-first publish polish ===== */
#wandTrail{
  display:none !important;
}

.glass{
  background: linear-gradient(180deg, rgba(41, 25, 58, .56), rgba(21, 13, 33, .42));
  border-color: rgba(255,255,255,.14);
}

.topbar{
  padding: 10px 12px;
  margin: calc(10px + env(safe-area-inset-top)) auto 10px;
  border-radius: 20px;
  gap: 12px;
}
.app-brand{
  flex: 0 0 auto;
  gap: 0;
}
.app-title{
  display:none !important;
}
.brand-icon{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.14);
}
.stat{
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
.stat-pill{
  min-height: 34px;
  padding: 6px 10px;
  gap: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  border-color: rgba(255,255,255,.14);
}
.stat-pill b{
  font-size: 14px;
}
.stat-ico{
  width: 15px;
  height: 15px;
}
.stat-pill-lives{
  margin-left: 0;
}

.home-hero{
  min-height: clamp(228px, 44vw, 320px);
  margin: 8px 0 16px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(18, 12, 28, .38);
}
.home-hero::before{
  background:
    linear-gradient(180deg, rgba(15,8,24,.08), rgba(15,8,24,.28) 42%, rgba(15,8,24,.62) 100%),
    linear-gradient(90deg, rgba(20,10,30,.84) 0%, rgba(20,10,30,.64) 38%, rgba(20,10,30,.16) 76%, rgba(20,10,30,.24) 100%);
}
.home-hero-banner{
  inset: -1%;
  width: 102%;
  height: 102%;
  object-position: center 42%;
  transform: translate(calc(var(--px, 0px) * .36), calc(var(--py, 0px) * .36)) scale(1.03);
  filter: saturate(1.03) contrast(1.02) brightness(.84);
}
.home-hero-mist{
  opacity: .22;
}
.home-hero-glow{
  opacity: .48;
  mix-blend-mode: screen;
}
.home-hero-copy,
.hero-panel{
  position: relative !important;
  inset: auto !important;
  z-index: 4;
  width: min(52%, 430px);
  margin: 20px 0 20px 20px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  text-align: left;
  pointer-events: auto !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  background: linear-gradient(180deg, rgba(17,12,28,.76), rgba(17,12,28,.46));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 36px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-kicker{
  min-height: 30px;
  padding: 7px 11px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.96);
  font-size: 11px;
  letter-spacing: .08em;
}
.hero-title{
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: .94;
  font-weight: 900;
  letter-spacing: -.03em;
  text-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.hero-sub,
.hero-benefits,
.hero-footnote,
#homeSparkles,
.home-hero-fx,
.home-hero-owl,
.owl-bubble{
  display:none !important;
}
.hero-actions{
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 10px;
  align-items: stretch;
}
.hero-actions .btn{
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 16px;
}
.hero-play-btn,
.hero-side-btn{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
}
.hero-play-btn{
  background: linear-gradient(180deg, rgba(255,204,92,.26), rgba(var(--accent-rgb),.14));
  border-color: rgba(255,220,132,.44);
  box-shadow: 0 14px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.12);
}
.hero-side-btn{
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
}
.hero-play-btn > span,
.hero-side-btn > span{
  font-size: 18px;
  line-height: 1.05;
  font-weight: 850;
}
.hero-play-btn small,
.hero-side-btn small{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.78);
}

.home-focus-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.focus-card{
  min-height: 134px;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 182, 82, .18), rgba(95, 44, 22, .18));
}
.focus-main{
  margin-top: 12px;
  font-size: 21px;
}
.focus-sub{
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255,255,255,.78);
}

.home-info{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.info-card{
  min-height: 106px;
  padding: 14px 13px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(35,22,49,.66), rgba(18,12,29,.44));
}
.info-main{
  font-size: 20px;
  line-height: 1.08;
}
.info-sub{
  font-size: 12px;
  line-height: 1.35;
}

.home-actions{
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}
.menu-card{
  min-height: 84px;
  padding: 14px;
  border-radius: 18px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
}
.menu-card .btn-copy > span{
  font-size: 16px;
  font-weight: 850;
}
.menu-card small{
  font-size: 11px;
  color: rgba(255,255,255,.72);
}
#btnDailyChallenge{
  grid-column: 1 / -1;
}

.bottom-nav{
  margin: 10px auto calc(10px + env(safe-area-inset-bottom));
  padding: 10px 10px;
  gap: 2px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(49,31,63,.90), rgba(28,18,38,.78));
}
.bottom-nav .tab{
  min-width: 40px;
  min-height: 42px;
}
.bottom-nav .tab img{
  width: 22px;
  height: 22px;
}

@media (max-width: 760px){
  .home-hero-copy,
  .hero-panel{
    width: min(62%, 330px);
    margin: 16px;
    padding: 16px 16px 14px;
  }
  .home-info{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-info .info-card:last-child{
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px){
  .topbar{
    padding: 9px 10px;
    gap: 10px;
  }
  .brand-icon{
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .stat{
    gap: 4px;
  }
  .stat-pill{
    min-height: 30px;
    padding: 5px 8px;
  }
  .stat-pill b{
    font-size: 13px;
  }
  .stat-ico{
    width: 14px;
    height: 14px;
  }
  .home-hero{
    min-height: 220px;
  }
  .home-hero-copy,
  .hero-panel{
    width: min(calc(100% - 32px), 308px);
    margin: 14px;
    padding: 14px 14px 13px;
  }
  .hero-title{
    font-size: 36px;
    margin-bottom: 10px;
  }
  .hero-actions .btn{
    min-height: 64px;
    padding: 10px 12px;
  }
  .hero-play-btn > span,
  .hero-side-btn > span{
    font-size: 15px;
  }
  .hero-play-btn small,
  .hero-side-btn small{
    font-size: 11px;
  }
  .home-focus-grid{
    grid-template-columns: 1fr;
  }
  .focus-card{
    min-height: 126px;
  }
  .menu-card small{
    display:none;
  }
}

@media (max-width: 420px){
  .topbar{
    padding: 8px 9px;
  }
  .home-hero{
    min-height: 208px;
  }
  .home-hero-copy,
  .hero-panel{
    width: calc(100% - 24px);
    margin: 12px;
  }
  .hero-kicker{
    font-size: 10px;
    padding: 6px 9px;
  }
  .hero-title{
    font-size: 31px;
  }
  .hero-actions{
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .home-actions{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .menu-card{
    min-height: 78px;
    padding: 12px;
  }
  .menu-card .btn-copy > span{
    font-size: 15px;
  }
}

@media (max-width: 360px){
  .home-actions{
    grid-template-columns: 1fr;
  }
}


/* ===== Release v10: cloud-save banner/header refresh ===== */
.brand-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
  margin-left:10px;
}
.brand-title{
  font-size:13px;
  line-height:1;
  font-weight:800;
  letter-spacing:.04em;
  color:rgba(255,255,255,.96);
  text-shadow:0 2px 10px rgba(0,0,0,.32);
  white-space:nowrap;
}

.home-hero{
  min-height: clamp(232px, 43vw, 316px);
}
.home-hero::before{
  background:
    radial-gradient(circle at 50% 30%, rgba(255,214,126,.16), transparent 34%),
    linear-gradient(180deg, rgba(12,8,18,.14), rgba(12,8,18,.06) 28%, rgba(12,8,18,.24) 100%),
    linear-gradient(90deg, rgba(16,10,24,.22) 0%, rgba(16,10,24,.04) 26%, rgba(16,10,24,.04) 74%, rgba(16,10,24,.22) 100%);
}
.home-hero-banner{
  inset:-1%;
  width:102%;
  height:102%;
  object-position:center 36%;
  transform: translate(calc(var(--px, 0px) * .28), calc(var(--py, 0px) * .28)) scale(1.03);
  filter:saturate(1.04) contrast(1.01) brightness(.94);
}
.home-hero-mist{ opacity:.14; }
.home-hero-glow{ opacity:.38; }
.hero-ribbon{
  position:absolute;
  top:14px;
  left:50%;
  transform:translateX(-50%);
  z-index:5;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:7px 14px;
  margin:0;
  background:rgba(24,15,36,.50);
  border:1px solid rgba(255,255,255,.16);
  border-radius:999px;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}
.home-hero-copy,
.hero-panel{
  position:absolute !important;
  inset:auto auto 14px 50% !important;
  transform:translateX(-50%);
  z-index:4;
  width:auto;
  max-width:calc(100% - 28px);
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  align-items:center !important;
}
.hero-title,
.hero-sub,
.hero-benefits,
.hero-footnote,
#homeSparkles,
.home-hero-fx,
.home-hero-owl,
.owl-bubble{
  display:none !important;
}
.hero-actions,
.hero-actions-overlay{
  width:auto;
  display:grid;
  grid-template-columns:repeat(2, minmax(132px, 1fr));
  gap:10px;
  align-items:stretch;
  justify-content:center;
}
.hero-actions .btn{
  min-height:60px;
  padding:10px 14px;
  border-radius:16px;
}
.hero-play-btn,
.hero-side-btn{
  align-items:center;
  justify-content:center;
  text-align:center;
  background:linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,.08));
  border-color:rgba(255,255,255,.22);
  box-shadow:0 12px 22px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.hero-play-btn{
  background:linear-gradient(180deg, rgba(255,255,255,.22), rgba(var(--accent-rgb),.18));
  border-color:rgba(255,255,255,.28);
}
.hero-play-btn > span,
.hero-side-btn > span{
  font-size:16px;
  line-height:1.05;
  font-weight:850;
}
.hero-play-btn small,
.hero-side-btn small{
  margin-top:4px;
  font-size:11px;
  color:rgba(255,255,255,.82);
}

@media (max-width: 760px){
  .brand-copy{ margin-left:8px; }
  .brand-title{ font-size:12px; }
}

@media (max-width: 620px){
  .brand-copy{ margin-left:7px; }
  .brand-title{ font-size:11px; }
  .hero-ribbon{
    top:10px;
    max-width:calc(100% - 20px);
    font-size:10px;
    letter-spacing:.07em;
    padding:6px 12px;
  }
  .home-hero{
    min-height:210px;
  }
  .home-hero-banner{
    object-position:center 34%;
  }
  .home-hero-copy,
  .hero-panel{
    bottom:12px !important;
    max-width:calc(100% - 20px);
  }
  .hero-actions,
  .hero-actions-overlay{
    grid-template-columns:repeat(2, minmax(118px, 1fr));
    gap:8px;
  }
  .hero-actions .btn{
    min-height:56px;
    padding:9px 10px;
    border-radius:14px;
  }
  .hero-play-btn > span,
  .hero-side-btn > span{
    font-size:14px;
  }
  .hero-play-btn small,
  .hero-side-btn small{
    font-size:10px;
  }
}

@media (max-width: 420px){
  .hero-actions,
  .hero-actions-overlay{
    grid-template-columns:repeat(2, minmax(104px, 1fr));
  }
  .hero-actions .btn{
    min-width:0;
  }
}


/* ===== Release v11: quiz screen redesign ===== */
#quiz .wrap{
  max-width: 1100px;
}

.quiz-head{
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
}

.question{
  position: relative;
  margin-bottom: 14px;
  padding: 20px 20px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)),
    radial-gradient(140% 160% at 0% 0%, rgba(var(--accent-rgb),.18), transparent 62%);
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 800;
  line-height: 1.3;
}

.question::before{
  content: "Вопрос";
  display: block;
  width: max-content;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
}
html[lang="en"] .question::before{
  content: "Question";
}

.answers{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  justify-content: center;
  gap: 14px;
  margin: 0 auto 12px;
  width: min(100%, 560px);
}

.answer{
  position: relative;
  min-height: 88px;
  padding: 16px 16px 16px 62px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05)),
    radial-gradient(120% 180% at 0% 0%, rgba(var(--accent-rgb),.16), transparent 70%);
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.answer::before{
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.answer:nth-child(1)::before{ content:'A'; }
.answer:nth-child(2)::before{ content:'B'; }
.answer:nth-child(3)::before{ content:'C'; }
.answer:nth-child(4)::before{ content:'D'; }
.answer:hover{ box-shadow: 0 18px 38px rgba(0,0,0,.24); }
.answer.correct{
  border-color: rgba(66, 233, 191, .75);
  box-shadow: 0 0 0 2px rgba(66, 233, 191, .18), 0 18px 36px rgba(0,0,0,.22);
}
.answer.wrong{
  border-color: rgba(255, 107, 107, .8);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, .16), 0 18px 36px rgba(0,0,0,.22);
}

.quiz-next-row{
  margin-top: 8px;
  margin-bottom: 14px;
}
.btn.next-big{
  max-width: 620px;
  min-height: 58px;
  border-radius: 18px;
  font-size: 20px;
  font-weight: 800;
}

.quiz-tools{
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  margin: 12px auto 0;
  justify-content: center;
  width: min(100%, 560px);
}
.quiz-tools .btn{
  min-height: 66px;
  justify-content: center;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
}
.quiz-tools .badge{
  margin-left: 8px;
}

.quiz-buys{
  justify-content: center;
  gap: 12px;
  margin: 14px auto 0;
  width: min(100%, 560px);
  flex-wrap: wrap;
}
.quiz-buys .btn{
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
}

.lives-timer{
  margin-top: 14px;
  text-align: center;
}

.result-actions{
  gap: 12px;
}
#result .result-btn{
  min-width: 180px;
}

@media (max-width: 820px){
  .quiz-head{
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 14px;
  }
  .question{
    padding: 16px 16px 14px;
    margin-bottom: 12px;
    border-radius: 18px;
    font-size: clamp(15px, 4.8vw, 22px);
  }
  .question::before{
    margin-bottom: 8px;
    padding: 4px 10px;
    font-size: 11px;
  }
  .answers{
    grid-template-columns: repeat(2, minmax(132px, 1fr));
    width: min(100%, 500px);
    gap: 10px;
  }
  .answer{
    min-height: 72px;
    padding: 12px 12px 12px 50px;
    border-radius: 16px;
    font-size: 15px;
  }
  .answer::before{
    left: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 15px;
  }
  .quiz-next-row{
    margin-bottom: 12px;
  }
  .btn.next-big{
    max-width: 500px;
    min-height: 52px;
    border-radius: 16px;
    font-size: 18px;
  }
  .quiz-tools{
    grid-template-columns: repeat(3, minmax(0, 150px));
    width: min(100%, 500px);
    gap: 10px;
  }
  .quiz-tools .btn{
    min-height: 54px;
    padding: 10px 10px;
    border-radius: 14px;
    font-size: 13px;
  }
  .quiz-tools .badge{
    margin-left: 6px;
    padding: 2px 6px;
  }
  .quiz-buys{
    width: min(100%, 500px);
    gap: 10px;
  }
  .quiz-buys .btn{
    padding: 10px 14px;
    font-size: 13px;
  }
  .lives-timer{
    margin-top: 12px;
    font-size: 14px;
  }
  #result .result-btn{
    width: auto;
  }
}

@media (max-width: 520px){
  .answers{
    grid-template-columns: repeat(2, minmax(132px, 1fr));
    width: min(100%, 440px);
  }
  .quiz-tools{
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    width: min(100%, 360px);
  }
  .quiz-buys{
    width: min(100%, 360px);
    flex-direction: column;
    align-items: center;
  }
  .quiz-buys .btn{
    width: 100%;
    max-width: 360px;
  }
}

@media (max-width: 380px){
  .question{
    padding: 14px 14px 12px;
    font-size: clamp(15px, 4.6vw, 20px);
  }
  .answers{
    grid-template-columns: 1fr;
    width: min(100%, 320px);
  }
  .answer{
    min-height: 64px;
    padding-left: 46px;
    font-size: 14px;
  }
  .answer::before{
    width: 28px;
    height: 28px;
  }
  .quiz-tools{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 320px);
  }
  .quiz-tools .btn{
    min-height: 50px;
    font-size: 12px;
  }
  .btn.next-big,
  .quiz-buys .btn,
  #result .result-btn{
    width: min(100%, 320px);
  }
}


/* Release v15 polish */
.quiz-tools .badge{ min-width: 52px; text-align:center; }
.help-icon-accent{ color:#ffd36a; border-color: rgba(255,211,106,.55); background: rgba(255,211,106,.14); box-shadow: 0 0 0 1px rgba(255,211,106,.08) inset; }
