.street-only {
  display: none;
}

.chapter-only { display: none; }
.street-campaign .chapter-only { display: block; }
.street-campaign .chapter-legacy { display: none; }

.street-campaign #startScreen .best-line,
.street-campaign .hud-right > .hud-row,
.street-campaign .hud-left > .hud-row { display: none; }

.street-campaign #startScreen .subtitle { margin-bottom: 1.28rem; }

.chapter-hud {
  position: fixed;
  z-index: 11;
  top: 56px;
  left: 50%;
  width: min(315px, 54vw);
  transform: translateX(-50%);
  padding: .55rem .70rem .46rem;
  border-left: 3px solid #e0ac67;
  background: rgba(21, 39, 33, .94);
  color: #f1e7c9;
  pointer-events: none;
}

.chapter-hud h2 {
  font-size: .89rem;
  line-height: 1.25;
  font-weight: 800;
}

.chapter-hud-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .15rem .65rem;
  margin: .26rem 0 .35rem;
  font-size: .75rem;
}

#chapterHudTime { font-variant-numeric: tabular-nums; }

.street-campaign #chapterTurnGuide .street-turn {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .2rem;
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  font-size: .79rem;
}

.street-campaign #chapterTurnGuide .street-turn-row { gap: .3rem; }
.street-campaign #chapterTurnGuide .street-turn button {
  margin: 0;
  min-width: 0;
  padding: .25rem .52rem;
  white-space: nowrap;
}

.chapter-goal-done { color: #bdeb9e; }
.chapter-hud progress {
  display: block;
  width: 100%;
  height: 3px;
  border: 0;
  color: #e6b977;
  accent-color: #e6b977;
  background: #506558;
}

.chapter-hud progress::-webkit-progress-bar { background: #506558; }
.chapter-hud progress::-webkit-progress-value { background: #e6b977; }

.chapter-panel #chapterDetail {
  margin: 0 auto 1.2rem;
  max-width: 32ch;
  line-height: 1.65;
}

.street-campaign #chapterScreen { z-index: 28; }

.street-campaign .bubble {
  top: auto;
  bottom: 24px;
  left: 50%;
  max-width: min(360px, 82vw);
  padding: .36rem .72rem;
  font-size: clamp(13px, 2vw, 16px);
  text-align: center;
  white-space: normal;
  pointer-events: none;
  border-left: 3px solid #e0ac67;
}

.menu-sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

#streetFeedbackLayer {
  position: fixed;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  overflow: hidden;
}

.sf-pop {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, 0);
  padding: .18rem .52rem;
  border-radius: 2px;
  font-weight: 800;
  font-size: clamp(15px, 2.8vw, 20px);
  color: #fff6d6;
  background: rgba(21, 39, 33, .82);
  border-left: 3px solid #e0ac67;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  white-space: nowrap;
  opacity: 0;
}

.sf-pop.sf-gold { color: #ffe07d; border-color: #ffd15c; }
.sf-pop.sf-turn { color: #c4f39a; border-color: #8ee068; }
.sf-pop.sf-wave { top: 28%; font-size: clamp(16px, 3vw, 22px); border-color: #aa3f27; }

.sf-pop.sf-run {
  animation: sfFloatUp .88s cubic-bezier(.16, .84, .32, 1) forwards;
}

@keyframes sfFloatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.9); }
  18% { opacity: 1; transform: translate(-50%, -4px) scale(1.04); }
  75% { opacity: 1; transform: translate(-50%, -26px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(.96); }
}

#streetSpeedLines {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s ease;
  background: radial-gradient(circle at 50% 52%, transparent 52%, rgba(255, 222, 130, .18) 88%, rgba(255, 202, 88, .32) 100%);
}

#streetSpeedLines.active { opacity: 1; }

#streetDangerGlow {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 108%, rgba(190, 38, 28, .55) 0%, rgba(160, 26, 22, .18) 38%, transparent 68%);
}

