/* ============================================================
   灵宠寻踪 · 治愈系暖色主题
   palette: 暖粉 #ff7fa6 · 奶白 #fff8ef · 桃黄 #ffe89a · 浅薰 #d9c4f0
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff2e3;
}

:root {
  --rose:        #ff7fa6;
  --rose-deep:   #e0508a;
  --rose-dark:   #b03466;
  --peach:       #ffd6c9;
  --cream:       #fff8ef;
  --cream-deep:  #ffe89a;
  --lav:         #d9c4f0;
  --teal-soft:   #a5dfd0;
  --ink:         #6b3050;
  --ink-soft:    #a8688a;
}

#video {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
#boxes {
  position: fixed; inset: 0;
  z-index: 6; pointer-events: none;
  display: none;
}

#sketch-snap {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
}
#sketch-snap.show { opacity: 1; }

#sketch-paper {
  display: none !important;
}

#fallback-bg {
  position: fixed; inset: 0; z-index: 1; display: none;
  background:
    radial-gradient(ellipse at 25% 28%, rgba(255,230,180,0.7), transparent 45%),
    radial-gradient(ellipse at 75% 65%, rgba(255,200,210,0.65), transparent 50%),
    radial-gradient(circle at 80% 18%, rgba(255,255,200,0.4), transparent 30%),
    linear-gradient(135deg, #ffe5c8 0%, #ffd0c8 30%, #ffc8d4 60%, #e5d0e8 100%);
}

/* 摄像头开启后，给画面加一层暖色 + 弱光晕，让真实场景也变温暖 */
#overlay {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255,220,170,0.35), transparent 45%),
    radial-gradient(ellipse at 80% 75%, rgba(255,190,210,0.3), transparent 50%),
    linear-gradient(180deg, rgba(255,230,200,0.22) 0%, rgba(255,200,220,0.18) 100%);
}

/* 飘动光斑 / 星点 */
#stars { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.star {
  position: absolute; border-radius: 50%;
  background: white;
  box-shadow: 0 0 6px #fff8d0, 0 0 16px #ffe8a8;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}
.particle {
  position: fixed; z-index: 4; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,1), rgba(255,220,200,0.45) 60%, transparent);
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(105vh) translateX(0) scale(0.5); opacity: 0; }
  10%  { opacity: 0.95; }
  90%  { opacity: 0.95; }
  100% { transform: translateY(-10vh) translateX(40px) scale(1); opacity: 0; }
}

/* ====================== 顶部 HUD ====================== */
#hud {
  position: fixed; top: 14px; left: 14px; right: 14px;
  z-index: 10;
  display: none;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }

/* 左：计时徽章 */
.timer-badge {
  background: linear-gradient(180deg, #fffbe8, #ffeebd);
  border: 3px solid #fff;
  border-radius: 18px;
  padding: 7px 14px 8px;
  box-shadow:
    0 4px 0 #ffc88a,
    0 8px 18px rgba(220,140,80,0.25);
  color: #8a4a25;
  display: flex; flex-direction: column; align-items: center;
  min-width: 92px;
  position: relative;
}
.timer-badge .label {
  font-size: 11px; letter-spacing: 2px;
  display: flex; align-items: center; gap: 4px;
  opacity: 0.85;
}
.timer-badge .label::before, .timer-badge .label::after {
  content: '🐾'; font-size: 10px;
}
.timer-badge .clock {
  font-family: "DIN Alternate", "SF Mono", Menaco, monospace;
  font-size: 22px; font-weight: 700;
  letter-spacing: 2px;
  color: #6b3050;
  margin-top: 1px;
}

/* 中：爪印进度条 */
.paw-progress {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  height: 44px;
  padding: 6px 12px;
}
.paw-progress .track {
  position: relative;
  flex: 1; max-width: 280px;
  height: 12px;
  background: linear-gradient(90deg, #ffd9b3, #ffc8d8, #cae6dc, #d8c8ec);
  border: 3px solid #fff;
  border-radius: 12px;
  box-shadow:
    0 3px 0 rgba(180,120,140,0.25),
    inset 0 2px 4px rgba(255,255,255,0.6);
  overflow: visible;
}
.paw-progress .fill {
  position: absolute; inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #ffe17a, #ffc864);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(255,200,80,0.6);
  transition: width 0.6s cubic-bezier(.5,1.6,.6,1);
}
.paw-progress .paw {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  background: #fff;
  border: 3px solid #ffd3a8;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 3px 0 #f6b888;
  transition: all 0.4s;
  z-index: 2;
}
.paw-progress .paw.active {
  background: linear-gradient(180deg, #fff5a8, #ffd24a);
  border-color: #fff;
  box-shadow: 0 3px 0 #d8951c, 0 0 14px rgba(255,200,80,0.7);
  transform: translate(-50%, -50%) scale(1.1);
}
.paw-progress .paw[data-i="0"] { left: 0%; }
.paw-progress .paw[data-i="1"] { left: 33.33%; }
.paw-progress .paw[data-i="2"] { left: 66.66%; }
.paw-progress .paw[data-i="3"] { left: 100%; }

/* 右：圆形按钮 */
.round-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff5c8, #ffd870);
  border: 3px solid #fff;
  box-shadow: 0 4px 0 #d8951c, 0 6px 14px rgba(200,140,40,0.3);
  color: #7a4810;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.round-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #d8951c, 0 3px 8px rgba(200,140,40,0.3);
}
.round-btn .cap {
  position: absolute; bottom: -18px;
  left: 50%; transform: translateX(-50%);
  font-size: 10px;
  color: #6b3050;
  background: rgba(255, 248, 230, 0.85);
  padding: 1px 8px; border-radius: 8px;
  letter-spacing: 2px; white-space: nowrap;
}
.round-btn-group { display: flex; gap: 10px; }

/* 左下提示卡 */
.hint-card {
  position: fixed;
  top: 100px; left: 16px;
  z-index: 11;
  display: none;
  background: linear-gradient(180deg, #fffaee, #fff0d8);
  border: 3px solid #fff;
  border-radius: 18px;
  padding: 10px 14px 12px 42px;
  color: #8a4a25;
  box-shadow:
    0 4px 0 #ffc88a,
    0 8px 18px rgba(220,140,80,0.25);
  max-width: 220px;
  font-size: 12px; line-height: 1.6;
  letter-spacing: 1px;
}
.hint-card::before {
  content: '✦';
  position: absolute;
  left: 10px; top: 10px;
  width: 24px; height: 24px;
  background: linear-gradient(180deg, #fff5a8, #ffc864);
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
  box-shadow: 0 2px 0 #d8951c;
}
.hint-card .ttl {
  font-weight: 700; font-size: 13px;
  color: #d6678c; letter-spacing: 2px;
  display: block; margin-bottom: 3px;
}

/* ====================== 物体 hit-zone + 表情 ====================== */
.hit-zone {
  position: fixed; z-index: 7;
  border: 2px dashed rgba(255, 200, 220, 0.85);
  background: rgba(255, 240, 230, 0.10);
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
  animation: zoneIn 0.6s cubic-bezier(.34,1.56,.64,1);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 24px rgba(255, 200, 220, 0.35) inset,
    0 4px 16px rgba(255,180,200,0.25);
}
.hit-zone:hover {
  background: rgba(255, 240, 230, 0.2);
  border-color: #ff9bbf;
  transform: scale(1.02);
}
.hit-zone:active { transform: scale(0.98); }
.hit-zone .face {
  font-size: 50px;
  filter: drop-shadow(0 4px 10px rgba(255, 150, 180, 0.6));
  animation: faceFloat 3s ease-in-out infinite;
  pointer-events: none;
  transition: transform 0.3s, filter 0.3s;
}
.hit-zone .name-tag {
  position: absolute; bottom: -22px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #fffaee, #ffe0c8);
  border: 2px solid #fff;
  color: #8a4a25; font-size: 11px;
  padding: 2px 10px; border-radius: 10px;
  white-space: nowrap; letter-spacing: 1px;
  box-shadow: 0 2px 0 #f6b888;
  pointer-events: none;
  font-weight: 600;
}
.hit-zone.collected {
  border-color: rgba(150, 140, 150, 0.4);
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}
.hit-zone.collected .face {
  filter: grayscale(70%) brightness(0.85) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  animation: none;
}
@keyframes zoneIn {
  0%   { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes faceFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}

/* ====================== 漫画气泡（暖色版） ====================== */
.speech-bubble {
  position: fixed; z-index: 25;
  background: linear-gradient(180deg, #fffaee, #fff0e0);
  color: #6b3050;
  border: 3px solid #fff;
  border-radius: 22px;
  padding: 14px 18px 14px;
  max-width: min(320px, 80vw);
  min-width: 200px;
  box-shadow:
    0 6px 0 #ffc88a,
    0 14px 32px rgba(220,140,80,0.35);
  cursor: pointer;
  animation: bubblePop 0.4s cubic-bezier(.34,1.56,.64,1);
  isolation: isolate;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  background: linear-gradient(180deg, #fffaee, #fff0e0);
  border: 3px solid #fff;
  transform: rotate(45deg);
  z-index: -1;
  left: calc(var(--tail-x, 30px) - 11px);
}
.speech-bubble.tail-bottom::before { bottom: -13px; }
.speech-bubble.tail-top::before    { top: -13px; }
@keyframes bubblePop {
  0%   { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1); }
}
.speech-bubble.closing { animation: bubbleOut 0.25s ease-in forwards; }
@keyframes bubbleOut { to { opacity: 0; transform: scale(0.7); } }
.bubble-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: #d6678c;
  margin-bottom: 6px;
  letter-spacing: 2px;
  font-weight: 700;
}
.bubble-header .ic { font-size: 18px; }
.bubble-text {
  font-size: 14.5px; line-height: 1.7;
  min-height: 44px;
  letter-spacing: 0.3px;
  color: #6b3050;
}
.bubble-cursor {
  display: inline-block;
  width: 6px; height: 13px;
  background: #d6678c;
  vertical-align: middle;
  margin-left: 3px;
  animation: blink 0.8s steps(2) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.bubble-next {
  margin-top: 8px;
  text-align: right;
  color: #d6678c;
  font-size: 11px;
  opacity: 0.75;
  display: none;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ====================== 扫描遮罩 ====================== */
#scan-overlay {
  position: fixed; inset: 0; z-index: 9;
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
  background: radial-gradient(circle, rgba(255,230,200,0.25), rgba(180,90,120,0.35));
  pointer-events: none;
}
#scan-circle {
  width: 200px; height: 200px; border-radius: 50%;
  border: 3px solid #fff;
  position: relative;
  box-shadow: 0 0 40px rgba(255,200,150,0.7), inset 0 0 30px rgba(255,200,150,0.4);
  animation: scanPulse 2s ease-in-out infinite;
}
#scan-circle::before, #scan-circle::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid #ffd29a;
  animation: scanExpand 2s ease-out infinite;
}
#scan-circle::after { animation-delay: 1s; }
@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(255,200,150,0.5), inset 0 0 20px rgba(255,200,150,0.3); }
  50%      { box-shadow: 0 0 70px rgba(255,210,170,0.95), inset 0 0 40px rgba(255,220,180,0.55); }
}
@keyframes scanExpand {
  0%   { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}
#scan-text {
  margin-top: 32px;
  color: #fff;
  font-size: 15px;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(180,90,120,0.9), 0 0 14px rgba(255,200,180,0.6);
  animation: textPulse 1.5s ease-in-out infinite;
  text-align: center;
  max-width: 86%;
  line-height: 1.7;
  font-weight: 600;
}
@keyframes textPulse {
  0%, 100% { opacity: 0.75; } 50% { opacity: 1; }
}

/* ====================== 开始界面 ====================== */
#start-screen {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(ellipse at 28% 30%, rgba(255,235,190,0.85), transparent 45%),
    radial-gradient(ellipse at 75% 65%, rgba(255,195,210,0.7), transparent 55%),
    radial-gradient(circle at 82% 18%, rgba(255,255,210,0.5), transparent 30%),
    radial-gradient(circle at 18% 80%, rgba(220,200,240,0.5), transparent 35%),
    linear-gradient(135deg, #ffeacd 0%, #ffd6c4 25%, #ffc8d3 60%, #e8d2ee 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px;
  text-align: center;
  overflow: hidden;
}
/* 房间感装饰：模拟柔光、书架、植物等的色块（不依赖图片） */
#start-screen::before, #start-screen::after {
  content: ''; position: absolute;
  pointer-events: none;
}
#start-screen::before {
  /* 左下角植物色块 */
  width: 280px; height: 280px;
  bottom: -60px; left: -50px;
  background: radial-gradient(circle, rgba(180,210,160,0.55), transparent 65%);
  filter: blur(20px);
}
#start-screen::after {
  /* 右下角暖光 */
  width: 320px; height: 320px;
  bottom: -50px; right: -60px;
  background: radial-gradient(circle, rgba(255,200,140,0.6), transparent 65%);
  filter: blur(20px);
}

