* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; overflow: hidden; overscroll-behavior: none;
  background: #17161c; color: #e8e4d8;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#wrap { position: fixed; inset: 0; width: 100%; height: 100%; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none; z-index: 5;
}
#hearts { font-size: 22px; letter-spacing: 4px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
#hearts .lost { opacity: .22; filter: grayscale(1); }
#boss-info { text-align: right; }
#boss-name {
  font-size: 19px; font-weight: 700; letter-spacing: 1px;
  color: #e8e4d8; text-shadow: 0 1px 6px rgba(0,0,0,.7);
  writing-mode: vertical-rl; margin-left: auto;
}
#boss-dots { margin-top: 8px; display: flex; gap: 5px; justify-content: flex-end; }
#boss-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(232,228,216,.18); border: 1px solid rgba(232,228,216,.25);
}
#boss-dots .dot.done { background: #d23b3b; border-color: #d23b3b; }
#boss-dots .dot.now { background: #e8e4d8; border-color: #e8e4d8; box-shadow: 0 0 8px rgba(232,228,216,.7); }
#stage-label {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  font-size: 12px; letter-spacing: 3px; color: rgba(232,228,216,.55);
}

#banner {
  position: absolute; top: 34%; left: 50%; transform: translate(-50%,-50%);
  font-size: 34px; font-weight: 800; letter-spacing: 8px; color: #e8e4d8;
  text-shadow: 0 0 18px rgba(210,59,59,.8), 0 2px 6px rgba(0,0,0,.7);
  pointer-events: none; z-index: 6; animation: bannerPop .5s ease-out;
  white-space: nowrap;
}
@keyframes bannerPop {
  0% { transform: translate(-50%,-50%) scale(1.8); opacity: 0; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}
#banner.red { color: #d23b3b; text-shadow: 0 0 22px rgba(210,59,59,.9), 0 2px 6px rgba(0,0,0,.8); }

.overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(15,14,19,.86);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.title-kr {
  font-size: 72px; font-weight: 900; letter-spacing: 6px;
  color: #e8e4d8;
  text-shadow: 0 0 30px rgba(210,59,59,.35), 0 3px 8px rgba(0,0,0,.8);
  margin-bottom: 10px;
}
.title-sub { font-size: 14px; color: rgba(232,228,216,.7); margin-bottom: 18px; line-height: 1.5; }
.best-line { font-size: 13px; color: #c9a441; margin-bottom: 14px; letter-spacing: 1px; }
.howto { margin-bottom: 26px; display: flex; flex-direction: column; gap: 12px; }
.how-row {
  display: flex; align-items: center; gap: 12px; text-align: left;
  font-size: 13px; line-height: 1.45; color: rgba(232,228,216,.85);
  max-width: 300px;
}
.how-row b { color: #fff; }
.how-ico { font-size: 24px; flex-shrink: 0; width: 34px; text-align: center; }
.big-btn {
  min-width: 200px; min-height: 56px; padding: 14px 34px;
  font-size: 20px; font-weight: 800; letter-spacing: 3px;
  font-family: inherit;
  color: #e8e4d8; background: #d23b3b;
  border: none; border-radius: 4px; cursor: pointer;
  box-shadow: 0 4px 0 #8f2424, 0 6px 16px rgba(0,0,0,.5);
  transition: transform .08s, box-shadow .08s;
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f2424, 0 2px 8px rgba(0,0,0,.5); }
.icon-btn {
  position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); right: 14px; z-index: 11;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(232,228,216,.12); border: 1px solid rgba(232,228,216,.25);
  color: #e8e4d8; font-size: 20px; cursor: pointer;
}
#result-overlay { background: rgba(15,14,19,.9); }
@media (max-height: 640px) {
  .title-kr { font-size: 52px; }
  .howto { gap: 8px; margin-bottom: 16px; }
  .how-row { font-size: 12px; }
}
