:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --panel: #14141b;
  --text: #f3f3f7;
  --muted: #9a9aab;
  --accent: #ff5c8a;
  --hot: rgba(0, 200, 255, 0.22);
  --hot-border: rgba(0, 220, 255, 0.9);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  user-select: none; touch-action: none;
}
.app {
  min-height: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; padding: 10px 12px 18px;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 4px 2px 10px;
}
.title { font-weight: 700; letter-spacing: 0.02em; font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  border: 1px solid #333348; background: #1b1b27; color: var(--text);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"] { border-color: var(--hot-border); color: #b9f3ff; }
.chip.link { border-color: #3a3a55; color: #c8c8d8; }
.ver { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 0;
}
#stage {
  position: relative; width: 100%;
  aspect-ratio: 640 / 852;
  max-height: min(72vh, 820px);
  background: #101018; border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  touch-action: none;
}
.layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff; display: block;
  pointer-events: none;
}
.layer.react-vid {
  opacity: 0;
  /* Short fade hides hard cut when last/first frame ≠ idle; reveal still waits canplay */
  transition: opacity 100ms linear;
  z-index: 2;
  /* empty video elements paint black on many engines; never show until .playing */
  background: transparent;
}
.layer.react-vid.playing { opacity: 1; }
.layer.react-vid.playing.swap-front { z-index: 3; }
.layer.idle { z-index: 1; opacity: 1; transition: opacity 140ms linear; }
.layer.idle.idle-b { opacity: 0; z-index: 1; pointer-events: none; }
.layer.idle.idle-b.show { opacity: 1; z-index: 1; }
.layer.idle.fade-out { opacity: 0; }
.layer.idle-vid {
  z-index: 1;
  opacity: 0;
  transition: opacity 120ms linear;
  background: transparent;
}
.layer.idle-vid.playing { opacity: 1; }
.layer.idle-vid.hidden-idle { opacity: 0; }

#hotDebug {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
}
.hot-zone {
  position: absolute; border: 1.5px dashed var(--hot-border);
  background: var(--hot); border-radius: 10px;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 3px 5px; font-size: 10px; color: #e8fbff; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  overflow: hidden;
}
.hot-zone.hold { border-style: solid; background: rgba(255, 180, 80, 0.28); border-color: rgba(255, 190, 90, 0.95); }
.hot-zone.z-hips_private { background: rgba(180, 40, 120, 0.28); border-color: rgba(255, 100, 180, 0.9); }
.hot-zone.z-chest { background: rgba(255, 100, 140, 0.25); }
.hot-zone.z-calf_foot { background: rgba(100, 220, 180, 0.22); border-color: rgba(120, 240, 200, 0.85); }
.hot-zone.z-belly { background: rgba(255, 180, 60, 0.2); }
.hot-zone.hit {
  animation: zoneHit 420ms ease-out;
}
@keyframes zoneHit {
  0% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0.0); filter: brightness(1); }
  35% { box-shadow: inset 0 0 24px rgba(255,255,255,0.35); filter: brightness(1.25); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0.0); filter: brightness(1); }
}

.zone-pulse {
  position: absolute; z-index: 4; pointer-events: none;
  border-radius: 14px;
  border: 2px solid rgba(255,92,138,0.85);
  box-shadow: 0 0 24px rgba(255,92,138,0.45);
  animation: pulseRing 700ms ease-out;
}
@keyframes pulseRing {
  0% { opacity: 0.9; transform: scale(0.92); }
  100% { opacity: 0; transform: scale(1.08); }
}

.react-flash {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  text-shadow: 0 4px 18px rgba(255,92,138,0.8);
  background: radial-gradient(circle at center, rgba(255,92,138,0.16), transparent 55%);
  animation: flash 700ms ease-out;
}
.react-flash.sticky {
  animation: none; opacity: 1;
  background: radial-gradient(circle at 50% 22%, rgba(255,160,90,0.28), transparent 50%);
}
.react-flash.c-pink { background: radial-gradient(circle at center, rgba(255,120,180,0.22), transparent 55%); }
.react-flash.c-rose { background: radial-gradient(circle at 50% 34%, rgba(255,80,120,0.28), transparent 50%); }
.react-flash.c-violet { background: radial-gradient(circle at 50% 14%, rgba(180,120,255,0.25), transparent 50%); }
.react-flash.c-amber { background: radial-gradient(circle at 50% 44%, rgba(255,180,60,0.22), transparent 50%); }
.react-flash.c-cyan { background: radial-gradient(circle at center, rgba(80,220,255,0.2), transparent 55%); }
.react-flash.c-coral { background: radial-gradient(circle at 50% 62%, rgba(255,120,100,0.24), transparent 50%); }
.react-flash.c-mint { background: radial-gradient(circle at 50% 82%, rgba(100,255,200,0.2), transparent 50%); }
.react-flash.c-deep { background: radial-gradient(circle at 50% 54%, rgba(160,40,100,0.32), transparent 50%); }
.react-flash.c-warm { background: radial-gradient(circle at 50% 24%, rgba(255,150,80,0.3), transparent 50%); }
@keyframes flash {
  0% { opacity: 0; transform: scale(0.96); }
  20% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}

.react-hud {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 10; pointer-events: none;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(20,20,28,0.78); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
  animation: hudIn 700ms ease-out;
}
.react-hud.sticky {
  animation: none; opacity: 1;
  background: rgba(60, 30, 10, 0.85);
  border: 1px solid rgba(255,180,90,0.55);
}
.react-hud.c-deep { background: rgba(40,10,28,0.85); }
.react-hud.c-rose { background: rgba(50,10,24,0.82); }
.react-hud.c-warm { background: rgba(60,30,10,0.85); border: 1px solid rgba(255,180,90,0.45); }
@keyframes hudIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.placeholder-tag {
  position: absolute; top: 10px; right: 10px; z-index: 11;
  font-size: 10px; padding: 4px 8px; border-radius: 8px;
  background: rgba(0,0,0,0.55); color: #ffd59a; pointer-events: none;
}

.hud { padding: 12px 4px 0; }
.hud-row {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.hud-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.hint { margin: 8px 0 4px; font-size: 13px; line-height: 1.45; color: #d7d7e2; }
.honest { margin: 0; font-size: 11px; line-height: 1.4; color: #7f7f93; }
