:root {
  --cream: #fffaf0;
  --jade: #59a87a;
  --jade-dark: #2f6c4a;
  --lime: #a9ef32;
  --sunset-orange: #ff7e47;
  --sunset-pink: #ff3c88;
  --violet: #8b5cf6;
  --ink: #241e2e;
}

* { box-sizing: border-box; user-select: none; -webkit-user-select: none; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #2a2138 0%, #120e1c 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
}

#viewport {
  position: relative;
  width: 100vw; height: 100vh; height: 100dvh;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

#camera-rig {
  position: relative; width: 1376px; height: 768px;
  flex-shrink: 0;
  transform-origin: center center;
  will-change: transform;
}

#stage {
  position: relative; width: 1376px; height: 768px;
  overflow: hidden; border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72), 0 0 0 2px rgba(255, 255, 255, 0.24);
  background: #f5ede0;
}

.layer-img {
  position: absolute; inset: 0; width: 1376px; height: 768px;
  object-fit: cover; pointer-events: none;
}
#bg-twilight { opacity: 0; transition: opacity 1.1s ease; }

/* 5-Phase Shenzhen Bay Window Atmospheric Tint */
#window-sky-tint {
  position: absolute; left: 68px; top: 0; width: 1240px; height: 304px;
  pointer-events: none; z-index: 3;
  mix-blend-mode: soft-light;
  transition: background 1.4s ease, opacity 1.2s ease;
  opacity: 0;
}
#window-sky-tint.mode-coral {
  opacity: 0.72;
  background: linear-gradient(180deg, rgba(255, 92, 138, 0.55), rgba(255, 166, 76, 0.4));
}
#window-sky-tint.mode-bluehour {
  opacity: 0.85;
  background: linear-gradient(180deg, rgba(32, 54, 158, 0.78), rgba(138, 72, 206, 0.45));
}
#window-sky-tint.mode-neon {
  opacity: 0.88;
  background: linear-gradient(180deg, rgba(22, 18, 86, 0.82), rgba(235, 56, 152, 0.42));
}
#window-sky-tint.mode-fireworks {
  opacity: 0.92;
  background: linear-gradient(180deg, rgba(12, 12, 52, 0.88), rgba(88, 34, 138, 0.55));
}

/* Interactive Window Toys */
#window-toys { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.sky-toy, .canister-toy {
  position: absolute; background: transparent; border: none; cursor: pointer; pointer-events: auto;
  border-radius: 16px; transition: background 0.2s ease;
}
.sky-toy:hover { background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%); }
.canister-toy:hover { background: radial-gradient(circle, rgba(169, 239, 50, 0.24), transparent 70%); }

/* Diegetic Order Ticket Clip */
#order-ticket {
  position: absolute; left: 16px; top: 16px; width: 222px; z-index: 20;
  padding: 12px 13px 11px; border-radius: 16px;
  background: rgba(255, 252, 244, 0.94);
  border: 2px solid #fff;
  box-shadow: 0 14px 30px rgba(24, 16, 44, 0.28);
  backdrop-filter: blur(8px);
}
.ticket-pin {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 11px; border-radius: 999px;
  background: linear-gradient(90deg, #ff7e47, #ff3c88);
  box-shadow: 0 3px 6px rgba(0,0,0,0.22);
}
.ticket-guest { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.ticket-avatar {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(145deg, #fff1c9, #ffd6e8);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);
}
.ticket-guest strong { display: block; font-size: 13px; font-weight: 900; color: var(--ink); }
.ticket-guest small { display: block; font-size: 10.5px; color: #726689; font-weight: 700; }
.ticket-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ticket-list li {
  font-size: 11.5px; font-weight: 800; color: #4a415e;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 4px 8px; border-radius: 8px; background: rgba(36, 30, 46, 0.05);
}
.ticket-list li.done { background: #dcfce7; color: #166534; text-decoration: line-through; }

/* Induction Ring Dynamic Glow */
#induction-ring-glow {
  position: absolute;
  left: 465px; top: 586px; width: 446px; height: 134px;
  border-radius: 50%;
  box-shadow: 0 0 30px 10px rgba(255, 130, 32, 0.45), inset 0 0 28px rgba(255, 178, 66, 0.4);
  border: 3px solid rgba(255, 198, 92, 0.75);
  mix-blend-mode: screen;
  opacity: 0.45; pointer-events: none; z-index: 5;
  transition: opacity 0.25s, box-shadow 0.25s;
}

/* Pot Interactive Overlay */
#pot-overlay { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
#pot-empty-cover {
  position: absolute;
  left: 460px; top: 344px; width: 456px; height: 186px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 58%, rgba(235, 228, 206, 0.94) 0%, rgba(212, 204, 180, 0.88) 65%, rgba(165, 178, 152, 0.08) 100%);
  box-shadow: inset 0 18px 34px rgba(100, 92, 70, 0.28);
  transition: opacity 0.7s ease;
}
#pot-boil-shimmer {
  position: absolute;
  left: 468px; top: 356px; width: 440px; height: 162px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 240, 150, 0.36) 0%, rgba(169, 239, 50, 0.12) 60%, transparent 100%);
  mix-blend-mode: screen; opacity: 0;
}

