:root {
  --chest-blue: #0756a5;
  --chest-blue-dark: #031e42;
  --chest-blue-mid: #0b3f76;
  --chest-gold: #ffc439;
  --chest-gold-dark: #d98500;
  --chest-cyan: #24d8ff;
  --chest-paper: #f7fbff;
  --chest-danger: #ed4f4f;
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: white;
  background:
    radial-gradient(circle at 50% -10%, #2b6aa7 0, transparent 42%),
    #071629;
}

button {
  font: inherit;
}

.hidden-chest {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #f7fbff 0 72px, #09284e 72px 100%);
  box-shadow: 0 0 54px rgba(0, 0, 0, 0.44);
}

.hidden-chest__brand {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 56px 9px;
  color: var(--chest-blue);
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 4px solid var(--chest-gold);
  border-radius: 0 0 28px 28px;
  box-shadow: 0 7px 0 rgba(0, 43, 87, 0.22);
}

.hidden-chest__brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  color: white;
  font-size: 21px;
  font-weight: 950;
  background: var(--chest-blue);
  border: 3px solid white;
  border-radius: 50%;
  outline: 2px solid var(--chest-gold);
}

.hidden-chest__brand strong,
.hidden-chest__brand small {
  display: block;
}

.hidden-chest__brand strong {
  font-size: 18px;
  line-height: 1;
}

.hidden-chest__brand small {
  margin-top: 4px;
  color: #637891;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hidden-chest__help {
  position: absolute;
  top: max(15px, env(safe-area-inset-top));
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: white;
  font-size: 20px;
  font-weight: 950;
  background: var(--chest-blue);
  border: 3px solid white;
  border-radius: 50%;
  outline: 2px solid var(--chest-gold);
  cursor: pointer;
}

.hidden-chest__hero {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 66px;
  gap: 8px;
  align-items: center;
  min-height: 122px;
  padding: 16px 10px 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(50, 174, 255, 0.36), transparent 46%),
    linear-gradient(145deg, var(--chest-blue), #052c59 72%);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 74% 95%, 49% 89%, 24% 97%, 0 90%);
}

.hidden-chest__title-lockup {
  text-align: center;
  text-transform: uppercase;
}

.hidden-chest__title-lockup > p:first-child {
  margin: 0;
  color: var(--chest-gold);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.hidden-chest__title-lockup h1 {
  margin: -1px 0 4px;
  font-size: clamp(26px, 7.5vw, 36px);
  line-height: 0.93;
  letter-spacing: -0.07em;
  text-shadow: 0 4px 0 rgba(0, 17, 40, 0.54);
}

.hidden-chest__title-lockup > p:last-child {
  max-width: 190px;
  margin: 0 auto;
  color: #d6ecff;
  font-size: 8px;
  font-weight: 850;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

.hidden-chest__hud {
  display: grid;
  min-height: 62px;
  padding: 7px 3px;
  place-items: center;
  align-content: center;
  color: var(--chest-blue-dark);
  line-height: 1;
  background: white;
  border: 3px solid var(--chest-gold);
  border-radius: 14px;
  box-shadow: 0 5px 0 rgba(0, 19, 44, 0.42);
}

.hidden-chest__hud span {
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.hidden-chest__hud strong {
  margin-top: 4px;
  color: var(--chest-blue);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.hidden-chest__hud small {
  font-size: 10px;
}

.hidden-chest__hud--timer {
  border-radius: 50%;
}

.is-timer-urgent .hidden-chest__hud--timer {
  color: white;
  background: var(--chest-danger);
  border-color: white;
  animation: timer-alert 620ms ease-in-out infinite alternate;
}

.is-timer-urgent .hidden-chest__hud--timer strong {
  color: white;
}

.hidden-chest__stage {
  position: relative;
  min-height: min(58vh, 570px);
  min-height: min(58dvh, 570px);
  margin-top: -16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 16, 36, 0.08), rgba(2, 12, 27, 0.64)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 48px),
    radial-gradient(circle at 50% 38%, #174e79, #06172c 74%);
  border-bottom: 4px solid #0f5e9b;
}

.hidden-chest__stage::before,
.hidden-chest__stage::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.hidden-chest__stage::before {
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(38, 216, 255, 0.12), transparent 18%),
    radial-gradient(circle at 85% 68%, rgba(255, 196, 57, 0.13), transparent 22%);
}

.hidden-chest__stage::after {
  right: -80px;
  bottom: -70px;
  width: 230px;
  height: 160px;
  background: linear-gradient(135deg, transparent 45%, rgba(255, 196, 57, 0.12));
  transform: rotate(-12deg);
}

.hidden-chest__scene,
.hidden-chest__grid {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.hidden-chest__scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.hidden-chest__grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 7), 1fr);
  gap: 4px;
  align-content: center;
  padding: 32px 20px 38px;
  background: rgba(4, 20, 42, 0.92);
}