/* 顶部 HUD 在开始界面里也展示一下（计时不走，仅作样式预览） */
.start-top-hud {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  z-index: 2;
}
.start-top-hud .timer-badge .clock { color: #8a4a25; }

.start-hint-card {
  align-self: flex-start;
  margin-top: 10px;
  position: relative;
  background: linear-gradient(180deg, #fffaee, #fff0d8);
  border: 3px solid #fff;
  border-radius: 18px;
  padding: 10px 14px 12px 42px;
  color: #8a4a25;
  box-shadow: 0 4px 0 #ffc88a, 0 8px 18px rgba(220,140,80,0.25);
  max-width: 220px;
  font-size: 12px; line-height: 1.6;
  letter-spacing: 1px;
  text-align: left;
  z-index: 2;
}
.start-hint-card::before {
  content: '★';
  position: absolute;
  left: 10px; top: 10px;
  width: 24px; height: 24px;
  background: linear-gradient(180deg, #fff5a8, #ffc864);
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff;
  box-shadow: 0 2px 0 #d8951c;
}
.start-hint-card .ttl {
  font-weight: 700; font-size: 13px;
  color: #d6678c; letter-spacing: 2px;
  display: block; margin-bottom: 3px;
}

/* 主视觉区：标题 + 灵宠角色 + 按钮 */
.start-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 2;
  margin-top: 6px;
}
.start-stage {
  display: flex;
  align-items: center;
  gap: clamp(20px, 6vw, 60px);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  padding: 0 16px;
}
.start-textcol {
  display: flex; flex-direction: column;
  align-items: center;
  flex: 1 1 280px;
}

/* 肉嘟嘟描边标题 */
#start-title {
  font-size: clamp(54px, 14vw, 92px);
  font-weight: 900;
  letter-spacing: 8px;
  padding-left: 8px;
  white-space: nowrap;
  color: #ff4b85;
  -webkit-text-stroke: 5px #fff;
  text-shadow:
    0 6px 0 #ffb1c5,
    0 8px 0 #ffa1b8,
    0 12px 20px rgba(220,80,130,0.35),
    0 0 30px rgba(255,200,230,0.9);
  margin-bottom: 6px;
  line-height: 1;
  animation: titlePop 0.8s cubic-bezier(.34,1.56,.64,1);
}
@keyframes titlePop {
  0% { opacity: 0; transform: translateY(20px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.title-paws {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  font-size: 22px;
  color: #ff8eb0;
  margin-top: -4px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(220,80,130,0.4));
}
.title-paws .line {
  flex: 1; max-width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ff8eb0, transparent);
  border-radius: 2px;
}
#start-sub {
  color: #b03a68;
  font-weight: 700;
  font-size: 14px; letter-spacing: 6px;
  margin-bottom: 28px;
  padding-left: 6px;
  background: rgba(255,255,255,0.55);
  padding: 6px 18px;
  border-radius: 20px;
  border: 2px dashed #ffb6cf;
}

/* 大开始按钮 */
#start-btn {
  background: linear-gradient(180deg, #ff9bbf 0%, #e84d8c 100%);
  color: #fff;
  padding: 16px 36px;
  border: 4px solid #fff;
  border-radius: 36px;
  font-size: 17px;
  letter-spacing: 6px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 6px 0 #b03466,
    0 14px 30px rgba(220,80,130,0.4),
    inset 0 -3px 0 rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 10px;
  padding-left: 42px;
}
#start-btn::before, #start-btn::after { content: '🐾'; font-size: 16px; }
#start-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b03466, 0 6px 14px rgba(220,80,130,0.35);
}

