@font-face {font-family:"Chest Fredoka";src:url("assets/fonts/fredoka-variable.ttf?v=0.18.1") format("truetype");font-weight:300 700;font-style:normal;font-display:swap;}
/* V0.11 presentation layer. The fallback grid and native result remain authoritative. */
body { background: radial-gradient(ellipse at 50% 30%, #173448, #07101c 70%); }
.hidden-chest { width:min(100%,480px); min-height:max(700px,100svh); }
.hidden-chest__brand { min-height:54px; justify-content:flex-start; padding:10px 68px 10px 20px; color:#e7f6ff; background:#091f30; border-radius:0; box-shadow:0 1px 0 #ffffff18; }
.hidden-chest__brand-mark { width:29px;height:29px;font-size:15px;border:1px solid #ffe2a0;outline:none;background:#173f55;box-shadow:none; }
.hidden-chest__brand strong { font-size:13px;letter-spacing:.16em; }
.hidden-chest__brand small { color:#9eb7c6;font-size:8px;letter-spacing:.1em; }
.hidden-chest__help { top:6px;right:12px;width:42px;height:42px;border:1px solid #ffffff30;outline:none;background:#ffffff08;box-shadow:none;font-size:18px; }
.hidden-chest__hero { top:54px;min-height:160px;padding:20px 20px 28px;grid-template-columns:62px minmax(0,1fr) 78px;gap:8px;align-items:center;clip-path:none;background:linear-gradient(#091f30 10%,#091f30e8 65%,#091f3000); }
.hidden-chest__title-lockup { padding:0 0 18px;margin:0;background:none;border:0;box-shadow:none;transform:none; }
.hidden-chest__title-lockup::before,.hidden-chest__title-lockup::after { display:none; }
.hidden-chest__title-lockup > p:first-child { color:#c5deeb;font-size:9px;letter-spacing:.34em;margin-bottom:6px; }
.hidden-chest__title-lockup h1 { font-size:clamp(28px,8vw,40px);font-weight:950;line-height:.85;-webkit-text-stroke:0;letter-spacing:-.055em;text-shadow:0 3px 0 #051222; }
.hidden-chest__title-lockup h1 span:last-child { color:#ffd277;text-shadow:0 3px 0 #754119,0 8px 18px #0008; }
.hidden-chest__timer-badge { bottom:-16px;min-height:31px;border:1px solid #f9d08d75;border-radius:30px;background:#0b2439;box-shadow:0 3px 9px #0005; }
.hidden-chest__timer-badge strong {font-size:18px;}.hidden-chest__timer-badge > span {font-size:17px;color:#edc47f;}
.hidden-chest__hud { min-height:53px;padding:9px 2px;background:#082335b8;border:1px solid #a6d5e543;border-radius:14px;box-shadow:inset 0 1px 0 #ffffff14;transform:none; }
.hidden-chest__hud > span {font-size:8px;color:#b6cfdb;letter-spacing:.05em;}.hidden-chest__hud strong {font-size:21px;color:#ffe0a0;}
.hidden-chest__hud--progress-summary {min-width:0;border-radius:14px;aspect-ratio:auto;}
.hidden-chest__hud--progress-summary > span {font-size:7.5px;letter-spacing:0;white-space:nowrap;}.hidden-chest__hud--progress-summary strong {font-size:19px;}
.hidden-chest__hud--progress-summary strong span {font-size:inherit;color:inherit;}
.hidden-chest__stage {border:0;background-image:linear-gradient(#061e3230,#0a14200a 45%,#091a3050),url('assets/premium-v09/school-diorama-backing.webp');}
.hidden-chest__mission { top:166px;color:#fff0d4;background:#0b2038df;border:1px solid #efd29755;border-radius:24px;padding:8px 14px;box-shadow:0 5px 18px #0004;font-weight:650;font-size:11px; }
.hidden-chest__footer {min-height:100px;padding:14px 16px max(14px,env(safe-area-inset-bottom));gap:10px;grid-template-columns:65px 1fr 94px;background:linear-gradient(#0a1f32eb,#071827);border-top:1px solid #e9ce942e;box-shadow:0 -16px 38px #07182755;}
.hidden-chest__progress,.hidden-chest__ammo {min-height:60px;border:1px solid #92c7dd40;border-radius:12px;background:#ffffff06;box-shadow:none;}
.hidden-chest__progress strong,.hidden-chest__ammo strong {color:#ffdb91;}
.hidden-chest__progress > span:first-child,.hidden-chest__ammo-label {font-size:8px;letter-spacing:.08em;color:#b9cddc;}
.hidden-chest__status {font-size:11px;font-weight:550;line-height:1.5;color:#d4e4ed;text-shadow:none;}
.hidden-chest__ammo-icons {gap:3px;}.hidden-chest__ammo-icons i {width:5px;height:12px;border-radius:2px;background:linear-gradient(#ffe5a7,#bf8b36);border:0;box-shadow:none;}
.hidden-chest__intro,.hidden-chest__result {width:calc(100% - 48px);max-width:358px;border:1px solid #ffe0a089;border-radius:26px;background:linear-gradient(145deg,#123447f5,#081b2bf9);padding:112px 24px 26px;box-shadow:0 24px 80px #0009,inset 0 1px 0 #fff2;}
.hidden-chest__intro::before,.hidden-chest__result::before {border:0;}
.chest-intro-art {position:absolute;width:190px;height:auto;top:-68px;left:50%;transform:translateX(-50%) rotate(-6deg);filter:drop-shadow(0 14px 15px #0006);}
.hidden-chest__intro h2,.hidden-chest__result h2 {font-size:29px;line-height:1.06;letter-spacing:-.045em;text-shadow:none;}
.hidden-chest__intro > p:not(.hidden-chest__eyebrow),.hidden-chest__result > p:not(.hidden-chest__eyebrow) {color:#c2d7e3;font-size:14px;line-height:1.6;margin:14px 0 22px;}
.hidden-chest__eyebrow {font-size:9px;letter-spacing:.2em;color:#f2c883;margin-bottom:10px;}
.hidden-chest__button--primary {width:100%;border-radius:14px;min-height:52px;text-transform:none;font-size:15px;color:#382411;background:linear-gradient(#ffe2a2,#efb954);box-shadow:0 4px 0 #956827,inset 0 1px 0 #fff9,0 8px 22px #f3bc5126;}
.hidden-chest__button:focus-visible,.hidden-chest__help:focus-visible {outline:3px solid #fff;outline-offset:4px;}
.hidden-chest__result {padding-top:90px;}
.hidden-chest__result-chest {width:180px;top:-67px;}
.hidden-chest__result dl div {background:#ffffff08;border-color:#d5eafa20;border-radius:12px;padding:12px;}
.hidden-chest__result dd {color:#ffda8e;font-size:27px;}
.hidden-chest[data-phase='revealing'] .hidden-chest__intro {display:none;}
.hidden-chest[data-phase='revealing'] .hidden-chest__mission {opacity:0;}
.hidden-chest[data-phase='result'] .hidden-chest__scene {filter:brightness(.65);transition:filter .3s;}
.hidden-chest[data-outcome='lost'] .hidden-chest__result-chest {filter:saturate(.7) drop-shadow(0 14px 14px #0006);}
.hidden-chest.has-hit .hidden-chest__stage {animation:none;}
.chest-impact-label {position:absolute;z-index:5;pointer-events:none;color:#e5faff;font-size:17px;font-weight:900;white-space:nowrap;text-shadow:0 2px 0 #172d42,0 3px 12px #000;animation:impact-label 1050ms cubic-bezier(.15,.75,.25,1) both;}
.chest-impact-label.is-gold {color:#ffe4a0;font-size:21px;text-shadow:0 2px 0 #7b4315,0 0 20px #e8a634;}
@keyframes impact-label {0%{opacity:0;transform:translate(-50%,0) scale(.7);}15%{opacity:1;transform:translate(-50%,-20px) scale(1.06);}65%{opacity:1;}100%{opacity:0;transform:translate(-50%,-62px) scale(.95);}}
.hidden-chest.is-dom-fallback .hidden-chest__grid {padding:210px 16px 122px;}
.hidden-chest__grid:focus-within {padding:210px 16px 122px;}
@media (min-width:700px) { .hidden-chest {min-height:860px;height:min(960px,100svh);} }
@media (max-height:740px) {.hidden-chest__hero{min-height:148px;padding-top:12px;}.hidden-chest__title-lockup{transform:scale(.9);}.hidden-chest__mission{top:154px;}.hidden-chest__intro,.hidden-chest__result{top:53%;}.hidden-chest__footer{min-height:94px;}}
@media (prefers-reduced-motion:reduce) {.chest-impact-label{display:none;}.hidden-chest[data-phase='result'] .hidden-chest__scene{transition:none;}}
.hidden-chest__progress {min-width:0;}.hidden-chest__progress > span:first-child {font-size:6px;letter-spacing:0;}.hidden-chest__progress-track {max-width:100%;}

/* V0.12: one compact HUD, a dedicated play area, and a native result below the chest. */
.hidden-chest__hero {display:block;min-height:0;padding:14px 18px 0;background:linear-gradient(#091f30 75%,#091f3000);clip-path:none;}
.hidden-chest__title-lockup {margin:0 0 14px;padding:0;transform:none;}
.hidden-chest__title-lockup h1 {display:block;font-size:25px;line-height:1.1;letter-spacing:-.04em;text-transform:none;text-shadow:none;}
.hidden-chest__title-lockup h1 span:last-child {display:inline;margin:0;color:#ffda91;text-shadow:none;}
.chest-round-hud {display:grid;grid-template-columns:1fr 1.3fr 1fr;gap:0;border:1px solid #b3d4e32b;border-radius:16px;background:#0b2638ed;padding:10px 0;}
.chest-round-hud .hidden-chest__timer-badge,.chest-round-hud .hidden-chest__progress,.chest-round-hud .hidden-chest__ammo {position:static;display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:51px;min-width:0;margin:0;padding:0 8px;aspect-ratio:auto;border:0;border-radius:0;background:none;box-shadow:none;transform:none;}
.chest-round-hud .hidden-chest__progress {border-left:1px solid #bed9e520;border-right:1px solid #bed9e520;}
.chest-round-hud .hidden-chest__timer-badge > span,.chest-round-hud .hidden-chest__progress > span:first-child,.chest-round-hud .hidden-chest__ammo-label {color:#b6cedb;font-size:9px;line-height:1;letter-spacing:.08em;text-transform:uppercase;}
.chest-round-hud strong {font-size:21px;line-height:1;color:#f0f8ff;}
.chest-round-hud .hidden-chest__progress strong {font-size:14px;color:#ffda91;}
.chest-round-hud .hidden-chest__timer-badge small {color:#b6cedb;font-size:12px;text-transform:none;}
.chest-round-hud .hidden-chest__progress-track {width:108px;height:10px;border-radius:0;background:#54717e;mask:radial-gradient(circle at 9px 5px,#000 4px,transparent 4.5px) 0 0/18px 10px repeat-x;}
.chest-round-hud .hidden-chest__progress-track i {height:100%;border-radius:0;background:#ffce76;box-shadow:none;}
.chest-round-hud .hidden-chest__ammo-icons {gap:2px;height:5px;flex-wrap:nowrap;}
.chest-round-hud .hidden-chest__ammo-icons i {width:4px;height:5px;border-radius:1px;background:#d9e9f0;}
.is-timer-urgent .chest-round-hud .hidden-chest__timer-badge {animation:none;}
.is-timer-urgent .chest-round-hud .hidden-chest__timer-badge strong {color:#ff957e;}
.hidden-chest__mission {position:static;max-width:100%;margin:12px auto 0;padding:6px 10px;font-size:11px;white-space:normal;transform:none;}
.hidden-chest__scene {top:160px;bottom:64px;}
.hidden-chest__footer {min-height:60px;padding:12px 18px max(12px,env(safe-area-inset-bottom));grid-template-columns:minmax(0,1fr) auto;gap:14px;box-shadow:none;}
.hidden-chest__status {text-align:left;font-size:11px;margin:0;}
.chest-secondary-score {white-space:nowrap;color:#b0c8d6;font-size:10px;}
.chest-secondary-score strong {display:block;color:#e8f4fa;font-size:17px;text-align:right;}
.hidden-chest__intro {padding:26px 24px;max-width:340px;}
.chest-intro-art {display:none;}
.hidden-chest__intro h2 {font-size:28px;}
.hidden-chest__result {top:auto;bottom:76px;max-width:350px;padding:18px 20px 20px;border-radius:20px;transform:translateX(-50%);background:linear-gradient(145deg,#123447fa,#081b2bfc);box-shadow:0 14px 32px #0005;}
.hidden-chest__result h2 {font-size:24px;line-height:1.1;}
.hidden-chest__result .hidden-chest__eyebrow {font-size:8px;margin:0 0 7px;}
.hidden-chest__result > p:not(.hidden-chest__eyebrow) {font-size:12px;line-height:1.45;margin:8px 0 12px;}
.hidden-chest__result dl {margin:0 0 14px;gap:8px;}
.hidden-chest__result dl div {padding:8px;}
.hidden-chest__result dt {font-size:8px;}
.hidden-chest__result dd {font-size:21px;}
.hidden-chest__result .hidden-chest__button {min-height:44px;font-size:14px;}
.hidden-chest[data-phase='result'] .hidden-chest__scene {filter:none;}
.hidden-chest[data-phase='result'] .hidden-chest__stage::before {background:linear-gradient(transparent 40%,#06162470);backdrop-filter:none;}
.hidden-chest[data-phase='revealing'] .hidden-chest__mission,.hidden-chest[data-phase='result'] .hidden-chest__mission {display:none;}
.hidden-chest.is-dom-fallback .hidden-chest__grid,.hidden-chest__grid:focus-within {padding:175px 18px 80px;}
@media (max-height:740px) {
  .hidden-chest__hero {padding-top:10px;}
  .hidden-chest__title-lockup {margin-bottom:10px;transform:none;}
  .hidden-chest__title-lockup h1 {font-size:23px;}
  .hidden-chest__scene {top:145px;}
  .hidden-chest__intro {top:53%;}
  .hidden-chest__result {top:auto;bottom:72px;padding:14px 18px 16px;}
  .hidden-chest__footer {min-height:60px;}
}

/* V0.13: a compact embossed title, keeping the HUD in the same reading order. */
.hidden-chest__title-lockup {display:table;max-width:100%;margin:0 auto 14px;padding:6px 15px 8px;border:1px solid #5599c0;border-radius:8px;background:linear-gradient(145deg,#1d6190,#103753 75%);box-shadow:0 3px 0 #072237,inset 0 1px 0 #a3d9ec66,0 6px 14px #0003;}
.hidden-chest__title-lockup h1 {font-size:24px;text-shadow:0 2px 0 #092338;}
.hidden-chest__title-lockup h1 span:last-child {color:#ffd27b;text-shadow:0 2px 0 #855721;}
@media (max-width:350px) {.hidden-chest__title-lockup {padding:6px 12px 8px;}.hidden-chest__title-lockup h1 {font-size:22px;}}

/* V0.13.1: score in the main HUD; a quiet result after a lost round. */
.chest-round-hud {grid-template-columns:repeat(4,minmax(0,1fr));}
.chest-round-score {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;border-right:1px solid #bed9e520;}
.chest-round-score > span {color:#b6cedb;font-size:9px;line-height:1;letter-spacing:.08em;text-transform:uppercase;}
.chest-round-score strong {color:#ffda91;font-variant-numeric:tabular-nums;}
.chest-round-hud .hidden-chest__progress-track {width:60px;mask:radial-gradient(circle at 5px 5px,#000 3px,transparent 3.5px) 0 0/10px 10px repeat-x;}
.chest-round-hud .hidden-chest__timer-badge,.chest-round-hud .hidden-chest__progress,.chest-round-hud .hidden-chest__ammo {padding-left:4px;padding-right:4px;}
.hidden-chest__footer {grid-template-columns:1fr;}
.hidden-chest[data-outcome='lost'] .hidden-chest__result {border-color:#8ca9ba80;}

/* V0.15: a clear desk before the board is placed. */
.hidden-chest[data-phase='idle'] .hidden-chest__scene {visibility:hidden;}
.hidden-chest[data-phase='idle'] .hidden-chest__grid {display:none;}
.hidden-chest__intro {top:auto;bottom:82px;transform:translateX(-50%);padding:20px;}
.hidden-chest__intro h2 {font-size:25px;}
.hidden-chest__intro > p:not(.hidden-chest__eyebrow) {font-size:13px;margin:10px 0 16px;line-height:1.5;}
.hidden-chest[data-phase='entering'] .hidden-chest__intro {pointer-events:none;animation:chest-intro-exit 160ms ease-out both;}
.hidden-chest[data-phase='entering'][data-entry='replay'] .hidden-chest__intro {display:none;}
.hidden-chest[data-phase='entering'] .hidden-chest__scene {pointer-events:none;animation:chest-board-enter 180ms ease-out both;}
@keyframes chest-board-enter {from{opacity:0;}to{opacity:1;}}
@keyframes chest-intro-exit {to{opacity:0;transform:translate(-50%,8px);}}
@media(max-height:740px) {.hidden-chest__intro {bottom:74px;padding:16px 20px;}.hidden-chest__intro h2 {font-size:23px;}}
@media(prefers-reduced-motion:reduce) {.hidden-chest[data-phase='entering'] .hidden-chest__intro {animation:none;display:none;}}

/* V0.17: show the round information when play starts, leaving the welcome scene clear. */
.hidden-chest[data-phase='idle'] .chest-round-hud,
.hidden-chest[data-phase='idle'] .hidden-chest__mission {display:none;}
.hidden-chest[data-phase='entering'] .chest-round-hud {animation:chest-hud-enter 220ms ease-out both;}
.hidden-chest__intro > p.chest-intro-rules {color:#ffdb93;font-size:12px;font-weight:800;letter-spacing:.04em;margin:0 0 12px;}
@keyframes chest-hud-enter {from{opacity:0;transform:translateY(-5px);}to{opacity:1;transform:translateY(0);}}
@media(prefers-reduced-motion:reduce) {.hidden-chest[data-phase='entering'] .chest-round-hud {animation:none;}}

/* V0.18: a compact treasure showcase inside the welcome card. */
.hidden-chest__intro {padding:17px 22px 20px;border-radius:25px;border-color:#e5c68188;background:radial-gradient(ellipse at 50% 20%,#244754 0%,#102e3f 44%,#081d2d 100%);box-shadow:0 16px 40px #0006,inset 0 1px 0 #ffecbf33;max-height:calc(100% - 150px);overflow-y:auto;scrollbar-width:thin;}
.chest-intro-preview {position:relative;width:190px;height:120px;margin:0 auto 3px;pointer-events:none;background:radial-gradient(ellipse at 50% 50%,#ffd57424,transparent 67%);}
.chest-intro-preview::after {content:"";position:absolute;bottom:4px;left:22%;right:22%;height:9px;border-radius:50%;background:#020b16;filter:blur(5px);opacity:.5;}
.chest-intro-preview canvas,.chest-intro-preview img {position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:1;}
.chest-intro-preview img {padding:5px 20px;filter:drop-shadow(0 5px 8px #0004);}
.chest-intro-preview.is-preview-ready img {display:none;}
.hidden-chest__intro h2 {font-size:25px;line-height:1.1;letter-spacing:-.035em;margin:2px 0 10px;}
.hidden-chest__intro > p.chest-intro-rules {display:table;margin:0 auto 12px;padding:5px 12px;border:1px solid #e2c88330;border-radius:20px;background:#ffe1a00b;font-size:11px;font-family:system-ui,sans-serif;font-weight:650;letter-spacing:.01em;}
.hidden-chest__intro > p:not(.hidden-chest__eyebrow):not(.chest-intro-rules) {font-size:13px;line-height:1.5;margin:0 0 16px;color:#bed1db;}
.hidden-chest__intro strong {color:#ecf5fa;font-weight:700;}
.hidden-chest__intro [data-start] {display:flex;align-items:center;justify-content:center;gap:12px;min-height:50px;padding:12px 14px;border-radius:13px;font-family:"Chest Fredoka",ui-rounded,system-ui,sans-serif;font-size:17px;font-weight:550;line-height:1.2;letter-spacing:.015em;background:linear-gradient(#ffe5aa,#efbe62);color:#352712;box-shadow:0 3px 0 #936422,inset 0 1px 0 #fff4d5,0 6px 18px #e9aa3520;}
.hidden-chest__intro [data-start] svg {width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
@media(max-height:740px){.hidden-chest__intro{padding:13px 18px 17px;}.chest-intro-preview{height:102px;width:170px;}.hidden-chest__intro h2{font-size:23px;margin-bottom:8px;}.hidden-chest__intro > p.chest-intro-rules{margin-bottom:10px;}.hidden-chest__intro > p:not(.hidden-chest__eyebrow):not(.chest-intro-rules){font-size:12px;margin-bottom:12px;}}