.hidden-chest__grid button {
  min-width: 0;
  aspect-ratio: 1;
  color: transparent;
  background: linear-gradient(145deg, #2b6e9f, #123b69);
  border: 2px solid rgba(139, 220, 255, 0.38);
  border-radius: 8px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 3px 0 rgba(0, 0, 0, 0.28);
  cursor: crosshair;
}

.hidden-chest__grid button[data-exposed="true"] {
  background: rgba(7, 22, 40, 0.45);
  border-style: dashed;
  box-shadow: none;
}

.hidden-chest__grid button[data-hit="true"] {
  background: radial-gradient(circle, #fff8bd, var(--chest-gold) 45%, #a25c00);
  border-color: white;
}

.hidden-chest.is-pixi-ready .hidden-chest__grid,
.hidden-chest.is-three-ready .hidden-chest__grid {
  z-index: 3;
  opacity: 0;
  background: rgba(4, 20, 42, 0.96);
  pointer-events: none;
}

.hidden-chest.is-pixi-ready .hidden-chest__grid button,
.hidden-chest.is-three-ready .hidden-chest__grid button {
  pointer-events: none;
}

.hidden-chest.is-pixi-ready .hidden-chest__grid:focus-within,
.hidden-chest.is-three-ready .hidden-chest__grid:focus-within {
  opacity: 1;
}

.hidden-chest.is-pixi-ready .hidden-chest__grid button:focus-visible,
.hidden-chest.is-three-ready .hidden-chest__grid button:focus-visible,
.hidden-chest__grid button:focus-visible {
  position: relative;
  z-index: 2;
  outline: 4px solid white;
  box-shadow: 0 0 0 7px var(--chest-gold);
}

.hidden-chest__intro,
.hidden-chest__result {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 34px), 350px);
  padding: 24px 22px;
  color: var(--chest-blue-dark);
  text-align: center;
  background: rgba(255, 255, 255, 0.97);
  border: 4px solid var(--chest-gold);
  border-radius: 26px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52), inset 0 0 0 4px #fff;
  transform: translate(-50%, -50%);
}

.hidden-chest__intro-icon,
.hidden-chest__result-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: -52px auto 10px;
  place-items: center;
  color: white;
  font-size: 31px;
  background: linear-gradient(145deg, #ffdf62, var(--chest-gold-dark));
  border: 5px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--chest-blue), 0 8px 18px rgba(0, 0, 0, 0.26);
}

.hidden-chest__eyebrow {
  margin: 0 0 6px;
  color: var(--chest-blue);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hidden-chest__intro h2,
.hidden-chest__result h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hidden-chest__intro > p:not(.hidden-chest__eyebrow),
.hidden-chest__result > p:not(.hidden-chest__eyebrow) {
  margin: 12px auto 18px;
  color: #4c6078;
  font-size: 13px;
  line-height: 1.42;
}

.hidden-chest__result dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 18px;
}