/* 灵宠角色站位（占位 — 等待官方素材） */
.start-pet-stage {
  flex: 0 1 240px;
  display: flex; flex-direction: column;
  align-items: center;
  position: relative;
}
.pet-art {
  font-size: 130px;
  filter: drop-shadow(0 14px 24px rgba(220,80,130,0.35));
  animation: petFloat 3.5s ease-in-out infinite;
  line-height: 1;
}
@keyframes petFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(3deg); }
}
.pet-label {
  margin-top: 12px;
  background: linear-gradient(180deg, #fffaee, #ffe6c8);
  border: 3px solid #fff;
  border-radius: 16px;
  padding: 5px 14px;
  color: #8a4a25;
  font-size: 12px; letter-spacing: 2px;
  font-weight: 700;
  box-shadow: 0 3px 0 #ffc88a;
}

/* 角色侧栏（灵瑞图鉴占位） */
.pet-card {
  position: absolute;
  right: -76px; top: 12px;
  width: 60px;
  background: linear-gradient(180deg, #fffaee, #ffe0c8);
  border: 3px solid #fff;
  border-radius: 14px;
  padding: 8px 4px 6px;
  text-align: center;
  box-shadow: 0 4px 0 #ffc88a;
}
.pet-card .ttl {
  font-size: 10px; color: #d6678c; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 4px;
}
.pet-card .row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px;
  color: #8a4a25;
  margin-bottom: 2px;
  padding: 0 2px;
}
.pet-card .row .dots {
  display: flex; gap: 1px;
}
.pet-card .row .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: #ffc88a;
}
.pet-card .row .dot.on { background: #ff7fa6; box-shadow: 0 0 3px #ff7fa6; }
@media (max-width: 640px) { .pet-card { display: none; } }

/* 底部摄像头权限提示 */
#start-hint {
  margin-top: 24px;
  color: rgba(107, 48, 80, 0.78);
  font-size: 12px;
  letter-spacing: 1.5px;
  max-width: 320px;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.4);
  padding: 8px 18px;
  border-radius: 14px;
  border: 1.5px dashed rgba(255, 150, 180, 0.5);
  position: relative;
  z-index: 2;
}

/* ====================== 最终灵宠 + 结局 ====================== */
#pet-final {
  position: fixed; left: 50%; top: 50%;
  font-size: 130px;
  z-index: 15;
  filter:
    drop-shadow(0 0 30px rgba(255,230,180,1))
    drop-shadow(0 14px 24px rgba(220,80,130,0.35));
  display: none;
  transform: translate(-50%, -50%);
  animation: petAppear 1s ease-out, petFloatFinal 3s ease-in-out 1s infinite;
}
@keyframes petAppear {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes petFloatFinal {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, calc(-50% - 14px)); }
}

#ending {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,230,200,0.6), transparent 60%),
    linear-gradient(135deg, rgba(255,210,200,0.92), rgba(220,180,220,0.92));
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
  animation: dialogIn 1.5s ease-out;
}
@keyframes dialogIn {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}
#ending-pet {
  font-size: 102px; margin-bottom: 22px;
  filter: drop-shadow(0 14px 24px rgba(220,80,130,0.4));
  animation: petFloat 3s ease-in-out infinite;
}
#ending-text {
  color: #b03466;
  font-weight: 700;
  font-size: 18px; line-height: 2;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(255,255,255,0.7);
  margin-bottom: 36px;
}
#ending-btn {
  background: linear-gradient(180deg, #ff9bbf 0%, #e84d8c 100%);
  color: #fff;
  padding: 13px 36px;
  border: 4px solid #fff;
  border-radius: 30px;
  font-size: 14px; letter-spacing: 4px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 #b03466, 0 10px 22px rgba(220,80,130,0.35);
}
#ending-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b03466; }

/* ====================== 浮动 / Toast ====================== */
#rescan-btn {
  position: fixed; bottom: 24px; right: 18px;
  z-index: 12; display: none;
  background: linear-gradient(180deg, #fff5c8, #ffd870);
  color: #7a4810;
  border: 3px solid #fff;
  padding: 9px 18px;
  border-radius: 24px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 4px 0 #d8951c, 0 8px 18px rgba(200,140,40,0.3);
}
#rescan-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d8951c; }

/* 我要猜按钮 */
#guess-btn {
  position: fixed; bottom: clamp(50px, 8vh, 88px); left: 50%;
  transform: translateX(-50%);
  z-index: 12; display: none;
  background: linear-gradient(180deg, #ffd0e3, #ff7fa6);
  color: #fff;
  border: 4px solid #fff;
  padding: 14px 34px 15px;
  border-radius: 32px;
  font-size: 17px; font-weight: 800;
  letter-spacing: 3px; cursor: pointer;
  box-shadow: 0 6px 0 #c54480, 0 14px 26px rgba(200,80,140,0.32);
  animation: guessPulse 2.4s ease-in-out infinite;
}
#guess-btn:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 1px 0 #c54480; }
@keyframes guessPulse {
  0%,100% { transform: translateX(-50%) scale(1); }
  50%     { transform: translateX(-50%) scale(1.06); }
}

/* 猜测弹窗 */
#guess-modal {
  position: fixed; inset: 0;
  z-index: 9998;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(80, 40, 90, 0.55), rgba(20, 10, 30, 0.85));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 18px;
}
#guess-modal.show { display: flex; opacity: 1; }
.guess-card {
  position: relative;
  width: min(92vw, 480px);
  background: linear-gradient(180deg, #fff7ef, #ffe6f0);
  border: 3px solid #fff;
  border-radius: 24px;
  padding: 28px 24px 22px;
  box-shadow: 0 20px 60px rgba(180, 110, 180, 0.5),
              0 0 80px rgba(255, 220, 240, 0.3);
  animation: chairPop 0.45s cubic-bezier(0.2, 1.2, 0.4, 1.05);
  color: #6b3050;
  font-family: "Noto Sans SC", sans-serif;
}
.guess-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #b03466;
  letter-spacing: 4px;
  text-align: center;
}
.guess-sub {
  font-size: 12px;
  color: #a8688a;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
}
.guess-clues {
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed #ffb6cf;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  max-height: 30vh;
  overflow-y: auto;
}
.guess-clues .clue {
  padding: 4px 0;
  color: #6b3050;
  border-bottom: 1px dashed rgba(255, 182, 207, 0.5);
}
.guess-clues .clue:last-child { border-bottom: none; }
.guess-clues .clue .ic { margin-right: 6px; }
.guess-clues .empty {
  color: #b88; font-style: italic; text-align: center;
}
.guess-input-row {
  display: flex; gap: 8px;
  margin-bottom: 10px;
}
#guess-input {
  flex: 1;
  border: 2px solid #ffb6cf;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #6b3050;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease;
}
#guess-input:focus { border-color: #ff7fa6; }
#guess-submit {
  border: none;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(135deg, #ff9ec2, #ff7fa6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 127, 166, 0.5);
  transition: transform 0.15s ease;
}
#guess-submit:active { transform: translateY(1px); }
.guess-feedback {
  min-height: 22px;
  font-size: 13px;
  text-align: center;
  color: #b03466;
  font-weight: 600;
  letter-spacing: 1px;
}
.guess-feedback.wrong { color: #b35a47; }
.guess-feedback.right { color: #2d8c5f; }
.guess-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #b03466;
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 自拍上传弹窗 */
#selfie-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(80, 40, 90, 0.55), rgba(20, 10, 30, 0.86));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 18px;
}
#selfie-modal.show { display: flex; opacity: 1; }
.selfie-card {
  position: relative;
  width: min(92vw, 420px);
  background: linear-gradient(180deg, #fff7ef, #ffe6f0);
  border: 3px solid #fff;
  border-radius: 24px;
  padding: 28px 22px 20px;
  box-shadow: 0 20px 60px rgba(180, 110, 180, 0.5),
              0 0 80px rgba(255, 220, 240, 0.3);
  animation: chairPop 0.45s cubic-bezier(0.2, 1.2, 0.4, 1.05);
  color: #6b3050;
  font-family: "Noto Sans SC", sans-serif;
  text-align: center;
}
.selfie-card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  color: #b03466;
  letter-spacing: 2px;
}
.selfie-sub {
  font-size: 12px;
  color: #a8688a;
  margin-bottom: 16px;
  line-height: 1.6;
}
.selfie-drop {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 240px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed #ffb6cf;
  border-radius: 20px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease, transform 0.18s ease;
}
.selfie-drop:hover { border-color: #ff7fa6; transform: scale(1.02); }
.selfie-prompt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: #b03466;
}
.selfie-ic { font-size: 42px; }
.selfie-tip { font-size: 13px; letter-spacing: 2px; font-weight: 600; }
.selfie-preview {
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  image-rendering: auto;
}
.selfie-preview.show { display: block; }
.selfie-drop.has-image {
  background: #000;
}
.selfie-drop.has-image .selfie-prompt { display: none; }
#selfie-done {
  width: 80%;
  margin: 4px auto 0;
  padding: 12px 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9ec2, #ff7fa6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 127, 166, 0.5);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
#selfie-done:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
#selfie-done:not(:disabled):active { transform: translateY(2px); }
.selfie-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #b03466;
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 拍立得 */
#polaroid-overlay {
  position: fixed; inset: 0;
  z-index: 10001;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
  background: radial-gradient(ellipse at center,
              rgba(255, 220, 200, 0.35),
              rgba(80, 40, 90, 0.78) 60%,
              rgba(20, 10, 30, 0.95));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.45s ease;
  padding: 20px;
}
#polaroid-overlay.show { display: flex; opacity: 1; }