.voice-panel {
  width: min(580px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

.voice-sub {
  margin: .3rem 0 .7rem;
  font-size: .82rem;
  color: var(--muted, #5c6659);
  line-height: 1.45;
}

.voice-list {
  flex: 1;
  overflow-y: auto;
  max-height: 52vh;
  margin-bottom: .8rem;
  border: 1px solid #a59871;
  background: #f5eacf;
  border-radius: 2px;
}

.voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem .65rem;
  border-bottom: 1px solid #d7caa4;
  text-align: left;
}

.voice-row:last-child { border-bottom: 0; }
.voice-meta { min-width: 0; flex: 1; }
.voice-name { font-weight: 700; font-size: .9rem; color: var(--ink, #162925); }
.voice-trig { font-size: .75rem; color: #637264; margin-top: .1rem; }
.voice-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .32rem;
  font-size: .7rem;
  border-radius: 2px;
  background: #aa3f27;
  color: #fff3d6;
}
.voice-btns { display: flex; gap: .32rem; flex-shrink: 0; }
.voice-btns .btn {
  min-height: 34px;
  padding: .28rem .55rem;
  font-size: .78rem;
}
.voice-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.voice-batch-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .55rem;
}

.career-summary {
  margin: -.4rem 0 .9rem;
  padding: .32rem .55rem;
  font-size: .78rem;
  color: #374e40;
  background: rgba(245, 234, 207, .78);
  border-left: 3px solid #aa3f27;
  font-variant-numeric: tabular-nums;
}

.career-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .42rem;
  margin: .45rem 0 .7rem;
}

.career-card {
  padding: .42rem .5rem;
  border: 1px solid #a59871;
  background: #f5eacf;
  border-radius: 2px;
  text-align: center;
}

.career-val {
  font-size: .95rem;
  font-weight: 800;
  color: #162925;
  font-variant-numeric: tabular-nums;
}

.career-label {
  font-size: .72rem;
  color: #637264;
  margin-top: .1rem;
}

@media (max-width: 520px) {
  .career-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.street-campaign .tip {
  top: 165px;
  padding: .4rem .66rem;
  font-size: 13px;
}

.street-campaign .egg-toast {
  inset: auto 14px 19px auto;
  max-width: min(225px, 45vw);
  padding: .46rem .62rem;
  border: 1px solid #e0ac67;
  border-radius: 2px;
  background: #233d31;
  color: #f7e9c6;
  font-size: 12px;
  transform: translateY(6px);
}

.street-campaign .egg-toast.show { transform: translateY(0); }

.street-campaign .invuln-tag {
  inset: auto 14px 62px auto;
  border: 1px solid #edc784;
  border-radius: 2px;
  background: #3f3b29;
  color: #f8e8c5;
  animation: none;
  transform: none;
}

@media (max-width: 600px) {
  .chapter-hud {
    top: 79px;
    width: min(282px, 73vw);
  }
  .street-campaign .chase-wrap { top: 52px; width: min(200px, 62vw); }
  .street-campaign .bubble { top: auto; bottom: 102px; }
  .street-campaign .tip { top: 200px; }
}

.street-ui {
  --ink: #162925;
  --paper: #e9dfbd;
  --muted: #637264;
  --seal: #aa3f27;
  --lit: #f0b86f;
  --glass: rgba(21, 39, 33, .91);
  --display: "YouYuan", "STKaiti", "KaiTi", "Songti SC", serif;
}

.street-ui .street-only {
  display: block;
}

.street-ui .screen {
  background: rgba(10, 22, 19, .69);
}

.street-ui #startScreen {
  justify-content: flex-start;
  align-items: flex-end;
  padding: 5vh 6vw 10vh;
  background: linear-gradient(90deg, rgba(12, 29, 24, .69), transparent 72%);
}

.street-ui .panel {
  width: min(480px, 92vw);
  padding: clamp(20px, 4.5vw, 40px);
  border: 1px solid #bfb188;
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 16px 50px #0918127a;
}

.street-ui #startScreen .panel {
  position: relative;
  overflow: hidden;
  text-align: left;
  border-top: 5px solid var(--seal);
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, #60523416 25px 26px),
    var(--paper);
}

.street-ui .title {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(46px, 8vw, 78px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.075em;
  text-shadow: 1px 1px 0 #aa9b6a;
}

.street-ui .subtitle {
  width: fit-content;
  margin: .68rem 0 1.25rem;
  padding: .2rem .65rem .22rem;
  color: #f4e8c7;
  background: var(--seal);
  font-size: clamp(14px, 3.8vw, 17px);
  letter-spacing: .1em;
  transform: rotate(-2deg);
}

.street-ui .best-line {
  margin: 0 0 1rem;
  color: #374e40;
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}

.street-ui .btn {
  min-height: 44px;
  padding: .65rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  box-shadow: none;
  color: #f8edcf;
  font-size: 16px;
  line-height: 1.2;
}

.street-ui #startBtn {
  display: block;
  width: 100%;
  margin: 0 0 .68rem;
  color: var(--paper);
  background: var(--ink);
  text-align: left;
}

.street-ui #startBtn::after {
  content: '→';
  float: right;
  color: var(--lit);
}