.hidden-chest__result dl div {
  padding: 9px;
  background: #eef7ff;
  border: 1px solid #bdddf7;
  border-radius: 12px;
}

.hidden-chest__result dt {
  color: #60758b;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.hidden-chest__result dd {
  margin: 3px 0 0;
  color: var(--chest-blue);
  font-size: 21px;
  font-weight: 950;
}

.hidden-chest__button {
  min-height: 48px;
  padding: 11px 20px;
  font-weight: 900;
  text-transform: uppercase;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.hidden-chest__button--primary {
  color: white;
  background: linear-gradient(180deg, #ffb326, #ec7600);
  box-shadow: 0 5px 0 #a94b00, 0 9px 18px rgba(223, 111, 0, 0.26);
}

.hidden-chest__button--primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #a94b00;
}

.hidden-chest__footer {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: 78px 1fr 96px;
  gap: 9px;
  align-items: center;
  min-height: 112px;
  padding: 12px 12px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0b3d72, #041d3b);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hidden-chest__progress,
.hidden-chest__ammo {
  display: grid;
  min-height: 74px;
  padding: 8px 6px;
  place-items: center;
  align-content: center;
  color: var(--chest-blue-dark);
  text-align: center;
  background: white;
  border: 3px solid var(--chest-gold);
  border-radius: 14px;
}

.hidden-chest__progress > span:first-child,
.hidden-chest__ammo-label {
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.hidden-chest__progress strong,
.hidden-chest__ammo strong {
  color: var(--chest-blue);
  font-size: 20px;
  line-height: 1;
}

.hidden-chest__progress-track {
  width: 100%;
  height: 6px;
  margin-top: 5px;
  overflow: hidden;
  background: #dce9f5;
  border-radius: 999px;
}

.hidden-chest__progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--chest-gold-dark), var(--chest-gold));
  transition: width 240ms ease;
}

.hidden-chest__status {
  margin: 0;
  color: #d9edff;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.32;
  text-align: center;
}

.hidden-chest__ammo-icons {
  display: flex;
  max-width: 80px;
  min-height: 14px;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  margin: 4px 0;
}