.polaroid {
  position: relative;
  background: #fffaf3;
  width: min(88vw, 360px);
  padding: 14px 14px 0;
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5),
              0 8px 16px rgba(0, 0, 0, 0.3),
              inset 0 0 0 1px rgba(255, 200, 220, 0.4);
  animation: polaroidDrop 0.8s cubic-bezier(0.2, 1.2, 0.4, 1.05);
}
@keyframes polaroidDrop {
  0%   { transform: translateY(-60px) rotate(-8deg) scale(0.9); opacity: 0; }
  100% { transform: translateY(0)     rotate(0)     scale(1);   opacity: 1; }
}

.polaroid-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(160deg, #d6c3ee 0%, #ffd5e6 55%, #ffe9d6 100%);
  isolation: isolate;
}

/* 星空 + 粉色光晕背景 */
.polaroid-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
}
.bg-burst {
  position: absolute;
  right: 8%; top: 18%;
  width: 60%; height: 65%;
  background: radial-gradient(circle at center,
              rgba(255, 200, 220, 0.85) 0%,
              rgba(255, 180, 210, 0.6) 22%,
              rgba(220, 170, 230, 0.4) 45%,
              transparent 65%);
  filter: blur(2px);
  border-radius: 50%;
  z-index: 1;
}
.bg-stars {
  position: absolute; inset: 0;
  z-index: 2;
  color: #fff8dc;
  text-shadow: 0 0 6px rgba(255, 240, 200, 0.9);
}
.bg-stars span {
  position: absolute;
  font-size: 11px;
  animation: sparkleTwinkle 1.8s ease-in-out infinite;
  opacity: 0.85;
}
.bg-stars span:nth-child(1) { top: 8%;  left: 12%; font-size: 14px; animation-delay: 0s; }
.bg-stars span:nth-child(2) { top: 18%; right: 8%; font-size: 10px; animation-delay: 0.3s; }
.bg-stars span:nth-child(3) { top: 28%; left: 28%; animation-delay: 0.6s; }
.bg-stars span:nth-child(4) { top: 12%; left: 60%; font-size: 13px; animation-delay: 0.9s; }
.bg-stars span:nth-child(5) { top: 40%; right: 20%; font-size: 12px; animation-delay: 0.2s; }
.bg-stars span:nth-child(6) { top: 55%; left: 8%; animation-delay: 0.7s; }
.bg-stars span:nth-child(7) { top: 22%; left: 40%; font-size: 9px; animation-delay: 1.1s; }
.bg-stars span:nth-child(8) { top: 6%;  right: 28%; animation-delay: 0.4s; }
@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.2); }
}

/* 用户自拍：偏右 */
.polaroid-photo {
  position: absolute;
  right: 0; top: 0;
  width: 62%; height: 100%;
  object-fit: cover;
  display: block;
  z-index: 3;
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  mask-image: linear-gradient(to left, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 70%, transparent 100%);
}
/* 小灵宠贴纸：左半边大尺寸主角 */
.polaroid-sticker {
  position: absolute;
  left: -4%; bottom: 0;
  width: 60%;
  height: auto;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
  animation: stickerPop 0.6s 0.35s both cubic-bezier(0.2, 1.2, 0.4, 1.05);
  transform-origin: bottom left;
}
@keyframes stickerPop {
  0%   { transform: scale(0.5) rotate(-12deg); opacity: 0; }
  100% { transform: scale(1)   rotate(0);      opacity: 1; }
}

/* 底部 caption 区 */
.polaroid-caption {
  position: relative;
  margin: 8px -14px 0;
  padding: 0;
  background: linear-gradient(180deg, #ffd0e1 0%, #ffc6db 100%);
  border-radius: 0 0 18px 18px;
  font-family: "Noto Sans SC", sans-serif;
  color: #b03466;
  overflow: hidden;
}
/* 上下花边（半圆点连排）*/
.cap-lace {
  height: 10px;
  background:
    radial-gradient(circle at 7px 50%, #fffaf3 6px, transparent 6.5px) 0 0 / 14px 100% repeat-x;
}
.cap-lace.top {
  margin-top: 0;
}
.cap-lace.bottom {
  margin-bottom: 0;
}
.cap-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px 2px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}
.cap-heart { font-size: 14px; }
.cap-star  { font-size: 13px; color: #ffae5e; }
.cap-line1 { color: #b03466; }
.cap-date {
  text-align: center;
  padding: 0 0 6px;
  font-size: 10px;
  color: #d77ba0;
  letter-spacing: 2px;
}

.polaroid-actions {
  display: flex;
  gap: 14px;
  animation: fadeUp 0.5s 0.6s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
#polaroid-again {
  background: linear-gradient(135deg, #ff9ec2, #ff7fa6);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  font-family: "Noto Sans SC", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 127, 166, 0.55);
  transition: transform 0.15s ease;
}
#polaroid-again:active { transform: translateY(2px); }

/* 小灵宠现身全屏视频 */
#pet-reveal {
  position: fixed; inset: 0;
  z-index: 10000;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center,
              rgba(255, 220, 200, 0.35),
              rgba(80, 40, 90, 0.78) 60%,
              rgba(20, 10, 30, 0.92));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
#pet-reveal.show { display: flex; opacity: 1; pointer-events: auto; }
#pet-reveal-video {
  max-width: min(80vw, 720px);
  max-height: 76vh;
  width: auto; height: auto;
  filter: drop-shadow(0 0 30px rgba(255, 220, 180, 0.8))
          drop-shadow(0 0 80px rgba(255, 200, 230, 0.6));
  animation: petRevealIn 0.7s cubic-bezier(0.2, 1.2, 0.4, 1.05);
}
@keyframes petRevealIn {
  0%   { transform: scale(0.7) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0);      opacity: 1; }
}
.pet-reveal-msg {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(20px, 3.6vw, 36px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 6px;
  text-shadow: 0 4px 18px rgba(255, 127, 166, 0.95),
               0 0 30px rgba(255, 240, 200, 0.8);
  animation: chairFooterPulse 1.6s ease-in-out infinite;
}

#status-bar {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 13; display: none;
  background: linear-gradient(180deg, #fffaee, #ffe6c8);
  border: 3px solid #fff;
  color: #8a4a25;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 4px 0 #ffc88a, 0 8px 18px rgba(220,140,80,0.3);
  max-width: 90%; text-align: center;
}

/* ====================== 帮助弹窗 ====================== */
#help-modal {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(180,90,120,0.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 30px;
}
#help-modal.show { display: flex; }
#help-modal .card {
  background: linear-gradient(180deg, #fffaee, #ffe8d4);
  border: 4px solid #fff;
  border-radius: 22px;
  padding: 22px 22px 20px;
  max-width: 360px;
  width: 100%;
  color: #6b3050;
  box-shadow: 0 8px 0 #ffc88a, 0 16px 36px rgba(220,140,80,0.35);
  text-align: left;
}
#help-modal .card h3 {
  font-size: 18px; color: #d6678c;
  letter-spacing: 4px; margin-bottom: 10px;
  text-align: center;
}
#help-modal .card ul {
  list-style: none; padding: 0;
  font-size: 13px; line-height: 1.9;
  color: #8a4a25;
}
#help-modal .card ul li::before {
  content: '🐾 ';
}
#help-modal .card .close {
  display: block; margin: 16px auto 0;
  background: linear-gradient(180deg, #ff9bbf, #e84d8c);
  color: #fff; border: 3px solid #fff;
  padding: 8px 24px; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 3px;
  box-shadow: 0 4px 0 #b03466;
  cursor: pointer;
}
#help-modal .card .close:active { transform: translateY(2px); box-shadow: 0 2px 0 #b03466; }