/* Skimmable Foam Layer (Chapter 2+) */
#pot-foam-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.foam-cloud {
  position: absolute; width: 52px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ffffff 0%, rgba(246, 236, 212, 0.9) 68%, rgba(226, 208, 175, 0.15) 100%);
  box-shadow: 0 4px 10px rgba(130, 96, 48, 0.22), inset 0 -3px 6px rgba(188, 156, 110, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  transform: translate(-50%, -50%);
  cursor: pointer; pointer-events: auto;
}
.foam-cloud:hover { transform: translate(-50%, -50%) scale(1.16); }

/* Chapter 4 & 5 Golden 3s Ceramic Pot Lid */
#pot-lid {
  position: absolute; left: 454px; top: 320px; width: 468px; height: 172px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 45% 32%, #fffcf5 0%, #ede6d1 58%, #c9c0a8 100%);
  border: 6px solid #59a87a;
  box-shadow: 0 20px 44px rgba(32, 42, 34, 0.38), inset 0 10px 22px rgba(255, 255, 255, 0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(-95px) scale(0.92);
  pointer-events: none; cursor: pointer; z-index: 24;
}
#pot-lid.active { pointer-events: auto; }
.lid-handle {
  position: absolute; top: 32px; left: 50%; transform: translateX(-50%);
  width: 74px; height: 34px; border-radius: 999px;
  background: linear-gradient(145deg, #6ec491, #3f875d);
  box-shadow: 0 8px 16px rgba(26, 70, 46, 0.4), inset 0 3px 4px rgba(255, 255, 255, 0.45);
}
.lid-ring-qte {
  position: absolute; inset: -16px; border-radius: 50%;
  border: 5px solid #ffd43b;
  box-shadow: 0 0 30px rgba(255, 212, 59, 0.85);
  animation: popPulse 0.55s infinite;
}
.lid-cta-pill {
  margin-top: 38px; padding: 7px 18px; border-radius: 999px;
  background: linear-gradient(90deg, #ff7e47, #ff3c88);
  color: #fff; font-size: 14px; font-weight: 900;
  box-shadow: 0 8px 22px rgba(255, 60, 136, 0.55);
}

#pot-overboil-alert {
  position: absolute; left: 50%; top: 288px; transform: translateX(-50%);
  padding: 6px 16px; border-radius: 999px;
  background: linear-gradient(90deg, #ff3366, #ff7b33);
  color: #fff; font-size: 13px; font-weight: 900;
  box-shadow: 0 10px 24px rgba(255, 51, 102, 0.55);
  animation: popPulse 0.55s infinite; z-index: 25;
}

/* Chapter 4 & 5 Blow First Soup Bowl Mini-Station */
#blow-station {
  position: absolute; left: 50%; top: 430px; transform: translate(-50%, -50%);
  z-index: 28; width: 270px; padding: 18px; border-radius: 26px; text-align: center;
  background: rgba(255, 252, 245, 0.96); border: 3px solid #fff;
  box-shadow: 0 24px 60px rgba(20, 14, 38, 0.55); cursor: pointer;
}
.blow-cup {
  width: 118px; height: 74px; margin: 0 auto 10px; border-radius: 14px 14px 52px 52px;
  background: linear-gradient(180deg, #fffdf8, #e6efe9);
  border: 4px solid #59a87a; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 20px rgba(34, 72, 48, 0.25);
}
.blow-broth {
  position: absolute; left: 0; right: 0; bottom: 0; height: 74%;
  background: linear-gradient(180deg, #ffe787, #f5b93a);
}
.blow-temp {
  position: relative; z-index: 2; font-size: 22px; font-weight: 900; color: #3a2006;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}
.blow-hint { font-size: 12.5px; font-weight: 900; color: var(--ink); margin-bottom: 8px; }
.blow-bar { height: 10px; border-radius: 999px; background: rgba(36, 30, 46, 0.12); overflow: hidden; }
.blow-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #ff7e47, #59a87a, #38bdf8); transition: width 0.1s; }

/* Embedded Touch-Glass Induction Stove Control Strip */
#induction-panel {
  position: absolute; left: 456px; top: 702px; width: 464px; height: 38px;
  z-index: 16; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; border-radius: 999px;
  background: rgba(20, 17, 26, 0.88);
  border: 1.5px solid rgba(255, 198, 114, 0.62);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}
.ind-tag { font-size: 12px; font-weight: 900; color: #ffbe66; white-space: nowrap; }
#heat-slider { flex: 1; accent-color: #ff8a3d; cursor: pointer; height: 6px; }
.ind-val { font-size: 12px; font-weight: 800; color: #fff6e6; white-space: nowrap; min-width: 112px; text-align: right; }

/* Left Wooden Cutting Board Prep Station */
#cutting-board-zone {
  position: absolute; left: 4px; top: 432px; width: 184px; height: 326px;
  z-index: 15; pointer-events: none;
}
.board-badge {
  position: absolute; left: 8px; top: -12px;
  padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(90deg, #ff7e47, #ff3c88);
  color: #fff; font-size: 11.5px; font-weight: 900;
  box-shadow: 0 8px 18px rgba(255, 60, 136, 0.45);
  animation: popPulse 0.95s infinite;
}
#board-items {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 5px;
  padding: 14px 6px 8px 6px;
}
.board-token {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 253, 246, 0.96), rgba(246, 236, 212, 0.95));
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(96, 56, 22, 0.25), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.board-token:hover { transform: scale(1.06) translateX(6px) rotate(-1.5deg); }
.board-token .tk-emoji { font-size: 20px; }
.board-token b { font-size: 11.5px; color: var(--ink); display: block; line-height: 1.2; }
.board-token small { font-size: 9.5px; color: #7a5c46; display: block; line-height: 1.15; }
.chop-pips { margin-left: auto; font-size: 10px; font-weight: 900; color: #e11d48; background: #ffe4e6; padding: 2px 6px; border-radius: 999px; }

/* Chapter 2+ Coconut Cultivar Selector Bar */
#cultivar-bar {
  position: absolute; left: 50%; top: 274px; transform: translateX(-50%);
  z-index: 22; display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(24, 20, 36, 0.9); border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
}
.cult-title { font-size: 11px; font-weight: 800; color: #f6e8ff; white-space: nowrap; }
.cult-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 11.5px; font-weight: 800;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.cult-btn i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cult-btn[data-cult="green"] i { background: #7be34a; }
.cult-btn[data-cult="thai"] i { background: #58d6b4; }
.cult-btn[data-cult="aged"] i { background: #e6b15c; }
.cult-btn.active { background: #fff; color: var(--ink); border-color: #a9ef32; transform: scale(1.05); }

/* Floating Sprites */
.pop-sprite { position: absolute; z-index: 12; }

#coconut-pair { left: 656px; top: 14px; width: 418px; height: 274px; cursor: crosshair; z-index: 14; }
#coco-left-img {
  position: absolute; left: 4px; top: 2px; width: 186px; height: 214px;
  filter: drop-shadow(0 18px 22px rgba(42, 74, 34, 0.28)); pointer-events: none;
}
#coco-right-img {
  position: absolute; left: 160px; top: 20px; width: 256px; height: 248px;
  filter: drop-shadow(0 18px 22px rgba(42, 74, 34, 0.28)); pointer-events: none;
}
.slash-guide { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; }
.slash-line {
  display: block; width: 180px; height: 4px; margin: 0 auto 10px; border-radius: 4px;
  background: linear-gradient(90deg, transparent, #fff, #9ef7ff, transparent);
  transform: rotate(-16deg); box-shadow: 0 0 16px #78f2ff;
  animation: slashSweep 1.3s infinite ease-in-out;
}
@keyframes slashSweep {
  0% { transform: rotate(-16deg) scaleX(0.35); opacity: 0.3; }
  50% { transform: rotate(-16deg) scaleX(1.1); opacity: 1; }
  100% { transform: rotate(-16deg) scaleX(0.35); opacity: 0.3; }
}
.slash-pill {
  display: inline-block; white-space: nowrap; padding: 6px 14px; border-radius: 999px;
  background: rgba(25, 22, 38, 0.9); color: #fff; font-size: 12.5px; font-weight: 900;
  border: 2px solid #8bf6ff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

#lime-pair { position: absolute; inset: 0; pointer-events: none; z-index: 14; }
.lime-sprite {
  position: absolute; background: transparent; border: none; padding: 0;
  cursor: pointer; pointer-events: auto;
  filter: drop-shadow(0 14px 16px rgba(56, 98, 12, 0.35));
}
#lime-left-btn { left: 184px; top: 374px; width: 96px; height: 98px; }
#lime-right-btn { left: 282px; top: 334px; width: 94px; height: 96px; }
.lime-sprite img { width: 100%; height: 100%; display: block; pointer-events: none; }
.lime-cta {
  position: absolute; left: 186px; top: 300px;
  white-space: nowrap; padding: 5px 13px; border-radius: 999px;
  background: linear-gradient(90deg, #74d91a, #b4ff33);
  color: #163206; font-size: 12px; font-weight: 900;
  box-shadow: 0 8px 20px rgba(116, 217, 26, 0.45);
  animation: popPulse 0.85s infinite;
}

#dipping-bowl-wrap { left: 190px; top: 548px; width: 208px; height: 130px; z-index: 15; }
#dipping-bowl-img { width: 100%; height: 100%; display: block; pointer-events: none; }
#zest-fill-badge {
  position: absolute; left: 50%; top: -12px; transform: translateX(-50%);
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(24, 22, 36, 0.9); color: #c4ff4d; font-size: 11px; font-weight: 900;
  border: 1.5px solid #a9ef32; pointer-events: none;
}

/* Chapter 3+ Sauce Alchemy Mini-Dock */
#sauce-alchemy-dock {
  position: absolute; left: 50%; bottom: -36px; transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 22;
}
.alch-btn {
  padding: 5px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: rgba(255, 252, 245, 0.96); border: 2px solid #ff9d47;
  color: var(--ink); font-size: 11px; font-weight: 900;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.alch-btn:hover { transform: translateY(-2px) scale(1.06); }
.alch-btn b { color: #e11d48; }

#hourglass-wrap {
  left: 996px; top: 308px; width: 196px; height: 242px;
  cursor: pointer; z-index: 14; transform-origin: center center;
  filter: drop-shadow(0 18px 22px rgba(72, 34, 112, 0.28));
}
#hourglass-img { width: 100%; height: 100%; display: block; pointer-events: none; }
#purple-sand-canvas { position: absolute; inset: 0; pointer-events: none; }
.hg-cta {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  white-space: nowrap; padding: 5px 14px; border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  color: #fff; font-size: 12.5px; font-weight: 900;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.55);
  animation: popPulse 0.9s infinite;
}

#chopsticks-btn {
  position: absolute; left: 1014px; top: 556px; width: 210px; height: 196px;
  background: transparent; border: none; cursor: pointer; z-index: 14; border-radius: 20px;
}
.chop-cta {
  position: absolute; left: 50%; top: -18px; transform: translateX(-50%);
  white-space: nowrap; padding: 7px 15px; border-radius: 999px;
  background: linear-gradient(90deg, #ff7e47, #ff3c88);
  color: #fff; font-size: 13px; font-weight: 900;
  box-shadow: 0 10px 24px rgba(255, 60, 136, 0.55);
  animation: popPulse 0.8s infinite;
}

/* Nour Freeplay Toy Spawner Bar */
#sandbox-dock {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 26; display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(24, 19, 38, 0.9); border: 2px solid #a9ef32;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}
.sb-label { font-size: 11.5px; font-weight: 900; color: #c4ff4d; white-space: nowrap; }
.sb-toy {
  padding: 5px 10px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.12); color: #fff; font-size: 11.5px; font-weight: 800;
  cursor: pointer; white-space: nowrap; transition: transform 0.16s;
}
.sb-toy:hover { transform: scale(1.08); background: rgba(169, 239, 50, 0.28); }

#fx-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 18; }
#callout-layer { position: absolute; inset: 0; pointer-events: none; z-index: 26; }
.pop-callout {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 19px; font-weight: 900; letter-spacing: 0.5px;
  color: #fff; text-shadow: 0 3px 0 rgba(28, 18, 44, 0.85), 0 8px 18px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* === AAA SINGLE-LINE TOP HUD === */
#hud-top {
  position: fixed; top: 10px; left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  z-index: 40; pointer-events: none;
}
.pop-brand-pill, .pop-score-dock, .pop-actions {
  pointer-events: auto; display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.pop-brand-pill {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 252, 245, 0.94); border: 2px solid #fff;
  box-shadow: 0 10px 26px rgba(24, 18, 42, 0.28); backdrop-filter: blur(12px);
}
.pill-chip {
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(90deg, #59a87a, #3d8e65);
  color: #fff; font-size: 10px; font-weight: 900;
}
.pop-brand-pill h1 { margin: 0; font-size: 13.5px; font-weight: 900; color: var(--ink); white-space: nowrap; }
.stage-dots { display: flex; gap: 4px; }
.s-dot {
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap;
  background: rgba(36, 30, 46, 0.08); color: rgba(36, 30, 46, 0.52);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.s-dot.active { background: linear-gradient(90deg, #ff7e47, #ff3c88); color: #fff; transform: scale(1.06); }
.s-dot.done { background: #d6f7df; color: #1f6b3d; }

.pop-score-dock {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(28, 22, 42, 0.9); border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); backdrop-filter: blur(12px);
}
.coin-pill, .combo-pill, .score-pill { text-align: center; padding: 0 5px; white-space: nowrap; }
.coin-pill small, .combo-pill small, .score-pill small, .fever-meter small {
  display: block; font-size: 9px; letter-spacing: 0.6px; opacity: 0.72; font-weight: 800; white-space: nowrap;
}
#coins-val { font-size: 15px; font-weight: 900; color: #fbbf24; }
#combo-val { font-size: 15px; font-weight: 900; color: #c4ff4d; }
#score-val { font-size: 15px; font-weight: 900; color: #ffd466; font-variant-numeric: tabular-nums; }
.fever-meter { width: 88px; }
.fever-bar { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; margin-top: 3px; }
.fever-bar i { display: block; height: 100%; width: 12%; border-radius: 999px; background: linear-gradient(90deg, #a9ef32, #ff7e47, #ff3c88, #8b5cf6); transition: width 0.3s; }

.pop-btn {
  padding: 7px 11px; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: rgba(255, 252, 245, 0.94); border: 2px solid #fff;
  color: var(--ink); font-size: 12px; font-weight: 900; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 8px 20px rgba(24, 18, 42, 0.22);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pop-btn svg { width: 14px; height: 14px; }
.pop-btn:hover { transform: translateY(-2px) scale(1.04); }
.pop-btn:active { transform: scale(0.95); }
.pop-btn.on { background: linear-gradient(90deg, #a9ef32, #52e3a5); color: #123318; }
.pop-btn.alt-link { background: linear-gradient(90deg, #583524, #874727); color: #fff4df; border-color: #e8ba6c; }
.pop-btn.dark-btn { background: #261f35; color: #fff; border-color: rgba(255,255,255,0.22); }
.pop-btn.danger-btn { background: #ffe4e6; color: #be123c; border-color: #fda4af; }

/* Bottom Guide Pill */
#hud-bottom {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%);
  z-index: 40; width: min(880px, calc(100vw - 28px)); pointer-events: none;
}
.guide-pill {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border-radius: 20px;
  background: rgba(255, 252, 246, 0.95); border: 2px solid #fff;
  box-shadow: 0 14px 34px rgba(24, 18, 42, 0.34); backdrop-filter: blur(12px);
}
.guide-emoji {
  width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(145deg, #fff2c6, #ffd19c);
}
.guide-text { flex: 1; }
.guide-text strong { display: block; font-size: 13.5px; color: var(--ink); font-weight: 900; }
.guide-text small { display: block; font-size: 11.5px; color: #675e78; margin-top: 1px; font-weight: 600; }
.fever-countdown {
  padding: 5px 13px; border-radius: 14px; text-align: center;
  background: linear-gradient(135deg, #8b5cf6, #ff3c88); color: #fff;
}
.fever-countdown span { display: block; font-size: 9.5px; font-weight: 800; }
.fever-countdown strong { font-size: 18px; font-weight: 900; font-family: monospace; }

/* Achievement Unlock Toast */
#badge-toast {
  position: fixed; right: 20px; top: 68px; z-index: 95;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 18px;
  background: linear-gradient(135deg, #1f1733, #352052);
  border: 2px solid #ffd43b; color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.bt-icon { font-size: 26px; }
#badge-toast small { display: block; font-size: 10.5px; color: #ffd43b; font-weight: 800; }
#badge-toast strong { font-size: 14px; font-weight: 900; }

/* === MODAL BACKDROPS & SCREENS === */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(28, 18, 48, 0.52), rgba(14, 10, 26, 0.84));
  backdrop-filter: blur(7px); padding: 18px;
}

.pop-cta {
  padding: 12px 26px; border-radius: 999px; border: none; cursor: pointer;
  background: linear-gradient(90deg, #ff7e47 0%, #ff3c88 52%, #8b5cf6 100%);
  color: #fff; font-size: 15px; font-weight: 900; letter-spacing: 0.6px;
  box-shadow: 0 12px 26px rgba(255, 60, 136, 0.42), inset 0 2px 3px rgba(255, 255, 255, 0.42);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s;
}
.pop-cta.secondary { background: linear-gradient(90deg, #10b981, #0ea5e9); box-shadow: 0 12px 24px rgba(14, 165, 233, 0.35); }
.pop-cta:hover { transform: translateY(-2px) scale(1.04); filter: brightness(1.06); }
.pop-cta:active { transform: scale(0.96); }

/* Title Card */
.pop-title-card {
  width: min(650px, 95vw); padding: 28px 32px; border-radius: 30px; text-align: center;
  background: linear-gradient(160deg, rgba(255, 253, 248, 0.98), rgba(244, 250, 244, 0.97));
  border: 3px solid #fff;
  box-shadow: 0 32px 84px rgba(15, 10, 32, 0.68), 0 0 0 8px rgba(255, 255, 255, 0.14);
}
.pop-tag { font-size: 11px; font-weight: 900; letter-spacing: 2px; color: var(--jade-dark); }
.pop-title-card h2 { margin: 6px 0 4px; font-size: 38px; font-weight: 900; color: var(--ink); }
.pop-title-card h2 span {
  background: linear-gradient(90deg, #ff7e47, #ff3c88, #8b5cf6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle-line { font-size: 12.5px; font-weight: 800; color: #7c3aed; margin-bottom: 12px; }
.pop-title-card p { margin: 0 0 16px; font-size: 13.8px; line-height: 1.68; color: #544b66; }
.title-chapter-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.tc-node {
  padding: 8px 6px; border-radius: 14px; background: #f4f6f2; border: 1.5px solid #dbe7dc;
  font-size: 11px; font-weight: 800; color: #5a526e; cursor: pointer; transition: transform 0.18s;
}
.tc-node:hover:not(.locked) { transform: translateY(-3px); border-color: #59a87a; }
.tc-node.locked { opacity: 0.45; cursor: not-allowed; }
.tc-node.done { background: #ecfdf5; border-color: #34d399; color: #065f46; }
.tc-node b { display: block; font-size: 18px; margin-bottom: 2px; }
.title-btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
.title-sub-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.text-link {
  background: none; border: none; color: #6d28d9; font-size: 12.5px; font-weight: 800;
  cursor: pointer; text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* Guest Order Briefing Card */
.briefing-card {
  width: min(560px, 94vw); padding: 26px 28px; border-radius: 28px;
  background: linear-gradient(160deg, #fffdf8, #f7f3ff); border: 3px solid #fff;
  box-shadow: 0 28px 76px rgba(15, 10, 32, 0.65);
}
.briefing-time-pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(90deg, #ff7e47, #ff3c88); color: #fff;
  font-size: 11.5px; font-weight: 900; margin-bottom: 12px;
}
.briefing-guest-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.br-avatar {
  width: 66px; height: 66px; border-radius: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: linear-gradient(145deg, #fff2c6, #ffd4ea);
  border: 3px solid #fff; box-shadow: 0 10px 22px rgba(45, 22, 68, 0.18);
}
.br-meta h3 { margin: 0 0 4px; font-size: 20px; font-weight: 900; color: var(--ink); }
.br-meta span { font-size: 12.5px; font-weight: 700; color: #6b5e85; }
.br-speech {
  margin: 0 0 16px; padding: 14px 16px; border-radius: 18px;
  background: #fff; border: 2px solid #ede9fe;
  font-size: 14px; line-height: 1.65; color: #362d47; font-weight: 700;
}
.br-checklist-box {
  padding: 12px 14px; border-radius: 16px; background: #f0fdf4; border: 1.5px solid #bbf7d0; margin-bottom: 18px;
}
.br-check-title { font-size: 12px; font-weight: 900; color: #166534; margin-bottom: 8px; }
.br-check-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.br-check-chips span {
  padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid #86efac;
  font-size: 12px; font-weight: 800; color: #14532d;
}
.br-actions { display: flex; gap: 10px; justify-content: center; }

/* Customer Reaction Theater */
.reaction-card {
  width: min(580px, 94vw); padding: 26px 28px; border-radius: 28px; text-align: center;
  background: linear-gradient(160deg, #fffdf8, #fff1f7); border: 3px solid #fff;
  box-shadow: 0 32px 84px rgba(15, 10, 32, 0.7);
}
.react-stage { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.react-avatar {
  width: 78px; height: 78px; border-radius: 24px; font-size: 46px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #fff0bd, #ffc4e4); border: 3px solid #fff;
  box-shadow: 0 12px 26px rgba(45, 22, 68, 0.22);
}
.react-stars { font-size: 34px; color: #f59e0b; letter-spacing: 4px; text-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.react-grade {
  padding: 6px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #ff7e47, #ff3c88);
  color: #fff; font-size: 22px; font-weight: 900; transform: rotate(-6deg);
}
.reaction-card h3 { margin: 4px 0 8px; font-size: 24px; font-weight: 900; }
.react-quote { margin: 0 0 14px; font-size: 14px; line-height: 1.65; color: #524766; font-weight: 700; }
.react-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.rb-item { padding: 8px 6px; border-radius: 12px; background: rgba(139, 92, 246, 0.08); }
.rb-item small { display: block; font-size: 10px; color: #6d5e8a; font-weight: 700; }
.rb-item b { font-size: 15px; font-weight: 900; color: var(--ink); }
.react-cooksta-preview {
  text-align: left; padding: 11px 14px; border-radius: 16px; margin-bottom: 16px;
  background: #fff; border: 1.5px solid #f3e8ff; font-size: 12.5px; line-height: 1.55; color: #4c3f63;
}
.react-cooksta-preview strong { color: #db2777; }
.react-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Hub Modal (Shop / Cooksta / Codex / Chapters) */
.hub-modal {
  width: min(820px, 95vw); max-height: 86vh; display: flex; flex-direction: column;
  border-radius: 28px; overflow: hidden;
  background: #fffdf8; border: 3px solid #fff;
  box-shadow: 0 34px 90px rgba(10, 6, 24, 0.72);
}
.hub-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; background: #1f1930; color: #fff;
}
.hub-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.hub-tab {
  padding: 8px 14px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px; font-weight: 800; transition: all 0.2s;
}
.hub-tab.active { background: linear-gradient(90deg, #ff7e47, #ff3c88); color: #fff; }
.hub-right { display: flex; align-items: center; gap: 12px; }
.hub-wallet { font-size: 13.5px; color: #fde68a; font-weight: 800; }
.hub-body { padding: 20px; overflow-y: auto; flex: 1; }

.shop-grid, .codex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.codex-grid { grid-template-columns: repeat(3, 1fr); }
.shop-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px;
  background: #f8f7fc; border: 2px solid #ece8f8;
}
.shop-card.owned { background: #ecfdf5; border-color: #6ee7b7; }
.shop-ico { font-size: 32px; flex-shrink: 0; }
.shop-info { flex: 1; }
.shop-info b { display: block; font-size: 14px; margin-bottom: 3px; }
.shop-info small { font-size: 11.5px; color: #625878; line-height: 1.45; display: block; }
.buy-btn {
  padding: 7px 13px; border-radius: 999px; border: none; cursor: pointer; font-weight: 900; font-size: 12px;
  background: linear-gradient(90deg, #f59e0b, #f97316); color: #fff; white-space: nowrap;
}
.buy-btn:disabled { background: #d1d5db; color: #6b7280; cursor: not-allowed; }
.buy-btn.owned-tag { background: #10b981; color: #fff; }

.codex-card {
  padding: 12px; border-radius: 16px; text-align: center;
  background: #f4f2f8; border: 2px solid #e5e0f0; opacity: 0.55;
}
.codex-card.unlocked { background: linear-gradient(155deg, #fffbeb, #fef3c7); border-color: #fbbf24; opacity: 1; }
.codex-card span { font-size: 28px; display: block; margin-bottom: 4px; }
.codex-card b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.codex-card small { font-size: 10.5px; color: #615578; }

.cooksta-feed { display: flex; flex-direction: column; gap: 12px; }
.cooksta-post {
  padding: 14px 16px; border-radius: 18px; background: #fff; border: 2px solid #f3e8ff;
  box-shadow: 0 6px 18px rgba(32, 20, 52, 0.06);
}
.cp-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12.5px; font-weight: 900; color: #db2777; }
.cp-text { font-size: 13.5px; line-height: 1.6; color: #362e47; margin-bottom: 8px; }
.cp-like-btn {
  padding: 5px 12px; border-radius: 999px; border: 1.5px solid #fbcfe8; background: #fdf2f8;
  color: #db2777; font-size: 12px; font-weight: 800; cursor: pointer;
}
.cp-like-btn.liked { background: #ec4899; color: #fff; border-color: #ec4899; }

.chapter-list-grid { display: flex; flex-direction: column; gap: 10px; }
.ch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 16px; background: #f8f7fc; border: 2px solid #ece8f8;
}
.ch-row.locked { opacity: 0.45; }
.ch-left { display: flex; align-items: center; gap: 12px; }
.ch-left span { font-size: 28px; }
.ch-left b { display: block; font-size: 14px; }
.ch-left small { font-size: 12px; color: #625878; }

/* Pause & Settings Modal */
.pause-card {
  width: min(500px, 94vw); padding: 24px 26px; border-radius: 26px;
  background: #fffdf8; border: 3px solid #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}
.pause-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pause-header h3 { margin: 0; font-size: 20px; font-weight: 900; }
.setting-group { margin-bottom: 12px; }
.setting-group label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.setting-group input[type="range"] { width: 100%; accent-color: #8b5cf6; }
.setting-toggles { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.howto-box {
  padding: 10px 12px; border-radius: 14px; background: #f5f3ff; border: 1.5px solid #ddd6fe;
  font-size: 12px; line-height: 1.6; color: #4c3f6b; margin-bottom: 16px;
}
.pause-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* 3D-Tilt Holographic Gold Card */
.holo-stage { perspective: 1100px; }
.holo-card {
  position: relative; width: min(520px, 93vw);
  padding: 22px 24px 24px; border-radius: 28px;
  background: linear-gradient(155deg, #fffdf8 0%, #fef9c3 45%, #fce7f3 100%);
  border: 3px solid #fde047;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.72), 0 0 46px rgba(250, 204, 21, 0.45);
  transform-style: preserve-3d; transition: transform 0.12s ease-out;
  overflow: hidden; text-align: center;
}
.holo-glare {
  position: absolute; inset: 0; pointer-events: none; z-index: 10;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.56), rgba(145, 240, 255, 0.2) 35%, rgba(255, 110, 199, 0.15) 60%, transparent 78%);
  mix-blend-mode: overlay; opacity: 0.8;
}
.holo-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.holo-series { font-size: 10.5px; font-weight: 900; letter-spacing: 1.4px; color: #7c3aed; }
.holo-grade { padding: 4px 12px; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #ec4899); color: #fff; font-size: 15px; font-weight: 900; }
.holo-art-frame { position: relative; border-radius: 18px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 12px 28px rgba(42, 28, 72, 0.2); }
.holo-art-frame img { width: 100%; display: block; }
.holo-sticker {
  position: absolute; right: 12px; bottom: 12px; padding: 5px 12px; border-radius: 999px; transform: rotate(-6deg);
  background: #c4ff4d; color: #193805; font-size: 12px; font-weight: 900;
}
.holo-card h3 { margin: 12px 0 6px; font-size: 23px; font-weight: 900; color: var(--ink); }
.holo-card p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: #564c6b; }
.holo-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.h-metric { padding: 8px 4px; border-radius: 14px; background: rgba(139, 92, 246, 0.08); border: 1.5px solid rgba(139, 92, 246, 0.2); }
.h-metric small { display: block; font-size: 10px; color: #6b5d8a; font-weight: 700; }
.h-metric b { font-size: 15.5px; font-weight: 900; color: var(--ink); }
.holo-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.hidden { display: none !important; }

@keyframes popPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

@media (max-width: 1020px) {
  .stage-dots, .fever-meter { display: none; }
  .shop-grid, .codex-grid { grid-template-columns: 1fr; }
}
