:root {
  --mag: #ff2d55;
  --mag-soft: rgba(255, 45, 85, 0.35);
  --cyan: #32d6e6;
  --cyan-soft: rgba(50, 214, 230, 0.28);
  --glass: rgba(22, 18, 28, 0.78);
  --border: rgba(255, 255, 255, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body { background: #08060a; }

.app {
  width: 100%; max-width: 430px; height: 100dvh; position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 45% at 50% 18%, rgba(255, 45, 85, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 70%, rgba(50, 214, 230, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 40%, #1a0c16 0%, #08060a 72%);
}

/* 顶部好感度条 */
.header-hud {
  z-index: 10; flex-shrink: 0;
  background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px 14px;
  box-shadow: 0 0 0 1px rgba(255, 45, 85, 0.06), 0 10px 28px rgba(0, 0, 0, 0.35);
}
.hud-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 650; margin-bottom: 10px; letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.92);
}
.meter-bg {
  height: 12px; background: rgba(255, 255, 255, 0.1); border-radius: 999px;
  overflow: hidden; position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}
.meter-fill {
  height: 100%; width: 0; border-radius: inherit; position: relative;
  background: linear-gradient(90deg, #ff3b5c 0%, var(--mag) 42%, #ff6b9a 68%, var(--cyan) 100%);
  box-shadow: 0 0 14px var(--mag-soft), 0 0 8px var(--cyan-soft);
  transition: width 0.55s var(--ease);
}
.meter-fill::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, transparent 55%);
  pointer-events: none;
}
.meter-fill.bump {
  animation: meterBump 0.55s var(--ease);
}
@keyframes meterBump {
  0% { filter: brightness(1); }
  35% { filter: brightness(1.35); box-shadow: 0 0 22px rgba(255, 45, 85, 0.7), 0 0 16px rgba(50, 214, 230, 0.45); }
  100% { filter: brightness(1); }
}

/* 角色主视觉：圆环内放图片或视频，18+ 前模糊 */
.character-box {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 0;
}
.avatar-ring {
  width: min(178px, 42vw); height: min(178px, 42vw); border-radius: 50%; padding: 4px;
  background: linear-gradient(145deg, var(--mag) 0%, #7a3cff 48%, var(--cyan) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 28px var(--mag-soft),
    0 0 40px rgba(50, 214, 230, 0.12);
  transition: filter 0.6s ease, transform 0.35s var(--ease), box-shadow 0.35s ease;
}
.avatar-ring.blurred { filter: blur(18px); }
.avatar-ring.react {
  animation: ringReact 0.5s var(--ease);
}
@keyframes ringReact {
  0% { transform: scale(1); }
  40% { transform: scale(1.045); box-shadow: 0 0 36px rgba(255, 45, 85, 0.55), 0 0 28px rgba(50, 214, 230, 0.25); }
  100% { transform: scale(1); }
}
.avatar-ring img, .avatar-ring video {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; object-position: 50% 18%;
  background: #1a1018;
}
.mood-tag {
  margin-top: 14px; max-width: 92%;
  background: rgba(255, 45, 85, 0.16); border: 1px solid rgba(255, 45, 85, 0.55);
  color: #ff7a86; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; text-align: center;
  transition: color 0.3s, border-color 0.3s, background 0.3s, opacity 0.3s;
  box-shadow: 0 0 18px rgba(255, 45, 85, 0.12);
}
.mood-tag.flash {
  animation: moodFlash 0.45s var(--ease);
}
@keyframes moodFlash {
  0% { transform: scale(0.96); opacity: 0.55; }
  100% { transform: scale(1); opacity: 1; }
}

.dialog-panel {
  flex-shrink: 0; z-index: 10;
  background: var(--glass); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border); border-radius: 22px; padding: 16px 16px 14px;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(50, 214, 230, 0.04);
}
.speaker {
  font-size: 12px; color: var(--mag); font-weight: 750;
  text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 6px;
}
.speech-text {
  font-size: 15.5px; line-height: 1.45; margin-bottom: 14px; min-height: 46px;
  color: rgba(255, 255, 255, 0.94);
}
.speech-text.in {
  animation: speechIn 0.35s var(--ease);
}
@keyframes speechIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.options-list { display: flex; flex-direction: column; gap: 8px; }
.opt-btn {
  min-height: 48px; background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14); color: #fff;
  padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600;
  text-align: left; cursor: pointer; touch-action: manipulation;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.2s ease, box-shadow 0.18s ease;
}
.opt-btn:active { transform: scale(0.98); background: rgba(255, 45, 85, 0.35); border-color: rgba(255, 45, 85, 0.55); }
.opt-btn.picked {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.55), rgba(50, 214, 230, 0.22));
  border-color: rgba(255, 45, 85, 0.75);
  box-shadow: 0 0 18px var(--mag-soft);
}
.opt-btn.dim { opacity: 0.35; pointer-events: none; }
.opt-btn.center { text-align: center; }
.opt-btn.primary {
  min-height: 52px; background: linear-gradient(135deg, var(--mag), #c42b8a 55%, #2bb8c9);
  border: none; text-align: center; font-size: 15px;
  box-shadow: 0 8px 22px rgba(255, 45, 85, 0.38);
}
.opt-btn.primary:active { transform: scale(0.97); }