/* ============================================================
   2026-06 polish · 参考童话房间游戏首屏
   ============================================================ */
:root {
  --candy-pink: #f56fa2;
  --candy-rose: #d94c8c;
  --candy-plum: #8e4a78;
  --sun-gold: #ffc75d;
  --soft-card: rgba(255, 244, 226, 0.9);
  --card-edge: rgba(255, 255, 255, 0.92);
}

#fallback-bg {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 229, 184, 0.5), transparent 42%),
    linear-gradient(180deg, rgba(255, 206, 176, 0.38), rgba(238, 173, 198, 0.28)),
    url('/assets/start-room-bg.png') center / cover no-repeat;
}

#overlay {
  background:
    radial-gradient(circle at 42% 36%, rgba(255, 239, 190, 0.36), transparent 36%),
    radial-gradient(circle at 78% 72%, rgba(255, 181, 207, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(255, 219, 184, 0.24), rgba(162, 92, 120, 0.12));
  backdrop-filter: saturate(1.18);
}

#hud {
  top: clamp(12px, 2.4vw, 30px);
  left: clamp(12px, 2.8vw, 34px);
  right: clamp(12px, 2.8vw, 34px);
  align-items: flex-start;
}

.timer-badge {
  min-width: clamp(122px, 15vw, 188px);
  min-height: 72px;
  border-radius: 34px;
  padding: 12px 22px 13px;
  background:
    linear-gradient(180deg, rgba(255, 253, 237, 0.98), rgba(255, 229, 195, 0.94));
  border: 4px solid var(--card-edge);
  box-shadow:
    0 5px 0 #efb879,
    0 0 0 2px rgba(232, 141, 174, 0.34),
    0 16px 30px rgba(160, 90, 60, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
}

.timer-badge .label {
  color: var(--candy-plum);
  font-size: clamp(12px, 1.4vw, 18px);
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 #fff;
}

.timer-badge .clock {
  color: var(--candy-plum);
  font-size: clamp(24px, 2.8vw, 38px);
  text-shadow: 0 2px 0 #fff1c8;
}

.paw-progress {
  height: 72px;
  padding-top: 24px;
}

.paw-progress .track {
  max-width: clamp(260px, 38vw, 560px);
  height: 18px;
  border-radius: 18px;
  background: linear-gradient(90deg, #ffb0bf, #ffd173 38%, #c7efe5 67%, #b8d6ff);
  border-width: 4px;
  box-shadow:
    0 4px 0 rgba(158, 96, 112, 0.24),
    0 12px 24px rgba(255, 180, 132, 0.22),
    inset 0 3px 5px rgba(255, 255, 255, 0.65);
}

.paw-progress .fill {
  background: linear-gradient(90deg, #ff7d95, #ffe173 60%, #fff4b6);
  box-shadow: 0 0 18px rgba(255, 218, 105, 0.76);
}

.paw-progress .paw {
  width: clamp(42px, 4.4vw, 58px);
  height: clamp(42px, 4.4vw, 58px);
  border-width: 4px;
  font-size: clamp(20px, 2.4vw, 28px);
  box-shadow:
    0 5px 0 rgba(184, 113, 81, 0.46),
    0 12px 22px rgba(137, 85, 95, 0.2);
}

.paw-progress .paw[data-i="0"] { background: linear-gradient(180deg, #ff7d95, #f35c82); }
.paw-progress .paw[data-i="1"] { background: linear-gradient(180deg, #ffc85e, #ffae32); }
.paw-progress .paw[data-i="2"] { background: linear-gradient(180deg, #b992d7, #9a73c6); }
.paw-progress .paw[data-i="3"] { background: linear-gradient(180deg, #9ed0ff, #6da9e9); }

.round-btn {
  width: clamp(52px, 5.4vw, 74px);
  height: clamp(52px, 5.4vw, 74px);
  background: linear-gradient(180deg, #fff4c8, #ffc956 70%, #f4aa3b);
  border-width: 4px;
  color: #8a5a25;
  font-size: clamp(26px, 3vw, 38px);
  text-shadow: 0 2px 0 #fff4c9;
  box-shadow:
    0 6px 0 #b8792a,
    0 0 0 2px rgba(255, 198, 116, 0.4),
    0 14px 26px rgba(126, 76, 28, 0.24),
    inset 0 4px 0 rgba(255, 255, 255, 0.78);
}

.round-btn .cap {
  bottom: -25px;
  color: #fff7e8;
  background: transparent;
  font-size: clamp(12px, 1.35vw, 17px);
  font-weight: 900;
  text-shadow:
    0 2px 0 #7e4f2e,
    0 -1px 0 #7e4f2e,
    1px 0 0 #7e4f2e,
    -1px 0 0 #7e4f2e;
}

.round-btn-group {
  gap: clamp(12px, 2vw, 22px);
}

.hint-card,
.start-hint-card {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(255, 238, 210, 0.92));
  border: 4px solid var(--card-edge);
  box-shadow:
    0 5px 0 #efb879,
    0 0 0 2px rgba(218, 130, 168, 0.28),
    0 16px 30px rgba(120, 72, 58, 0.22);
  color: #704452;
  font-weight: 700;
}

.hint-card {
  top: clamp(150px, 30vh, 330px);
  left: clamp(18px, 4vw, 78px);
  max-width: 286px;
  min-height: 72px;
  padding: 15px 22px 16px 82px;
  font-size: clamp(13px, 1.35vw, 17px);
}

.hint-card::before,
.start-hint-card::before {
  content: '🔍';
  left: -24px;
  top: 50%;
  width: 72px;
  height: 72px;
  transform: translateY(-50%) rotate(-10deg);
  background: linear-gradient(180deg, #aee9ff, #79bff2);
  border: 5px solid #fff;
  color: #ffe46d;
  font-size: 36px;
  box-shadow:
    0 5px 0 #5d9fce,
    0 14px 22px rgba(78, 129, 166, 0.26),
    inset 0 3px 0 rgba(255, 255, 255, 0.72);
}

.hint-card .ttl,
.start-hint-card .ttl {
  color: #c75a92;
  font-size: clamp(14px, 1.5vw, 20px);
  text-shadow: 0 2px 0 #fff;
}

#pet-status {
  position: fixed;
  right: clamp(14px, 3.2vw, 54px);
  top: 50%;
  transform: translateY(-42%);
  z-index: 11;
  display: none;
}

.pet-status-panel {
  width: clamp(132px, 12vw, 166px);
  min-height: 250px;
  padding: 13px 12px 16px;
  border-radius: 26px;
  border: 4px solid var(--card-edge);
  background: linear-gradient(180deg, rgba(255, 244, 224, 0.96), rgba(255, 230, 197, 0.92));
  box-shadow:
    0 6px 0 #efb879,
    0 0 0 2px rgba(218, 130, 168, 0.24),
    0 18px 32px rgba(102, 62, 44, 0.24),
    inset 0 3px 0 rgba(255, 255, 255, 0.8);
  color: #704452;
  text-align: center;
}

.status-title {
  display: inline-block;
  margin: -30px auto 10px;
  padding: 4px 14px 5px;
  border: 3px solid #fff;
  border-radius: 16px;
  background: linear-gradient(180deg, #ff9cc4, #df5f9a);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 #9d416f;
  box-shadow: 0 4px 0 #b64f7f;
}

.status-face {
  width: 74px;
  height: 74px;
  margin: 8px auto 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 36%, #dff6ff, #a8d7f4 68%, #76afd6);
  border: 4px solid #fff;
  font-size: 38px;
  box-shadow:
    0 5px 0 #6da0c6,
    0 10px 18px rgba(64, 112, 146, 0.2),
    inset 0 3px 0 rgba(255, 255, 255, 0.7);
}

.status-mood {
  margin-bottom: 13px;
  color: #745064;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 2px;
}

.status-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
}

.status-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 2px solid #e7bea8;
  background: rgba(255, 250, 239, 0.82);
  box-shadow: inset 0 2px 3px rgba(117, 71, 61, 0.14);
}

.status-meter i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(.5, 1.6, .6, 1);
}

.status-meter.heart i { background: linear-gradient(90deg, #ff8aa7, #ffd4de); }
.status-meter.hunger i { background: linear-gradient(90deg, #ffc756, #ffe27e); }
.status-meter.energy i { background: linear-gradient(90deg, #58d79b, #9af0c1); }

#start-screen {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 221, 167, 0.3), transparent 40%),
    linear-gradient(180deg, rgba(255, 220, 188, 0.1), rgba(177, 90, 128, 0.18)),
    url('/assets/start-room-bg.png') center / cover no-repeat;
  padding: clamp(18px, 2vw, 30px);
}

#start-screen::before {
  inset: 0;
  width: auto;
  height: auto;
  left: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 247, 220, 0.34), transparent 28%),
    radial-gradient(circle at 86% 74%, rgba(255, 153, 191, 0.15), transparent 28%),
    linear-gradient(90deg, rgba(94, 45, 72, 0.14), transparent 24%, transparent 75%, rgba(94, 45, 72, 0.16));
  filter: none;
  z-index: 0;
}

#start-screen::after {
  inset: 0;
  width: auto;
  height: auto;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 50% 103%, rgba(255, 239, 199, 0.54), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(92, 44, 70, 0.16));
  filter: none;
  z-index: 0;
}

.start-glow {
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(650px, 70vw);
  height: min(360px, 46vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 198, 0.72), rgba(255, 196, 177, 0.34) 46%, transparent 70%);
  filter: blur(6px);
  pointer-events: none;
  z-index: 1;
}

.start-top-hud,
.start-hint-card,
.start-main {
  position: relative;
  z-index: 2;
}

.start-top-hud {
  align-items: flex-start;
  padding: 4px 10px 0;
}

.start-top-hud .paw-progress {
  max-width: 600px;
}

.start-hint-card {
  position: absolute;
  left: clamp(42px, 6.4vw, 100px);
  top: clamp(220px, 42vh, 380px);
  max-width: 296px;
  padding: 16px 22px 17px 86px;
  font-size: clamp(13px, 1.35vw, 17px);
}

.start-main {
  align-items: center;
  margin-top: 0;
}

.start-stage {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1280px;
  gap: clamp(40px, 6vw, 120px);
  padding: 0 clamp(16px, 3vw, 34px);
  overflow: visible;
}

.start-textcol {
  flex: 0 1 auto;
  min-width: 0;
  transform: translateX(clamp(160px, 22vw, 420px));
}

.start-pet-stage {
  flex: 0 0 auto;
  min-width: clamp(360px, 40vw, 600px);
  min-height: clamp(400px, 44vw, 680px);
  transform: translateX(clamp(20px, 4vw, 80px));
}

#start-title {
  position: relative;
  font-size: clamp(70px, 9.5vw, 128px);
  letter-spacing: 8px;
  padding: 0 0 6px 8px;
  color: #ff8db7;
  -webkit-text-fill-color: #ff8db7;
  -webkit-text-stroke: 2px #fff8f2;
  paint-order: stroke fill;
  white-space: nowrap;
  text-shadow:
    0 12px 24px rgba(125, 63, 94, 0.36),
    0 0 34px rgba(255, 238, 188, 0.9);
}

#start-title::before,
#start-title::after {
  content: '✦';
  position: absolute;
  color: #ffe37a;
  -webkit-text-fill-color: #ffe37a;
  -webkit-text-stroke: 3px #fff;
  font-size: clamp(22px, 3vw, 38px);
  text-shadow: 0 4px 8px rgba(153, 91, 33, 0.24);
}

#start-title::before {
  left: -28px;
  bottom: 10px;
  transform: rotate(-12deg);
}

#start-title::after {
  right: -30px;
  top: 12px;
  transform: rotate(16deg);
}

.title-paws {
  gap: 15px;
  margin-top: -8px;
  margin-bottom: 10px;
  font-size: clamp(18px, 2.2vw, 28px);
}

.title-paws .line {
  width: clamp(52px, 7vw, 95px);
  height: 4px;
  background: linear-gradient(90deg, transparent, #ffe28a 30%, #ff8eb0 70%, transparent);
}

#start-sub {
  margin-bottom: clamp(22px, 3vw, 34px);
  padding: 8px 22px 10px;
  border-radius: 18px;
  border: 3px solid #fff;
  color: #fff9ef;
  background: linear-gradient(90deg, rgba(143, 164, 211, 0.86), rgba(215, 112, 169, 0.88));
  box-shadow:
    0 4px 0 rgba(130, 87, 134, 0.55),
    0 12px 20px rgba(137, 82, 114, 0.2);
  text-shadow: 0 2px 0 rgba(105, 61, 103, 0.5);
}

.start-btn-row {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

#start-btn {
  min-width: 13em;
  justify-content: center;
  padding: 12px 22px 13px;
  border-radius: 32px;
  border-width: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 32%),
    linear-gradient(90deg, #ed6fa8, #dc5aa0 54%, #bd77d1);
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: 3px;
  white-space: nowrap;
  text-shadow: 0 2px 0 #94466f;
  box-shadow:
    0 5px 0 #9c4979,
    0 0 0 2px rgba(255, 177, 204, 0.44),
    0 12px 22px rgba(154, 72, 114, 0.32),
    inset 0 3px 0 rgba(255, 255, 255, 0.6);
}

#emotion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13em;
  padding: 12px 22px 13px;
  border-radius: 32px;
  border: 4px solid #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 32%),
    linear-gradient(90deg, #ffb066, #ff8aa8);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: 3px;
  white-space: nowrap;
  cursor: pointer;
  text-shadow: 0 2px 0 #a85a3a;
  box-shadow:
    0 5px 0 #b76244,
    0 0 0 2px rgba(255, 210, 180, 0.45),
    0 12px 22px rgba(180, 100, 70, 0.32),
    inset 0 3px 0 rgba(255, 255, 255, 0.6);
}
#emotion-btn:hover { filter: brightness(1.05) saturate(1.05); transform: translateY(-1px); }
#emotion-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b76244, 0 6px 14px rgba(180,100,70,0.3); }

#start-btn:hover {
  filter: brightness(1.05) saturate(1.05);
  transform: translateY(-1px);
}

#start-hint {
  margin-top: 28px;
  border: 0;
  background: transparent;
  color: #8f4f7a;
  font-size: clamp(13px, 1.3vw, 17px);
  font-weight: 900;
  line-height: 1.72;
  text-shadow: 0 2px 0 rgba(255, 247, 231, 0.9);
}

#start-hint::before,
#start-hint::after {
  content: '✧';
  color: #fff1a1;
  display: inline-block;
  margin: 0 12px;
  text-shadow: 0 2px 0 #c97877;
}

.start-pet-stage {
  align-self: center;
  margin-bottom: 0;
  justify-self: end;
}

.start-pet-stage::before {
  content: none;
}

.pet-art {
  position: relative;
  z-index: 1;
  font-size: clamp(130px, 15vw, 210px);
  text-shadow:
    0 5px 0 #fff6ee,
    0 15px 26px rgba(117, 65, 82, 0.26);
}

.pet-art.pet-mascot {
  width: clamp(360px, 40vw, 600px);
  height: clamp(400px, 44vw, 680px);
  font-size: 0;
  filter:
    drop-shadow(0 18px 28px rgba(116, 62, 78, 0.28));
  animation: petFloat 3.5s ease-in-out infinite;
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.pet-mascot span {
  position: absolute;
  display: block;
}

.mascot-body {
  left: 50%;
  bottom: 8%;
  width: 74%;
  height: 60%;
  transform: translateX(-50%);
  border-radius: 48% 52% 44% 44% / 48% 48% 56% 56%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,0.98), rgba(255, 247, 240, 0.94) 44%, rgba(255, 226, 219, 0.92) 100%);
  border: 5px solid #a76654;
  box-shadow:
    inset 0 10px 0 rgba(255,255,255,0.88),
    inset 0 -12px 18px rgba(246, 184, 187, 0.2);
}

