/* =========================================================================
   Linus Marble Drop v2 — styles
   All UI lives inside #stage, a 900 x 1600 box scaled to fit the screen,
   so every px below is a virtual px and lines up exactly with the canvas.
   ========================================================================= */

@font-face{font-family:'Baloo';src:local('Baloo 2'),local('Comic Sans MS'),local('Trebuchet MS');}

*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;
  -webkit-user-select:none;user-select:none;}

html,body{width:100%;height:100%;overflow:hidden;background:#140826;
  font-family:'Baloo 2','Baloo',ui-rounded,'Segoe UI Rounded','Trebuchet MS',system-ui,sans-serif;
  touch-action:none;overscroll-behavior:none;}

canvas#cv{position:fixed;inset:0;width:100%;height:100%;display:block;}

#stage{position:fixed;top:0;left:0;width:900px;height:1600px;transform-origin:0 0;
  pointer-events:none;}
/* width/height are set from JS per layout; these are just the portrait default */
#stage > *{pointer-events:auto;}

.hidden{display:none !important;}

/* ------------------------------------------------------------- buttons */
button{font-family:inherit;border:none;cursor:pointer;color:#fff;background:none;}

.big-btn{display:flex;align-items:center;justify-content:center;gap:14px;
  width:100%;padding:24px 18px;border-radius:24px;font-size:42px;font-weight:900;
  letter-spacing:1px;color:#0d0620;position:relative;transition:transform .08s;
  box-shadow:0 8px 0 rgba(0,0,0,.35),0 14px 30px rgba(0,0,0,.4);}
.big-btn:active{transform:translateY(5px);box-shadow:0 3px 0 rgba(0,0,0,.35);}
.big-btn.play{background:linear-gradient(180deg,#7bff9e,#12d96a);}
.big-btn.endless{background:linear-gradient(180deg,#ffd36b,#ff9a2e);}
.big-btn.locked{background:linear-gradient(180deg,#6b6b80,#42424f);color:#c9c9d6;}
.big-btn small{display:block;font-size:19px;font-weight:700;opacity:.85;}
.bb-ico{font-size:40px;}

.mid-btn{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:18px 6px;border-radius:20px;font-size:22px;font-weight:800;color:#fff;
  background:linear-gradient(180deg,rgba(255,255,255,.20),rgba(255,255,255,.07));
  border:3px solid rgba(255,255,255,.28);box-shadow:0 6px 0 rgba(0,0,0,.3);transition:transform .08s;}
.mid-btn span{font-size:36px;}
.mid-btn:active{transform:translateY(4px);box-shadow:0 2px 0 rgba(0,0,0,.3);}
.mid-btn.danger{background:linear-gradient(180deg,#ff7a8a,#e01b3d);border-color:#ffb3bd;}
.btn-row{display:flex;gap:12px;}

.icon-btn{width:72px;height:72px;flex:none;border-radius:22px;font-size:38px;line-height:1;
  background:rgba(255,255,255,.14);border:3px solid rgba(255,255,255,.26);
  display:flex;align-items:center;justify-content:center;box-shadow:0 5px 0 rgba(0,0,0,.28);}
.icon-btn:active{transform:translateY(3px);box-shadow:0 2px 0 rgba(0,0,0,.28);}

.chip{display:inline-flex;align-items:center;gap:9px;padding:11px 20px;border-radius:999px;
  font-size:31px;font-weight:900;color:#fff;background:rgba(10,4,26,.62);
  border:3px solid rgba(255,255,255,.22);white-space:nowrap;}
.chip.small{font-size:26px;padding:8px 16px;}
.chip-ico{font-size:28px;}
.chip-score{border-color:#ffd93d;color:#ffe999;}
.chip-coin{border-color:#ffc93d;color:#ffe08a;}

/* ---------------------------------------------------------------- HUD */
#hud{position:absolute;top:0;left:0;right:0;height:170px;padding:16px 18px;
  display:flex;align-items:flex-start;gap:14px;
  background:linear-gradient(180deg,rgba(6,2,16,.82),rgba(6,2,16,0));}
.hud-center{flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;}
#hud-level{font-size:32px;font-weight:900;color:#fff;text-shadow:0 3px 8px rgba(0,0,0,.8);}
.starbar{position:relative;width:320px;height:40px;border-radius:999px;overflow:hidden;
  background:rgba(0,0,0,.55);border:3px solid rgba(255,255,255,.3);}
.starbar-fill{height:100%;width:0;border-radius:999px;
  background:linear-gradient(90deg,#ffd93d,#ff9a2e);transition:width .45s cubic-bezier(.2,1.4,.4,1);}
.starbar-text{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:24px;font-weight:900;color:#fff;text-shadow:0 2px 4px rgba(0,0,0,.9);}
.hud-right{display:flex;flex-direction:column;gap:8px;align-items:flex-end;}
#hud-hearts{position:absolute;top:96px;left:110px;font-size:40px;letter-spacing:4px;
  text-shadow:0 3px 6px rgba(0,0,0,.7);}
#streakBadge{position:absolute;top:178px;right:22px;padding:10px 22px;border-radius:999px;
  font-size:30px;font-weight:900;color:#1a0a00;background:linear-gradient(180deg,#ffe36b,#ff8a1f);
  box-shadow:0 0 26px rgba(255,170,40,.9);animation:pulseBadge .7s infinite alternate;}
@keyframes pulseBadge{from{transform:scale(1)}to{transform:scale(1.09)}}
#feverBanner{position:absolute;top:178px;left:50%;transform:translateX(-50%);
  padding:12px 34px;border-radius:999px;font-size:34px;font-weight:900;color:#fff;
  background:linear-gradient(90deg,#ff2d55,#ff9a2e,#ffd93d,#ff2d55);background-size:300% 100%;
  animation:feverSlide 1.1s linear infinite;box-shadow:0 0 40px rgba(255,90,40,.9);}
@keyframes feverSlide{to{background-position:300% 0}}
.hud-btn{width:66px;height:66px;border-radius:20px;font-size:36px;font-weight:900;
  background:rgba(255,255,255,.16);border:3px solid rgba(255,255,255,.3);}

/* ------------------------------------------------------------- screens */
.screen{position:absolute;inset:0;display:none;
  flex-direction:column;padding:26px 32px 30px;overflow:hidden;}
.screen.on{display:flex;}

.home-top{display:flex;align-items:center;gap:14px;flex:none;}
.logo-wrap{flex:1;text-align:center;}
.logo{font-size:64px;line-height:.92;font-weight:900;letter-spacing:1px;color:#fff;
  text-shadow:0 0 24px rgba(56,214,255,.85),0 5px 0 #0a2a44,0 8px 20px rgba(0,0,0,.6);}
.logo span{background:linear-gradient(90deg,#ff5ce0,#ffd93d,#3dff9e,#38d6ff);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 3px 0 rgba(0,0,0,.35));font-size:50px;letter-spacing:2px;}

.home-mid{flex:1;display:flex;flex-direction:column;justify-content:center;gap:12px;min-height:0;}
.home-pet{position:relative;height:250px;display:flex;align-items:center;justify-content:center;}
.home-pet canvas{width:320px;height:250px;}
.pet-name{position:absolute;bottom:0;font-size:25px;font-weight:900;color:#fff;
  background:rgba(0,0,0,.5);padding:4px 20px;border-radius:999px;border:2px solid rgba(255,255,255,.32);}
.pet-prog{position:absolute;bottom:-4px;right:20px;font-size:21px;font-weight:900;color:#ffd93d;
  background:rgba(0,0,0,.55);padding:4px 14px;border-radius:999px;}

.home-stats{display:flex;gap:14px;margin-top:10px;}
.hstat{flex:1;text-align:center;padding:13px 4px;border-radius:18px;
  background:rgba(255,255,255,.09);border:3px solid rgba(255,255,255,.18);}
.hstat b{display:block;font-size:40px;color:#ffd93d;line-height:1.1;}
.hstat span{font-size:21px;color:#cfc6e8;font-weight:700;}

.home-btns{display:flex;flex-direction:column;gap:16px;margin-top:10px;flex:none;}

.daily-btn{margin-top:18px;flex:none;display:flex;align-items:center;gap:16px;padding:17px 22px;
  border-radius:22px;background:linear-gradient(90deg,#ff6ec7,#9b5cff);
  border:4px solid rgba(255,255,255,.4);box-shadow:0 6px 0 rgba(0,0,0,.34);}
.daily-btn:active{transform:translateY(4px);box-shadow:0 2px 0 rgba(0,0,0,.34);}
.daily-btn.done{background:linear-gradient(90deg,#5a5570,#3d3950);border-color:rgba(255,255,255,.2);}
.daily-ico{font-size:48px;animation:wiggle 1.4s ease-in-out infinite;}
.daily-btn.done .daily-ico{animation:none;opacity:.6;}
@keyframes wiggle{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(8deg)}}
.daily-txt{flex:1;text-align:left;min-width:0;}
.daily-txt b{display:block;font-size:30px;font-weight:900;color:#fff;}
.daily-txt small{font-size:20px;color:rgba(255,255,255,.85);display:block;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.daily-streak{font-size:28px;font-weight:900;color:#fff2b0;}

.goals{margin-top:16px;display:flex;flex-direction:column;gap:9px;flex:none;padding-bottom:26px;}
.goal{display:flex;align-items:center;gap:12px;padding:12px 16px;border-radius:16px;
  background:rgba(255,255,255,.08);border:2px solid rgba(255,255,255,.16);}
.goal.done{background:rgba(61,255,158,.16);border-color:#3dff9e;}
.goal-tick{font-size:26px;flex:none;}
.goal-txt{flex:1;font-size:23px;font-weight:700;color:#e8e2ff;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.goal-bar{width:120px;height:16px;border-radius:999px;background:rgba(0,0,0,.5);overflow:hidden;flex:none;}
.goal-bar i{display:block;height:100%;background:linear-gradient(90deg,#38d6ff,#3dff9e);}
.goal-rew{font-size:20px;font-weight:900;color:#ffd93d;min-width:78px;text-align:right;flex:none;}

.version-tag{position:absolute;bottom:8px;right:18px;font-size:19px;
  color:rgba(255,255,255,.35);padding:8px 14px;background:none;}

/* ---------------------------------------------------------- sheet head */
.sheet-head{display:flex;align-items:center;gap:16px;margin-bottom:18px;}
.sheet-head h2{flex:1;text-align:center;font-size:50px;font-weight:900;color:#fff;
  text-shadow:0 4px 14px rgba(0,0,0,.7);}

.tabs{display:flex;gap:8px;margin-bottom:16px;}
.tab{flex:1;padding:14px 4px;border-radius:18px 18px 0 0;font-size:23px;font-weight:800;
  background:rgba(255,255,255,.08);color:#bdb5d6;border:3px solid transparent;border-bottom:none;}
.tab.active{background:rgba(255,255,255,.2);color:#fff;border-color:rgba(255,255,255,.32);}

.tab-body{flex:1;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;
  padding:6px 4px 30px;touch-action:pan-y;}
.tab-body::-webkit-scrollbar{width:10px;}
.tab-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.28);border-radius:8px;}

/* ---------------------------------------------------------------- map */
.map-scroll{flex:1;overflow-y:auto;touch-action:pan-y;padding-bottom:40px;}
.world-block{margin-bottom:26px;border-radius:26px;padding:20px;border:4px solid rgba(255,255,255,.18);}
.world-block.locked{opacity:.55;}
.world-head{display:flex;align-items:center;gap:14px;margin-bottom:16px;}
.world-head h3{font-size:38px;font-weight:900;color:#fff;text-shadow:0 3px 8px rgba(0,0,0,.7);}
.world-head .wtag{font-size:22px;font-weight:800;padding:6px 14px;border-radius:999px;
  background:rgba(0,0,0,.4);border:2px solid rgba(255,255,255,.3);color:#fff;}
.world-mech{font-size:23px;color:#e4dcff;margin-bottom:14px;}
.lvl-row{display:flex;gap:14px;}
.lvl{flex:1;aspect-ratio:1;border-radius:24px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;font-weight:900;
  background:rgba(255,255,255,.14);border:4px solid rgba(255,255,255,.3);
  box-shadow:0 6px 0 rgba(0,0,0,.3);position:relative;}
.lvl b{font-size:44px;color:#fff;}
.lvl small{font-size:19px;color:#ffd93d;}
.lvl.done{background:linear-gradient(180deg,#7bff9e,#12b95c);border-color:#d6ffe4;}
.lvl.done b{color:#06280f;}
.lvl.done small{color:#0a3d18;}
.lvl.current{background:linear-gradient(180deg,#ffe36b,#ff9a2e);border-color:#fff3c0;
  animation:bounceLvl .9s infinite alternate;}
.lvl.current b{color:#3d2000;}
@keyframes bounceLvl{from{transform:translateY(0)}to{transform:translateY(-7px)}}
.lvl.lock{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.14);}
.lvl.lock b{color:rgba(255,255,255,.3);}

/* ------------------------------------------------------------- grids */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.grid.g4{grid-template-columns:repeat(4,1fr);}
.grid.g5{grid-template-columns:repeat(5,1fr);}
.card{border-radius:22px;padding:14px 8px;text-align:center;position:relative;
  background:rgba(255,255,255,.09);border:4px solid rgba(255,255,255,.18);}
.card.owned{background:rgba(255,255,255,.16);}
.card.locked{opacity:.45;filter:grayscale(.9);}
.card .cname{font-size:22px;font-weight:800;color:#fff;margin-top:6px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.card .crar{font-size:17px;font-weight:800;margin-top:2px;}
.card img{width:100%;max-width:150px;display:block;margin:0 auto;}
.card .emoji{font-size:60px;line-height:1.1;}
.card .dot{position:absolute;top:8px;right:10px;font-size:22px;}
.card.sel{outline:5px solid #ffd93d;outline-offset:2px;}
.card .cnt{position:absolute;top:6px;left:10px;font-size:20px;font-weight:900;color:#ffd93d;}

.badge-row{display:flex;align-items:center;gap:16px;padding:14px 16px;border-radius:20px;
  background:rgba(255,255,255,.08);border:3px solid rgba(255,255,255,.14);margin-bottom:12px;}
.badge-row.got{background:rgba(255,217,61,.16);border-color:#ffd93d;}
.badge-ico{font-size:52px;width:64px;text-align:center;}
.badge-row.locked .badge-ico{filter:grayscale(1);opacity:.45;}
.badge-info{flex:1;}
.badge-info b{display:block;font-size:28px;color:#fff;}
.badge-info small{font-size:21px;color:#cfc6e8;}
.badge-prog{width:130px;text-align:right;font-size:22px;font-weight:900;color:#ffd93d;}

/* facts chart */
.facts-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.fact-cell{border-radius:18px;padding:14px 6px;text-align:center;
  background:rgba(255,255,255,.08);border:3px solid rgba(255,255,255,.16);}
.fact-cell b{display:block;font-size:32px;color:#fff;}
.fact-bar{height:14px;border-radius:999px;background:rgba(0,0,0,.5);margin-top:8px;overflow:hidden;}
.fact-bar i{display:block;height:100%;background:linear-gradient(90deg,#38d6ff,#3dff9e);}
.fact-cell small{font-size:18px;color:#cfc6e8;}
.mastery-big{text-align:center;margin-bottom:18px;}
.mastery-big b{font-size:78px;color:#ffd93d;display:block;line-height:1;}
.mastery-big span{font-size:26px;color:#e0d8ff;}

/* -------------------------------------------------------------- shop */
.shop-item{display:flex;align-items:center;gap:18px;padding:18px;border-radius:24px;
  margin-bottom:16px;border:4px solid rgba(255,255,255,.22);
  background:linear-gradient(120deg,rgba(255,255,255,.14),rgba(255,255,255,.05));}
.shop-chest{width:140px;height:140px;}
.shop-info{flex:1;}
.shop-info b{display:block;font-size:34px;color:#fff;}
.shop-info small{font-size:21px;color:#d8d0f0;display:block;margin-top:4px;}
.shop-buy{padding:16px 24px;border-radius:18px;font-size:29px;font-weight:900;color:#2a1a00;
  background:linear-gradient(180deg,#ffe36b,#ffb02e);box-shadow:0 5px 0 rgba(0,0,0,.35);
  display:flex;align-items:center;gap:8px;}
.shop-buy:active{transform:translateY(3px);box-shadow:0 2px 0 rgba(0,0,0,.35);}
.shop-buy.cant{background:linear-gradient(180deg,#8a8698,#5c5868);color:#d8d4e4;}
.odds{font-size:19px;color:#bdb5d6;margin-top:6px;}

/* ------------------------------------------------------- sticker book */
.sticker-stage-wrap{display:flex;justify-content:center;}
.sticker-stage{position:relative;width:820px;height:950px;border-radius:26px;overflow:hidden;
  border:6px solid rgba(255,255,255,.35);box-shadow:0 10px 34px rgba(0,0,0,.5);}
.sticker-stage canvas{position:absolute;inset:0;width:100%;height:100%;}
.sticker-layer{position:absolute;inset:0;}
.pl-sticker{position:absolute;font-size:80px;line-height:1;transform-origin:50% 50%;
  filter:drop-shadow(0 4px 6px rgba(0,0,0,.45));touch-action:none;}
.pl-sticker.sel{outline:4px dashed #ffd93d;outline-offset:6px;border-radius:12px;}
.sticker-tools{display:flex;gap:10px;margin:14px 0 10px;}
.tool-btn{flex:1;padding:16px 6px;border-radius:18px;font-size:26px;font-weight:800;color:#fff;
  background:rgba(255,255,255,.16);border:3px solid rgba(255,255,255,.28);}
.tool-btn.danger{background:rgba(255,70,100,.3);border-color:#ff7a8a;}
.tool-btn:active{transform:translateY(3px);}
.sticker-tray{height:168px;overflow-y:auto;touch-action:pan-y;display:flex;flex-wrap:wrap;gap:10px;
  padding:14px;border-radius:22px;background:rgba(0,0,0,.35);border:3px solid rgba(255,255,255,.2);}
.tray-item{width:86px;height:86px;border-radius:16px;display:flex;align-items:center;justify-content:center;
  font-size:50px;background:rgba(255,255,255,.12);border:3px solid rgba(255,255,255,.22);position:relative;}
.tray-item.sel{border-color:#ffd93d;background:rgba(255,217,61,.25);}
.tray-item i{position:absolute;bottom:0;right:5px;font-size:17px;font-style:normal;font-weight:900;color:#ffd93d;}
.sticker-hint{text-align:center;font-size:23px;color:#d8d0f0;margin-top:10px;}

/* --------------------------------------------------------- overlays */
.overlay{position:absolute;inset:0;display:flex;
  flex-direction:column;align-items:center;justify-content:center;gap:24px;padding:40px;
  background:rgba(8,3,22,.6);backdrop-filter:blur(2px);}
.overlay.solid{background:rgba(8,3,22,.93);}

/* question */
#q{justify-content:flex-start;padding-top:250px;background:transparent;backdrop-filter:none;}
.q-card{width:620px;border-radius:30px;padding:24px 20px 16px;text-align:center;
  background:linear-gradient(180deg,rgba(18,8,40,.96),rgba(30,12,60,.96));
  border:6px solid #38d6ff;box-shadow:0 0 44px rgba(56,214,255,.6),0 12px 30px rgba(0,0,0,.6);}
.q-eq{font-size:86px;font-weight:900;color:#fff;letter-spacing:2px;
  text-shadow:0 0 26px rgba(56,214,255,.85),0 5px 0 rgba(0,0,0,.4);}
.q-timerbar{height:12px;border-radius:999px;background:rgba(0,0,0,.5);margin-top:14px;overflow:hidden;}
#qTimer{height:100%;width:100%;background:linear-gradient(90deg,#3dff9e,#ffd93d,#ff5c5c);
  transition:width .2s linear;}
.q-opts{display:grid;grid-template-columns:repeat(2,1fr);gap:22px;width:700px;margin-top:34px;}
.q-opts.three{grid-template-columns:repeat(1,1fr);width:520px;}
.q-opts.six{grid-template-columns:repeat(3,1fr);width:760px;}
.opt{padding:30px 10px;border-radius:26px;font-size:64px;font-weight:900;color:#0d2a14;
  background:linear-gradient(180deg,#8dffb4,#17c962);box-shadow:0 8px 0 rgba(0,0,0,.34);
  transition:transform .08s;}
.q-opts.six .opt{font-size:48px;padding:22px 6px;}
.opt:active{transform:translateY(5px);box-shadow:0 3px 0 rgba(0,0,0,.34);}
.opt.right{background:linear-gradient(180deg,#fff7a8,#ffd400);animation:rightPop .45s;}
.opt.wrongPick{background:linear-gradient(180deg,#ff9aa8,#e01b3d);color:#fff;animation:shakeX .4s;}
.opt.fade{opacity:.35;}
@keyframes rightPop{0%{transform:scale(1)}45%{transform:scale(1.16)}100%{transform:scale(1)}}
@keyframes shakeX{0%,100%{transform:translateX(0)}25%{transform:translateX(-12px)}75%{transform:translateX(12px)}}
.q-help{margin-top:30px;padding:16px 34px;border-radius:20px;font-size:30px;font-weight:800;
  color:#fff;background:rgba(255,255,255,.16);border:3px solid rgba(255,255,255,.3);}

/* hint */
.hint-card{width:760px;border-radius:32px;padding:34px;text-align:center;
  background:linear-gradient(180deg,#160a30,#2a1050);border:6px solid #ffd93d;
  box-shadow:0 0 50px rgba(255,217,61,.5);}
.hint-card h3{font-size:44px;color:#ffd93d;margin-bottom:22px;}
.hint-grid{display:flex;flex-wrap:wrap;gap:14px;justify-content:center;margin-bottom:22px;}
.hgroup{padding:12px;border-radius:16px;background:rgba(56,214,255,.12);border:3px solid #38d6ff;
  display:grid;gap:7px;}
.hdot{width:22px;height:22px;border-radius:50%;}
.hint-eq{font-size:46px;font-weight:900;color:#fff;margin-bottom:26px;}

/* intro */
.intro-card{width:760px;border-radius:32px;padding:38px;text-align:center;
  background:linear-gradient(180deg,rgba(18,8,40,.95),rgba(36,14,70,.95));
  border:6px solid #ff5ce0;box-shadow:0 0 50px rgba(255,92,224,.5);}
.intro-badge{display:inline-block;padding:8px 24px;border-radius:999px;font-size:26px;font-weight:900;
  background:#ff5ce0;color:#2a0020;margin-bottom:14px;}
.intro-card h2{font-size:58px;color:#fff;margin-bottom:12px;}
.intro-card p{font-size:30px;color:#ffe9fb;margin-bottom:22px;line-height:1.35;}
.intro-demo{font-size:24px;color:#bdb5d6;margin-bottom:26px;}

/* level complete */
.lv-card{width:760px;border-radius:34px;padding:40px;text-align:center;
  background:linear-gradient(180deg,#14082e,#2d0f57);border:6px solid #ffd93d;
  box-shadow:0 0 60px rgba(255,217,61,.55);}
.lv-burst{font-size:96px;animation:popIn .6s cubic-bezier(.2,1.7,.4,1);}
@keyframes popIn{from{transform:scale(0) rotate(-40deg)}to{transform:scale(1) rotate(0)}}
.lv-card h2{font-size:62px;color:#ffd93d;margin:6px 0 24px;}
.lv-rows{display:flex;flex-direction:column;gap:12px;margin-bottom:30px;}
.lv-line{display:flex;justify-content:space-between;font-size:30px;font-weight:800;
  padding:12px 20px;border-radius:16px;background:rgba(255,255,255,.09);color:#fff;}
.lv-line b{color:#ffd93d;}

/* chest */
#chestOv{background:rgba(8,3,22,.93);}
.chest-wrap{text-align:center;}
.chest-wrap h2{font-size:52px;color:#ffd93d;margin-bottom:6px;}
.chest-tapme{font-size:44px;font-weight:900;color:#fff;margin-bottom:6px;
  animation:tapPulse .55s infinite alternate;text-shadow:0 0 24px rgba(255,217,61,.9);}
@keyframes tapPulse{from{transform:scale(1)}to{transform:scale(1.14)}}
#chestCanvas{width:600px;height:520px;}
.chest-meter{width:560px;height:38px;border-radius:999px;margin:10px auto 0;overflow:hidden;
  background:rgba(0,0,0,.6);border:4px solid rgba(255,255,255,.3);}
#chestFill{height:100%;width:0;background:linear-gradient(90deg,#3dff9e,#ffd93d,#ff5c5c);
  transition:width .08s;}
.chest-help{font-size:26px;color:#d8d0f0;margin-top:14px;}

/* reward */
.reward-card{position:relative;width:800px;border-radius:34px;padding:40px 30px;text-align:center;
  background:linear-gradient(180deg,#16093a,#30125e);border:6px solid #ffd93d;
  box-shadow:0 0 70px rgba(255,217,61,.6);overflow:hidden;}
.reward-rays{position:absolute;inset:-50%;background:conic-gradient(from 0deg,
  rgba(255,217,61,.22) 0deg 12deg, transparent 12deg 24deg);animation:spinRays 9s linear infinite;}
@keyframes spinRays{to{transform:rotate(360deg)}}
.reward-items{position:relative;display:flex;flex-direction:column;gap:18px;margin-bottom:30px;}
.rw{display:flex;align-items:center;gap:20px;padding:18px;border-radius:22px;
  background:rgba(0,0,0,.4);border:4px solid rgba(255,255,255,.25);animation:rwIn .5s backwards;}
@keyframes rwIn{from{transform:translateY(30px) scale(.8);opacity:0}}
.rw-vis{width:120px;height:120px;display:flex;align-items:center;justify-content:center;font-size:74px;}
.rw-vis img{width:120px;height:120px;}
.rw-txt{flex:1;text-align:left;}
.rw-txt b{display:block;font-size:34px;color:#fff;}
.rw-txt small{font-size:23px;}
.rw-new{font-size:24px;font-weight:900;padding:6px 14px;border-radius:999px;
  background:#ff2d55;color:#fff;}

/* endless over */
.end-card{width:790px;border-radius:34px;padding:38px;text-align:center;
  background:linear-gradient(180deg,#140830,#2b1052);border:6px solid #38d6ff;
  box-shadow:0 0 60px rgba(56,214,255,.5);}
.end-card h2{font-size:56px;color:#fff;}
.end-score{font-size:104px;font-weight:900;color:#ffd93d;line-height:1.05;
  text-shadow:0 0 32px rgba(255,217,61,.8);}
.end-new{font-size:38px;font-weight:900;color:#3dff9e;margin-bottom:10px;
  animation:pulseBadge .55s infinite alternate;}
.end-namebox{margin:12px 0 18px;}
.end-namebox label{display:block;font-size:26px;color:#d8d0f0;margin-bottom:10px;}
#endName{width:100%;padding:18px;border-radius:18px;font-size:44px;font-weight:900;text-align:center;
  font-family:inherit;text-transform:uppercase;background:#0b0420;color:#ffd93d;
  border:4px solid #ffd93d;outline:none;-webkit-user-select:text;user-select:text;touch-action:auto;}
.quickname{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:12px;}
.quickname button{padding:10px 18px;border-radius:14px;font-size:24px;font-weight:800;
  background:rgba(255,255,255,.14);border:3px solid rgba(255,255,255,.28);color:#fff;}
.end-stats{display:flex;gap:12px;justify-content:center;margin:16px 0 24px;flex-wrap:wrap;}
.end-stats div{padding:10px 18px;border-radius:16px;background:rgba(255,255,255,.1);
  font-size:24px;font-weight:800;color:#e6dfff;}
.end-btns{display:flex;flex-direction:column;gap:14px;}
.end-btns .btn-row,.end-btns>.mid-btn{width:100%;}
.end-btns{align-items:stretch;}
.end-btns .mid-btn{flex-direction:row;gap:10px;}

/* leaderboard */
.lb-row{display:flex;align-items:center;gap:16px;padding:16px 20px;border-radius:20px;
  margin-bottom:12px;background:rgba(255,255,255,.08);border:3px solid rgba(255,255,255,.16);}
.lb-row.top1{background:linear-gradient(90deg,rgba(255,217,61,.3),rgba(255,217,61,.08));border-color:#ffd93d;}
.lb-row.top2{background:linear-gradient(90deg,rgba(220,230,255,.25),transparent);border-color:#cdd8ff;}
.lb-row.top3{background:linear-gradient(90deg,rgba(255,170,110,.25),transparent);border-color:#ffb37a;}
.lb-rank{font-size:40px;font-weight:900;width:80px;color:#ffd93d;}
.lb-name{flex:1;font-size:34px;font-weight:800;color:#fff;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;}
.lb-score{font-size:34px;font-weight:900;color:#3dff9e;}
.lb-date{font-size:19px;color:#a99fc4;width:130px;text-align:right;}
.empty-note{text-align:center;font-size:30px;color:#bdb5d6;padding:60px 20px;line-height:1.5;}

/* settings */
.set-row{display:flex;align-items:center;gap:18px;padding:20px;border-radius:22px;
  margin-bottom:14px;background:rgba(255,255,255,.08);border:3px solid rgba(255,255,255,.16);}
.set-row b{flex:1;font-size:30px;color:#fff;}
.set-row small{display:block;font-size:21px;color:#bdb5d6;font-weight:600;}
.toggle{width:110px;height:56px;border-radius:999px;background:#463f5e;position:relative;
  border:3px solid rgba(255,255,255,.24);}
.toggle.on{background:#12d96a;}
.toggle i{position:absolute;top:3px;left:3px;width:44px;height:44px;border-radius:50%;
  background:#fff;transition:left .2s;}
.toggle.on i{left:57px;}

/* toast + pet cheer */
.toast{position:absolute;left:50%;bottom:40px;transform:translateX(-50%);
  padding:18px 34px;border-radius:999px;font-size:32px;font-weight:900;color:#0d0620;
  background:linear-gradient(90deg,#ffe36b,#ffb02e);box-shadow:0 8px 26px rgba(0,0,0,.5);
  animation:toastIn .35s;z-index:50;max-width:800px;text-align:center;}
@keyframes toastIn{from{transform:translate(-50%,34px);opacity:0}}
.pet-cheer{position:absolute;right:22px;bottom:370px;width:190px;text-align:center;
  pointer-events:none;z-index:40;}
.pet-cheer canvas{width:180px;height:180px;}
.pet-bubble{display:inline-block;padding:8px 18px;border-radius:999px;font-size:24px;font-weight:900;
  background:#fff;color:#2a1050;box-shadow:0 5px 14px rgba(0,0,0,.4);}

.confirm-card{width:660px;border-radius:30px;padding:36px;text-align:center;
  background:linear-gradient(180deg,#16093a,#2b1052);border:6px solid #ff7a8a;}
.confirm-card p{font-size:34px;color:#fff;margin-bottom:28px;line-height:1.35;}
.confirm-btns{display:flex;gap:16px;}

/* rotate + install */
#rotate-note{position:fixed;inset:0;display:none;align-items:center;justify-content:center;
  background:#140826;color:#fff;font-size:26px;text-align:center;padding:30px;z-index:200;}
#installBar{position:fixed;left:12px;right:12px;bottom:12px;display:flex;align-items:center;gap:10px;
  padding:12px 16px;border-radius:18px;background:rgba(20,8,38,.96);border:2px solid #ffd93d;
  color:#fff;font-size:15px;z-index:150;box-shadow:0 8px 30px rgba(0,0,0,.6);}
#installBar button{padding:8px 16px;border-radius:12px;font-size:15px;font-weight:800;
  background:#ffd93d;color:#2a1a00;}
#installBar #installClose{background:transparent;color:#fff;font-size:18px;padding:6px 8px;}

@media (max-aspect-ratio: 9/19){ }

/* ======================================================================
   v2.1 additions — chart popup, pet buddy, dev menu, evolution
   ====================================================================== */

/* ------------------------------------------------- question helpers */
.chart-btn{margin-top:26px;padding:16px 34px;border-radius:20px;font-size:30px;font-weight:800;
  color:#2a1a00;background:linear-gradient(180deg,#ffe36b,#ffb02e);
  box-shadow:0 6px 0 rgba(0,0,0,.34);animation:popIn .4s;}
.chart-btn:active{transform:translateY(4px);box-shadow:0 2px 0 rgba(0,0,0,.34);}
.help-nudge{margin-top:16px;padding:10px 24px;border-radius:999px;font-size:24px;font-weight:800;
  color:#fff;background:rgba(0,0,0,.5);border:2px solid rgba(255,255,255,.3);animation:popIn .4s;}

/* --------------------------------------------------- times table */
.chart-card{width:790px;max-height:1340px;border-radius:32px;padding:30px 28px 26px;text-align:center;
  background:linear-gradient(180deg,#160a30,#2a1050);border:6px solid #ffd93d;
  box-shadow:0 0 50px rgba(255,217,61,.5);display:flex;flex-direction:column;}
.chart-card h3{font-size:44px;color:#ffd93d;margin-bottom:18px;}
.chart-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin-bottom:16px;}
.chart-row{display:flex;align-items:center;justify-content:center;gap:8px;
  padding:11px 8px;border-radius:14px;font-size:30px;font-weight:800;color:#fff;
  background:rgba(255,255,255,.09);border:2px solid rgba(255,255,255,.16);}
.chart-row b{color:#3dff9e;}
.chart-note{font-size:23px;color:#cfc6e8;margin-bottom:20px;}

/* ------------------------------------------------------ pet buddy */
.pet-cheer{position:absolute;right:26px;bottom:392px;width:210px;text-align:center;
  z-index:60;touch-action:none;cursor:grab;}
.pet-cheer.dragging{cursor:grabbing;}
.pet-cheer canvas{width:200px;height:200px;pointer-events:none;}
.pet-bubble{display:inline-block;padding:8px 18px;border-radius:999px;font-size:24px;font-weight:900;
  background:#fff;color:#2a1050;box-shadow:0 5px 14px rgba(0,0,0,.4);pointer-events:none;
  max-width:200px;}
.pet-help-tag{position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);
  padding:7px 18px;border-radius:999px;font-size:23px;font-weight:900;white-space:nowrap;
  color:#2a1a00;background:linear-gradient(180deg,#ffe36b,#ffb02e);
  box-shadow:0 0 22px rgba(255,190,60,.9);animation:pulseBadge .6s infinite alternate;
  pointer-events:none;}
.pet-cheer .ring{position:absolute;inset:6px 6px 30px;border-radius:50%;
  border:4px dashed rgba(255,217,61,.8);animation:spinRays 5s linear infinite;pointer-events:none;}

/* ------------------------------------------------------- dev menu */
#devOv,#devMenu{background:rgba(6,2,16,.94);}
.dev-card{width:620px;border-radius:30px;padding:30px;text-align:center;
  background:linear-gradient(180deg,#16093a,#241046);border:5px solid #6b7cff;
  box-shadow:0 0 44px rgba(107,124,255,.45);}
.dev-card.wide{width:780px;}
.dev-card h3{font-size:42px;color:#cbd4ff;margin-bottom:14px;}
.dev-sub{font-size:21px;color:#9aa3c7;margin-bottom:18px;}
.dev-dots{font-size:62px;letter-spacing:16px;color:#ffd93d;height:74px;line-height:74px;
  margin-bottom:16px;font-weight:900;}
.dev-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px;}
.dev-pad button{padding:20px 0;border-radius:18px;font-size:38px;font-weight:900;color:#fff;
  background:rgba(255,255,255,.13);border:3px solid rgba(255,255,255,.22);}
.dev-pad button:active{transform:translateY(3px);background:rgba(255,255,255,.24);}
.dev-pad button[data-k="ok"]{background:linear-gradient(180deg,#7bff9e,#12d96a);color:#0d2a14;}
.dev-pad button[data-k="del"]{background:rgba(255,90,110,.28);}
.dev-actions{display:flex;flex-direction:column;gap:10px;margin-bottom:20px;
  max-height:760px;overflow-y:auto;touch-action:pan-y;}
.dev-btn{padding:16px 20px;border-radius:16px;font-size:26px;font-weight:800;color:#fff;
  text-align:left;background:rgba(255,255,255,.1);border:3px solid rgba(255,255,255,.2);}
.dev-btn:active{transform:translateY(3px);background:rgba(255,255,255,.2);}
.dev-btn.danger{background:rgba(255,60,90,.22);border-color:#ff7a8a;}

/* ----------------------------------------------------- evolution */
#evoOv{background:#050010;}
.evo-wrap{text-align:center;}
.evo-kicker{font-size:44px;font-weight:900;color:#ffd93d;margin-bottom:8px;
  text-shadow:0 0 26px rgba(255,217,61,.9);animation:pulseBadge .5s infinite alternate;}
#evoCanvas{width:620px;height:620px;}
.evo-names{display:flex;align-items:center;justify-content:center;gap:22px;font-size:46px;
  font-weight:900;color:#fff;margin:6px 0 24px;min-height:60px;}
.evo-names .evo-arrow{color:#ffd93d;font-size:38px;}
.evo-names span{text-shadow:0 0 20px rgba(255,255,255,.5);}

/* --------------------------------------------- pet cards in collection */
.pcard{position:relative;border-radius:20px;padding:10px 6px 12px;text-align:center;
  background:rgba(255,255,255,.08);border:4px solid rgba(255,255,255,.18);}
.pcard.hatched{background:rgba(255,255,255,.16);}
.pcard.locked img{filter:grayscale(1) brightness(.45);}
.pcard img{width:100%;max-width:142px;display:block;margin:0 auto;}
.pcard .pname{font-size:21px;font-weight:900;color:#fff;margin-top:2px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pcard .prar{font-size:16px;font-weight:800;}
.pcard .pbar{height:14px;border-radius:999px;background:rgba(0,0,0,.55);margin:6px 6px 3px;overflow:hidden;}
.pcard .pbar i{display:block;height:100%;background:linear-gradient(90deg,#38d6ff,#3dff9e);}
.pcard .pcount{font-size:17px;font-weight:800;color:#9fe8ff;}
.pcard .pstage{position:absolute;top:6px;left:8px;font-size:18px;font-weight:900;color:#0d0620;
  background:linear-gradient(180deg,#ffe36b,#ffb02e);padding:2px 9px;border-radius:999px;}
.pcard .pactive{position:absolute;top:6px;right:8px;font-size:20px;}
.pcard.sel{outline:5px solid #ffd93d;outline-offset:2px;}
.pcard .pmax{font-size:17px;font-weight:900;color:#ffd93d;}

#fxCanvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:200;}
#chestFill.falling{background:linear-gradient(90deg,#ff5c5c,#ff2d55);}
.chest-help.urgent{color:#ff8a9c;font-weight:900;animation:pulseBadge .35s infinite alternate;}

/* ---------------------------------------------------- back button on top */
#hud{z-index:70;}
#hud .hud-btn{position:relative;z-index:72;}

/* --------------------------------------------------------- pet bulb tag */
.pet-help-tag{position:absolute;left:50%;top:26px;bottom:auto;transform:translateX(-50%);
  width:62px;height:62px;padding:0;border-radius:50%;font-size:34px;line-height:62px;
  text-align:center;white-space:nowrap;color:#2a1a00;
  background:linear-gradient(180deg,#ffe36b,#ffb02e);
  box-shadow:0 0 26px rgba(255,190,60,.95);animation:pulseBadge .6s infinite alternate;
  pointer-events:none;}

/* ---------------------------------------------------------- speed round */
.big-btn.speed{background:linear-gradient(180deg,#ffe36b,#ff8a1f);}
.speed-card{width:790px;border-radius:34px;padding:34px;text-align:center;
  background:linear-gradient(180deg,#2a1200,#4d2000);border:6px solid #ffb02e;
  box-shadow:0 0 60px rgba(255,176,46,.55);}
.speed-card h2{font-size:58px;color:#ffd93d;margin-bottom:10px;}
.speed-card p{font-size:28px;color:#ffe9c9;line-height:1.35;margin-bottom:22px;}
.speed-bolt{font-size:92px;animation:pulseBadge .5s infinite alternate;}
.speed-rules{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px;}
.speed-rules div{padding:12px;border-radius:16px;background:rgba(0,0,0,.34);
  border:2px solid rgba(255,255,255,.2);text-align:left;}
.speed-rules b{display:block;font-size:24px;color:#ffd93d;}
.speed-rules span{font-size:20px;color:#ffe9c9;}
.speed-best{font-size:26px;font-weight:800;color:#ffd93d;margin-bottom:18px;}
.speed-gold{font-size:104px;font-weight:900;color:#ffd93d;line-height:1.05;
  text-shadow:0 0 34px rgba(255,217,61,.85);}
.speed-gold small{font-size:38px;color:#ffe9c9;}
#speedIntroOv,#speedOv{background:rgba(24,8,0,.82);}
/* `#stage > *` sets pointer-events:auto and outranks a plain class, so this
   floating text needs the extra specificity or it eats taps on the answers. */
#stage > .speed-fly{position:absolute;left:50%;top:184px;transform:translateX(-50%);
  font-size:46px;font-weight:900;color:#ffd93d;pointer-events:none;z-index:65;
  white-space:nowrap;text-shadow:0 0 22px rgba(255,217,61,.9),0 4px 0 rgba(0,0,0,.5);
  animation:flyUp .85s ease-out forwards;}
@keyframes flyUp{from{opacity:0;transform:translate(-50%,26px) scale(.7)}
  35%{opacity:1;transform:translate(-50%,-10px) scale(1.12)}
  to{opacity:0;transform:translate(-50%,-110px) scale(1)}}
#qTimer.warn{background:linear-gradient(90deg,#ff5c5c,#ff2d55);}
.lvl.speed{background:linear-gradient(180deg,#ffe36b,#ff8a1f);border-color:#fff3c0;}
.lvl.speed b{color:#3d2000;font-size:52px;}
.world-block.speedblock{background:linear-gradient(140deg,#3a1800,#7a3a05) !important;
  border-color:#ffb02e !important;}

/* =======================================================================
   LANDSCAPE  —  iPad and any wide screen
   The stage becomes the exact shape of the display (height 1000, width
   from the real aspect) so it fills edge to edge. The pegboard keeps a
   fixed column on the left; everything the player reads or taps moves
   into a panel on the right.
   ======================================================================= */
body.landscape .screen{padding:20px 26px 22px;}

/* ---------------------------------- the marble-watching panel (landscape) */
#dropPanel{display:none;}
body.landscape #dropPanel{
  position:absolute;left:var(--board-w);right:0;top:250px;bottom:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:18px;padding:0 34px 30px;pointer-events:none;z-index:28;
}
body.landscape #dropPanel.hidden{display:none;}
.dp-tick{font-size:86px;line-height:1;font-weight:900;color:#3dff9e;
  text-shadow:0 0 22px rgba(61,255,158,.65),0 4px 0 rgba(0,0,0,.35);}
.dp-tick.miss{color:#ff5d7a;text-shadow:0 0 22px rgba(255,93,122,.6),0 4px 0 rgba(0,0,0,.35);}
.dp-eq{font-size:52px;font-weight:900;color:#fff;text-align:center;
  text-shadow:0 3px 0 rgba(0,0,0,.45);}
.dp-marbles{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;max-width:100%;}
.dp-dot{width:30px;height:30px;border-radius:50%;background:radial-gradient(circle at 34% 30%,#fff,#8ef0c0 42%,#1d9b67 100%);
  box-shadow:0 3px 10px rgba(0,0,0,.4);transition:opacity .25s,transform .25s;}
.dp-dot.spent{opacity:.22;transform:scale(.7);}
.dp-score{display:flex;flex-direction:column;align-items:center;gap:4px;
  background:rgba(8,3,22,.72);border:3px solid rgba(255,255,255,.16);
  border-radius:22px;padding:14px 38px;min-width:260px;}
.dp-score span{font-size:21px;color:#cfc4ee;font-weight:800;letter-spacing:.5px;}
.dp-score b{font-size:58px;color:#ffd93d;line-height:1;text-shadow:0 3px 0 rgba(0,0,0,.4);}

/* ------------------------------------------------------------ play HUD */
body.landscape #hud{
  left:var(--board-w);right:0;top:0;height:auto;
  padding:20px 24px 14px;
  display:grid;grid-template-columns:auto 1fr;
  grid-template-areas:"back center" "chips chips" "hearts hearts" "streak streak" "fever fever";
  gap:12px 14px;align-items:center;
  margin:14px 14px 0;border-radius:0 0 26px 26px;
  background:linear-gradient(180deg,rgba(8,3,22,.94),rgba(8,3,22,.72));
  border:3px solid rgba(255,255,255,.14);border-top:none;
  box-shadow:0 10px 26px rgba(0,0,0,.35);
}
body.landscape #hud .hud-btn{grid-area:back;width:62px;height:62px;font-size:32px;}
body.landscape .hud-center{grid-area:center;align-items:stretch;gap:6px;}
body.landscape #hud-level{font-size:30px;text-align:left;}
body.landscape .starbar{width:100%;height:36px;}
body.landscape .starbar-text{font-size:22px;}
body.landscape .hud-right{grid-area:chips;flex-direction:row;gap:12px;align-items:stretch;}
body.landscape .hud-right .chip{flex:1;justify-content:center;font-size:27px;padding:9px 12px;}
body.landscape #hud-hearts{position:static;grid-area:hearts;font-size:36px;text-align:center;}
body.landscape #streakBadge{position:static;grid-area:streak;justify-self:center;font-size:26px;}
body.landscape #feverBanner{position:static;grid-area:fever;justify-self:center;left:auto;
  transform:none;font-size:28px;padding:9px 26px;}

/* ------------------------------------------------- question, in the panel */
body.landscape #q{
  left:var(--board-w);right:0;top:250px;bottom:0;
  justify-content:center;gap:26px;padding:0 34px 30px;background:transparent;
}
body.landscape .q-card{width:100%;padding:22px 18px 14px;border-width:5px;}
body.landscape .q-eq{font-size:70px;}
body.landscape .q-opts{width:100%;margin-top:0;gap:20px;grid-template-columns:1fr 1fr;}
body.landscape .q-opts.three{grid-template-columns:1fr;width:78%;}
body.landscape .q-opts.six{grid-template-columns:1fr 1fr;width:100%;}
body.landscape .opt{font-size:56px;padding:32px 8px;border-radius:24px;}
body.landscape .q-opts.six .opt{font-size:44px;padding:20px 6px;}
body.landscape .chart-btn{margin-top:4px;font-size:26px;padding:13px 26px;}
body.landscape .help-nudge{margin-top:4px;font-size:21px;padding:8px 18px;}

/* the buddy lives over the board, not over the panel */
body.landscape .pet-cheer{left:calc(var(--board-w) - 245px);bottom:340px;right:auto;width:190px;}
body.landscape .pet-cheer canvas{width:180px;height:180px;}

/* -------------------------------------------------------------- overlays */
body.landscape .overlay{padding:20px;}
body.landscape .hint-card,
body.landscape .chart-card,
body.landscape .intro-card,
body.landscape .lv-card,
body.landscape .reward-card,
body.landscape .end-card,
body.landscape .speed-card,
body.landscape .dev-card,
body.landscape .confirm-card{max-height:94%;overflow-y:auto;touch-action:pan-y;}

body.landscape .hint-card{width:920px;padding:24px 28px;}
body.landscape .hint-card h3{font-size:36px;margin-bottom:14px;}
body.landscape .hint-grid{gap:10px;margin-bottom:14px;}
body.landscape .hdot{width:18px;height:18px;}
body.landscape .hint-eq{font-size:36px;margin-bottom:18px;}

body.landscape .chart-card{width:900px;padding:22px 24px 18px;}
body.landscape .chart-card h3{font-size:34px;margin-bottom:12px;}
body.landscape .chart-grid{grid-template-columns:repeat(3,1fr);gap:8px 12px;margin-bottom:12px;}
body.landscape .chart-row{font-size:25px;padding:8px 6px;}
body.landscape .chart-note{font-size:19px;margin-bottom:14px;}

body.landscape .intro-card{width:860px;padding:26px 30px;}
body.landscape .intro-card h2{font-size:46px;}
body.landscape .intro-card p{font-size:25px;margin-bottom:14px;}
body.landscape .intro-demo{margin-bottom:16px;font-size:20px;}

body.landscape .lv-card{width:820px;padding:24px 30px;}
body.landscape .lv-burst{font-size:62px;}
body.landscape .lv-card h2{font-size:46px;margin:2px 0 16px;}
body.landscape .lv-line{font-size:25px;padding:9px 16px;}
body.landscape .lv-rows{gap:8px;margin-bottom:18px;}

body.landscape .chest-wrap h2{font-size:50px;margin-bottom:2px;}
body.landscape .chest-tapme{font-size:42px;margin-bottom:0;}
body.landscape #chestCanvas{width:620px;height:538px;margin:-30px 0;}
body.landscape .chest-meter{width:620px;height:36px;margin-top:0;}
body.landscape .chest-help{font-size:24px;margin-top:12px;}

body.landscape .reward-card{width:880px;padding:26px 26px 22px;}
body.landscape .reward-items{gap:12px;margin-bottom:18px;}
body.landscape .rw{padding:12px 14px;gap:14px;}
body.landscape .rw-vis{width:84px;height:84px;font-size:54px;}
body.landscape .rw-vis img{width:84px;height:84px;}
body.landscape .rw-txt b{font-size:27px;}
body.landscape .rw-txt small{font-size:19px;}
body.landscape .rw-new{font-size:19px;padding:4px 11px;}

body.landscape #evoCanvas{width:460px;height:460px;}
body.landscape .evo-kicker{font-size:34px;}
body.landscape .evo-names{font-size:36px;margin:2px 0 16px;min-height:44px;}

body.landscape .end-card{width:820px;padding:24px 30px;}
body.landscape .end-card h2{font-size:42px;}
body.landscape .end-score{font-size:76px;}
body.landscape .end-new{font-size:30px;}
body.landscape #endName{font-size:34px;padding:12px;}
body.landscape .end-stats{margin:12px 0 16px;}
body.landscape .end-stats div{font-size:20px;padding:8px 14px;}
body.landscape .end-btns{gap:10px;}

body.landscape .speed-card{width:860px;padding:24px 30px;}
body.landscape .speed-card h2{font-size:44px;}
body.landscape .speed-bolt{font-size:62px;}
body.landscape .speed-card p{font-size:23px;margin-bottom:14px;}
body.landscape .speed-rules{grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:14px;}
body.landscape .speed-rules b{font-size:20px;}
body.landscape .speed-rules span{font-size:16px;}
body.landscape .speed-best{font-size:22px;margin-bottom:14px;}
body.landscape .speed-gold{font-size:76px;}
body.landscape .speed-gold small{font-size:28px;}
body.landscape #stage > .speed-fly{top:120px;font-size:38px;}

body.landscape .dev-card{width:560px;padding:22px 26px;}
body.landscape .dev-card.wide{width:760px;}
body.landscape .dev-card h3{font-size:34px;}
body.landscape .dev-dots{font-size:46px;height:56px;line-height:56px;margin-bottom:12px;}
body.landscape .dev-pad{gap:9px;margin-bottom:14px;}
body.landscape .dev-pad button{padding:13px 0;font-size:30px;}
body.landscape .dev-actions{grid-template-columns:1fr 1fr;display:grid;max-height:440px;}
body.landscape .dev-btn{font-size:21px;padding:12px 14px;}
body.landscape .dev-sub{font-size:18px;margin-bottom:12px;}

body.landscape .confirm-card{width:700px;padding:28px;}
body.landscape .confirm-card p{font-size:28px;margin-bottom:20px;}

body.landscape .big-btn{padding:30px 16px;font-size:46px;border-radius:24px;}
body.landscape .big-btn small{font-size:19px;}
body.landscape .bb-ico{font-size:34px;}
body.landscape .toast{font-size:26px;padding:13px 26px;bottom:24px;}

/* ------------------------------------------------------------- the home */
body.landscape #screen-home{
  display:none;
  grid-template-columns:1fr 1.08fr;
  grid-template-rows:auto 1fr auto auto;
  grid-template-areas:"top top" "mid btns" "mid daily" "goals goals";
  column-gap:34px;row-gap:14px;
}
body.landscape #screen-home.on{display:grid;}
body.landscape #screen-home .home-top{grid-area:top;}
body.landscape #screen-home .home-mid{grid-area:mid;justify-content:center;gap:16px;}
body.landscape #screen-home .home-btns{grid-area:btns;margin-top:0;align-self:center;gap:16px;}
body.landscape #screen-home .daily-btn{grid-area:daily;margin-top:0;align-self:start;}
body.landscape #screen-home .goals{grid-area:goals;margin-top:0;padding-bottom:0;
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
body.landscape .logo{font-size:64px;}
body.landscape .logo span{font-size:50px;}
body.landscape .home-pet{height:420px;}
body.landscape .home-pet canvas{width:510px;height:420px;}
body.landscape .home-stats{gap:16px;margin-top:0;}
body.landscape .hstat{padding:18px 4px;}
body.landscape .hstat b{font-size:50px;}
body.landscape .hstat span{font-size:23px;}
body.landscape .btn-row{gap:14px;}
body.landscape .mid-btn{font-size:23px;padding:26px 4px;}
body.landscape .mid-btn span{font-size:42px;}
body.landscape .daily-btn{padding:22px 26px;}
body.landscape .daily-txt b{font-size:34px;}
body.landscape .daily-txt small{font-size:19px;}
body.landscape .daily-ico{font-size:56px;}
body.landscape .daily-streak{font-size:28px;}
body.landscape .goals{align-items:stretch;}
body.landscape .goal{padding:10px 14px;gap:8px;align-items:center;}
body.landscape .goal-txt{font-size:18px;white-space:normal;overflow:visible;
  text-overflow:clip;line-height:1.15;}
body.landscape .goal-bar{width:62px;height:13px;}
body.landscape .goal-rew{font-size:17px;min-width:54px;}
body.landscape .goal-tick{font-size:22px;}
body.landscape .version-tag{top:24px;left:94px;bottom:auto;right:auto;padding:10px 12px;}

/* ------------------------------------------------- sheet heads + bodies */
body.landscape .sheet-head{margin-bottom:12px;}
body.landscape .sheet-head h2{font-size:38px;}
body.landscape .icon-btn{width:60px;height:60px;font-size:30px;}
body.landscape .chip{font-size:24px;padding:8px 15px;}
body.landscape .tabs{margin-bottom:10px;}
body.landscape .tab{font-size:20px;padding:10px 4px;}
body.landscape .mastery-big{margin:10px 0;}
body.landscape .mastery-big b{font-size:48px;}
body.landscape .mastery-big span{font-size:19px;}
body.landscape .empty-note{font-size:22px;padding:28px 16px;}

/* map: worlds two across */
body.landscape .map-scroll{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-content:start;}
body.landscape .world-block{margin-bottom:0;padding:14px 16px;}
body.landscape .world-head h3{font-size:28px;}
body.landscape .world-head .wtag{font-size:17px;padding:4px 10px;}
body.landscape .world-mech{font-size:17px;margin-bottom:10px;}
body.landscape .lvl{border-radius:16px;}
body.landscape .lvl b{font-size:30px;}
body.landscape .lvl small{font-size:14px;}
body.landscape .world-block.speedblock{grid-column:1 / -1;}
body.landscape .world-block.speedblock .lvl-row{max-width:46%;}

/* collection grids get more columns */
body.landscape .grid{grid-template-columns:repeat(6,1fr);gap:12px;}
body.landscape .grid.g4{grid-template-columns:repeat(8,1fr);}
body.landscape .grid.g5{grid-template-columns:repeat(10,1fr);}
body.landscape .pcard img{max-width:110px;}
body.landscape .pcard .pname{font-size:17px;}
body.landscape .pcard .prar{font-size:13px;}
body.landscape .pcard .pcount,body.landscape .pcard .pmax{font-size:14px;}
body.landscape .pcard .pstage{font-size:14px;}
body.landscape .card .emoji{font-size:44px;}
body.landscape .card .cname{font-size:17px;}
body.landscape .card .crar{font-size:13px;}
body.landscape .facts-grid{grid-template-columns:repeat(6,1fr);}
body.landscape .fact-cell b{font-size:26px;}
body.landscape .badge-row{padding:10px 14px;margin-bottom:9px;}
body.landscape .badge-ico{font-size:40px;width:52px;}
body.landscape .badge-info b{font-size:23px;}
body.landscape .badge-info small{font-size:17px;}
body.landscape #colBody .badge-list{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;}

/* shop: two chests across */
body.landscape #shopBody{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-content:start;}
body.landscape #shopBody > .empty-note{grid-column:1 / -1;padding:0 0 4px;font-size:22px;}
body.landscape .shop-item{margin-bottom:0;padding:22px;gap:20px;}
body.landscape .shop-chest{width:140px;height:140px;}
body.landscape .shop-info b{font-size:32px;}
body.landscape .shop-info small{font-size:20px;}
body.landscape .odds{font-size:17px;}
body.landscape .shop-buy{font-size:28px;padding:16px 22px;}

/* sticker book: picture left, tools and tray right */
body.landscape #screen-stickers{display:none;}
body.landscape #screen-stickers.on{display:grid;
  grid-template-columns:auto 1fr;grid-template-rows:auto auto 1fr auto;
  grid-template-areas:"head head" "pic tools" "pic tray" "pic hint";
  column-gap:22px;row-gap:12px;}
body.landscape #screen-stickers .sheet-head{grid-area:head;}
body.landscape .sticker-stage-wrap{grid-area:pic;align-items:flex-start;}
body.landscape .sticker-stage{width:738px;height:856px;}
body.landscape .sticker-tools{grid-area:tools;flex-wrap:wrap;margin:0;gap:10px;}
body.landscape .tool-btn{font-size:21px;padding:14px 6px;flex:1 1 28%;}
body.landscape .sticker-tray{grid-area:tray;height:auto;max-height:none;margin:0;
  align-content:flex-start;gap:14px;padding:18px;}
body.landscape .tray-item{width:104px;height:104px;font-size:62px;border-radius:20px;}
body.landscape .tray-item i{font-size:20px;}
body.landscape .sticker-hint{grid-area:hint;font-size:20px;margin:0;align-self:end;}
body.landscape .tray-item{width:68px;height:68px;font-size:40px;}

/* scores + settings read better centred */
body.landscape #lbBody,body.landscape #setBody{max-width:900px;margin:0 auto;width:100%;}
body.landscape .lb-row{padding:18px 22px;margin-bottom:13px;}
body.landscape .lb-rank{font-size:36px;width:70px;}
body.landscape .lb-name{font-size:33px;}
body.landscape .lb-score{font-size:33px;}
body.landscape .set-row{padding:12px 18px;margin-bottom:7px;}
body.landscape .set-row b{font-size:23px;}
body.landscape .set-row small{font-size:16px;}
body.landscape #setBody .big-btn{padding:16px 14px;font-size:27px;margin-bottom:8px;}
body.landscape .toggle{width:92px;height:46px;}
body.landscape .toggle i{width:36px;height:36px;}
body.landscape .toggle.on i{left:47px;}