.street-ui .btn-small,
.street-ui .btn-ghost {
  color: var(--ink);
  background: transparent;
}

.street-ui .btn:active,
.street-ui .btn:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--seal);
}

.street-ui .btn:disabled {
  opacity: .5;
  cursor: wait;
}

.street-ui button:focus-visible {
  outline: 2px solid #d38b42;
  outline-offset: 3px;
}

.street-ui .story-title,
.street-ui .egg-title,
.street-ui .help-title,
.street-ui .over-title,
.street-ui .pause-title {
  font-family: var(--display);
  color: var(--ink);
  text-shadow: none;
  letter-spacing: .03em;
}

.street-ui .help-panel { width: min(620px, 94vw); }
.street-ui .egg-panel { width: min(580px, 94vw); }
.street-ui .stat, .street-ui .egg-item, .street-ui .items {
  border-radius: 2px;
  border: 1px solid #a59871;
  background: #f5eacf;
  color: var(--ink);
}

.street-ui #hud {
  align-items: flex-start;
  color: #fff5db;
  text-shadow: none;
}

.street-ui .hud-left {
  padding: .50rem .75rem;
  border-left: 3px solid var(--lit);
  background: var(--glass);
  font-variant-numeric: tabular-nums;
}

.street-ui .hud-score {
  margin-bottom: .3rem;
  color: #fff5db;
  font-size: clamp(18px, 4.6vw, 23px);
}

.street-ui .hud-row {
  color: #f0e3bf;
  font-size: 12px;
}

.street-ui .hud-right > .hud-row {
  width: fit-content;
  margin-left: auto;
  margin-bottom: .3rem;
  padding: .22rem .48rem;
  background: var(--glass);
}

.street-ui .chase-wrap {
  border: 1px solid #ddd3ae52;
  border-radius: 2px;
  background: var(--glass);
}

.street-ui .icon-btn,
.street-ui .skill-btn,
.street-ui .skill-slot,
.street-ui .skill-wrap,
.street-ui .street-turn,
.street-ui .tip,
.street-ui .bubble {
  border-radius: 2px;
}

.street-ui .icon-btn {
  min-width: 44px;
  min-height: 42px;
  color: #f7e9c3;
  background: var(--glass);
  border-color: #d4c69d6f;
}