.mascot-head {
  left: 50%;
  top: 10%;
  width: 72%;
  height: 55%;
  transform: translateX(-50%);
  border-radius: 48% 52% 50% 50% / 48% 48% 54% 54%;
  background:
    radial-gradient(circle at 38% 30%, #fff, #fff5ef 56%, #ffdeda 100%);
  border: 5px solid #a76654;
  box-shadow: inset 0 9px 0 rgba(255,255,255,0.86);
}

.mascot-ear {
  top: 10%;
  width: 28%;
  height: 31%;
  background: linear-gradient(145deg, #fffaf5, #ffdeda);
  border: 5px solid #a76654;
  border-radius: 42% 58% 46% 54% / 52% 56% 44% 48%;
  z-index: -1;
}

.mascot-ear::after {
  content: '';
  position: absolute;
  inset: 22% 25% 26%;
  border-radius: inherit;
  background: #ffb7c9;
}

.ear-left {
  left: 16%;
  transform: rotate(-26deg);
}

.ear-right {
  right: 16%;
  transform: rotate(26deg) scaleX(-1);
}

.mascot-hat {
  left: 50%;
  top: 0;
  width: 46%;
  height: 24%;
  transform: translateX(-50%) rotate(-7deg);
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 70% 30%, #ffdf77 0 8%, transparent 9%),
    linear-gradient(180deg, #fff9f1 0 45%, #38446d 46% 100%);
  border: 4px solid #a76654;
  box-shadow: 0 5px 0 rgba(116, 62, 78, 0.18);
}

.mascot-eye {
  top: 42%;
  width: 13%;
  height: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 35%, #fff 0 12%, transparent 14%),
    radial-gradient(circle, #73c98c 0 44%, #2c7c63 45% 68%, #183c34 69%);
  border: 3px solid #754635;
  z-index: 3;
}

.eye-left { left: 35%; }
.eye-right { right: 35%; }

.mascot-glasses {
  top: 39%;
  width: 24%;
  height: 23%;
  border-radius: 50%;
  border: 5px solid #c7975b;
  z-index: 4;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.75);
}

.glasses-left { left: 29%; }
.glasses-right { right: 29%; }

.mascot-bridge {
  left: 50%;
  top: 48%;
  width: 10%;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #c7975b;
  z-index: 4;
}

.mascot-cheek {
  top: 57%;
  width: 11%;
  height: 7%;
  border-radius: 50%;
  background: rgba(255, 142, 165, 0.62);
  z-index: 2;
}

.cheek-left { left: 27%; }
.cheek-right { right: 27%; }

.mascot-mouth {
  left: 50%;
  top: 57%;
  width: 13%;
  height: 9%;
  transform: translateX(-50%);
  border-bottom: 4px solid #8a5140;
  border-radius: 0 0 999px 999px;
  z-index: 4;
}

.mascot-paw {
  top: 62%;
  width: 22%;
  height: 28%;
  border-radius: 48%;
  background: linear-gradient(180deg, #fffdf8, #ffe3df);
  border: 5px solid #a76654;
  z-index: 5;
}

.paw-left {
  left: 25%;
  transform: rotate(-12deg);
}

.paw-right {
  right: 25%;
  transform: rotate(12deg);
}

.mascot-cape {
  right: 4%;
  bottom: 11%;
  width: 24%;
  height: 37%;
  border-radius: 42% 58% 52% 48%;
  background:
    radial-gradient(circle at 64% 30%, #ffe16f 0 8%, transparent 9%),
    radial-gradient(circle at 34% 64%, #ffe16f 0 7%, transparent 8%),
    linear-gradient(160deg, #47d5ad, #35a88e);
  border: 5px solid #a76654;
  z-index: -1;
}

.pet-label {
  position: relative;
  z-index: 2;
  margin-top: -8px;
  border-radius: 18px;
  border-width: 3px;
  background: linear-gradient(180deg, rgba(255, 253, 239, 0.94), rgba(255, 226, 196, 0.9));
  font-size: 13px;
  box-shadow:
    0 4px 0 #efb879,
    0 10px 18px rgba(120, 72, 58, 0.18);
}

.start-status-panel {
  justify-self: center;
  align-self: center;
}

.hit-zone {
  border-width: 3px;
  border-style: solid;
  border-color: rgba(255, 240, 250, 0.95);
  background: radial-gradient(circle, rgba(255, 245, 222, 0.16), rgba(255, 147, 186, 0.08));
  box-shadow:
    0 0 0 3px rgba(244, 130, 174, 0.18),
    0 0 32px rgba(255, 221, 159, 0.5) inset,
    0 8px 24px rgba(128, 68, 88, 0.22);
}

.hit-zone .face {
  filter:
    drop-shadow(0 4px 0 rgba(255, 255, 255, 0.85))
    drop-shadow(0 10px 14px rgba(176, 78, 114, 0.38));
}

.name-tag,
.hit-zone .name-tag {
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(255, 223, 197, 0.94));
  border-width: 3px;
  box-shadow: 0 4px 0 #efb879, 0 10px 18px rgba(120, 72, 58, 0.16);
  color: #704452;
}

.speech-bubble {
  border-radius: 26px;
  border-width: 4px;
  background: linear-gradient(180deg, rgba(255, 252, 240, 0.98), rgba(255, 233, 211, 0.96));
  box-shadow:
    0 7px 0 #efb879,
    0 0 0 2px rgba(218, 130, 168, 0.24),
    0 18px 34px rgba(102, 62, 44, 0.3);
}

#rescan-btn {
  right: clamp(18px, 4vw, 58px);
  bottom: clamp(18px, 4vh, 38px);
  border-radius: 32px;
  padding: 12px 22px 13px;
  font-size: 15px;
  box-shadow:
    0 6px 0 #b8792a,
    0 14px 26px rgba(126, 76, 28, 0.22),
    inset 0 3px 0 rgba(255, 255, 255, 0.76);
}

#status-bar {
  border-radius: 28px;
  border-width: 4px;
  box-shadow:
    0 6px 0 #efb879,
    0 16px 28px rgba(120, 72, 58, 0.22);
}

#pet-intro-scene {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 244, 205, 0.42), transparent 36%),
    linear-gradient(180deg, rgba(255, 221, 190, 0.18), rgba(154, 75, 112, 0.22)),
    url('/assets/start-room-bg.png') center / cover no-repeat;
}

#pet-intro-scene::before,
#pet-intro-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#pet-intro-scene::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 243, 206, 0.62), transparent 30%),
    linear-gradient(90deg, rgba(78, 34, 58, 0.16), transparent 24%, transparent 76%, rgba(78, 34, 58, 0.18));
}

#pet-intro-scene::after {
  background: radial-gradient(circle at 50% 105%, rgba(255, 228, 186, 0.62), transparent 42%);
}

#pet-intro-scene.show {
  display: flex;
}