.hidden-chest__ammo-icons i {
  display: block;
  width: 6px;
  height: 13px;
  background: linear-gradient(90deg, #c06c00, var(--chest-gold), #fff0a7);
  border-radius: 3px 3px 1px 1px;
  box-shadow: 0 1px 0 #6d3e00;
}

.hidden-chest__ammo-icons i.is-spent {
  opacity: 0.18;
  filter: grayscale(1);
}

.hidden-chest__dialog {
  width: min(calc(100% - 30px), 390px);
  padding: 24px;
  color: var(--chest-blue-dark);
  background: white;
  border: 4px solid var(--chest-gold);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.hidden-chest__dialog::backdrop {
  background: rgba(0, 13, 31, 0.76);
  backdrop-filter: blur(3px);
}

.hidden-chest__dialog > button {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--chest-blue);
  font-size: 26px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.hidden-chest__dialog h2 {
  margin: 0 0 14px;
}

.hidden-chest__dialog ol {
  margin: 0;
  padding-left: 22px;
  color: #435a72;
  line-height: 1.55;
}

.hidden-chest[data-phase="playing"] .hidden-chest__intro,
.hidden-chest[data-phase="result"] .hidden-chest__intro {
  display: none;
}

.hidden-chest.has-hit .hidden-chest__stage {
  animation: stage-hit 240ms ease-out;
}

.hidden-chest.has-combo .hidden-chest__status {
  color: #fff2a6;
  text-shadow: 0 0 10px rgba(255, 196, 57, 0.8);
}

/* Premium V0.2 — generic retail art direction. */
body {
  background:
    radial-gradient(circle at 50% 10%, rgba(28, 126, 190, 0.52), transparent 42%),
    linear-gradient(145deg, #030914, #071e35 54%, #02060c);
}

.hidden-chest {
  display: flex;
  flex-direction: column;
  background: #030b16;
  box-shadow:
    0 0 0 1px rgba(127, 215, 255, 0.12),
    0 28px 90px rgba(0, 0, 0, 0.72);
}

.hidden-chest::before {
  position: absolute;
  z-index: 20;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  content: "";
  pointer-events: none;
}

.hidden-chest__brand {
  min-height: 66px;
  color: #082d59;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.98), rgba(235, 247, 255, 0.98)),
    white;
  border-bottom: 0;
  border-radius: 0 0 24px 24px;
  box-shadow:
    0 2px 0 #f5a916,
    0 7px 0 #0b5d9e,
    0 14px 30px rgba(0, 7, 18, 0.4);
}

.hidden-chest__brand-mark,
.hidden-chest__help {
  background: linear-gradient(145deg, #168bd0, #06457f);
  border-color: #eaf8ff;
  outline-color: #f2a719;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.3), 0 4px 10px rgba(0, 32, 70, 0.3);
}

.hidden-chest__brand strong {
  font-weight: 950;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hidden-chest__hero {
  min-height: 128px;
  padding-top: 21px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 22% 78%, rgba(255, 255, 255, 0.06)),
    radial-gradient(circle at 50% -25%, rgba(70, 190, 255, 0.64), transparent 48%),
    linear-gradient(145deg, #063f78, #031b38 72%);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 77% 94%, 50% 90%, 22% 96%, 0 91%);
}

.hidden-chest__title-lockup h1 {
  color: #fff;
  font-size: clamp(27px, 8vw, 37px);
  -webkit-text-stroke: 1px rgba(0, 17, 41, 0.48);
  text-shadow:
    0 3px 0 #062348,
    0 6px 12px rgba(0, 0, 0, 0.44),
    0 0 24px rgba(71, 196, 255, 0.18);
}

.hidden-chest__title-lockup > p:first-child {
  color: #ffd878;
}

.hidden-chest__hud {
  color: white;
  background:
    linear-gradient(155deg, rgba(25, 112, 180, 0.98), rgba(3, 38, 79, 0.98));
  border-color: rgba(156, 225, 255, 0.85);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.1),
    0 5px 0 #031733,
    0 10px 20px rgba(0, 0, 0, 0.32);
}

.hidden-chest__hud strong,
.hidden-chest__hud span {
  color: white;
}

.hidden-chest__hud strong {
  color: #ffd33f;
  text-shadow: 0 2px 0 rgba(74, 39, 0, 0.55);
}

.hidden-chest__stage {
  flex: 1 1 auto;
  background-image:
    linear-gradient(180deg, rgba(2, 9, 18, 0.04), rgba(1, 6, 14, 0.44)),
    url("assets/premium-v09/school-diorama-backing.webp");
  background-position:
    calc(50% + var(--chest-bg-x, 0px)) calc(50% + var(--chest-bg-y, 0px)),
    calc(50% + var(--chest-bg-x, 0px)) calc(50% + var(--chest-bg-y, 0px));
  background-size: cover;
  border-bottom-color: rgba(68, 181, 236, 0.72);
}

.hidden-chest__stage::before {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 47%, rgba(39, 166, 235, 0.15), transparent 36%),
    linear-gradient(90deg, rgba(0, 4, 10, 0.24), transparent 18% 82%, rgba(0, 4, 10, 0.24));
}

.hidden-chest__stage::after {
  right: auto;
  bottom: -45px;
  left: 50%;
  width: 88%;
  height: 120px;
  background: radial-gradient(ellipse, rgba(255, 176, 39, 0.3), transparent 67%);
  filter: blur(14px);
  transform: translateX(-50%);
}

.hidden-chest__intro,
.hidden-chest__result {
  color: white;
  background:
    linear-gradient(145deg, rgba(8, 40, 74, 0.96), rgba(2, 16, 34, 0.97));
  border: 2px solid rgba(255, 211, 92, 0.92);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.66),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 18px 34px rgba(49, 161, 225, 0.12);
  backdrop-filter: blur(14px) saturate(1.2);
}

.hidden-chest__intro::before,
.hidden-chest__result::before {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(127, 214, 255, 0.14);
  border-radius: 19px;
  content: "";
  pointer-events: none;
}

.hidden-chest__intro-icon,
.hidden-chest__result-icon {
  background: linear-gradient(145deg, #ffd96a, #e18200);
  box-shadow:
    0 0 0 4px #0b5692,
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 189, 39, 0.42);
}

.hidden-chest__intro h2,
.hidden-chest__result h2 {
  position: relative;
  color: white;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.42);
}

.hidden-chest__eyebrow {
  position: relative;
  color: #ffd968;
}

.hidden-chest__intro > p:not(.hidden-chest__eyebrow),
.hidden-chest__result > p:not(.hidden-chest__eyebrow) {
  position: relative;
  color: #c9e7fa;
}

.hidden-chest__result {
  padding-top: 96px;
}

.hidden-chest__result-chest {
  position: absolute;
  z-index: 2;
  top: -76px;
  left: 50%;
  width: 190px;
  height: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.58));
  transform: translateX(-50%);
}

