html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #120706; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
#stage { position: fixed; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
#overlay > * { pointer-events: auto; }
.hidden { display: none !important; }

.wpanel {
  box-sizing: border-box;
  border-style: solid; border-width: 26px;
  border-image: var(--panel-img, url(../assets/ui-panel.webp)) 14% fill / 26px stretch;
  padding: 10px 22px 14px;
  color: #2a1208;
  font-family: var(--font);
  text-align: center;
  min-width: min(440px, 80vw);
  max-width: 86vw; max-height: 88vh;
  overflow: hidden;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.6));
  animation: pop 0.28s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wpanel h2 {
  margin: 0 0 6px; font-size: clamp(22px, 4.2vh, 36px); font-weight: 900; color: #b3201a;
  -webkit-text-stroke: 1px #3a0d06; text-shadow: 2px 3px 0 rgba(58,13,6,0.35); letter-spacing: 1px;
}
.wpanel p { margin: 4px 0; font-size: clamp(14px, 2.6vh, 20px); font-weight: 700; }
.wpanel .stats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 6px 0 10px; }
.wpanel .stat { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.wpanel .stat b { font-size: clamp(20px, 4vh, 32px); color: #3a120a; }
.wpanel .stat span { font-size: 14px; opacity: 0.8; }
.wpanel .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.wpanel .item { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 6px 0; font-size: 18px; font-weight: 800; }
.wpanel .item img { width: 40px; height: 40px; object-fit: contain; }

.wbtn {
  box-sizing: border-box;
  min-height: 48px; min-width: 120px;
  padding: 4px 18px;
  border-style: solid; border-width: 14px;
  border-image: var(--button-img, url(../assets/ui-button.webp)) 30% fill / 14px stretch;
  background: none;
  color: #fff3dc;
  font-family: var(--font); font-weight: 900; font-size: clamp(15px, 2.6vh, 20px);
  text-shadow: 0 0 2px #2a0806, 0 2px 0 #2a0806, 2px 0 0 #2a0806, -2px 0 0 #2a0806, 0 -2px 0 #2a0806;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.12s, filter 0.12s;
  outline: none;
}
.wbtn img { width: 26px; height: 26px; object-fit: contain; }
.wbtn:hover, .wbtn.focus { transform: scale(1.06); filter: brightness(1.25) drop-shadow(0 0 6px rgba(255,190,120,0.8)); }
.wbtn:active { transform: scale(0.94); }
.wbtn.quiet { filter: saturate(0.4) brightness(0.85); }
.wbtn.quiet:hover, .wbtn.quiet.focus { filter: saturate(0.6) brightness(1.1); }
.wbtn.small { min-width: 88px; min-height: 44px; font-size: 16px; }
.wbtn:disabled { opacity: 0.45; pointer-events: none; }

#introWrap { position: absolute; inset: 0; background: #000 url(../assets/title-bg.webp) center/cover no-repeat; z-index: 20; }
#introVideo { width: 100%; height: 100%; object-fit: cover; background: transparent; }
#introSkip { position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right)); z-index: 2; }
.subtitle {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  max-width: 76%; text-align: center; color: #fff3dc;
  font-family: var(--font); font-weight: 800; font-size: clamp(15px, 3vh, 24px);
  text-shadow: 0 2px 0 #000, 0 0 6px #000, 2px 0 0 #000, -2px 0 0 #000;
  pointer-events: none; z-index: 21;
}
#subtitle { bottom: auto; top: 18%; }
