* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: linear-gradient(180deg, #1c2733 0%, #263544 55%, #2e4152 100%);
  color: #eef4f9;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
#app { position: relative; height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; }

#hud { display: flex; justify-content: space-between; padding: 12px 14px 4px; font-size: 14.5px; font-weight: 700; }
.hud-item { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 11px; }

#boss-zone { display: flex; flex-direction: column; align-items: center; padding: 10px 0 2px; }
#boss-avatar { font-size: 64px; line-height: 1.1; transition: transform .2s; }
#boss-avatar.inspect { animation: glare .5s; }
@keyframes glare { 40% { transform: scale(1.15) rotate(-4deg); filter: drop-shadow(0 0 12px rgba(255,90,90,.6)); } }
#boss-name { font-size: 13px; color: #a9c2d8; font-weight: 700; margin-top: 2px; }
#boss-tell { font-size: 15px; min-height: 22px; margin-top: 4px; color: #ffd166; font-weight: 600; }
#boss-bubble {
  margin-top: 6px; background: #eef4f9; color: #1c2733; font-weight: 800; font-size: 15px;
  border-radius: 14px; padding: 8px 16px; position: relative; max-width: 84%; min-height: 20px;
}
#boss-bubble::before {
  content: ''; position: absolute; top: -7px; left: 50%; margin-left: -7px;
  border: 7px solid transparent; border-bottom-color: #eef4f9; border-top: 0;
}

#toast-zone { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 24px; }
#toast-text { font-size: 17px; font-weight: 700; line-height: 1.5; text-align: center; white-space: pre-line; }
#toast-text.good { color: #7fd4ff; }
#toast-text.bad { color: #ff8a80; }
#toast-text.meh { color: #c8d6e2; }

#decide-row { display: flex; gap: 8px; padding: 6px 12px 10px; }
.act-btn {
  flex: 1; min-height: 58px; border: 0; border-radius: 14px;
  font-size: 16px; font-weight: 800; font-family: inherit; line-height: 1.25;
}
.act-btn.push { background: linear-gradient(180deg, #ffd166, #f0a840); color: #1c2733; }
.act-btn.push .sub { font-size: 11.5px; font-weight: 600; opacity: .75; }
.act-btn.back { background: rgba(255,255,255,.12); color: #a9c2d8; flex: .6; }
.act-btn:active { transform: scale(.96); }

#hand-zone { padding: 4px 12px calc(14px + env(safe-area-inset-bottom)); }
#hand-label { font-size: 12px; color: #8aa4bb; text-align: center; margin-bottom: 6px; }
#hand-row { display: flex; gap: 8px; }
.card-btn {
  flex: 1; min-height: 86px; border-radius: 14px; border: 2px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-family: inherit;
  transition: transform .15s, border-color .15s, opacity .2s;
}
.card-btn .card-emoji { font-size: 30px; }
.card-btn .card-name { font-size: 11.5px; font-weight: 700; color: #c8d6e2; }
.card-btn.picked { border-color: #ffd166; transform: translateY(-8px); background: rgba(255,209,102,.14); }
.card-btn:disabled { opacity: .3; }
.card-btn:active { transform: scale(.97); }

.overlay {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(12,18,26,.93); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 28px;
}
.overlay.hidden, .hidden { display: none !important; }
#title-logo { font-size: 72px; }
#title-h1 { font-size: 32px; font-weight: 800; color: #ffd166; }
#title-desc { font-size: 14px; line-height: 1.65; color: #b9cbda; }
#title-best { font-size: 15px; color: #7fd4ff; font-weight: 700; }
.big-btn {
  min-width: 200px; min-height: 56px; border: 0; border-radius: 16px;
  font-size: 18px; font-weight: 800; font-family: inherit;
  background: linear-gradient(180deg, #ffd166, #f0a840); color: #1c2733;
  margin-top: 8px;
}
.big-btn:active { transform: scale(.96); }
#result-emoji { font-size: 76px; }
#result-title { font-size: 26px; font-weight: 800; color: #ffd166; }
#result-score { font-size: 52px; font-weight: 800; color: #7fd4ff; }
#result-sub { font-size: 14px; line-height: 1.6; color: #b9cbda; white-space: pre-line; }

#float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.floaty { position: absolute; font-size: 24px; font-weight: 800; animation: floatUp 1.1s ease-out forwards; }
.floaty.good { color: #7fd4ff; }
.floaty.bad { color: #ff8a80; }
@keyframes floatUp { to { transform: translateY(-90px); opacity: 0; } }

#btn-mute {
  position: absolute; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08); font-size: 18px;
}