.intro-pet-wrap {
  position: relative;
  z-index: 1;
  width: min(42vw, 390px);
  min-width: 230px;
  aspect-ratio: 7 / 9;
  transform: translateY(-58px);
  animation: introPetFloat 3.4s ease-in-out infinite;
  filter:
    drop-shadow(0 7px 0 rgba(255, 255, 255, 0.78))
    drop-shadow(0 22px 28px rgba(105, 58, 76, 0.28));
}

@keyframes introPetFloat {
  0%, 100% { transform: translateY(-58px); }
  50% { transform: translateY(-76px); }
}

#intro-pet-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.intro-dialog-card {
  position: absolute;
  left: 50%;
  bottom: clamp(32px, 8vh, 78px);
  z-index: 2;
  width: min(660px, calc(100vw - 36px));
  min-height: 132px;
  transform: translateX(-50%);
  padding: 18px 24px 20px;
  border-radius: 30px;
  border: 5px solid rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 253, 241, 0.98), rgba(255, 232, 211, 0.95));
  color: #704452;
  text-align: center;
  box-shadow:
    0 8px 0 #efb879,
    0 0 0 2px rgba(218, 130, 168, 0.22),
    0 20px 40px rgba(112, 64, 58, 0.26),
    inset 0 3px 0 rgba(255, 255, 255, 0.78);
}

.intro-dialog-card::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -18px;
  width: 30px;
  height: 30px;
  transform: translateX(-50%) rotate(45deg);
  border-left: 5px solid rgba(255, 255, 255, 0.94);
  border-top: 5px solid rgba(255, 255, 255, 0.94);
  border-radius: 8px 0 0 0;
  background: rgba(255, 253, 241, 0.98);
}