.hidden-chest__result .hidden-chest__result-icon {
  display: none;
}

.hidden-chest__result dl div {
  position: relative;
  color: white;
  background: rgba(11, 72, 121, 0.58);
  border-color: rgba(124, 208, 255, 0.28);
}

.hidden-chest__result dt {
  color: #b9dff5;
}

.hidden-chest__result dd {
  color: #ffd248;
}

.hidden-chest__button--primary {
  position: relative;
  color: #071d35;
  background: linear-gradient(180deg, #ffe56f, #f4a20e 74%);
  box-shadow:
    0 5px 0 #9f5600,
    0 10px 26px rgba(242, 153, 0, 0.36),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.hidden-chest__footer {
  background:
    radial-gradient(circle at 50% 0, rgba(30, 130, 199, 0.22), transparent 48%),
    linear-gradient(180deg, #082f58, #020e20);
  border-top-color: rgba(105, 208, 255, 0.3);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24);
}

.hidden-chest__progress,
.hidden-chest__ammo {
  color: white;
  background: linear-gradient(150deg, rgba(15, 84, 139, 0.96), rgba(3, 31, 66, 0.98));
  border-color: rgba(132, 218, 255, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 5px 12px rgba(0, 0, 0, 0.28);
}

.hidden-chest__progress strong,
.hidden-chest__ammo strong {
  color: #ffd03c;
}

.hidden-chest__progress-track {
  background: rgba(0, 8, 20, 0.58);
}

.hidden-chest__status {
  color: #e3f4ff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.hidden-chest__grid {
  background:
    linear-gradient(180deg, rgba(2, 13, 28, 0.72), rgba(1, 8, 18, 0.86)),
    url("assets/premium-v09/school-diorama-backing.webp") center / cover;
}

.hidden-chest__grid button {
  border-color: rgba(157, 226, 255, 0.46);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.2),
    inset 0 -4px 0 rgba(0, 15, 34, 0.24),
    0 4px 0 rgba(0, 0, 0, 0.42);
}

.hidden-chest[data-phase="result"] .hidden-chest__stage::before {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 195, 49, 0.36), transparent 42%),
    rgba(0, 8, 20, 0.28);
  backdrop-filter: blur(3px);
}

.hidden-chest[data-phase="result"] .hidden-chest__result-chest {
  animation: chest-arrival 600ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

/* V0.5 — full-height stage with HUD overlays. */
.hidden-chest__brand {
  flex: 0 0 auto;
}

.hidden-chest__hero {
  position: absolute;
  z-index: 7;
  top: 66px;
  right: 0;
  left: 0;
  min-height: 122px;
  padding: 17px 10px 20px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 22% 78%, rgba(255, 255, 255, 0.05)),
    radial-gradient(circle at 50% -25%, rgba(70, 190, 255, 0.55), transparent 48%),
    linear-gradient(180deg, rgba(5, 63, 120, 0.97), rgba(3, 27, 56, 0.9) 78%, rgba(3, 27, 56, 0.38));
}

