/* 《The Fake Billionaire》— Dark luxury yacht / evening cinematic */

:root {
  --bg-deep: #05080f;
  --bg-navy: #0a1220;
  --bg-card: #121c2e;
  --gold: #c9a227;
  --gold-soft: #e8d48b;
  --gold-dim: rgba(201, 162, 39, 0.35);
  --text: #e8e6e0;
  --text-muted: #9aa3b5;
  --accent-line: rgba(201, 162, 39, 0.5);
  --danger: #8b3a4a;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --max-w: 430px;
  --font: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(30, 50, 90, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(80, 50, 20, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-navy) 0%, var(--bg-deep) 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Soft vignette */
#app::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 0;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  padding: 20px 20px calc(24px + var(--safe-area-bottom));
  z-index: 10;
}

.screen.active {
  display: flex;
}

/* ——— Title ——— */
#screen-title {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.title-ornament {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 8px auto;
}

.game-title {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-soft);
  text-shadow: 0 0 40px rgba(201, 162, 39, 0.35);
  user-select: none;
  -webkit-user-select: none;
}

.game-title-cn {
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-top: 4px;
}

.game-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.85;
}

.btn {
  appearance: none;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.18), rgba(201, 162, 39, 0.06));
  color: var(--gold-soft);
  font-family: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.15em;
  padding: 16px 36px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 52px;
  min-width: 180px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.97);
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.25);
  outline: none;
}

.btn-primary {
  margin-top: 36px;
}

.btn-block {
  width: 100%;
  display: block;
  text-align: left;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  padding: 16px 18px;
  min-height: 56px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, rgba(18, 28, 46, 0.95), rgba(10, 18, 32, 0.9));
  border: 1px solid rgba(201, 162, 39, 0.28);
  color: var(--text);
}

.btn-block:hover,
.btn-block:focus-visible {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(30, 42, 64, 0.98), rgba(14, 22, 38, 0.95));
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  margin-top: 12px;
}

/* ——— Top bar / progress ——— */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.progress-dots {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.2);
  transition: background 0.3s, box-shadow 0.3s;
}

.progress-dots .dot.done {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.progress-dots .dot.current {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.6);
}

.node-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

.critical-tag {
  font-size: 0.65rem;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.1em;
  margin-left: 6px;
  vertical-align: middle;
}

/* ——— Scene / video placeholder ——— */
.scene-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 3;
}

.video-slot {
  flex: 1;
  min-height: 180px;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 162, 39, 0.22);
  background:
    linear-gradient(145deg, rgba(25, 40, 70, 0.9) 0%, rgba(8, 12, 22, 0.95) 50%, rgba(40, 28, 18, 0.5) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.video-slot.has-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-slot .slot-shine {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(201, 162, 39, 0.08), transparent 70%);
  pointer-events: none;
}

.slot-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold-soft);
  margin-bottom: 8px;
  position: relative;
  z-index: 5;
  background: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 1px 3px #000;
}

.slot-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  opacity: 0.92;
  position: relative;
  z-index: 5;
  white-space: pre-wrap;
  background: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 1px 3px #000;
}

.progress-bar-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width linear;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.5);
}

.skip-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  opacity: 0.7;
  letter-spacing: 0.06em;
}

/* ——— Choices ——— */
.choices-panel {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  max-height: 48%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 3;
}

.choices-panel.hidden {
  display: none;
}

.choice-prompt {
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  text-align: center;
}

/* ——— Feedback toast ——— */
.feedback-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.feedback-overlay.show {
  opacity: 1;
  visibility: visible;
}

.feedback-card {
  background: linear-gradient(160deg, rgba(20, 30, 48, 0.98), rgba(10, 14, 24, 0.98));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.feedback-label {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

.feedback-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

/* ——— Ending ——— */
#screen-ending {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
  z-index: 3;
}

.ending-badge {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 6px 14px;
  border-radius: 999px;
}

.ending-title {
  font-size: 1.5rem;
  color: var(--gold-soft);
  font-weight: 600;
}

.ending-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
  opacity: 0.9;
  max-width: 340px;
  margin: 8px 0;
}

.ending-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* ——— Debug ——— */
.debug-fab {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(255, 255, 255, 0.15);
  font-size: 10px;
  cursor: pointer;
  z-index: 60;
  touch-action: manipulation;
}