.street-ui .skill-wrap { background: var(--glass); }
.street-ui .skill-btn { background: var(--lit); color: #222316; }
.street-ui .bubble { background: var(--glass); color: #fff2d1; }
.street-ui .bubble.big { background: var(--seal); }
.street-ui .tip { background: var(--glass); }
.street-ui .street-turn:not(.street-turn-ready):not(.street-turn-confirmed) { border-color: #d4c69d; }
.street-ui .street-turn-help { display: block; }

.street-load {
  position: fixed;
  z-index: 75;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: .55rem .85rem;
  width: max-content;
  max-width: 90vw;
  border-left: 3px solid #e3a86a;
  background: #192e27;
  color: #f3e6c6;
  font-size: .9rem;
}

@media (max-width: 600px) {
  .street-ui #startScreen {
    justify-content: center;
    padding: 0 0 max(11vh, 54px);
    background: linear-gradient(0deg, #10221bd9, transparent 78%);
  }
  .street-ui #startScreen .panel { width: min(440px, 89vw); }
  .street-ui #hud { padding: 9px; }
  .street-ui .icon-btn { min-width: 42px; min-height: 40px; }
}

.street-turn-banner {
  position: fixed;
  z-index: 62;
  top: clamp(72px, 14vh, 118px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border: 2px solid #9cf07c;
  border-radius: 6px;
  background: rgba(20, 44, 34, 0.92);
  color: #f6ffea;
  font: 700 1.08rem/1.35 system-ui, -apple-system, "PingFang SC", sans-serif;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42), 0 0 18px rgba(156, 240, 124, 0.35);
  cursor: pointer;
  white-space: nowrap;
  animation: streetTurnPulse 0.65s ease-in-out infinite alternate;
}
.street-turn-banner.is-elephant {
  border-color: #ffd35c;
  background: rgba(58, 34, 14, 0.92);
  color: #fff3cf;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.44), 0 0 18px rgba(255, 211, 92, 0.38);
}
@keyframes streetTurnPulse {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.05); }
}

/* 3D 前情提要过场遮罩 */
.prequel-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: #0d1412;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.prequel-overlay.is-closing {
  opacity: 0;
  transform: scale(1.045);
  pointer-events: none;
}
.prequel-overlay.is-closing .prequel-top {
  transform: translateY(-28px);
  opacity: 0;
}
.prequel-overlay.is-closing .prequel-bottom {
  transform: translateY(28px);
  opacity: 0;
}
.prequel-overlay.hidden { display: none; }
#prequelCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.prequel-storyboard {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0d1412;
}
.prequel-story-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.55s ease;
}
.prequel-story-img.is-active {
  opacity: 1;
  animation: prequelKenBurns 5.2s ease-out forwards;
}
@keyframes prequelKenBurns {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.11) translate(-1.2%, -0.8%); }
}
.prequel-storyboard.is-shaking {
  animation: prequelShake 0.14s linear infinite;
}
@keyframes prequelShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-6px, 4px); }
  50% { transform: translate(6px, -4px); }
  75% { transform: translate(-4px, -3px); }
  100% { transform: translate(4px, 3px); }
}
.prequel-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.prequel-flash.is-red { background: rgba(220, 38, 38, 0.38); opacity: 1; }
.prequel-flash.is-white { background: rgba(255, 255, 255, 0.72); opacity: 1; }
.prequel-top,
.prequel-bottom {
  position: relative;
  z-index: 2;
  padding: 14px clamp(14px, 3vw, 28px);
  color: #fff6de;
  font-family: system-ui, -apple-system, "PingFang SC", sans-serif;
  transition: transform 0.55s ease, opacity 0.55s ease;
}
.prequel-top {
  background: linear-gradient(180deg, rgba(10, 18, 15, 0.88) 0%, rgba(10, 18, 15, 0) 100%);
}
.prequel-bottom {
  background: linear-gradient(0deg, rgba(10, 18, 15, 0.94) 0%, rgba(10, 18, 15, 0.72) 68%, rgba(10, 18, 15, 0) 100%);
  padding-top: 28px;
}
.prequel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.prequel-title {
  font-weight: 800;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  letter-spacing: 0.04em;
  color: #facc15;
}
.prequel-actions-top { display: flex; gap: 8px; align-items: center; }
.prequel-audio-hint,
.prequel-audio-btn {
  border: 1px solid rgba(250, 204, 21, 0.55);
  background: rgba(20, 36, 30, 0.86);
  color: #fef3c7;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.prequel-audio-hint {
  background: #b45309;
  color: #fffbeb;
  animation: streetTurnPulse 0.75s ease-in-out infinite alternate;
}
.prequel-acts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.prequel-act {
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 246, 222, 0.65);
}
.prequel-act.is-active {
  background: #eab308;
  color: #1c1917;
  font-weight: 800;
}
.prequel-act.is-done {
  background: rgba(132, 204, 22, 0.25);
  color: #d9f99d;
}
.prequel-sub-box {
  max-width: 780px;
  margin: 0 auto 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(12, 22, 18, 0.84);
  border-left: 4px solid #facc15;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  line-height: 1.45;
}
.prequel-speaker {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 4px;
  background: #b91c1c;
  color: #fff;
  font-weight: 800;
  font-size: 0.88em;
}
.prequel-foot {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.prequel-progress-wrap { flex: 1 1 260px; }
.prequel-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.prequel-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #84cc16);
  transition: width 0.16s linear;
}
.prequel-progress-text {
  margin-top: 5px;
  font-size: 0.8rem;
  color: #e5e7eb;
}
.prequel-skip-btn {
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(55, 65, 81, 0.85);
  color: #e5e7eb;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: not-allowed;
}
.prequel-skip-btn.is-ready {
  border-color: #bef264;
  background: #65a30d;
  color: #f7fee7;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .street-ui *, .street-ui *::before, .street-ui *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