.hidden-chest__stage {
  min-height: 0;
  margin-top: 0;
}

.hidden-chest__footer {
  position: absolute;
  z-index: 7;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(30, 130, 199, 0.2), transparent 48%),
    linear-gradient(180deg, rgba(8, 47, 88, 0.9), rgba(2, 14, 32, 0.98));
  backdrop-filter: blur(5px) saturate(1.1);
}

@keyframes timer-alert {
  to { transform: scale(1.06); }
}

@keyframes stage-hit {
  35% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

@keyframes chest-arrival {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(22px) scale(0.72) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(0);
  }
}

@media (max-height: 740px) {
  .hidden-chest__brand {
    min-height: 58px;
  }

  .hidden-chest__hero {
    min-height: 104px;
    padding-top: 11px;
  }

  .hidden-chest__stage {
    min-height: 0;
  }

  .hidden-chest__footer {
    min-height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* V0.9 — hybrid premium composition: prerendered decor, interactive 3D diorama. */
.hidden-chest__hero {
  min-height: 188px;
  padding: 13px 11px 25px;
  grid-template-columns: 66px minmax(0, 1fr) 76px;
  align-items: start;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 24% 76%, rgba(255, 255, 255, 0.06)),
    radial-gradient(circle at 50% -10%, rgba(54, 184, 255, 0.46), transparent 48%),
    linear-gradient(180deg, rgba(5, 61, 117, 0.98), rgba(2, 22, 49, 0.93) 76%, rgba(2, 22, 49, 0.35));
  clip-path: polygon(0 0, 100% 0, 100% 88%, 78% 94%, 51% 91%, 22% 96%, 0 91%);
}

.hidden-chest__title-lockup {
  position: relative;
  min-width: 0;
  margin: -2px auto 0;
  padding: 7px 16px 25px;
  background:
    linear-gradient(180deg, rgba(21, 115, 187, 0.98), rgba(2, 42, 86, 0.99)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 6px);
  border: 3px solid #198fd5;
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 2px rgba(1, 23, 53, 0.82),
    inset 0 8px 15px rgba(113, 213, 255, 0.18),
    0 5px 0 #031b3b,
    0 11px 20px rgba(0, 4, 14, 0.42);
  transform: perspective(300px) rotateX(-1deg);
}

.hidden-chest__title-lockup::before,
.hidden-chest__title-lockup::after {
  position: absolute;
  z-index: -1;
  top: 17px;
  width: 13px;
  height: 65%;
  background: linear-gradient(180deg, #1ba1e8, #07528f);
  border: 2px solid rgba(1, 24, 55, 0.8);
  content: "";
}

.hidden-chest__title-lockup::before {
  left: -11px;
  transform: skewY(-18deg);
}

.hidden-chest__title-lockup::after {
  right: -11px;
  transform: skewY(18deg);
}

.hidden-chest__title-lockup > p:first-child {
  margin-bottom: -2px;
  color: #ffd05a;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.18em;
}

.hidden-chest__title-lockup h1 {
  display: grid;
  gap: 0;
  margin: 0;
  font-size: clamp(28px, 8.5vw, 40px);
  line-height: 0.78;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  -webkit-text-stroke: 1.5px rgba(1, 18, 38, 0.72);
}

.hidden-chest__title-lockup h1 span {
  display: block;
}

.hidden-chest__title-lockup h1 span:first-child {
  color: #f7fbff;
}

.hidden-chest__title-lockup h1 span:last-child {
  color: #ffc126;
  margin-top: 7px;
  text-shadow:
    0 3px 0 #b36a00,
    0 6px 9px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(255, 190, 29, 0.2);
}

.hidden-chest__title-lockup > p:nth-of-type(2) {
  display: none;
}

.hidden-chest__timer-badge {
  position: absolute;
  z-index: 3;
  right: 17%;
  bottom: -21px;
  left: 17%;
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: white;
  background: linear-gradient(180deg, #147fc8, #06447f);
  border: 3px solid #198fd5;
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px rgba(1, 25, 58, 0.72), 0 4px 0 #031a38, 0 8px 14px rgba(0, 0, 0, 0.35);
  font-size: 18px;
  line-height: 1;
}

.hidden-chest__timer-badge > span {
  color: #f7fbff;
  font-size: 20px;
}

.hidden-chest__timer-badge strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.hidden-chest__timer-badge small {
  margin-left: 1px;
  color: #ffd14a;
  font-size: 11px;
  text-transform: uppercase;
}

.is-timer-urgent .hidden-chest__timer-badge {
  background: linear-gradient(180deg, #bd3f31, #721413);
  border-color: #ffb44b;
  animation: timer-alert 500ms ease-in-out infinite alternate;
}

.hidden-chest__hud {
  min-height: 70px;
  padding: 8px 5px;
  border-width: 3px;
  border-radius: 17px;
}

.hidden-chest__hud > span {
  font-size: 9px;
}

.hidden-chest__hud strong {
  font-size: 24px;
}

.hidden-chest__hud--progress-summary {
  border-radius: 50%;
  aspect-ratio: 1;
}

.hidden-chest__hud--progress-summary strong {
  font-size: 18px;
}

.hidden-chest__stage {
  background-image:
    linear-gradient(180deg, rgba(2, 9, 18, 0.02), rgba(1, 6, 14, 0.2)),
    url("assets/premium-v09/school-diorama-backing.webp");
  background-position:
    calc(50% + var(--chest-bg-x, 0px)) calc(50% + var(--chest-bg-y, 0px)),
    calc(50% + var(--chest-bg-x, 0px)) calc(50% + var(--chest-bg-y, 0px));
  background-size: cover;
}

.hidden-chest__stage::before {
  background:
    radial-gradient(circle at 50% 53%, rgba(49, 188, 255, 0.09), transparent 37%),
    linear-gradient(90deg, rgba(0, 4, 10, 0.15), transparent 16% 84%, rgba(0, 4, 10, 0.15));
}

.hidden-chest__mission {
  position: absolute;
  z-index: 6;
  top: 190px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 64px);
  margin: 0;
  padding: 7px 15px 8px;
  color: #06447e;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 44, 89, 0.18);
  border-radius: 10px;
  box-shadow: 0 4px 0 rgba(2, 29, 58, 0.28), 0 9px 20px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.hidden-chest__grid {
  background:
    linear-gradient(180deg, rgba(2, 13, 28, 0.48), rgba(1, 8, 18, 0.68)),
    url("assets/premium-v09/school-diorama-backing.webp") center / cover;
}

@media (max-height: 740px) {
  .hidden-chest__hero {
    min-height: 165px;
    padding-top: 8px;
  }

  .hidden-chest__title-lockup {
    transform: scale(0.9);
    transform-origin: top center;
  }

  .hidden-chest__mission {
    top: 166px;
  }
}

/* V0.10 — compact HUD and more room for the interactive diorama. */
.hidden-chest__hero {
  min-height: 164px;
  padding-top: 7px;
  clip-path: polygon(0 0, 100% 0, 100% 87%, 78% 93%, 51% 90%, 22% 95%, 0 90%);
}

.hidden-chest__title-lockup {
  transform: perspective(300px) rotateX(-1deg) scale(0.88);
  transform-origin: top center;
}

.hidden-chest__hud {
  min-height: 64px;
  transform: scale(0.94);
  transform-origin: top center;
}

.hidden-chest__mission {
  top: 166px;
}

@media (max-height: 740px) {
  .hidden-chest__hero {
    min-height: 150px;
  }

  .hidden-chest__mission {
    top: 151px;
  }
}