.intro-speaker {
  display: inline-block;
  margin: -38px auto 12px;
  padding: 6px 18px 7px;
  border: 4px solid #fff;
  border-radius: 18px;
  background: linear-gradient(180deg, #ff9cc4, #df5f9a);
  color: #fff;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 #9d416f;
  box-shadow: 0 4px 0 #b64f7f;
}

.intro-line {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #74425f;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.82);
}

#intro-next-btn {
  margin-top: 14px;
  padding: 9px 24px 10px;
  border: 4px solid #fff;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 36%),
    linear-gradient(90deg, #ed6fa8, #bd77d1);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 3px;
  cursor: pointer;
  text-shadow: 0 2px 0 #94466f;
  box-shadow:
    0 5px 0 #9c4979,
    0 12px 22px rgba(154, 72, 114, 0.28);
}

#intro-next-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #9c4979,
    0 6px 12px rgba(154, 72, 114, 0.22);
}

@media (max-width: 900px) {
  .start-stage {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 680px;
  }

  .start-textcol {
    transform: none;
  }

  .start-pet-stage {
    margin-bottom: 0;
    order: 2;
  }

  .start-status-panel {
    display: none;
  }

  .start-hint-card {
    position: relative;
    left: auto;
    top: auto;
    align-self: flex-start;
    margin: 10px 0 0 clamp(24px, 8vw, 76px);
  }

  #pet-status {
    display: none !important;
  }
}

@media (max-width: 640px) {
  #hud {
    gap: 8px;
  }

  .timer-badge {
    min-width: 102px;
    min-height: 60px;
    padding: 8px 12px;
    border-radius: 24px;
  }

  .timer-badge .label {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .timer-badge .clock {
    font-size: 24px;
  }

  .paw-progress {
    height: 58px;
    padding: 20px 4px 0;
  }

  .paw-progress .track {
    max-width: none;
    height: 12px;
    border-width: 3px;
  }

  .paw-progress .paw {
    width: 36px;
    height: 36px;
    border-width: 3px;
    font-size: 18px;
  }

  .round-btn {
    width: 48px;
    height: 48px;
    border-width: 3px;
    font-size: 24px;
  }

  .round-btn .cap {
    display: none;
  }

  .hint-card {
    top: 104px;
    left: 18px;
    max-width: calc(100vw - 36px);
    padding: 12px 16px 13px 64px;
    font-size: 12px;
  }

  .hint-card::before,
  .start-hint-card::before {
    left: -16px;
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  #start-screen {
    overflow-y: auto;
    justify-content: flex-start;
  }

  .start-top-hud {
    padding: 0;
  }

  .start-hint-card {
    display: none;
  }

  .start-main {
    min-height: calc(100vh - 88px);
  }

  #start-title {
    font-size: clamp(54px, 19vw, 82px);
    letter-spacing: 5px;
    -webkit-text-stroke-width: 2px;
  }

  #start-title::before,
  #start-title::after {
    display: none;
  }

  #start-btn {
    min-width: min(310px, 92vw);
    padding: 15px 24px 17px;
    font-size: clamp(19px, 6vw, 26px);
    letter-spacing: 5px;
  }

  #start-hint {
    margin-top: 18px;
    font-size: 12px;
  }

  .pet-art {
    font-size: clamp(92px, 32vw, 130px);
  }

  .intro-pet-wrap {
    width: min(68vw, 330px);
    transform: translateY(-92px);
  }

  @keyframes introPetFloat {
    0%, 100% { transform: translateY(-92px); }
    50% { transform: translateY(-108px); }
  }

  .intro-dialog-card {
    bottom: 24px;
    min-height: 122px;
    padding: 16px 18px 18px;
  }

  .intro-line {
    font-size: 16px;
  }
}

/* ============================================================
   椅子专属对话覆盖层 — 以原图为舞台，叠加真实对话框
   ============================================================ */
#chair-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(80, 40, 90, 0.55), rgba(20, 10, 30, 0.88));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
  padding: 18px;
}
#chair-dialog.show {
  display: flex;
  opacity: 1;
}

/* 舞台：保持原图 1535:1025 宽高比；所有气泡按百分比定位 */
.chair-stage {
  position: relative;
  width: min(96vw, calc(88vh * 1.498));
  aspect-ratio: 1535 / 1025;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(180, 110, 180, 0.5),
              0 0 90px rgba(255, 220, 240, 0.25);
  animation: chairPop 0.5s cubic-bezier(0.2, 1.2, 0.4, 1.05);
}
@keyframes chairPop {
  0%   { transform: scale(0.85) translateY(18px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.chair-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

/* 关闭按钮 */
.chair-dialog-close {
  position: absolute;
  top: 2.2%; right: 2.2%;
  width: 6.5%;
  aspect-ratio: 1 / 1;
  min-width: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.96);
  color: #b03466;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: transform 0.18s ease, background 0.18s ease;
}
.chair-dialog-close:hover { transform: scale(1.08); background: #fff; }

/* 通用气泡样式 */
.chair-bubble {
  position: absolute;
  background: rgba(255, 244, 232, 0.96);
  border: 2px solid rgba(255, 180, 200, 0.85);
  box-shadow: 0 6px 24px rgba(180, 110, 160, 0.28),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  padding: clamp(10px, 1.4vw, 18px) clamp(12px, 1.6vw, 22px);
  color: #6b3050;
  font-size: clamp(12px, 1.35vw, 17px);
  line-height: 1.55;
  z-index: 4;
  opacity: 0.55;
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
  transform: scale(0.985);
  font-family: "Noto Sans SC", sans-serif;
}
.chair-bubble.active {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 8px 32px rgba(255, 127, 166, 0.45),
              0 0 0 3px rgba(255, 220, 235, 0.7),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* 左气泡 — 旁白 / 你 */
.chair-bubble-left {
  left: 3.5%;
  bottom: 8%;
  width: 28%;
  min-height: 14%;
  border-radius: 22px 22px 22px 8px;
}

/* 右气泡 — 椅子的心事面板 */
.chair-bubble-right {
  right: 3.5%;
  top: 26%;
  width: 32%;
  min-height: 32%;
  border-radius: 20px;
  background: rgba(252, 235, 245, 0.97);
  border-color: rgba(220, 150, 200, 0.75);
}
.cb-title {
  font-size: clamp(13px, 1.45vw, 18px);
  font-weight: 700;
  color: #b03466;
  margin-bottom: clamp(6px, 0.8vw, 12px);
  padding-bottom: clamp(4px, 0.6vw, 8px);
  border-bottom: 1px dashed rgba(255, 127, 166, 0.5);
  letter-spacing: 0.05em;
}
.cb-text {
  min-height: 3.2em;
  white-space: pre-wrap;
  word-break: break-word;
}
.cb-cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: #ff7fa6;
  margin-left: 2px;
  vertical-align: -2px;
  animation: cbBlink 0.9s steps(2, start) infinite;
}
@keyframes cbBlink { to { visibility: hidden; } }

.cb-next-btn {
  display: none;
  margin-top: clamp(8px, 1vw, 14px);
  padding: clamp(6px, 0.8vw, 10px) clamp(12px, 1.4vw, 20px);
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9ec2, #ff7fa6);
  color: #fff;
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 127, 166, 0.5);
  letter-spacing: 0.08em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cb-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 127, 166, 0.6);
}
.cb-next-btn.show { display: inline-block; }

.chair-dialog-footer {
  position: absolute;
  bottom: 2.2%;
  left: 50%;
  transform: translateX(-50%);
  color: #b03466;
  background: rgba(255, 244, 232, 0.85);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.18em;
  opacity: 0.85;
  z-index: 5;
  animation: chairFooterPulse 1.8s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes chairFooterPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* 窄屏适配：竖向堆叠两个气泡 */
@media (max-width: 720px), (orientation: portrait) {
  .chair-stage {
    width: min(96vw, calc(88vh * 1.498));
  }
  .chair-bubble-left {
    left: 4%; bottom: 4%;
    top: auto;
    width: 46%;
    border-radius: 18px 18px 18px 6px;
  }
  .chair-bubble-right {
    right: 4%; top: 6%;
    width: 46%;
    min-height: 26%;
  }
  .chair-dialog-footer {
    font-size: 11px;
    padding: 5px 14px;
  }
}
