* { 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, #2b1a0e 0%, #3d2412 55%, #4a2e16 100%);
  color: #fdf3e3;
  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; }

#ai-zone { display: flex; flex-direction: column; align-items: center; padding: 8px 0 2px; position: relative; }
#ai-avatar { font-size: 58px; line-height: 1.1; transition: transform .2s; }
#ai-avatar.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px) rotate(-6deg); } 60% { transform: translateX(5px) rotate(5deg); } }
#ai-tell { font-size: 22px; min-height: 28px; }
#ai-name { font-size: 12.5px; color: #d9b98c; font-weight: 700; }
#ai-bubble {
  margin-top: 6px; background: #fdf3e3; color: #3d2412; font-weight: 800; font-size: 15px;
  border-radius: 14px; padding: 8px 16px; position: relative; max-width: 80%;
}
#ai-bubble::before {
  content: ''; position: absolute; top: -7px; left: 50%; margin-left: -7px;
  border: 7px solid transparent; border-bottom-color: #fdf3e3; border-top: 0;
}

#decl-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
#decl-label { font-size: 13px; color: #d9b98c; }
#decl-num { font-size: 64px; font-weight: 800; color: #ffd166; line-height: 1; }
#decl-num.bump { animation: bump .3s; }
@keyframes bump { 30% { transform: scale(1.25); } }
#decl-sub { font-size: 12.5px; color: #b09271; }

#my-zone { text-align: center; padding: 6px 0; }
#my-fist-label { font-size: 12.5px; color: #d9b98c; margin-bottom: 4px; }
#my-fist { font-size: 34px; letter-spacing: 4px; min-height: 44px; }
#my-eff { font-size: 13px; color: #7fd4ff; font-weight: 700; margin-top: 2px; }

#action-row { display: flex; gap: 8px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
.act-btn {
  flex: 1; min-height: 58px; border: 0; border-radius: 14px;
  font-size: 16px; font-weight: 800; font-family: inherit; color: #2b1a0e;
  background: linear-gradient(180deg, #ffd166, #f0a840); line-height: 1.25;
}
.act-btn .sub { font-size: 12px; font-weight: 600; opacity: .75; }
.act-btn.call { background: linear-gradient(180deg, #ff9a8a, #f06048); color: #fff; }
.act-btn:disabled { opacity: .35; }
.act-btn:active { transform: scale(.96); }

.overlay {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(20,11,4,.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: #e0c9a6; }
#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: #2b1a0e;
  margin-top: 8px;
}
.big-btn:active { transform: scale(.96); }

#rv-title { font-size: 24px; font-weight: 800; color: #ffd166; }
.rv-row { display: flex; align-items: center; gap: 14px; }
.rv-who { font-size: 14px; font-weight: 700; color: #d9b98c; width: 42px; text-align: right; }
.rv-fist { font-size: 30px; letter-spacing: 3px; }
#rv-total { font-size: 16px; font-weight: 700; color: #7fd4ff; }
#rv-result { font-size: 15px; line-height: 1.6; color: #e0c9a6; white-space: pre-line; }
#result-emoji { font-size: 76px; }
#result-title { font-size: 26px; font-weight: 800; color: #ffd166; }
#result-score { font-size: 44px; font-weight: 800; }
#result-sub { font-size: 14px; line-height: 1.6; color: #e0c9a6; 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;
}
