:root{--dark:#171722;--hud:#241d24;--wall:#c9827d;--floor:#484c50;--yellow:#ffd16b;--red:#f6443d;--blue:#2b93e7;--green:#4caf50}*{box-sizing:border-box}html,body{height:100%;margin:0}body{display:grid;place-items:center;overflow:hidden;background:#11121c;font-family:"Courier New",monospace}.game{position:relative;width:min(100vw,960px);aspect-ratio:1.86/1;overflow:hidden;background:#222;border:5px solid #08090d;box-shadow:0 18px 65px #000c;image-rendering:pixelated}.topbar{height:12%;display:grid;grid-template-columns:38px 120px 1fr 92px;align-items:center;padding:0 12px;background:linear-gradient(#3a2c2d,#17151a);color:#fff;border-bottom:3px solid #18131a}.pause{width:31px;height:31px;display:flex;justify-content:center;align-items:center;gap:5px;border:0;border-radius:3px;background:#f15c42;box-shadow:0 3px #a7312b}.pause i{width:4px;height:15px;background:#fff}.hearts{display:flex;gap:6px}.heart{position:relative;width:20px;height:18px;transform:rotate(-45deg);background:#ff4c55;border:1px solid #7b1929}.heart:before,.heart:after{content:"";position:absolute;width:20px;height:18px;border-radius:50%;background:inherit;border:inherit}.heart:before{top:-9px;left:-1px}.heart:after{left:9px;top:-1px}.heart.lost{opacity:.2;filter:grayscale(1)}.level{text-align:center;font-size:14px;text-shadow:2px 2px #000}.stats{align-self:stretch;display:grid;place-content:center;background:#494a4d;border-radius:0 0 12px 12px;font-size:19px}.stats div{height:24px;display:flex;align-items:center;gap:4px}.coin{display:inline-block;width:21px;height:21px;border:2px solid #ffe56f;border-radius:50%;background:#ffb20d;box-shadow:inset 0 0 0 2px #e68400}.coin.small{width:16px;height:16px;vertical-align:-3px}.clock{width:17px;height:17px;border:3px solid #ccd0d2;border-radius:50%;position:relative}.clock:after{content:"";position:absolute;width:2px;height:6px;left:5px;top:2px;background:#fff}.stage{height:51%;position:relative;display:grid;place-items:center;background-color:var(--wall);background-image:linear-gradient(45deg,#ffffff12 25%,transparent 25%),linear-gradient(-45deg,#ffffff12 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ffffff12 75%),linear-gradient(-45deg,transparent 75%,#ffffff12 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}.question{width:40%;height:80%;display:grid;place-items:center;border:3px solid #54434b;border-radius:4px;background:var(--yellow);box-shadow:0 7px 0 #805c55,0 12px 15px #4b292a55;color:#fff;font-size:clamp(22px,4vw,38px);font-weight:bold;text-shadow:2px 2px #34414f,-1px -1px #34414f}.hint{position:absolute;right:15%;top:28%;width:86px;padding:0;border:0;border-radius:3px;background:#fff;box-shadow:0 5px 0 #255d8d;color:#fff}.hint span{display:block;height:29px;padding:5px;background:#f6f3eb;color:#4b4a4d;font-size:17px}.hint strong{display:block;padding:8px 2px;background:linear-gradient(#63b8ef,#2985ca);font-size:18px;text-shadow:1px 2px #1f4c78}.hint:disabled{filter:grayscale(.8);opacity:.5}.answers{height:34%;display:grid;grid-template-columns:repeat(4,1fr);gap:24px;padding:7px 55px 12px;background:var(--floor);box-shadow:inset 0 5px #565a5e}.answer{display:grid;place-items:center;min-width:0;border:4px solid #fff;border-radius:5px;background:#fff;box-shadow:0 5px 0 #9d9d9d;transition:.12s}.answer:active{transform:translateY(4px);box-shadow:0 1px #999}.answer.correct{outline:5px solid #62df75;transform:scale(1.03)}.answer.wrong{outline:5px solid #ff4d54;animation:shake .18s 3}.answer.removed{visibility:hidden}.logo{width:90%;aspect-ratio:1.25/1;display:grid;grid-template-columns:1fr 1fr;gap:7px}.logo i{display:block}.logo-squares i:nth-child(1),.logo-blocks i:nth-child(3),.logo-circles i:nth-child(2),.logo-mixed i:nth-child(4){background:var(--red)}.logo-squares i:nth-child(2),.logo-blocks i:nth-child(1),.logo-circles i:nth-child(4),.logo-mixed i:nth-child(2){background:var(--green)}.logo-squares i:nth-child(3),.logo-blocks i:nth-child(4),.logo-circles i:nth-child(1),.logo-mixed i:nth-child(3){background:var(--blue)}.logo-squares i:nth-child(4),.logo-blocks i:nth-child(2),.logo-circles i:nth-child(3),.logo-mixed i:nth-child(1){background:#ffbd0d}.logo-blocks i:nth-child(1){border-radius:80% 0 0 0}.logo-blocks i:nth-child(2){border-radius:0 80% 0 0}.logo-blocks i:nth-child(3){border-radius:0 0 0 80%}.logo-blocks i:nth-child(4){border-radius:0 0 80% 0}.logo-circles i{border-radius:50%}.logo-mixed i:nth-child(1){border-radius:80% 0 0 80%}.logo-mixed i:nth-child(2){border-radius:0 80% 80% 0}.logo-mixed i:nth-child(3){border-radius:80% 0 0 80%}.logo-mixed i:nth-child(4){border-radius:0 80% 80% 0}footer{height:3%;display:grid;place-items:center;background:#15171d;color:#fff;font-size:13px}.pixel-hero{position:absolute;width:88px;height:150px}.stage .pixel-hero{left:13%;bottom:0}.pixel-hero i{position:absolute;display:block}.head{left:19px;top:26px;width:52px;height:52px;background:#e89a72;box-shadow:-5px 8px #e89a72,5px 8px #e89a72}.hair{left:15px;top:14px;width:60px;height:22px;background:#573133;box-shadow:7px -5px #573133}.glasses{top:38px;width:22px;height:15px;background:#15151a;border-radius:40%}.glasses.left{left:18px}.glasses.right{left:49px}.nose{left:42px;top:50px;width:9px;height:15px;background:#c96c55}.mouth{left:35px;top:67px;width:23px;height:6px;background:#d91e45}.shirt{left:23px;top:80px;width:47px;height:46px;background:#13131b;border-left:13px solid #c52e3d;border-right:13px solid #c52e3d}.necklace{left:42px;top:84px;width:8px;height:18px;background:#ffd600}.arm{top:84px;width:13px;height:45px;background:#e89a72}.arm.left{left:11px;transform:rotate(20deg)}.arm.right{right:5px;transform:rotate(-20deg)}.leg{top:123px;width:20px;height:26px;background:#1c4d83}.leg.left{left:25px}.leg.right{left:49px}.shoe{top:145px;width:22px;height:9px;background:#5c3a24;border-radius:0 0 3px 3px}.shoe.left{left:24px}.shoe.right{left:48px}.pixel-hero.happy{animation:jump .32s 2 alternate}.pixel-hero.sad{filter:saturate(.5);animation:shake .18s 3}.message{position:absolute;left:50%;top:46%;z-index:8;transform:translate(-50%,-50%) scale(.7);padding:12px 26px;border:4px solid #fff;border-radius:7px;background:#333;color:#fff;font-weight:bold;opacity:0;pointer-events:none}.message.show{opacity:1;transform:translate(-50%,-50%) scale(1)}.message.good{background:#39a657}.message.bad{background:#d94545}.pause-layer{position:absolute;inset:0;z-index:10;background:#12131bd9}.pause-layer div{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);min-width:220px;padding:25px;text-align:center;border:4px solid #fff;border-radius:8px;background:#3e3447;color:#fff}.pause-layer button{padding:10px 35px;border:0;border-radius:4px;background:#47a9e9;color:#fff;font-weight:bold;margin:4px}.pause-layer .home-back{background:#f15c42}@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}@keyframes jump{to{transform:translateY(-13px)}}@media(max-width:700px){.game{width:100vw}.answers{gap:10px;padding-inline:20px}.hint{right:6%}.stage .pixel-hero{left:5%;transform:scale(.75);transform-origin:bottom}.level{font-size:11px}.question{width:48%}}@media(orientation:portrait){body:before{content:"សូមបង្វិលទូរស័ព្ទផ្ដេក";position:fixed;inset:0;z-index:99;display:grid;place-items:center;padding:30px;text-align:center;background:#171722;color:#fff;font:bold 24px "Segoe UI","Leelawadee UI",Arial}html[lang="en"] body:before{content:"Please rotate your phone"}.game{display:none}}
.home{position:absolute;inset:0;z-index:20;overflow:hidden;color:#fff;font-family:"Segoe UI","Leelawadee UI","Khmer OS Battambang","Noto Sans Khmer","Trebuchet MS",Arial,sans-serif;image-rendering:auto;background-color:#86cfe8;background-image:linear-gradient(45deg,#74c3df 25%,transparent 25%),linear-gradient(-45deg,#74c3df 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#74c3df 75%),linear-gradient(-45deg,transparent 75%,#74c3df 75%);background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0;user-select:none}
.home[hidden]{display:none!important}
.home button{font-family:inherit;color:#fff;cursor:pointer}

/* Real brand logo quiz */
body{font-family:"Segoe UI","Leelawadee UI","Khmer OS Battambang","Noto Sans Khmer",Arial,sans-serif}
.question{width:46%;padding:18px;text-align:center;font-size:clamp(18px,2.8vw,30px);line-height:1.45;text-wrap:balance}
.brand-logo{display:block;width:78%;height:78%;object-fit:contain;pointer-events:none;user-select:none;image-rendering:auto}
.answer{padding:14px}
@media(max-width:700px){.question{width:52%;font-size:clamp(14px,3.2vw,21px);padding:10px}.brand-logo{width:86%;height:86%}.answer{padding:8px}}

/* Wrong-answer feedback stays on the selected card long enough to understand it. */
.answer{position:relative;overflow:hidden}
.answer.wrong{outline:5px solid #f01f18;background:#b96961;animation:shake .18s 3}
.answer.wrong .brand-logo{opacity:.22;filter:grayscale(1)}
.wrong-label{position:absolute;inset:0;display:grid;place-items:center;padding:10px;color:#fff;font-size:clamp(16px,2.4vw,27px);font-weight:500;line-height:1.25;text-align:center;text-shadow:0 2px #3e3540;z-index:2}
.answer.correct-answer{outline:5px solid #34c94a;background:#eaffec;box-shadow:0 5px 0 #228f33,0 0 22px #4cff7099}
.answer.correct-answer .brand-logo{transform:scale(1.05)}

/* Simplified home: one primary action, compact status, quiet utilities. */
.home .hud-xp,.home .hud-facts,.home .mode-tabs,.home .mode-diff{display:none!important}
.home-hud{top:14px;left:16px;right:16px;height:44px;display:grid;grid-template-columns:auto 1fr auto auto auto;align-items:center;gap:8px}
.home .hud-chip,.home .hud-settings{height:42px;border-width:2px;border-radius:8px}
.home .hud-level{grid-column:1;width:62px}
.home .hud-shop{grid-column:3;width:78px;padding:3px 7px;background:linear-gradient(#f5bf31,#d99012)}
.home .hud-shop .hud-label{display:none}
.home .hud-energy{grid-column:4;width:104px;padding:3px 7px}
.home .hud-settings{grid-column:5;width:42px}
.home .hud-label{font-size:9px;opacity:.9}
.home .hud-body b{font-size:15px}
.home-stage{inset:0}
.home .logo-board{left:7%;top:21%;width:30%}
.home .home-hero{left:40%!important;bottom:6%!important}
.home .mode-panel{top:35%;right:7%;width:28%;max-width:260px;gap:12px}
.home .mode-name{height:auto;padding:0;border:0;background:transparent;box-shadow:none;pointer-events:none;font-size:clamp(18px,2.7vw,26px);text-shadow:0 3px 0 #247a32}
.home .mode-next{display:none}
.home .mode-play{height:74px;border-radius:14px;padding:0 16px;box-shadow:inset 0 3px 0 #fff5,inset 0 -7px 0 #0002,0 6px 0 #145218}
.home .mode-play strong{text-align:center;padding-left:0;font-size:clamp(28px,4.3vw,40px)}
.home .mode-play span{position:absolute;right:12px;bottom:8px;font-size:14px;opacity:.85}
@media(max-width:700px){.home-hud{left:8px;right:8px;gap:4px}.home .hud-shop{width:64px}.home .hud-energy{width:88px}.home .hud-settings{width:38px}.home .logo-board{left:4%;width:31%}.home .home-hero{left:37%!important}.home .mode-panel{right:4%;width:31%}.home .mode-play{height:62px}}

/* Portrait mobile layout — 9:16 */
body:before{display:none!important}
.game{
  width:min(100vw,calc(100svh * 9 / 16),480px);
  height:min(100svh,calc(100vw * 16 / 9),854px);
  aspect-ratio:9/16;
  display:block!important;
}

/* Quiz screen */
.topbar{height:8%;grid-template-columns:34px 82px 1fr 70px;padding:0 8px}
.pause{width:30px;height:30px}
.hearts{gap:4px}.heart{width:16px;height:14px}.heart:before,.heart:after{width:16px;height:14px}.heart:before{top:-7px}.heart:after{left:7px}
.level{font-size:11px}.stats{font-size:15px}.stats div{height:19px}.stats .coin{width:16px;height:16px}.clock{width:14px;height:14px;border-width:2px}
.stage{height:42%;display:block}
.stage .question{position:absolute;top:8%;left:10%;width:80%;height:53%;padding:16px;font-size:clamp(18px,5.2vw,27px);line-height:1.55}
.stage .pixel-hero{left:8%;bottom:0;transform:scale(.78);transform-origin:bottom left}
.stage .hint{right:7%;top:auto;bottom:9%;width:78px}
.answers{height:46%;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:12px;padding:13px 14px 17px}
.answer{min-height:0;padding:13px;border-radius:10px}
.brand-logo{width:82%;height:82%}
footer{height:4%;font-size:12px}
.wrong-label{font-size:clamp(17px,5vw,24px)}

/* Home screen */
.home-hud{top:max(10px,env(safe-area-inset-top));left:10px;right:10px;height:42px;grid-template-columns:auto 1fr auto auto auto;gap:5px}
.home .hud-chip,.home .hud-settings{height:40px}
.home .hud-level{width:58px}
.home .hud-shop{width:65px}
.home .hud-energy{width:88px}
.home .hud-settings{width:38px}
.home .hud-body b{font-size:13px}
.home .hud-label{font-size:8px}
.home .logo-board{top:11%;left:50%;width:58%;max-width:270px;transform:translateX(-50%)}
.home .home-hero{left:50%!important;bottom:28%!important;transform:translateX(-50%) scale(1.1);animation:portrait-idle 1.7s ease-in-out infinite}
.home .mode-panel{top:auto;right:auto;bottom:7%;left:50%;width:76%;max-width:330px;transform:translateX(-50%);gap:8px}
.home .mode-name{font-size:20px}
.home .mode-play{height:72px;border-radius:16px}
.home .mode-play strong{font-size:34px}
.home-floor{height:25%}
@keyframes portrait-idle{0%,100%{transform:translateX(-50%) translateY(0) scale(1.1)}50%{transform:translateX(-50%) translateY(-7px) scale(1.1)}}

@media(max-height:680px){
  .home .logo-board{top:10%;width:49%}
  .home .home-hero{bottom:27%;transform:translateX(-50%) scale(.88)}
  .home .mode-play{height:60px}
  .stage .question{height:50%;font-size:clamp(16px,4.7vw,22px)}
  .answer{padding:9px}
}

/* Country/category question: large brand mark under the prompt. */
.country-mode .stage .question{
  display:grid;grid-template-rows:auto 1fr;align-items:stretch;justify-items:center;
  padding:12px 14px 14px;gap:8px;
}
.country-mode .country-prompt{
  position:relative;inset:auto;width:100%;
  font-size:clamp(15px,4.2vw,20px);
}
.country-mode .question>.brand-logo{
  display:block;width:92%!important;height:100%!important;
  max-width:none;max-height:none;min-height:0;margin:0!important;padding:16px 18px;
  border:1px solid #d8e0e8;border-radius:18px;
  background:#fff;object-fit:contain;
  box-shadow:0 5px 14px #263b5630;
  filter:none;
}

/* Final no-energy button state override. */
#home .mode-play.is-off{
  opacity:1!important;filter:none!important;
  background-image:url("assets/btn-coral.webp")!important;
  cursor:pointer;
}
#home .mode-play.is-off strong{font-size:clamp(23px,6vw,31px)}

/* Keep the baked-in gameplay mascot below the question card. */
.quiz-bg{
  object-position:center top!important;
  transform:translateY(8%);
}

/* Premium unlock sheet: compact hierarchy and a clear primary action. */
#home .home-modal.is-unlock{
  width:min(88%,350px);padding:28px 24px 24px;gap:8px;
  border:2px solid #f8c653;border-radius:28px;
  background:linear-gradient(165deg,#17283a 0%,#0c1726 100%)!important;
  box-shadow:inset 0 1px #ffffff2e,0 0 0 5px #8a5b1b66,0 18px 45px #020914b8;
}
#home .home-modal.is-unlock .modal-x{top:12px;right:12px}
.is-unlock .unlock-lock{
  position:relative;width:54px;height:54px;margin:0 auto 2px;border-radius:18px;
  background:linear-gradient(145deg,#ffc94d,#f28b19);
  box-shadow:inset 0 2px #fff4a0,0 5px 0 #8f5012,0 9px 18px #0007;
}
.is-unlock .unlock-lock i{
  position:absolute;left:17px;top:23px;width:20px;height:17px;border-radius:4px;background:#fff7d0;
  box-shadow:0 2px #8f5f1a;
}
.is-unlock .unlock-lock i:before{
  content:"";position:absolute;left:3px;top:-12px;width:14px;height:14px;
  border:4px solid #fff7d0;border-bottom:0;border-radius:10px 10px 0 0;
}
#home .home-modal.is-unlock h2{margin:4px 30px 0;padding:0;font-size:clamp(20px,5.6vw,25px);color:#fff7db}
#home .home-modal.is-unlock .unlock-copy{margin:0 0 5px;color:#a9bdd1;font-size:12px;text-shadow:none}
.is-unlock .unlock-details, .pause-card .unlock-details{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%;margin:4px 0 7px}
.is-unlock .unlock-balance,.is-unlock .unlock-price,
.pause-card .unlock-balance,.pause-card .unlock-price{
  width:auto;margin:0;padding:10px 12px;border:1px solid #ffffff1f;border-radius:16px;
  background:#223247;color:#fff;box-shadow:inset 0 1px #ffffff14;
  display:flex;flex-direction:column;align-items:flex-start;gap:4px;
}
.is-unlock .unlock-balance>span,.is-unlock .unlock-price>span,
.pause-card .unlock-balance>span,.pause-card .unlock-price>span{color:#9fb2c7;font-size:11px;font-weight:500}
.is-unlock .unlock-balance strong,.is-unlock .unlock-price strong,
.pause-card .unlock-balance strong,.pause-card .unlock-price strong{display:flex;align-items:center;gap:7px;color:#ffe276;font-size:22px;line-height:1}
.pause-card .unlock-balance,.pause-card .unlock-price{
  width:auto!important;min-width:0;margin:0!important;
}
#home .home-modal.is-unlock #unlockModeBtn,
#home .home-modal.is-unlock #openShopBtn{
  width:100%;height:54px;margin:0;padding:0 14px 4px;border:1px solid #8ff29a!important;border-radius:17px!important;
  background:linear-gradient(180deg,#58d663,#2cab42)!important;
  box-shadow:inset 0 2px #ffffff61,0 5px 0 #14742b,0 9px 18px #04150b80!important;
  color:#fff;font-size:16px;text-shadow:0 2px #176e2b;cursor:pointer;
}
#home .home-modal.is-unlock #unlockModeBtn:active:not(:disabled){transform:translateY(4px);box-shadow:inset 0 2px #ffffff61,0 1px 0 #14742b!important}
#home .home-modal.is-unlock #unlockModeBtn:disabled{background:linear-gradient(#657384,#465363)!important;border-color:#8492a1!important;box-shadow:inset 0 1px #ffffff35,0 4px 0 #29333e!important;opacity:.72}
.is-unlock .need-coins{margin:2px 0 0!important;color:#ffb8a8!important;font-size:12px!important;text-shadow:none!important}

/* Category mode asks with the brand name only—no logo artwork. */
.category-text-mode .stage .question{
  display:grid;place-items:center;text-align:center;
  padding:24px 28px;font-size:clamp(19px,5vw,25px);
  line-height:1.45;
}

/* Keep all six mode names readable inside the selector. */
#home .mode-name b{
  display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;font-size:clamp(14px,4vw,21px);
}

/* Make the no-energy state explicit instead of looking accidentally disabled. */
#home .mode-play.is-off{
  opacity:1!important;filter:none!important;
  background-image:url("assets/btn-coral.webp")!important;
  cursor:pointer;
}
#home .mode-play.is-off strong{font-size:clamp(23px,6vw,31px)}

/* Edge-to-edge app canvas: no outer padding, border, or letterboxing. */
html,body{width:100%;height:100%;margin:0;padding:0;overflow:hidden}
body{display:grid;place-items:center;background:#11121c}
.game{
  width:min(100vw,calc(100dvh * 10 / 16));
  height:min(100dvh,calc(100vw * 16 / 10));
  min-width:0;
  max-width:none;
  max-height:none;
  aspect-ratio:10/16;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.home{inset:0;width:100%;height:100%}

/* Polished portrait game HUD */
.topbar{
  position:relative;
  height:9%;
  min-height:58px;
  display:grid;
  grid-template-columns:42px 78px minmax(0,1fr) 76px;
  align-items:center;
  gap:7px;
  padding:8px 10px 10px;
  background:linear-gradient(180deg,#332531 0%,#211923 72%,#17131b 100%);
  border:0;
  box-shadow:0 5px 0 #e66c63,0 10px 18px #331c2b55;
  z-index:6;
}
.topbar:after{
  content:"";
  position:absolute;
  left:12px;right:12px;bottom:-3px;
  height:2px;
  border-radius:2px;
  background:linear-gradient(90deg,transparent,#ffad8e 18%,#ffad8e 82%,transparent);
}
.pause{
  width:38px;height:38px;
  gap:5px;
  border:2px solid #ff9a7d;
  border-radius:10px;
  background:linear-gradient(#ff7057,#e84b43);
  box-shadow:inset 0 2px 0 #ffc0aa,0 4px 0 #9f2d36,0 6px 10px #0005;
}
.pause i{width:5px;height:17px;border-radius:2px;background:#fff7ea;box-shadow:0 1px #923338}
.hearts{height:30px;display:flex;align-items:center;gap:4px;padding-left:2px}
.heart{
  position:relative;
  width:21px;height:19px;
  flex:0 0 21px;
  transform:none;
  border:0;
  border-radius:0;
  background:linear-gradient(145deg,#ff6d76,#ed334f);
  clip-path:polygon(50% 96%,8% 55%,2% 32%,8% 13%,24% 3%,42% 8%,50% 20%,58% 8%,76% 3%,92% 13%,98% 32%,92% 55%);
  filter:drop-shadow(0 2px 0 #8d2035) drop-shadow(0 0 2px #ff9ca0);
}
.heart:before,.heart:after{display:none}
.heart.lost{opacity:.18;filter:grayscale(1)}
.level{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:center;
  color:#fff9ea;
  font-size:12px;
  font-weight:400;
  letter-spacing:.01em;
  text-shadow:0 2px 0 #000,0 0 8px #f69a8066;
}
.stats{
  align-self:center;
  width:76px;height:48px;
  display:grid;
  grid-template-rows:1fr 1fr;
  align-content:center;
  padding:4px 8px;
  border:1px solid #665967;
  border-radius:12px;
  background:linear-gradient(145deg,#5b5360,#3e3945);
  box-shadow:inset 0 2px 0 #8a818e,0 3px 0 #17131b,0 6px 12px #0004;
  font-size:15px;
}
.stats div{height:auto;display:flex;align-items:center;gap:6px;line-height:1}
.stats b{color:#fff;font-weight:500;text-shadow:0 1px #1c1720}
.stats .coin{width:17px;height:17px;border-width:2px}
.stats .clock{width:15px;height:15px;border:2px solid #d7d9db;box-shadow:0 1px #17191d}
.stats .clock:after{left:5px;top:2px;height:5px;background:#fff}

/* Keep the vertical rhythm clean below the taller HUD. */
.stage{height:41%}
.answers{height:46%}
footer{height:4%}

/* Readable regular-weight fonts: Latin + Khmer. */
@font-face{font-family:"Game Sans";src:url("assets/fonts/nunito-400.ttf") format("truetype");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Game Khmer";src:url("assets/fonts/kantumruy-400.ttf") format("truetype");font-weight:400;font-style:normal;font-display:swap}

html[lang="en"] body,html[lang="en"] button{font-family:"Game Sans",Arial,sans-serif;font-weight:400}
html[lang="km"] body,html[lang="km"] button{font-family:"Game Khmer","Noto Sans Khmer",Arial,sans-serif;font-weight:400}
.home,.home button{font-family:inherit;font-weight:400}
.game b,.game strong{font-weight:500}
.question{font-family:inherit!important;font-weight:400!important;letter-spacing:.01em;text-shadow:0 1px 0 #3f344466;line-height:1.4}
html[lang="km"] .question{line-height:1.55;font-weight:400!important}
.level,.stats,.mode-play,.hud-body,.hud-label,footer,.hint,.message,.pause-layer,.wrong-label{font-family:inherit;font-weight:400}
.level{font-weight:400;letter-spacing:.01em;text-shadow:0 1px 0 #0008}
.stats b{font-weight:500}
.hint strong{font-weight:500;text-shadow:0 1px 0 #1f4c78}
.mode-name,.mode-play strong,.home-modal h2{font-weight:500;letter-spacing:0}
html[lang="km"] .mode-name,html[lang="km"] .mode-play strong,html[lang="km"] .home-modal{font-family:"Game Khmer",Arial,sans-serif}
.wrong-label,.message{font-family:inherit;font-weight:500;text-shadow:0 1px 0 #3e3540}
.hud-facts,.hud-settings,.hud-lang{padding:0}
.home-floor{position:absolute;left:0;right:0;bottom:0;z-index:1;height:17%;background:linear-gradient(#53585d,#3f4348);box-shadow:inset 0 10px #2f3336}
.home-hud{position:absolute;top:16px;left:10px;right:10px;z-index:5;display:flex;align-items:flex-end;gap:7px;height:56px}
.hud-chip,.hud-facts,.hud-settings,.hud-lang{position:relative;height:52px;border:2.5px solid #1b1c22;border-radius:9px;box-shadow:inset 0 2px 0 #fff5,inset 0 -4px 0 #0003,0 3px 0 #12131a}
.hud-chip{display:flex;flex-direction:column;padding:3px 7px 5px}
.hud-label{display:block;font-size:11px;font-weight:500;letter-spacing:.2px;line-height:1.1;text-align:center;text-shadow:0 1px 0 #111;white-space:nowrap}
.hud-body{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;min-height:0}
.hud-body b{font-size:16px;text-shadow:0 1px 0 #0008}
.hud-level{width:62px;flex:none;background:linear-gradient(#4aa7ea,#2b86cc)}
.hud-xp{flex:1.15;min-width:0;background:linear-gradient(#62c15a,#3d9a45)}
.hud-shop{width:92px;flex:none;background:linear-gradient(#b25fd4,#8a3db0)}
.hud-energy{width:118px;flex:none;background:linear-gradient(#7ad2ef,#4eb4dc)}
.hud-facts{flex:1.05;min-width:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(#ffe56a,#f0c230);color:#fff;font-size:clamp(16px,2.4vw,22px);font-weight:500;text-shadow:0 1px 0 #b88612}
.hud-settings{width:48px;flex:none;background:linear-gradient(#ffe56a,#f0c230);display:grid;place-items:center;padding:0}
.hud-lang{width:64px;flex:none;display:grid;grid-template-columns:1fr 1fr;gap:3px;padding:5px;background:linear-gradient(#ffe56a,#f0c230)}
.hud-lang button{display:grid;place-items:center;padding:0;border:0;border-radius:5px;background:transparent;color:#fff;font-size:11px;font-weight:500;box-shadow:none;text-shadow:0 1px 0 #b88612}
.hud-lang button.on{background:#fff;color:#1b1c22;box-shadow:0 1px 0 #b88612}
.hud-shop:active,.hud-facts:active,.hud-settings:active,.hud-lang:active,.mode-name:active,.mode-play:active,.mode-tabs button:active{transform:translateY(3px);box-shadow:inset 0 3px 0 #0003}
.xp-track{position:relative;flex:1;height:22px;overflow:hidden;border:2px solid #1d5c28;border-radius:4px;background:#1f6b2c}
.xp-fill{position:absolute;inset:0 auto 0 0;width:16.6%;background:linear-gradient(#8be56a,#4caf50)}
.xp-track b{position:relative;z-index:1;display:block;width:100%;text-align:center;font-size:13px;line-height:18px}
.facts-badge{position:absolute;top:-8px;right:8px;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#e23b3b;border:2px solid #fff;color:#fff;font-size:14px;font-style:normal;font-weight:900;line-height:1;text-shadow:none;box-shadow:0 2px 0 #8d1c1c}
.ico{display:inline-block;flex:none}
.ico-star{width:20px;height:20px;background:#f3f0e6;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);filter:drop-shadow(0 1px 0 #1a1a1a)}
.ico-star.sm{width:16px;height:16px}
.ico-bolt{width:14px;height:20px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%233aa6ee' stroke='%230b3a5c' stroke-width='1.5' stroke-linejoin='round' d='M13 2L3 14h8l-2 8 12-14h-8l2-8z'/%3E%3C/svg%3E")}
.ico-gear{width:28px;height:28px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' stroke='%231b1c22' stroke-width='.6' d='M19.14 12.94c.04-.31.06-.63.06-.94s-.02-.63-.06-.94l2.03-1.58a.5.5 0 0 0 .12-.64l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39 1a7.15 7.15 0 0 0-1.63-.94l-.36-2.54a.5.5 0 0 0-.5-.42h-3.84a.5.5 0 0 0-.5.42l-.36 2.54c-.59.24-1.13.55-1.63.94l-2.39-1a.5.5 0 0 0-.6.22L2.71 8.84a.5.5 0 0 0 .12.64l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94L2.83 14.68a.5.5 0 0 0-.12.64l1.92 3.32c.13.23.4.32.64.22l2.39-1c.5.39 1.04.7 1.63.94l.36 2.54c.05.24.26.42.5.42h3.84c.24 0 .45-.18.5-.42l.36-2.54c.59-.24 1.13-.55 1.63-.94l2.39 1c.23.1.51 0 .64-.22l1.92-3.32a.5.5 0 0 0-.12-.64l-2.03-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z'/%3E%3C/svg%3E")}
.logo-board{position:absolute;left:4.2%;top:20%;z-index:2;width:29%;max-width:260px;aspect-ratio:1;overflow:hidden;border:4px solid #8af3ff;border-radius:8px;background:#bfeaf6;box-shadow:0 0 0 4px #3ad7f0,0 0 26px 8px #5ef0ffaa,0 8px 0 #2a92ad}
.mosaic{display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(6,1fr);height:100%;gap:3px;padding:4px}
.tile{display:grid;place-items:center;overflow:hidden;border-radius:4px;font-size:17px;font-weight:900;color:#fff;text-shadow:1px 1px 0 #0006}
.t1{grid-area:1/1/3/3;background:#e31c23;font-size:26px}.t2{grid-area:1/3/2/5;background:#111}.t3{grid-area:1/5/3/7;background:#f5c518;color:#c41200;font-size:24px}
.t4{grid-area:3/1/5/2;background:#cc0000}.t5{grid-area:2/3/4/5;background:#f96302;font-size:22px}.t6{grid-area:3/5/5/7;background:#034694;font-size:22px}
.t7{grid-area:5/1/7/3;background:#ffc72c;color:#c8102e;font-size:22px}.t8{grid-area:4/3/6/4;background:#0071c5}
.t9{grid-area:4/4/6/5;background:#004b93}.t10{grid-area:5/5/7/7;background:#1ed760;color:#111;font-size:22px}
.t11{grid-area:6/3/7/4;background:#98002e}.t12{grid-area:6/4/7/5;background:#dc0000}
.t13,.t14,.t15,.t16{display:none}
.mk-swoosh{width:70%;height:10px;border-radius:0 0 100% 100%;border-bottom:4px solid #fff;transform:rotate(-18deg)}
.mk-ball{width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 3px #cc0000}
.mk-ring{width:16px;height:16px;border:3px solid #fff;border-radius:50%}
.mk-tri{width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:14px solid #fff}
.logo-word{position:absolute;inset:0;z-index:2;display:grid;place-items:center;font-size:clamp(34px,6.8vw,58px);letter-spacing:2px;color:#fff;-webkit-text-stroke:0;text-shadow:-3px -3px 0 #17171c,3px -3px 0 #17171c,-3px 3px 0 #17171c,3px 3px 0 #17171c,0 5px 0 #0d0d12;pointer-events:none}
.home-hero{left:34%!important;bottom:6%!important;z-index:3;height:160px;image-rendering:pixelated;transform-origin:bottom center;animation:idle 1.7s ease-in-out infinite}
@keyframes idle{0%,100%{transform:translateY(0) scale(1.12)}50%{transform:translateY(-7px) scale(1.12)}}
.mode-panel{position:absolute;top:20%;right:3.2%;z-index:4;width:34%;max-width:300px;display:flex;flex-direction:column;gap:6px}
.mode-tabs{display:grid;grid-template-columns:repeat(6,1fr);gap:4px}
.mode-tabs button{height:36px;display:grid;place-items:center;padding:0;border:2.5px solid #1b1c22;border-radius:6px;background:linear-gradient(#5ec85a,#3fa046);box-shadow:inset 0 2px 0 #fff4,0 2px 0 #1b1c22}
.mode-tabs button svg{width:18px;height:18px;fill:#fff;filter:drop-shadow(0 1px 0 #1b5e20)}
.mode-tabs button.on{background:linear-gradient(#7be06f,#4caf50);box-shadow:inset 0 2px 0 #fff6,0 2px 0 #1b1c22}
.mode-tabs button.on:after{content:"";position:absolute;left:18%;right:18%;bottom:4px;height:3px;border-radius:2px;background:#fff}
.mode-tabs button{position:relative}
.mode-name,.mode-diff,.mode-play{width:100%;border:2.5px solid #1b1c22;border-radius:8px;color:#fff;text-shadow:0 2px 0 #145a22}
.mode-name{display:flex;align-items:center;justify-content:center;height:52px;background:linear-gradient(#62d15c,#3fa046);box-shadow:inset 0 2px 0 #fff4,inset 0 -4px 0 #0002,0 3px 0 #145218;font-size:clamp(22px,3.4vw,32px);font-weight:500}
.mode-name b{flex:1;text-align:center}
.mode-next{width:28px;height:28px;margin-right:10px;border:2px solid #1b1c22;border-radius:5px;background:linear-gradient(#ffe56a,#f0c230);box-shadow:inset 0 1px 0 #fff8}
.mode-next:after{content:"";display:block;width:0;height:0;margin:7px 0 0 9px;border-style:solid;border-width:6px 0 6px 9px;border-color:transparent transparent transparent #145218}
.mode-diff{height:30px;display:flex;align-items:center;justify-content:center;gap:6px;background:linear-gradient(#3a9a44,#247a32);box-shadow:inset 0 2px 0 #fff2,0 2px 0 #123;font-size:16px;font-weight:500;white-space:nowrap}
.mode-play{display:flex;align-items:center;height:58px;padding:0 14px 3px;background:linear-gradient(#6fe068,#3fb246);box-shadow:inset 0 3px 0 #fff4,inset 0 -5px 0 #0002,0 4px 0 #145218}
.mode-play strong{flex:1;font-size:clamp(26px,4vw,36px);text-align:left;padding-left:8px}
.mode-play span{display:flex;align-items:center;gap:6px;font-size:22px;font-weight:500}
.mode-play.is-off{filter:grayscale(.7);opacity:.65}
.home-layer{position:absolute;inset:0;z-index:8;display:grid;place-items:center;background:#12131bd9}
.home-layer[hidden]{display:none!important}
.home-modal{width:min(78%,420px);padding:18px 18px 16px;border:4px solid #fff;border-radius:10px;background:linear-gradient(#4a3f55,#322a3d);box-shadow:0 10px 0 #1a1520;text-align:center}
.home-modal h2{margin:0 0 10px;font-size:26px;text-shadow:0 2px 0 #000}
.home-modal p{margin:0 0 12px;font-size:16px;line-height:1.35;text-shadow:0 1px 0 #0008}
.home-modal .row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0;padding:10px 12px;border:2px solid #1b1c22;border-radius:8px;background:#2b2433}
.home-modal button{min-width:92px;padding:10px 16px;border:2px solid #1b1c22;border-radius:8px;background:linear-gradient(#5ec85a,#3fa046);font-weight:500;box-shadow:0 3px 0 #145218}
.home-modal .close{background:linear-gradient(#f15c42,#c43c36);box-shadow:0 3px 0 #7a1f1c}
.home-modal .buy:disabled{filter:grayscale(.8);opacity:.55}
.lang-picks{display:flex;gap:6px}
.lang-picks button{min-width:58px;padding:8px 10px;background:linear-gradient(#5a5168,#3e3648);box-shadow:0 3px 0 #1a1520}
.lang-picks button.on{background:linear-gradient(#ffe56a,#f0c230);color:#1b1c22;box-shadow:0 3px 0 #b88612}
html[lang="km"] .hud-label{font-size:10px}
html[lang="km"] .hud-level{width:72px}
html[lang="km"] .hud-energy{width:124px}
html[lang="km"] .question,.pause-layer,.message{font-family:"Game Khmer","Noto Sans Khmer",Arial,sans-serif}
.pause-layer button{font-weight:500}
@media(max-width:700px){
  .home-hud{gap:4px;height:48px}
  .hud-chip,.hud-facts,.hud-settings,.hud-lang{height:42px;border-radius:7px}
  .hud-level{width:48px}
  .hud-shop{width:72px}
  .hud-energy{width:92px}
  .hud-settings{width:40px}
  .hud-lang{width:54px}
  .hud-label{font-size:9px}
  .hud-body b,.hud-facts{font-size:13px}
  .logo-board{width:30%;top:24%}
  .logo-word{font-size:28px;-webkit-text-stroke:3px #17171c}
  .mode-panel{width:38%;top:22%}
  .mode-tabs button{height:28px}
  .mode-name{height:40px;font-size:18px}
  .mode-play{height:44px}
  .mode-play strong{font-size:20px}
  .home-hero{transform:scale(.9);left:32%!important}
}

/* Premium animated home */
.home{background-color:#63c5e4;background-image:radial-gradient(circle at 50% 35%,#d8f9ff 0,#8bdef1 29%,transparent 58%),linear-gradient(155deg,#75d8ee 0%,#4db7dc 48%,#3586bd 100%)}
.home:before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.16;background-image:linear-gradient(45deg,#fff 25%,transparent 25%),linear-gradient(-45deg,#fff 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#fff 75%),linear-gradient(-45deg,transparent 75%,#fff 75%);background-size:28px 28px;background-position:0 0,0 14px,14px -14px,-14px 0}
.home:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#15375d2b,transparent 15% 85%,#15375d2b),linear-gradient(0deg,#10273e55,transparent 26%)}
.floating-marks{position:absolute;inset:0;z-index:1;overflow:hidden;pointer-events:none}
.float-mark{position:absolute;display:grid;place-items:center;width:34px;height:34px;border:2px solid #ffffffa8;border-radius:10px;color:#fff;font:700 17px "Game Sans",sans-serif;font-style:normal;background:linear-gradient(145deg,#ffffff45,#ffffff12);box-shadow:0 7px 15px #14548230,inset 0 1px #fff8;opacity:.48;animation:float-mark 6s ease-in-out infinite}
.fm-1{left:8%;top:18%}.fm-2{right:7%;top:18%;animation-delay:-1.2s;color:#ffe35c}.fm-3{left:5%;top:55%;animation-delay:-2.1s}.fm-4{right:8%;top:52%;animation-delay:-3.4s;color:#ff7f8c}.fm-5{left:16%;bottom:10%;animation-delay:-4.2s;color:#ffe35c}.fm-6{right:17%;bottom:16%;animation-delay:-5s;color:#62e589}
@keyframes float-mark{0%,100%{translate:0 0;rotate:-4deg}50%{translate:0 -16px;rotate:6deg}}

.home .logo-board{overflow:hidden;border:4px solid #eaffff;border-radius:16px 16px 28px 28px;clip-path:polygon(8% 0,92% 0,100% 10%,94% 76%,50% 100%,6% 76%,0 10%);box-shadow:0 0 0 5px #31cde9,0 0 34px 13px #90f5ffcc,0 12px 22px #155d8b66;animation:shield-float 3.2s ease-in-out infinite}
.home .logo-board:after{content:"";position:absolute;inset:-30% 48% -30% -20%;z-index:4;transform:rotate(18deg);background:linear-gradient(90deg,transparent,#fff7,transparent);animation:shield-shine 4.5s ease-in-out infinite;pointer-events:none}
@keyframes shield-float{0%,100%{translate:-50% 0}50%{translate:-50% -8px}}
@keyframes shield-shine{0%,55%{translate:-180% 0}80%,100%{translate:380% 0}}

.home .home-hero{filter:drop-shadow(0 10px 7px #17384e66)}
.home .home-hero .glasses{transform-origin:center;animation:hero-blink 5s ease-in-out infinite}
.home .home-hero .mouth{animation:hero-smile 5s ease-in-out infinite}
@keyframes hero-blink{0%,45%,49%,100%{scale:1 1}46%,48%{scale:1 .15}}
@keyframes hero-smile{0%,42%,55%,100%{height:6px;border-radius:0}46%,51%{height:10px;border-radius:0 0 12px 12px}}

.home .mode-play{position:relative;overflow:hidden;animation:play-pulse 1.8s ease-in-out infinite}
.home .mode-play:before{content:"";position:absolute;inset:4px;border:2px solid #baffae;border-radius:11px;opacity:.55;pointer-events:none}
.home .mode-play:after{content:"";position:absolute;top:-70%;bottom:-70%;width:34%;left:-50%;transform:rotate(18deg);background:linear-gradient(90deg,transparent,#fff8,transparent);animation:play-shine 3s ease-in-out infinite;pointer-events:none}
@keyframes play-pulse{0%,100%{scale:1}50%{scale:1.025}}
@keyframes play-shine{0%,55%{left:-50%}85%,100%{left:125%}}
.home .hud-shop .coin{animation:coin-spin 2.8s linear infinite;transform-style:preserve-3d}
@keyframes coin-spin{0%{transform:perspective(60px) rotateY(0)}50%{transform:perspective(60px) rotateY(90deg) scaleX(.45)}100%{transform:perspective(60px) rotateY(360deg)}}
.home .hud-chip,.home .hud-settings{backdrop-filter:blur(5px);box-shadow:inset 0 2px 0 #fff7,inset 0 -4px 0 #0002,0 5px 12px #164f7340}
@media(prefers-reduced-motion:reduce){.float-mark,.home .logo-board,.home .logo-board:after,.home .home-hero,.home .home-hero .glasses,.home .home-hero .mouth,.home .mode-play,.home .mode-play:after,.home .hud-shop .coin{animation:none!important}}

/* Premium casual-game gameplay screen */
.stage{
  background-color:#edaca3;
  background-image:radial-gradient(circle at 50% 20%,#ffd8bd 0,#efaca4 45%,transparent 72%),linear-gradient(160deg,#f3bdb0,#d98791);
  box-shadow:inset 0 -12px 24px #8a4c6540;
}
.stage:before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.14;background-image:radial-gradient(#fff 1.4px,transparent 1.4px);background-size:18px 18px}
.stage .question{
  border:3px solid #fff2c2;
  border-radius:24px;
  background:linear-gradient(145deg,#ffe899 0%,#ffc95e 100%);
  box-shadow:inset 0 3px 0 #fff8,inset 0 -7px 0 #eba949,0 9px 0 #9a5660,0 16px 28px #803c5145;
  color:#fff;
  text-shadow:0 2px 0 #554255;
}
.stage .question:after{content:"";position:absolute;inset:9px;border:2px dashed #e4a74e;border-radius:16px;opacity:.58;pointer-events:none}

.stage .pixel-hero{filter:drop-shadow(0 10px 7px #633e4b66);animation:game-mascot-idle 1.8s ease-in-out infinite}
.stage .pixel-hero .head{border-radius:46% 46% 42% 42%;box-shadow:-5px 8px #e89a72,5px 8px #e89a72,inset 0 3px #ffc2a0}
.stage .pixel-hero .hair{border-radius:22px 22px 6px 6px}
.stage .pixel-hero .glasses{border-radius:50%;box-shadow:inset 0 2px #4a3d48}
.stage .pixel-hero .shirt{border-radius:10px 10px 4px 4px}
@keyframes game-mascot-idle{0%,100%{translate:0 0}50%{translate:0 -5px}}

.stage .hint{
  overflow:hidden;
  border:3px solid #c9efff;
  border-radius:15px;
  background:#fff;
  box-shadow:inset 0 2px #fff,0 6px 0 #1467ae,0 0 22px #35c8ff99,0 10px 18px #4b314c45;
  animation:hint-glow 2.2s ease-in-out infinite;
}
.stage .hint span{background:linear-gradient(#fffdf7,#fff0cf);color:#564652}
.stage .hint strong{background:linear-gradient(#6bcaff,#268bdd);text-shadow:0 2px 0 #17528d}
.stage .hint:active:not(:disabled){translate:0 4px;box-shadow:0 2px 0 #1467ae,0 0 14px #35c8ff80}
@keyframes hint-glow{0%,100%{filter:brightness(1)}50%{filter:brightness(1.08)}}

.answers{
  gap:14px;
  padding:16px 16px 20px;
  background:linear-gradient(160deg,#4e515c 0%,#2e303a 100%);
  box-shadow:inset 0 10px 22px #17192380;
}
.answer{
  border:3px solid #fff;
  border-radius:18px;
  background:linear-gradient(145deg,#fff,#f6f4f0);
  box-shadow:inset 0 2px 0 #fff,0 7px 0 #b9b6b8,0 12px 20px #16182370;
  transition:translate .14s ease,scale .14s ease,box-shadow .14s ease,filter .2s ease;
}
.answer:hover{filter:brightness(1.03)}
.answer:active:not(:disabled){translate:0 5px;scale:.98;box-shadow:inset 0 2px #fff,0 2px 0 #a5a2a5,0 5px 10px #16182355}
.answer .brand-logo{filter:drop-shadow(0 4px 5px #27334a25);transition:scale .2s ease,opacity .2s ease,filter .2s ease}
.answer.correct,.answer.correct-answer{border-color:#d9ffe0;outline:4px solid #43d560;box-shadow:inset 0 2px #fff,0 7px 0 #258e39,0 0 24px #54ff7488}
.answer.wrong{border-color:#ffd6d3;outline:4px solid #f13d39;background:linear-gradient(145deg,#d67b73,#af5d61);box-shadow:0 7px 0 #8c3038,0 0 22px #ff514b70}
footer{background:linear-gradient(#232631,#171923);box-shadow:inset 0 2px #626673;color:#fff7df;letter-spacing:.08em}
@media(prefers-reduced-motion:reduce){.stage .pixel-hero,.stage .hint{animation:none!important}}

/* Names / Country mode and coin unlock */
.home .mode-name{pointer-events:auto;cursor:pointer;min-height:38px;padding:5px 42px 5px 12px;border:2px solid #1b1c22;border-radius:12px;background:linear-gradient(#49bce5,#278dc5);box-shadow:inset 0 2px #fff5,0 4px 0 #155a86;text-shadow:0 2px #145173}
.home .mode-next{display:block;position:absolute;right:8px;width:28px;height:28px;margin:0}
.home .mode-name.is-locked:after{content:"250";position:absolute;right:42px;top:50%;translate:0 -50%;padding:2px 7px;border-radius:9px;background:#463b4b;color:#ffe276;font:700 11px "Game Sans",sans-serif;text-shadow:none;box-shadow:inset 0 1px #776a7a}
.home .mode-name.is-locked .mode-next:after{border:0;width:10px;height:9px;margin:10px 0 0 7px;border-radius:2px;background:#56420b;box-shadow:0 -5px 0 -2px #56420b}
.country-prompt{position:absolute;left:8px;right:8px;top:8px;z-index:2;padding:5px 8px;border-radius:12px;background:#51495b;color:#fff;font-size:clamp(12px,3.2vw,17px);line-height:1.2;text-shadow:0 1px #17121b}
.question>.brand-logo{width:58%;height:58%;margin-top:28px;object-fit:contain;filter:drop-shadow(0 5px 5px #65414935)}
.country-answer{color:#4c4050;font-family:inherit;font-size:clamp(17px,4.8vw,25px);font-weight:700;line-height:1.3;text-align:center;text-shadow:0 1px #fff}
html[lang="km"] .country-answer{font-family:"Game Khmer","Noto Sans Khmer",Arial,sans-serif;font-size:clamp(16px,4.4vw,23px)}
.unlock-price{width:120px;margin:12px auto;display:flex;align-items:center;justify-content:center;gap:8px;padding:9px;border-radius:14px;background:#27212e;color:#ffe276;font:700 25px "Game Sans",sans-serif;box-shadow:inset 0 2px #5c5062}
.unlock-price .coin{width:24px;height:24px}.need-coins{color:#ffb7ad!important;font-size:13px!important}.home-modal button:disabled{filter:grayscale(1);opacity:.45}

/* ===== Home v2: portrait mascot lobby ===== */
#home.home{
  background:#6ec7e8;
  font-family:inherit;
}
#home .home-bg{
  position:absolute;inset:0;z-index:0;
  width:100%;height:100%;object-fit:cover;object-position:center bottom;
  pointer-events:none;user-select:none;
}
#home.home:before,#home.home:after,.home .floating-marks,.home .logo-board,#home .home-floor,#home .hero-glow,#home .hero-pad{display:none!important}
#home .home-hud{
  position:absolute;top:max(12px,env(safe-area-inset-top));left:10px;right:10px;
  z-index:6;height:40px;display:flex;align-items:center;gap:6px;
  pointer-events:none;
}
#home .home-hud > *{pointer-events:auto}
#home .home-hud-gap{flex:1;min-width:4px}
#home .hud-chip,#home .hud-settings,#home .hud-lang{
  height:38px;border:2px solid #1b1c22;border-radius:19px;
  box-shadow:inset 0 2px 0 #fff6,0 3px 0 #12131a;
  backdrop-filter:none;
}
#home .hud-chip{display:flex;align-items:center;padding:0 8px;width:auto}
#home .hud-label{display:none}
#home .hud-body{gap:5px;padding:0}
#home .hud-body b{font-size:14px;font-weight:500}
#home .hud-level{background:linear-gradient(#5eb4ef,#2f8fd4);width:auto;min-width:52px}
#home .hud-shop{background:linear-gradient(#f6c54a,#e39a14);width:auto;min-width:64px;padding:0 8px}
#home .hud-energy{background:linear-gradient(#7ad2ef,#45b4d8);width:auto;min-width:58px}
#home .hud-settings{width:38px;flex:none;background:linear-gradient(#6d7580,#4a515a);display:grid;place-items:center}
#home .hud-level,#home .hud-shop,#home .hud-energy{width:auto!important}
#home .hud-lang{width:58px;flex:none;display:grid!important;grid-template-columns:1fr 1fr;gap:2px;padding:3px;background:linear-gradient(#f6c54a,#e39a14)}
#home .ico-gear{width:22px;height:22px}
#home .home-stage{
  position:absolute;inset:0 0 28% 0;z-index:2;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
}
#home .home-title-wrap{
  position:absolute;top:11%;left:0;right:0;z-index:3;
  display:flex;flex-direction:column;align-items:center;gap:4px;
  pointer-events:none;
}
#home .home-title{
  font-size:clamp(28px,8vw,42px);font-weight:500;letter-spacing:.04em;
  color:#fff;text-shadow:0 2px 0 #3a5a78,0 6px 16px #1d3a5466;
}
#home .home-tag{
  font-size:15px;font-weight:400;color:#fff;opacity:.95;
  text-shadow:0 1px 0 #3a5a78;
}
#home .home-hero-img{display:none!important}
#home .home-dock{
  position:absolute;left:50%;bottom:5%;z-index:5;
  width:min(84%,340px);transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
#home .mode-name{
  width:auto;height:32px;padding:0 16px;margin:0;
  border:2px solid #1b1c22;border-radius:16px;
  background:linear-gradient(#5aa8d8,#3b86b8);
  box-shadow:inset 0 1px 0 #fff5,0 3px 0 #1b4d6a;
  font-size:14px;font-weight:500;text-shadow:0 1px 0 #1b4d6a;
}
#home .mode-name b{flex:none}
#home .mode-play{
  position:relative;width:100%;height:76px;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  padding:0 18px;border:3px solid #1b1c22;border-radius:22px;
  background:linear-gradient(#7ae56a,#3db246);
  box-shadow:inset 0 3px 0 #fff5,inset 0 -7px 0 #0002,0 7px 0 #1e6b2c;
  animation:none;
}
#home .mode-play:before,#home .mode-play:after{display:none}
#home .mode-play strong{
  flex:1;text-align:center;padding:0;
  font-size:clamp(28px,8vw,40px);font-weight:500;
  text-shadow:0 2px 0 #145218;
}
#home .mode-play span{
  position:static;right:auto;bottom:auto;
  font-size:18px;opacity:1;font-weight:500;
}
#home .mode-play:active{transform:translateY(4px);box-shadow:inset 0 3px 0 #0002,0 3px 0 #1e6b2c}
#home .mode-play.is-off{filter:grayscale(.7);opacity:.7}
@keyframes home-bob{0%,100%{transform:translateX(-50%) translateY(0)}50%{transform:translateX(-50%) translateY(-8px)}}
@media(max-height:680px){
  #home .home-title{font-size:28px}
  #home .home-hero-img{width:min(62%,220px)}
  #home .mode-play{height:64px}
}
@media(prefers-reduced-motion:reduce){#home .home-hero-img{animation:none!important}}

/* ===== Shared art kit: gold-rim 3D buttons + sunset quiz ===== */
.game{image-rendering:auto;background:#142033}
.quiz-bg{
  position:absolute;inset:0;z-index:0;
  width:100%;height:100%;object-fit:cover;object-position:center bottom;
  pointer-events:none;user-select:none;
}
.topbar,.stage,.answers,footer{position:relative;z-index:2}
.message{position:absolute;z-index:8}
.pause-layer{position:absolute;z-index:12}
.btn-green,.btn-gold,.btn-coral,.btn-sky,.btn-icon{
  border:0!important;border-radius:0!important;box-shadow:none!important;
  background-color:transparent!important;
  background-repeat:no-repeat!important;background-position:center!important;background-size:100% 100%!important;
  color:#fff;image-rendering:auto;cursor:pointer;
}
.btn-green{background-image:url("assets/btn-green.webp")}
.btn-gold{background-image:url("assets/btn-gold.webp")}
.btn-coral{background-image:url("assets/btn-coral.webp")}
.btn-sky{background-image:url("assets/btn-sky.webp")}
.btn-icon{background-image:url("assets/btn-icon.webp")}
.btn-green,.btn-gold,.btn-coral,.btn-sky{text-shadow:0 2px 0 #0006}
.btn-green:active,.btn-gold:active,.btn-coral:active,.btn-sky:active,.btn-icon:active,
#playBtn:active,#resumeBtn:active,#homeBtn:active,.hint:active:not(:disabled),
#home .mode-play:active,#home .mode-name:active,.pause:active,
.home-modal button:active{
  transform:translateY(3px);filter:brightness(.93);
}
.btn-green:disabled,.btn-gold:disabled,.btn-coral:disabled,.hint:disabled,.mode-play.is-off{
  filter:grayscale(.55) brightness(.88);opacity:.78;
}

/* Home HUD + dock use the same art */
#home .hud-chip,#home .hud-settings,#home .hud-lang{
  border:0!important;border-radius:0!important;box-shadow:none!important;
  background-color:transparent!important;
  background-repeat:no-repeat;background-position:center;background-size:100% 100%;
  backdrop-filter:none;overflow:visible;
}
#home .hud-level,#home .hud-energy{background-image:url("assets/btn-sky.webp")}
#home .hud-shop,#home .hud-lang{background-image:url("assets/btn-gold.webp")}
#home .hud-settings{background-image:url("assets/btn-icon.webp");width:40px;height:40px;flex:none}
#home .home-hud{overflow:visible;height:42px;gap:5px}
#home .hud-chip{height:40px;min-width:54px;padding:0 10px}
#home .hud-lang{width:64px;height:40px;padding:4px}
#home .hud-lang button{color:#fff;text-shadow:0 1px 0 #8a5a12}
#home .hud-lang button.on{background:#fff;color:#3a2a14;border-radius:8px;box-shadow:none}
#home .mode-name{
  width:auto;min-width:120px;height:40px;padding:0 22px 4px;
  border:0!important;border-radius:0!important;
  background:transparent url("assets/btn-sky.webp") center / 100% 100% no-repeat!important;
  box-shadow:none!important;text-shadow:0 2px 0 #1b4d6a;
}
#home .mode-play{
  height:86px;padding:0 22px 8px;
  border:0!important;border-radius:0!important;
  background:transparent url("assets/btn-green.webp") center / 100% 100% no-repeat!important;
  box-shadow:none!important;overflow:visible;animation:none;
}
#home .mode-play:before,#home .mode-play:after{display:none}
#home .mode-play strong{text-shadow:0 2px 0 #145218}
#home .home-layer{background:#0b1524d4}
#home .home-modal{
  position:relative;
  width:min(86%,340px);aspect-ratio:auto;height:auto;min-height:0;
  padding:34px 26px 22px;
  display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:10px;
  border:0;border-radius:0;
  background:linear-gradient(165deg,#17283a 0%,#0c1726 100%);
  box-shadow:none;color:#fff8e8;
}
#home .home-modal.is-settings{min-height:360px;padding:32px 24px 20px;gap:12px}
.home-modal h2{margin:0 0 4px;padding:0 36px;font-size:22px;color:#ffe9a8;text-shadow:0 2px 0 #0008;text-align:center}
.home-modal p{margin:0 0 8px;font-size:14px;text-align:center}
.home-modal .row{
  width:100%;margin:4px 0;padding:10px 12px;
  border:0;border-radius:18px;background:#101a28cc;
  display:flex;align-items:center;justify-content:space-between;gap:8px;
}
.home-modal button{
  flex:none;flex-shrink:0;
  min-width:0;width:100%;height:46px;margin:6px 0 0;padding:0 16px 4px;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  background-color:transparent!important;
  background-repeat:no-repeat;background-position:center;background-size:100% 100%;
  font-weight:500;
}
.home-modal .buy,.home-modal #nextFactBtn,.home-modal #openShopBtn,.home-modal #unlockCountryBtn{
  background-image:url("assets/btn-green.webp")!important;
  background-size:100% 100%!important;background-repeat:no-repeat!important;background-color:transparent!important;
}
.home-modal .buy{width:auto;min-width:96px;height:42px;margin:0}
.home-modal .modal-x{
  position:absolute;top:14px;right:12px;z-index:2;
  width:36px;min-width:36px;height:36px;margin:0;padding:0 0 3px;
  display:grid;place-items:center;
  background-image:url("assets/btn-icon.webp")!important;
  background-size:100% 100%!important;background-repeat:no-repeat!important;background-color:transparent!important;
  color:#fff8e8;font-size:22px;line-height:1;text-shadow:0 1px 0 #000a;
}
.home-modal .close{
  display:none;
}
.home-modal .lang-picks{display:flex;gap:6px}
.home-modal .lang-picks button{width:auto;min-width:52px;height:36px;margin:0;background-image:url("assets/btn-sky.webp")}
.home-modal .lang-picks button.on{background-image:url("assets/btn-gold.webp");color:#fff}

/* Compact settings sheet */
.home-modal .set-list{display:flex;flex-direction:column;gap:8px;width:100%;margin:6px 0 2px}
.home-modal .set-row{
  width:100%;min-height:52px;margin:0;padding:0 10px 3px 16px;
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  border:0;border-radius:0;
  background:#223247;
  color:#fff8e8;font-size:15px;text-shadow:0 1px 0 #0008;
}
.home-modal .set-row > span{flex:1;text-align:left}
.home-modal .set-link{
  width:100%;height:52px;margin:0;padding:0 16px 3px 16px;
  display:flex;align-items:center;justify-content:space-between;
  background:#223247!important;
  color:#fff8e8;font-size:15px;text-shadow:0 1px 0 #0008;
}
.home-modal .set-link span{flex:1;text-align:left}
.home-modal .set-link b{font-size:22px;font-weight:400;opacity:.85;padding-bottom:2px}
.home-modal .seg{
  display:flex;align-items:center;gap:0;
  height:32px;padding:2px;border-radius:16px;background:#0b1528cc;
}
.home-modal .seg button{
  width:46px;min-width:46px;height:28px;margin:0;padding:0 0 1px;
  background-image:none!important;background-color:transparent!important;
  color:#fff8e8;font-size:12px;letter-spacing:.04em;text-shadow:none;opacity:.7;
}
.home-modal .seg button.on{
  background-image:url("assets/btn-gold.webp")!important;
  background-size:100% 100%!important;opacity:1;color:#fff;
}
.home-modal .set-toggle{
  width:72px;min-width:72px;height:32px;margin:0;padding:0 0 2px;
  font-size:13px;
  background-size:100% 100%!important;background-repeat:no-repeat!important;
}
.home-modal .set-toggle.on{
  background-image:url("assets/btn-gold.webp")!important;
}
.home-modal .set-toggle:not(.on){
  background-image:url("assets/btn-sky.webp")!important;
  filter:saturate(.7) brightness(.9);
}

/* Quiz HUD */
.topbar{
  background:transparent!important;box-shadow:none!important;border:0;
  min-height:52px;padding:8px 8px 6px;
}
.topbar:after{display:none}
.pause{
  width:42px;height:42px;border:0!important;border-radius:0!important;
  background:transparent url("assets/btn-icon.webp") center / 100% 100% no-repeat!important;
  box-shadow:none!important;
}
.pause i{width:5px;height:15px;background:#fff8e8;box-shadow:0 1px #0006}
.stats{
  width:78px;height:50px;border:0;border-radius:0;padding:6px 10px 8px;
  background:url("assets/btn-gold.webp") center / 100% 100% no-repeat;
  box-shadow:none;
}
.level{color:#fff;text-shadow:0 2px 8px #0b1524,0 1px 0 #000}

/* Quiz stage */
.stage{
  background:none!important;box-shadow:none!important;overflow:hidden;
}
.stage:before{display:none!important}
.stage .question{
  position:absolute;top:6%;left:8%;z-index:3;
  width:84%;height:46%;padding:22px 26px 26px;
  border:0!important;border-radius:0!important;
  background:linear-gradient(145deg,#fffdf4f2,#fff0cfe8)!important;
  box-shadow:none!important;color:#4a3014;
  text-shadow:0 1px 0 #fff6;
}
.stage .question:after{display:none!important}
.stage .hint{
  z-index:4;right:6%;bottom:6%;top:auto;width:112px;height:58px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  padding:0 12px 6px;border:0!important;border-radius:0!important;
  background:transparent url("assets/btn-sky.webp") center / 100% 100% no-repeat!important;
  box-shadow:none!important;overflow:visible;animation:none;
}
.stage .hint span{
  height:auto;padding:0;background:none;color:#fff;font-size:13px;
  display:flex;align-items:center;gap:4px;
}
.stage .hint strong{
  padding:0;background:none;font-size:16px;text-shadow:0 1px 0 #0b3a5c;
}

/* Answer board sits on the dark rock */
.answers{
  gap:10px;padding:10px 12px 14px;
  background:linear-gradient(180deg,transparent 0%,#0b1528aa 22%,#0b1220e8 100%)!important;
  box-shadow:none!important;
}
.answer{
  display:grid!important;place-items:center!important;place-content:center!important;
  border:0!important;border-radius:0!important;padding:0!important;
  font-size:0;line-height:0;
  background:linear-gradient(145deg,#fffefb,#eef4f8)!important;
  box-shadow:none!important;
}
.answer .brand-logo{
  width:76%!important;height:76%!important;max-width:76%;max-height:76%;
  margin:0!important;padding:0;
  object-fit:contain;object-position:center;
  transform:none;
}
.answer:hover{filter:brightness(1.04)}
.answer:active:not(:disabled){translate:0 4px;filter:brightness(.96);box-shadow:none!important}
.answer.correct,.answer.correct-answer{
  outline:0;filter:brightness(1.08) saturate(1.15);
  background:linear-gradient(145deg,#fffefb,#eef4f8)!important;
  box-shadow:0 0 0 3px #43d560,0 0 18px #54ff7488!important;
}
.answer.wrong{
  outline:0;animation:shake .18s 3;
  background:linear-gradient(145deg,#fffefb,#eef4f8)!important;
  box-shadow:0 0 0 3px #f13d39,0 0 18px #ff514b70!important;
  filter:sepia(.35) saturate(1.4) hue-rotate(-20deg);
}
footer{
  background:transparent!important;box-shadow:none!important;
  color:#fff7df;text-shadow:0 1px 4px #000a;
}
.message{
  border:0;border-radius:0;padding:18px 32px 20px;
  background:linear-gradient(165deg,#17283a 0%,#0c1726 100%);
  color:#fff8e8;font-weight:500;
}
.message.good{background:url("assets/btn-green.webp") center / 100% 100% no-repeat}
.message.bad{background:url("assets/btn-coral.webp") center / 100% 100% no-repeat}
.pause-layer{
  position:absolute;inset:0;z-index:12;
  display:grid;place-items:center;
  padding:18px;
  background:#061018e0;
  backdrop-filter:blur(10px);
}
.pause-layer[hidden]{display:none!important}
.pause-card{
  position:relative;
  width:min(86%,300px);aspect-ratio:auto;height:auto;min-height:0;
  padding:26px 22px 22px;
  display:flex;flex-direction:column;align-items:stretch;gap:8px;
  border:0;border-radius:0;
  background:linear-gradient(165deg,#17283a 0%,#0c1726 100%);
  color:#fff8e8;text-align:center;
  filter:drop-shadow(0 18px 28px #02080fcc);
}
.pause-badge{
  width:54px;height:54px;
  display:flex;align-items:center;justify-content:center;gap:7px;
  background:url("assets/btn-icon.webp") center / 100% 100% no-repeat;
  filter:drop-shadow(0 4px 0 #0004);
}
.pause-badge i{width:6px;height:18px;border-radius:2px;background:#fff8e8;box-shadow:0 1px #0008}
.pause-layer h2{
  margin:2px 0 6px;padding:0;
  color:#ffe9a8;font-size:clamp(26px,7vw,32px);font-weight:500;letter-spacing:.04em;
  text-shadow:0 2px 0 #0008;
}
.pause-layer h2:after{
  content:"";display:block;width:72px;height:3px;margin:10px auto 0;
  border-radius:99px;background:linear-gradient(90deg,transparent,#f2b63b,transparent);
}
.pause-layer button{
  flex:none;
}
.pause-layer #resumeBtn{
  width:100%;height:54px;margin:0;padding:0 14px 4px;
  border:1px solid #8ff29a;border-radius:17px;
  background:linear-gradient(180deg,#58d663,#2cab42);background-image:none;
  box-shadow:inset 0 2px #ffffff61,0 5px 0 #14742b,0 9px 18px #04150b80;
  color:#fff;font-size:16px;font-weight:500;text-shadow:0 2px #176e2b;cursor:pointer;
}
.pause-layer .pause-home-link,
.pause-layer #homeBtn{
  width:100%;height:44px;margin:0;padding:0 14px;
  border:1px solid #ffffff1f;border-radius:16px;
  background:#223247;background-image:none;
  box-shadow:inset 0 1px #ffffff14;
  color:#d5e2ef;font-size:15px;text-shadow:none;cursor:pointer;
}
.pause-layer .modal-x{
  position:absolute;top:12px;right:12px;z-index:2;
  width:34px;min-width:34px;height:34px;margin:0;padding:0;
  border:1px solid #ffffff24;border-radius:12px;
  background:#223247;background-image:none;
  box-shadow:inset 0 1px #ffffff14;
  color:#fff7db;font-size:20px;line-height:1;cursor:pointer;
}

@media(max-height:680px){
  #home .mode-play{height:72px}
  .stage .question{height:44%;padding:16px 20px 20px;font-size:clamp(16px,4.7vw,22px)}
  .pause-layer .pause-card{width:min(88%,280px);padding:22px 18px 18px;gap:8px}
  .pause-layer #resumeBtn{height:50px}
}
@media(prefers-reduced-motion:reduce){
  .stage .hint{animation:none!important}
}

/* Clear interactive affordances on the Home dock. */
#home .home-dock{gap:5px}
#home .mode-caption{display:block;color:#fff4c7;font:500 12px "Game Sans","Game Khmer",sans-serif;letter-spacing:.08em;text-transform:uppercase;text-shadow:0 2px 0 #244b68,0 0 8px #fff5}
#home .mode-name{position:relative;width:72%;min-width:190px;height:50px;padding:0 58px 5px 24px;cursor:pointer;transition:transform .14s ease,filter .14s ease}
#home .mode-name b{font-size:19px;pointer-events:none}
#home .mode-chevron{position:absolute;right:18px;top:50%;width:0;height:0;translate:0 -55%;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:10px solid #fff8d5;filter:drop-shadow(0 2px 0 #155274);animation:mode-nudge 1.25s ease-in-out infinite;pointer-events:none}
#home .mode-name.is-locked .mode-chevron{border:0;width:13px;height:10px;border-radius:2px;background:#fff0a8;box-shadow:0 -6px 0 -3px #fff0a8,0 2px 0 #6f581c}
#home .mode-name.is-locked:after{content:"250";right:40px;top:50%;translate:0 -55%;font-size:10px;padding:2px 6px}
#home .mode-help{display:block;min-height:18px;color:#e9f9ff;font:400 12px "Game Sans","Game Khmer",sans-serif;text-align:center;text-shadow:0 1px 0 #22506d;opacity:.92}
#home .mode-play{cursor:pointer;transition:transform .14s ease,filter .14s ease}
#home .mode-name:hover,#home .mode-play:hover,#home .hud-shop:hover,#home .hud-energy:hover,#home .hud-settings:hover{filter:brightness(1.08)}
#home .mode-name:focus-visible,#home .mode-play:focus-visible,#home .hud-shop:focus-visible,#home .hud-settings:focus-visible,.answer:focus-visible,.hint:focus-visible,.pause:focus-visible{outline:4px solid #fff4a8;outline-offset:3px}
#home .mode-name:active,#home .mode-play:active{transform:translateY(3px) scale(.985)!important}
@keyframes mode-nudge{0%,100%{translate:0 -55%}50%{translate:4px -55%}}
@media(max-height:680px){#home .mode-name{height:44px}.mode-caption{font-size:10px!important}#home .mode-help{font-size:10px;min-height:14px}}
@media(prefers-reduced-motion:reduce){#home .mode-chevron{animation:none!important}}

/* Wide carousel-style mode selector. */
#home .mode-selector{width:100%;display:grid;grid-template-columns:46px minmax(0,1fr) 46px;align-items:center;gap:7px}
#home .mode-name{width:100%;min-width:0;height:56px;padding:0 58px 6px 22px}
#home .mode-name b{font-size:21px}
#home .mode-name.is-locked:after{display:none}
#home .mode-price{display:none;position:absolute;right:14px;top:50%;translate:0 -58%;align-items:center;gap:5px;padding:3px 7px;border-radius:11px;background:#57484f;color:#ffe373;font:700 11px "Game Sans",sans-serif;text-shadow:0 1px #33262a;box-shadow:inset 0 2px #877075,0 2px #1b1720}
#home .mode-name.is-locked .mode-price{display:flex}
.mini-lock{position:relative;width:10px;height:9px;border-radius:2px;background:#fff3a6;box-shadow:0 1px #5b4616}
.mini-lock:before{content:"";position:absolute;left:2px;top:-6px;width:6px;height:7px;border:2px solid #fff3a6;border-bottom:0;border-radius:6px 6px 0 0}
#home .mode-arrow{position:relative;width:46px;height:46px;padding:0;border:0;background:transparent url("assets/btn-gold.webp") center/100% 100% no-repeat;cursor:pointer;filter:drop-shadow(0 3px 0 #7c5315);transition:transform .14s ease,filter .14s ease}
#home .mode-arrow i{position:absolute;left:50%;top:50%;translate:-50% -55%;width:0;height:0;border-top:9px solid transparent;border-bottom:9px solid transparent;filter:drop-shadow(0 2px #714d12)}
#home .mode-prev i{border-right:12px solid #fff8d5;margin-left:-2px}
#home .mode-next-btn i{border-left:12px solid #fff8d5;margin-left:2px}
#home .mode-arrow:hover{filter:brightness(1.1) drop-shadow(0 3px 0 #7c5315)}
#home .mode-arrow:active{transform:translateY(3px) scale(.96);filter:brightness(.92)}
#home .mode-arrow:focus-visible{outline:4px solid #fff4a8;outline-offset:3px}
#home .mode-help{margin-top:-1px}
@media(max-height:680px){#home .mode-selector{grid-template-columns:40px minmax(0,1fr) 40px}#home .mode-arrow{width:40px;height:40px}#home .mode-name{height:48px}#home .mode-name b{font-size:18px}}

/* ===== Quiz polish v3: clean, calm and readable ===== */
.topbar{
  height:9%;padding:9px 10px 7px;gap:6px;
  grid-template-columns:44px 96px minmax(0,1fr) 78px;
  background:linear-gradient(180deg,#10233ad9,#14263eb8)!important;
  border-bottom:1px solid #ffffff20!important;
  backdrop-filter:blur(10px);
}
.pause{width:40px;height:40px;filter:drop-shadow(0 4px 7px #06101d88)}
.hearts{gap:7px}.heart{filter:drop-shadow(0 3px 3px #4b132966)}
.level{font-size:12px;line-height:1.25;color:#f5fbff;text-shadow:0 2px 5px #07111e}
.stats{
  width:76px;height:48px;padding:5px 9px 7px;
  border:1px solid #ffd76f66;border-radius:14px;
  background:linear-gradient(145deg,#334966e8,#172942e8);
  box-shadow:inset 0 1px #ffffff3d,0 5px 14px #06101d66;
}
.stage{height:40%;overflow:hidden}
.stage:after{
  content:"";position:absolute;inset:auto 0 0;height:42%;z-index:2;pointer-events:none;
  background:linear-gradient(180deg,transparent,#0d1a2a9c);
}
.stage .question{
  top:5%;left:5%;width:90%;height:52%;padding:20px 24px;
  overflow:hidden;border:1px solid #ffffff73!important;border-radius:24px!important;
  background:linear-gradient(145deg,#fffdf4f2,#fff0cfe8)!important;
  box-shadow:inset 0 2px #fff,0 10px 26px #1722384d!important;
  color:#25344b;text-shadow:none;font-size:clamp(17px,4.8vw,23px);
}
.stage .question:before{
  content:"";position:absolute;left:18%;right:18%;top:0;height:3px;border-radius:0 0 10px 10px;
  background:linear-gradient(90deg,transparent,#f2b63b,transparent);
}
.country-prompt{
  left:14px;right:14px;top:12px;padding:0;background:none;
  color:#27374e;font-size:clamp(13px,3.4vw,16px);font-weight:600;
  text-shadow:none;
}
.question>.brand-logo{
  width:88%;height:58%;max-width:none;margin-top:28px;padding:10px;
  object-fit:contain;filter:drop-shadow(0 4px 6px #29364b24);
}
.stage .hint{
  right:5%;bottom:5%;width:104px;height:54px;padding-bottom:6px;
  border-radius:17px!important;overflow:hidden;
  background:linear-gradient(180deg,#24bff1,#167acb)!important;
  box-shadow:inset 0 2px #ffffff8a,0 5px 0 #0b4f91,0 8px 18px #06142666!important;
}
.stage .hint span{font-size:12px}.stage .hint strong{font-size:15px}
.answers{
  height:47%;gap:12px;padding:14px 14px 18px;
  background:linear-gradient(180deg,#102039d9,#091525f5)!important;
}
.answer{
  border:1px solid #ffffff9c!important;border-radius:22px!important;
  background:linear-gradient(145deg,#fffefb,#eef4f8)!important;
  box-shadow:inset 0 2px #fff,0 6px 0 #aebbc5,0 11px 20px #0209156b!important;
  transition:transform .15s ease,filter .15s ease,box-shadow .15s ease!important;
}
.answer:hover{transform:translateY(-2px);filter:brightness(1.025)}
.answer:active:not(:disabled){transform:translateY(5px);translate:0 0;box-shadow:inset 0 2px #fff,0 2px 0 #9aa8b2,0 5px 9px #02091555!important}
.answer .brand-logo{width:80%!important;height:80%!important;transform:none;filter:drop-shadow(0 4px 6px #24364c22)}
.country-answer{
  padding:12px!important;color:#27364c!important;font-size:clamp(17px,4.5vw,23px)!important;
  line-height:1.25!important;text-shadow:none!important;
}
.answer.correct,.answer.correct-answer{
  background:linear-gradient(145deg,#f4fff5,#dff9e4)!important;
  box-shadow:inset 0 2px #fff,0 6px 0 #2d9c49,0 0 0 3px #49d568,0 10px 22px #113b2466!important;
}
.answer.wrong{
  background:linear-gradient(145deg,#fff5f3,#ffdeda)!important;
  box-shadow:inset 0 2px #fff,0 6px 0 #bd4b47,0 0 0 3px #f05a54,0 10px 22px #4c171766!important;
}
footer{height:4%;background:#091525!important}
.country-mode .stage{height:46%}
.country-mode .stage .question{
  top:4%;height:78%;overflow:visible;
  display:grid;grid-template-rows:auto minmax(0,1fr);align-items:stretch;justify-items:center;
  padding:14px 16px 18px;gap:10px;
}

@media(max-height:680px){
  .topbar{height:9%;padding-block:5px}.pause{width:36px;height:36px}
  .stage{height:40%}.stage .question{top:4%;height:51%;padding:15px 20px}
  .country-mode .stage .question{height:58%}.question>.brand-logo{height:100%;margin-top:0}
  .answers{height:47%;gap:9px;padding:10px 12px 15px}.answer{border-radius:18px!important}
}

/* Final country/category logo sizing: fill the question card. */
.country-mode .stage .question{
  display:grid;grid-template-rows:auto minmax(140px,1fr);align-items:stretch;justify-items:center;
  padding:12px 14px 16px;gap:8px;height:78%;overflow:visible;
}
.country-mode .country-prompt{
  position:relative;inset:auto;width:100%;
  font-size:clamp(16px,4.4vw,22px);font-weight:600;
}
.country-mode .question>.brand-logo{
  display:block;width:90%!important;height:100%!important;
  max-width:none!important;max-height:none!important;min-height:140px;
  margin:0!important;padding:10px 12px;
  border:1px solid #d8e0e8;border-radius:20px;background:#fff;
  object-fit:contain;box-shadow:0 5px 14px #263b5630;filter:none;
}
@media(max-height:680px){
  .country-mode .stage .question{padding:10px 12px 12px;height:74%}
  .country-mode .question>.brand-logo{padding:8px 10px;min-height:120px}
}

/* Final no-energy button state override (must remain after shared button rules). */
#home .mode-play.is-off{
  opacity:1!important;filter:none!important;
  background-image:url("assets/btn-coral.webp")!important;
  cursor:pointer;
}
#home .mode-play.is-off strong{font-size:clamp(23px,6vw,31px)}

/* Settings, Pause, and home sheets match Unlock: navy card, gold rim, compact. */
#home .home-modal,
.pause-layer .pause-card{
  width:min(88%,350px)!important;
  min-width:0;min-height:0!important;aspect-ratio:auto;height:auto;
  padding:28px 24px 24px!important;
  border:2px solid #f8c653!important;border-radius:28px!important;
  background:linear-gradient(165deg,#17283a 0%,#0c1726 100%)!important;
  box-shadow:inset 0 1px #ffffff2e,0 0 0 5px #8a5b1b66,0 18px 45px #020914b8!important;
  filter:none;
}
#home .home-modal.is-settings{gap:10px}
#home .home-modal h2,
.pause-layer h2{
  margin:4px 30px 0;padding:0;
  color:#fff7db;font-size:clamp(20px,5.6vw,25px);font-weight:500;
  text-shadow:none;letter-spacing:0;
}
.pause-layer h2:after{display:none}
.sheet-copy{
  margin:0 0 6px;color:#a9bdd1;font-size:12px;text-align:center;text-shadow:none;
}
.sheet-badge{
  position:relative;width:54px;height:54px;margin:0 auto 2px;border-radius:18px;
  background:linear-gradient(145deg,#ffc94d,#f28b19);
  box-shadow:inset 0 2px #fff4a0,0 5px 0 #8f5012,0 9px 18px #0007;
  display:grid;place-items:center;
}
.sheet-badge-gear .ico-gear{width:26px;height:26px;filter:brightness(0) invert(1) drop-shadow(0 1px #8f5f1a)}
.pause-badge{
  display:flex;align-items:center;justify-content:center;gap:6px;
  background:linear-gradient(145deg,#ffc94d,#f28b19);
}
.pause-badge i{width:6px;height:18px;border-radius:2px;background:#fff7d0;box-shadow:0 2px #8f5f1a}
#home .home-modal .modal-x{
  top:12px;right:12px;width:34px;min-width:34px;height:34px;
  border:1px solid #ffffff24!important;border-radius:12px!important;
  background:#223247!important;background-image:none!important;
  color:#fff7db;font-size:20px;box-shadow:inset 0 1px #ffffff14;
}
#home .home-modal .set-list{gap:10px;margin:4px 0 0}
#home .home-modal .set-row{
  min-height:58px;padding:10px 12px 10px 16px;
  border:1px solid #ffffff1f;border-radius:16px;
  background:#223247;box-shadow:inset 0 1px #ffffff14;
  color:#fff;font-size:15px;text-shadow:none;
}
#home .home-modal .seg{
  height:34px;padding:3px;border-radius:17px;background:#0b1528cc;
}
#home .home-modal .seg button{
  width:48px;min-width:48px;height:28px;border-radius:14px!important;
  background-image:none!important;opacity:.7;
}
#home .home-modal .seg button.on{
  background:linear-gradient(145deg,#ffc94d,#f28b19)!important;
  color:#3a2208;opacity:1;text-shadow:none;font-weight:700;
}
#home .home-modal .set-toggle{
  width:72px;min-width:72px;height:32px;border-radius:16px!important;
  background-image:none!important;
  background:linear-gradient(145deg,#ffc94d,#f28b19)!important;
  color:#3a2208;font-size:13px;font-weight:700;text-shadow:none;
}
#home .home-modal .set-toggle:not(.on){
  background:#314257!important;color:#d5e2ef;font-weight:500;
}
#home .home-modal .row{
  border:1px solid #ffffff1f;border-radius:16px;background:#223247;
  box-shadow:inset 0 1px #ffffff14;
}
#home .home-modal .buy,
#home .home-modal #openShopBtn{
  border:1px solid #8ff29a!important;border-radius:17px!important;
  background:linear-gradient(180deg,#58d663,#2cab42)!important;
  background-image:none!important;
  box-shadow:inset 0 2px #ffffff61,0 5px 0 #14742b,0 9px 18px #04150b80!important;
  text-shadow:0 2px #176e2b;
}
.pause-layer{
  inset:0;display:grid;place-items:center;padding:20px;
  background:#061018e3;backdrop-filter:blur(10px);
}
.pause-layer[hidden]{display:none!important}
.pause-layer .pause-card{
  position:relative;left:auto;top:auto;transform:none;
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.pause-layer{
  inset:0;display:grid;place-items:center;padding:20px;
  background:#061018e3;backdrop-filter:blur(10px);
}
.pause-layer[hidden]{display:none!important}
.pause-layer .pause-card{
  position:relative;left:auto;top:auto;transform:none;
  display:flex;flex-direction:column;align-items:stretch;gap:8px;
  text-align:center;
}
.pause-layer .sheet-badge,
.pause-layer h2,
.pause-layer .sheet-copy{align-self:center}
.pause-layer h2:after{display:none!important;content:none!important;height:0;margin:0}
.pause-card .unlock-details{min-height:0;padding:0;background:none;border:0;align-content:start}
.pause-card .unlock-balance,
.pause-card .unlock-price{
  width:100%!important;max-width:none!important;margin:0!important;
  justify-self:stretch;position:relative;left:auto;top:auto;transform:none;
  padding:10px 12px;border:1px solid #ffffff1f;border-radius:16px;
  background:#223247;box-shadow:inset 0 1px #ffffff14;
  display:flex;flex-direction:column;align-items:flex-start;gap:4px;
}
.pause-layer #resumeBtn{
  width:100%;height:54px;margin:0;padding:0 14px 4px;
  border:1px solid #8ff29a!important;border-radius:17px!important;
  background:linear-gradient(180deg,#58d663,#2cab42)!important;background-image:none!important;
  box-shadow:inset 0 2px #ffffff61,0 5px 0 #14742b,0 9px 18px #04150b80!important;
  color:#fff;font-size:16px;font-weight:500;text-shadow:0 2px #176e2b;cursor:pointer;
}
.pause-layer #resumeBtn:active{transform:translateY(4px);box-shadow:inset 0 2px #ffffff61,0 1px 0 #14742b!important}
.pause-layer #homeBtn{
  width:100%;height:44px;margin:0;padding:0;
  border:1px solid #ffffff1f!important;border-radius:16px!important;
  background:#223247!important;background-image:none!important;
  box-shadow:inset 0 1px #ffffff14!important;
  color:#d5e2ef;font-size:15px;text-shadow:none;cursor:pointer;
}
.pause-layer #homeBtn:active{transform:translateY(2px);filter:brightness(.96)}
.pause-layer .modal-x{
  position:absolute;top:12px;right:12px;z-index:2;
  width:34px;min-width:34px;height:34px;margin:0;padding:0;
  border:1px solid #ffffff24!important;border-radius:12px!important;
  background:#223247!important;background-image:none!important;
  box-shadow:inset 0 1px #ffffff14!important;
  color:#fff7db;font-size:20px;line-height:1;cursor:pointer;
}
@media(max-height:680px){
  #home .home-modal,.pause-layer .pause-card{padding:22px 18px 18px!important}
  .pause-layer #resumeBtn{height:50px}
}

/* Final gameplay art alignment: reveal the mascot beneath the question. */
.quiz-bg{
  object-position:center top!important;
  transform:translateY(8%);
}

/* Compact gameplay cards: more breathing room and a clearer mascot area. */
.stage{height:44%!important}
.answers{
  width:94%;height:43%!important;margin:0 auto;
  gap:10px;padding:12px 8px 18px;
  border-radius:22px 22px 0 0;
}
.stage .question{
  top:6%;left:9%;width:82%;height:43%;
  padding:18px 22px;border-radius:22px!important;
  box-shadow:inset 0 2px #fff,0 8px 20px #08142552!important;
}
.answer{
  border-radius:19px!important;
  padding:6px!important;
  box-shadow:inset 0 2px #fff,0 5px 0 #aebbc5,0 8px 15px #02091555!important;
}
.answer .brand-logo{
  width:92%!important;height:90%!important;
  max-width:none!important;max-height:none!important;
}
.country-answer{padding:12px!important;font-size:clamp(16px,4.2vw,21px)!important}
.country-mode .stage .question{
  left:10%;width:80%;height:59%;
  grid-template-rows:auto minmax(82px,1fr);
  padding:11px 13px 13px;gap:7px;
}
.country-mode .question>.brand-logo{
  width:82%!important;height:100%!important;min-height:82px!important;
  padding:8px 10px;border-radius:17px;
}
.country-mode .country-prompt{font-size:clamp(14px,3.8vw,19px)}
.category-text-mode .stage .question{
  left:9%;width:82%;height:43%;padding:20px 24px;
  font-size:clamp(17px,4.5vw,23px);
}
@media(max-height:680px){
  .stage{height:44%!important}.answers{height:43%!important;padding:9px 7px 14px;gap:8px}
  .stage .question{top:5%;height:42%;padding:14px 18px}
  .country-mode .stage .question{height:57%;padding:9px 11px 11px}
  .country-mode .question>.brand-logo{min-height:72px!important;padding:7px 9px}
}

/* Letters mode: build the brand name with tactile letter tiles. */
.answers.letters-board-mode{
  display:block!important;width:100%;padding:10px 14px 16px;
  background:linear-gradient(180deg,#263342e8,#0a1626f5)!important;
}
.stage .hint[hidden]{display:none!important}
.letter-game{
  width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;
}
.letter-slots{
  width:100%;display:flex;align-items:center;justify-content:center;gap:4px;padding:0 4px;
}
.letter-slot{
  flex:1 1 0;min-width:18px;max-width:36px;height:38px;padding:0;border:1px solid #ffffff20;border-radius:7px;
  background:#142130;color:#fff;font:700 clamp(13px,4vw,20px) "Game Sans",sans-serif;
  box-shadow:inset 0 2px 5px #02081299,0 2px #536171;cursor:pointer;
}
.letter-slot.filled{background:#eaf3fa;color:#24364c;box-shadow:inset 0 1px #fff,0 3px #9baab7}
.letter-keys{
  width:min(100%,330px);display:flex;flex-wrap:wrap;align-content:center;justify-content:center;gap:7px;
}
.letter-key{
  width:38px;height:40px;padding:0 0 3px;border:1px solid #fff09b;border-radius:8px;
  background:linear-gradient(180deg,#ffe66b,#ffc72e);color:#26354a;
  font:700 20px "Game Sans",sans-serif;text-shadow:0 1px #fff7bd;
  box-shadow:inset 0 2px #fff9ba,0 4px 0 #b87a13,0 7px 11px #02081266;cursor:pointer;
  transition:transform .12s ease,filter .12s ease;
}
.letter-key:active:not(:disabled){transform:translateY(3px);box-shadow:inset 0 2px #fff9ba,0 1px 0 #b87a13}
.letter-key:disabled{opacity:.22;filter:grayscale(.6);transform:translateY(3px)}
.letter-game.letter-correct .letter-slot{background:#dcf9e2;color:#1e7134;box-shadow:0 0 0 2px #45d264,0 4px #258d3e}
.letter-game.letter-wrong .letter-slot{background:#ffe2de;color:#a12d2b;box-shadow:0 0 0 2px #ef5952,0 4px #a63b37;animation:shake .18s 2}
@media(max-height:680px){
  .letter-game{gap:13px}.letter-slot{height:32px}.letter-keys{gap:6px;width:min(100%,310px)}
  .letter-key{width:34px;height:35px;font-size:17px}
}

/* Pause must not inherit the old ".pause-layer div { position:absolute }" rule. */
.pause-layer .pause-card,
.pause-layer .pause-card :not(.modal-x){
  position:relative!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;
  transform:none!important;min-width:0!important;
}
.pause-layer .pause-card{
  display:flex!important;flex-direction:column;align-items:stretch;gap:10px;
  overflow:visible;
}
.pause-layer .modal-x{
  position:absolute!important;left:auto!important;right:12px!important;top:12px!important;
  transform:none!important;
}
.pause-layer h2:after{display:none!important;content:none!important;margin:0!important;height:0!important}
.pause-stats{
  display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px;
  width:100%!important;margin:2px 0 4px!important;padding:0!important;
  border:0!important;background:transparent!important;box-shadow:none!important;
  min-height:0!important;height:auto!important;
}
.pause-stat{
  width:100%!important;max-width:100%!important;min-width:0!important;
  margin:0!important;padding:10px 12px!important;
  height:auto!important;min-height:0!important;
  border:1px solid #ffffff1f!important;border-radius:16px!important;
  background:#223247!important;box-shadow:inset 0 1px #ffffff14!important;
  display:flex!important;flex-direction:column;align-items:flex-start;gap:4px;
  text-align:left;
}
.pause-stat span{color:#9fb2c7;font-size:11px;font-weight:500}
.pause-stat strong{color:#ffe276;font-size:22px;line-height:1;font-weight:500}

#home .hud-energy{
  appearance:none;-webkit-appearance:none;font:inherit;color:inherit;cursor:pointer;
}
.sheet-badge-bolt .ico-bolt{
  width:18px;height:22px;background-size:contain;
  filter:brightness(0) invert(1) drop-shadow(0 1px #8f5f1a);
}
.help-note{
  margin:8px 0 0;padding:10px 12px;
  border:1px solid #ffffff1f;border-radius:16px;
  background:#223247;color:#a9bdd1;font-size:12px;line-height:1.45;
  text-align:left;text-shadow:none;
}
#home .home-modal.is-how{
  max-height:min(82dvh,560px);overflow:auto;gap:8px;
}
.how-list{
  width:100%;margin:4px 0 0;padding:0;list-style:none;
  display:flex;flex-direction:column;gap:8px;text-align:left;
}
.how-list li{
  display:flex;align-items:flex-start;gap:10px;
  margin:0;padding:9px 11px;
  border:1px solid #ffffff1f;border-radius:16px;background:#223247;
  color:#e8f0f8;font-size:13px;line-height:1.4;text-shadow:none;
}
.how-num{
  flex:none;width:22px;height:22px;margin-top:1px;
  display:grid;place-items:center;border-radius:50%;
  background:linear-gradient(145deg,#ffc94d,#f28b19);color:#3a2208;
  font-size:12px;font-weight:700;
}
#home .home-modal.is-settings .set-link{
  min-height:58px;height:auto;padding:10px 12px 10px 16px;
  border:1px solid #ffffff1f;border-radius:16px;
  background:#223247!important;background-image:none!important;
  box-shadow:inset 0 1px #ffffff14;
}

/* Mobile taps: no 300ms zoom delay, no sticky hover, no grey flash. */
html,body,.game{
  touch-action:manipulation;
  overscroll-behavior:none;
  -webkit-tap-highlight-color:transparent;
}
#home .home-modal.is-how{touch-action:pan-y}
.game,.home,button,.answer,.letter-key,.letter-slot,.hint{
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
}
button,.answer,.letter-key,.letter-slot,.hint,.pause,.mode-arrow{
  touch-action:manipulation;
}
@media (hover:none),(pointer:coarse){
  .answer:hover,
  #home .mode-name:hover,
  #home .mode-play:hover,
  #home .hud-shop:hover,
  #home .hud-energy:hover,
  #home .hud-settings:hover,
  #home .mode-arrow:hover{
    transform:none!important;
    filter:none!important;
  }
  .answer:active:not(:disabled){
    transform:translateY(3px)!important;
    filter:brightness(.97);
  }
  .topbar,.pause-layer{
    backdrop-filter:none!important;
  }
  .letter-key{width:42px;height:44px}
}
@media(max-height:680px) and (pointer:coarse){
  .letter-key{width:40px;height:42px}
}