.debug-panel {
  position: absolute;
  top: 40px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  color: var(--gold-soft);
  z-index: 60;
  display: none;
  line-height: 1.5;
}

.debug-panel.visible {
  display: block;
}

/* ——— Utility ——— */
.hidden {
  display: none !important;
}

@media (min-width: 480px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
  }
  #app {
    height: min(100dvh, 900px);
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.15), 0 24px 80px rgba(0, 0, 0, 0.7);
    overflow: hidden;
  }
}

.btn-skip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  appearance: none;
  border: 1px solid rgba(232, 212, 139, 0.75);
  background: rgba(0,0,0,0.55);
  color: #e8d48b;
  font: inherit;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.btn-skip.hidden { display: none !important; }
.choice-on-image {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice-on-image.hidden { display: none !important; }
.choice-on-image button {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(201,162,39,0.45);
  background: rgba(10, 16, 28, 0.82);
  color: #e8e6e0;
  font: inherit;
  cursor: pointer;
}
.video-slot.has-video img.slot-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.slot-title, .slot-body { position: relative; z-index: 3; }

.video-slot.fb-standby-frame { padding: 0; }
.video-slot .fb-standby-title,
.video-slot .fb-standby-body {
  position: absolute; z-index: 4; margin: 0; padding: 0 4px;
  background: transparent !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 1px 3px #000;
  white-space: pre-wrap; pointer-events: none;
}
.video-slot .fb-standby-choices,
.choice-on-image.fb-standby-choices {
  position: absolute; z-index: 5; display: flex; flex-direction: column;
  left: auto; right: auto; bottom: auto;
}


.fb-choice-btn[data-style="solid"] {
  border: 1px solid rgba(201,162,39,0.55); background: rgba(18,28,46,0.95); color: #e8e6e0;
}
.fb-choice-btn[data-style="outline"] {
  border: 1px solid rgba(232,212,139,0.85); background: transparent; color: #e8d48b;
}


.fb-choice-btn {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  padding: 10px calc(var(--fb-bar-width, 5px) + 8px) 10px var(--fb-card-pad-x, 4px);
  border-radius: var(--fb-card-radius, 10px);
  font: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-height: var(--fb-card-min-h, 48px);
}
.fb-choice-btn[data-style="glass"] {
  border: 1px solid rgba(232, 232, 232, 0.28);
  background: rgba(10, 16, 28, 0.72);
  color: #e8e6e0;
}
.fb-choice-btn[data-style="solid"] {
  border: 1px solid rgba(201,162,39,0.35);
  background: rgba(18, 28, 46, 0.94);
  color: #e8e6e0;
}
.fb-choice-btn[data-style="outline"] {
  border: 1px solid rgba(232,212,139,0.65);
  background: rgba(0,0,0,0.28);
  color: #e8e6e0;
}
.fb-choice-letter {
  flex: 0 0 auto;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-size: var(--fb-letter-size, 28px);
  font-weight: 600;
  line-height: 1;
  color: var(--fb-choice-color, #c9a227);
  opacity: var(--fb-letter-opacity, 0.55);
  padding: 0;
  margin: 0;
  min-width: 0.75em;
  width: 0.85em;
  text-align: left;
}
.fb-choice-label {
  flex: 1 1 auto;
  font-size: var(--fb-label-size, 14px);
  line-height: 1.35;
  color: #f2f0ea;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.fb-choice-bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--fb-bar-width, 5px);
  background: var(--fb-choice-color, #c9a227);
  border-radius: 0 var(--fb-card-radius, 10px) var(--fb-card-radius, 10px) 0;
  margin: 0;
  pointer-events: none;
}
.layout-choices .fb-choice-btn { pointer-events: none; }


/* ——— Choice transitions (image-only) ——— */
.fb-fx-stage {
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform, filter, opacity;
}
.fb-softflash-layer {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(255, 248, 240, 0.78) 42%,
      rgba(255, 255, 255, 0.2) 78%,
      rgba(255, 255, 255, 0) 100%);
  transition: opacity 0.7s ease-out;
  mix-blend-mode: screen;
}
.fb-softflash-layer.on { opacity: 1; }
.fb-softflash-hide {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease-out !important;
}
.fb-fx-active { perspective: 900px; overflow: hidden; }

/* softflash */
.fb-fx-softflash.fb-softflashing .fb-fx-stage.go,
.fb-fx-softflash.fb-softflashing img.slot-media,
.fb-fx-softflash.fb-softflashing img.lp-media {
  filter: blur(5px) brightness(1.22) saturate(1.05);
  transform: scale(1.04);
  transition: filter 0.7s ease-out, transform 0.85s ease-out;
}

/* spin-y: card flip */
.fb-fx-spin-y .fb-fx-stage.go {
  transition: transform 1s cubic-bezier(0.4, 0.0, 0.2, 1), filter 0.85s ease-out, opacity 0.85s ease-out;
  transform: rotateY(95deg) scale(1.05);
  filter: blur(3px) brightness(1.35);
  opacity: 0.35;
}

/* spin-z: flat spin out */
.fb-fx-spin-z .fb-fx-stage.go {
  transition: transform 1s cubic-bezier(0.45, 0.05, 0.55, 0.95), filter 0.9s ease-out, opacity 0.9s ease-out;
  transform: rotate(125deg) scale(0.55);
  filter: blur(4px) brightness(1.4);
  opacity: 0.25;
}

/* swirl: rotate + zoom into white */
.fb-fx-swirl .fb-fx-stage.go {
  transition: transform 1.05s cubic-bezier(0.33, 0.0, 0.2, 1), filter 0.95s ease-out, opacity 0.9s ease-out;
  transform: rotate(220deg) scale(1.55);
  filter: blur(8px) brightness(1.5);
  opacity: 0.2;
}

/* prism: skewed diagonal spin */
.fb-fx-prism .fb-fx-stage.go {
  transition: transform 1s cubic-bezier(0.4, 0.0, 0.2, 1), filter 0.9s ease-out, opacity 0.85s ease-out;
  transform: rotateY(-70deg) rotateZ(18deg) skewX(-8deg) scale(1.1);
  filter: blur(4px) brightness(1.35) contrast(1.1);
  opacity: 0.3;
}

.fb-trans-select {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #121826;
  color: #e8d48b;
  border: 1px solid rgba(201,162,39,.35);
}


/* Start-game gate: flashing title */
.slot-title.fb-flash-title,
.fb-flash-title {
  animation: fbTitlePulse 1.4s ease-in-out infinite;
}
@keyframes fbTitlePulse {
  0%, 100% { opacity: 1; text-shadow: 0 2px 12px rgba(0,0,0,0.9), 0 0 12px rgba(232,212,139,0.35); }
  50% { opacity: 0.35; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
}
.video-slot.fb-start-gate { cursor: pointer; }


/* Options appear: 叠化 dissolve */
.fb-dissolve-veil {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: #05080f;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.fb-dissolve-veil.on {
  opacity: 1;
}
.fb-dissolve-veil.on.out {
  opacity: 0;
}
/* old dissolve fade-in replaced by crossfade */


/* Free ABC modules */
.layout-choices-host {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.layout-choice-card {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  border: 1px dashed rgba(126,200,227,0.7);
  background: rgba(0,0,0,0.08);
  cursor: grab;
  pointer-events: auto;
  padding: 0;
  min-height: 0;
}
.layout-choice-card.dragging,
.layout-choice-card.selected {
  border-color: #7ec8e3;
  background: rgba(20,50,70,0.25);
  box-shadow: 0 0 0 1px rgba(126,200,227,0.35);
}
.layout-choice-card .fb-choice-btn {
  pointer-events: none;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
}
.layout-resize {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 3px 0 3px 0;
  background: #7ec8e3;
  cursor: nwse-resize;
  z-index: 8;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.lay-slot-panel {
  margin: 6px 0 10px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(126,200,227,0.35);
  background: rgba(18,28,46,0.6);
}
.fb-choices-free {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  pointer-events: none;
}
.fb-choices-free .fb-choice-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  min-height: 0 !important;
  height: 100%;
}
.fb-choices-stack {
  display: flex !important;
  flex-direction: column;
}


/* Options appear: crossfade (交叉淡化) */
.fb-crossfade-out {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.72s ease;
  background: transparent;
}
.fb-crossfade-out.fade {
  opacity: 0;
}
.fb-crossfade-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Incoming stays opaque under the fading snapshot — avoids mid-crossfade black. */
.fb-crossfade-host .slot-media,
.fb-crossfade-host .lp-media,
.fb-crossfade-host .choice-on-image,
.fb-crossfade-host .fb-standby-choices,
.fb-crossfade-host .fb-standby-title,
.fb-crossfade-host .fb-standby-body,
.fb-crossfade-host .slot-title,
.fb-crossfade-host .slot-body {
  opacity: 1;
}


.video-slot.fb-standby-frame .slot-title,
.video-slot.fb-standby-frame .slot-body,
.lp-slot.fb-standby-frame .fb-standby-title,
.lp-slot.fb-standby-frame .fb-standby-body {
  position: absolute;
  z-index: 4;
  margin: 0;
  pointer-events: none;
}


/* ——— Cover / Desire FX 0910-31: corner Cover+/-, UP burst vs DOWN gray leaves ——— */
.fb-stat-fx-layer {
  position: absolute;
  left: 0; right: 0; top: 16%;
  z-index: 40;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.fb-stat-chip {
  position: relative;
  width: 140px;
  padding: 10px 8px 12px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(12px) scale(0.88);
  color: #e8d48b;
  overflow: visible;
}
.fb-stat-chip.d { color: #ff8fb0; }
.fb-stat-chip.drain { filter: none; }
.fb-stat-icon {
  width: 64px; height: 64px;
  position: relative; z-index: 3;
  filter: drop-shadow(0 0 14px currentColor) drop-shadow(0 6px 18px rgba(0,0,0,.55));
}
.fb-stat-chip.drain.f { color: #e8d48b; }
.fb-stat-chip.drain.d { color: #ff8fb0; }
.fb-stat-chip.drain .fb-stat-icon {
  filter: drop-shadow(0 0 14px currentColor) drop-shadow(0 6px 18px rgba(0,0,0,.55));
  opacity: 1;
}
.fb-stat-chip.drain .fb-stat-dir {
  color: #9a9aa3;
  text-shadow: 0 2px 10px rgba(0,0,0,.75);
}
.fb-stat-icon svg { width: 100%; height: 100%; display: block; }
.fb-stat-cover-img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.fb-stat-dir {
  position: relative; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.24em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,.75);
}
.fb-stat-arrow {
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}
.fb-stat-chip.boost .fb-stat-arrow { border-bottom: 12px solid currentColor; }
.fb-stat-chip.drain .fb-stat-arrow { border-top: 12px solid currentColor; }

/* corner tips: see refined rules at file end */

/* UP surround */
.fb-stat-burst, .fb-stat-ring {
  position: absolute; left: 50%; top: 38%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; opacity: 0; z-index: 1; pointer-events: none;
}
.fb-stat-burst { background: radial-gradient(circle, currentColor 0%, transparent 70%); }
.fb-stat-ring { border: 2px solid currentColor; width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.fb-stat-sparks, .fb-stat-floats, .fb-stat-leaves {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: visible;
}
.fb-stat-spark {
  position: absolute; left: var(--x); top: var(--y);
  width: 5px; height: 5px; margin: -2px; border-radius: 50%;
  background: currentColor; opacity: 0; box-shadow: 0 0 8px currentColor;
}
.fb-stat-float {
  position: absolute; left: var(--x); top: 48%;
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; opacity: 0;
}

/* DOWN gray leaves */
.fb-stat-ash {
  position: absolute; left: 50%; top: 40%;
  width: 70px; height: 70px; margin: -35px 0 0 -35px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140,140,150,.28) 0%, transparent 70%);
  opacity: 0; z-index: 1; pointer-events: none;
}
.fb-stat-leaf {
  position: absolute;
  left: var(--x); top: 28%;
  width: 14px; height: 18px;
  color: #8e8e98;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.fb-stat-leaf svg { width: 100%; height: 100%; display: block; }


.fb-stat-chip.boost.go { animation: fb-stat-boost 1.45s cubic-bezier(0.2, 0.85, 0.25, 1) forwards; }
.fb-stat-chip.drain.go { animation: fb-stat-drain 1.45s cubic-bezier(0.35, 0.1, 0.25, 1) forwards; }
.fb-stat-chip.boost.go .fb-stat-burst { animation: fb-stat-burst 1.2s ease-out forwards; }
.fb-stat-chip.boost.go .fb-stat-ring { animation: fb-stat-ring 1.15s ease-out forwards; }
.fb-stat-chip.boost.go .fb-stat-spark { animation: fb-stat-spark 1.1s ease-out forwards; animation-delay: var(--d); }
.fb-stat-chip.boost.go .fb-stat-float { animation: fb-stat-rise 1.2s ease-out forwards; animation-delay: var(--d); }
.fb-stat-chip.boost.go .fb-stat-icon { animation: fb-stat-pop-icon 1.45s ease-out forwards; }
.fb-stat-chip.drain.go .fb-stat-ash { animation: fb-stat-ash 1.25s ease-out forwards; }
.fb-stat-chip.drain.go .fb-stat-leaf { animation: fb-stat-leaf-fall 1.35s ease-in forwards; animation-delay: var(--d); }
.fb-stat-chip.drain.go .fb-stat-icon { animation: fb-stat-pop-icon 1.45s ease-out forwards; }

@keyframes fb-stat-boost {
  0% { opacity: 0; transform: translateY(10px) scale(0.92); }
  18% { opacity: 1; transform: translateY(-2px) scale(1.04); }
  48% { opacity: 1; transform: translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateY(-26px) scale(1.02); }
}
@keyframes fb-stat-drain {
  0% { opacity: 0; transform: translateY(-8px) scale(1.04); }
  14% { opacity: 1; transform: translateY(2px) scale(0.98); }
  45% { opacity: 0.95; transform: translateY(12px) scale(0.93); }
  100% { opacity: 0; transform: translateY(28px) scale(0.88); }
}
@keyframes fb-stat-burst {
  0% { opacity: 0.95; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(9); }
}
@keyframes fb-stat-ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(6.5); }
}
@keyframes fb-stat-spark {
  0% { opacity: 0; transform: translate(0,0) scale(0.4) rotate(var(--r)); }
  20% { opacity: 1; transform: translate(0,0) scale(1.2) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(calc((var(--x) - 50%) * 0.9), calc((var(--y) - 42%) * 0.9)) scale(0.3) rotate(var(--r)); }
}
@keyframes fb-stat-rise {
  0% { opacity: 0; transform: translateY(0); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-64px); }
}
@keyframes fb-stat-ash {
  0% { opacity: 0; transform: scale(0.6); }
  25% { opacity: 0.7; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(2.2); }
}
@keyframes fb-stat-leaf-fall {
  0% { opacity: 0; transform: translate(0, -8px) rotate(var(--rot)) scale(0.7); }
  15% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--drift), 72px) rotate(calc(var(--rot) + 120deg)) scale(0.85); }
}
@keyframes fb-stat-pop-icon {
  0%, 100% { transform: scale(1); }
  28% { transform: scale(1.08); }
  55% { transform: scale(1.02); }
}
@keyframes fb-stat-corner {
  0% { opacity: 0; transform: translateY(-10px) scale(0.9); }
  12% { opacity: 1; transform: translateY(0) scale(1.08); }
  70% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-4px) scale(1); }
}
#video-slot, .scene-stage, #app, .lp-phone { position: relative; }
.lp-phone .fb-stat-fx-layer,
#video-slot .fb-stat-fx-layer,
.scene-stage .fb-stat-fx-layer {
  top: 16%;
  z-index: 200;
  overflow: visible;
}
.lp-phone .fb-stat-corner,
#video-slot .fb-stat-corner,
.scene-stage .fb-stat-corner,
#app .fb-stat-corner {
  top: 12px;
  right: 12px;
  z-index: 300;
  overflow: visible;
  gap: 6px;
}
.fb-stat-corner {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 300;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
/* tip base moved to end */
.fb-stat-corner-tip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 10px 5px 11px;
  border-radius: 999px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}
.fb-stat-corner-tip .fb-stat-corner-label {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
}
.fb-stat-corner-tip .fb-stat-corner-sign {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
  min-width: 0.7em;
  text-align: center;
}
.fb-stat-corner-tip.f.plus { color: #f6e09a; background: rgba(20,16,8,.55); box-shadow: inset 0 0 0 1px rgba(243,213,106,.35), 0 4px 14px rgba(0,0,0,.35); }
.fb-stat-corner-tip.d.plus { color: #ffb0c8; background: rgba(28,10,18,.55); box-shadow: inset 0 0 0 1px rgba(255,95,152,.35), 0 4px 14px rgba(0,0,0,.35); }
.fb-stat-corner-tip.minus { color: #d8d8de !important; background: rgba(12,12,16,.55); box-shadow: inset 0 0 0 1px rgba(200,200,210,.28), 0 4px 14px rgba(0,0,0,.35); }
.fb-stat-corner-tip.go {
  /* hold visibility driven by JS for full FX window */
  animation: none !important;
  opacity: 1;
}

/* ——— QTE rapid-tap (CPR trial) ——— */
.fb-qte-layer {
  position: absolute;
  inset: 0;
  z-index: 220;
  pointer-events: none;
}
.fb-qte-top {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 8%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fb-qte-prompt {
  color: #e8d48b;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 2px 10px #000;
}
.fb-qte-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  box-shadow: inset 0 0 0 1px rgba(232,212,139,.35);
  overflow: hidden;
}
.fb-qte-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c9a227, #f6e09a);
  box-shadow: 0 0 12px rgba(246,224,154,.55);
  transition: width .08s linear;
}
.fb-qte-stats {
  display: flex;
  justify-content: space-between;
  color: #e8e6e0;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 2px 8px #000;
}
.fb-qte-hit {
  position: absolute;
  pointer-events: auto;
  appearance: none;
  border: 2px solid rgba(255, 95, 120, .85);
  border-radius: 50%;
  background: rgba(255, 80, 100, .18);
  box-shadow: 0 0 0 6px rgba(255, 80, 100, .12), 0 0 24px rgba(255, 80, 100, .35);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.fb-qte-hit::after {
  content: "TAP";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd0d8;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 8px #000;
}
.fb-qte-hit.pulse {
  animation: fb-qte-pulse .18s ease-out;
}
.fb-qte-layer.is-success .fb-qte-fill { background: linear-gradient(90deg, #5dca8a, #b6f0c8); }
.fb-qte-layer.is-fail .fb-qte-meter { box-shadow: inset 0 0 0 1px rgba(232,120,120,.5); }
@keyframes fb-qte-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.graph-node.type-qte .node-type-tag { color: #ff8fb0; }

.fb-qte-active video.lp-media,
.fb-qte-active video.slot-media,
.fb-qte-active img.lp-media,
.fb-qte-active img.slot-media {
  transform-origin: center center;
  /* no will-change — causes black video on Safari/Chrome */
  opacity: 1 !important;
  visibility: visible !important;
}
.fb-qte-shock {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(255,120,140,.28), transparent 55%);
  opacity: 0;
}
.fb-qte-shock.go {
  animation: fb-qte-shock .2s ease-out;
}
@keyframes fb-qte-shock {
  0% { opacity: .85; }
  100% { opacity: 0; }
}
.fb-qte-stage-0 { --qte-glow: 0; }
.fb-qte-stage-1 { --qte-glow: .2; }
.fb-qte-stage-2 { --qte-glow: .45; }
.fb-qte-stage-3 { --qte-glow: .7; }
.fb-qte-active.fb-qte-stage-2 .fb-qte-hit,
.fb-qte-active.fb-qte-stage-3 .fb-qte-hit {
  box-shadow: 0 0 0 8px rgba(255, 80, 100, calc(.12 + var(--qte-glow) * .2)), 0 0 28px rgba(255, 80, 100, calc(.3 + var(--qte-glow) * .35));
}
.fb-qte-active.fb-qte-stage-3 .fb-qte-fill {
  background: linear-gradient(90deg, #ff6b7a, #f6e09a);
}

/* QTE hit — translucent white phallic silhouette */
.fb-qte-hit {
  position: absolute;
  pointer-events: auto;
  appearance: none;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
}
.fb-qte-hit::after { content: none !important; display: none !important; }
.fb-qte-hit-svg {
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.35));
  pointer-events: none;
}
.fb-qte-hit-fill {
  fill: rgba(255, 255, 255, 0.62);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.fb-qte-hit.pulse .fb-qte-hit-fill {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(255, 255, 255, 0.95);
}
.fb-qte-hit.pulse {
  animation: fb-qte-pulse .18s ease-out;
}
.fb-qte-active.fb-qte-stage-2 .fb-qte-hit,
.fb-qte-active.fb-qte-stage-3 .fb-qte-hit {
  box-shadow: none !important;
}
.fb-qte-active.fb-qte-stage-2 .fb-qte-hit-fill,
.fb-qte-active.fb-qte-stage-3 .fb-qte-hit-fill {
  fill: rgba(255, 255, 255, 0.58);
  stroke: rgba(255, 255, 255, 0.85);
}
.fb-qte-rate {
  font-variant-numeric: tabular-nums;
  color: #f6e09a;
  min-width: 3.2em;
  text-align: center;
}


.fb-qte-hit.fb-qte-hit-phallus {
  min-width: 72px;
  min-height: 110px;
  z-index: 230;
  pointer-events: auto !important;
}

.fb-qte-layer { z-index: 260 !important; }
.lp-phone .fb-qte-layer, #video-slot .fb-qte-layer { z-index: 260 !important; }
.fb-qte-active .lp-title,
.fb-qte-active .lp-body,
.fb-qte-active .fb-standby-title,
.fb-qte-active .fb-standby-body { display: none !important; }



/* 0911-06: force-visible QTE overlay */
.fb-qte-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 400 !important;
  pointer-events: none;
}
.fb-qte-hit {
  z-index: 401 !important;
  min-width: 88px !important;
  min-height: 140px !important;
}
.fb-qte-hit-fill {
  fill: rgba(255, 255, 255, 0.45) !important;
  stroke: #fff !important;
  stroke-width: 3 !important;
}
.fb-qte-hit-svg {
  filter: drop-shadow(0 0 14px rgba(255,255,255,.85)) !important;
}
.fb-qte-active .lp-title,
.fb-qte-active .lp-body,
.fb-qte-active .fb-standby-title,
.fb-qte-active .fb-standby-body { display: none !important; }

/* 0911-07 video visible */
.lp-slot.fb-qte-active video.lp-media,
#video-slot.fb-qte-active video.slot-media {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none;
  z-index: 1 !important;
  background: #000;
}


/* Wake board — three ending odds + this-run hit */
.lp-wake-board {
  position: absolute;
  inset: 10% 8%;
  z-index: 95;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 16px 16px;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid rgba(201, 162, 39, 0.38);
  color: #e8e6e0;
  text-align: center;
  text-shadow: 0 1px 8px #000;
}
.lp-wake-board .wb-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: #9aa3b5;
}
.lp-wake-board .wb-you {
  margin: 0;
  font-size: 12px;
  color: #c9b56a;
}
.lp-wake-board h2 {
  margin: 4px 0 16px;
  color: #e8d48b;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.lp-wake-board ul {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
.lp-wake-board li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #9aa3b5;
}
.lp-wake-board li span { flex: 1; font-size: 14px; }
.lp-wake-board li b {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: #c5c9d4;
}
.lp-wake-board li i {
  font-style: normal;
  font-size: 11px;
  color: #0a1220;
  background: #e8d48b;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 700;
}
.lp-wake-board li.on {
  background: rgba(232, 212, 139, 0.14);
  color: #e8d48b;
  box-shadow: inset 0 0 0 1px rgba(232, 212, 139, 0.35);
}
.lp-wake-board li.on b { color: #f6e09a; }
.lp-wake-board .wb-tap {
  margin: 14px 0 0;
  font-size: 11px;
  color: #8b93a7;
  letter-spacing: 0.12em;
}


.fb-speed {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(201,162,39,.35);
  background: rgba(8,12,22,.72);
  backdrop-filter: blur(8px);
  z-index: 80;
}
.fb-speed-btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: transparent;
  color: #9aa3b5;
  font: 600 11px/1 inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-width: 34px;
}
.fb-speed-btn.on {
  background: rgba(232,212,139,.18);
  color: #e8d48b;
}
.fb-speed.floating {
  position: absolute;
  top: 10px;
  right: 10px;
}
.top-bar .fb-speed { flex-shrink: 0; }
.speed-host {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 52px;
}

/* Ending actions after first playthrough */
.lp-end-actions {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lp-end-btn {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201,162,39,.4);
  background: rgba(10,16,28,.82);
  color: #e8e6e0;
  font: 600 15px/1.2 inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lp-end-btn.primary {
  background: rgba(232,212,139,.16);
  color: #e8d48b;
  border-color: rgba(232,212,139,.55);
}
.ending-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  width: min(320px, 86%);
}
.ending-actions .btn { width: 100%; }
