:root {
  color-scheme: dark;
  --bg: #121213;
  --surface: #1b1b1d;
  --surface-2: #242427;
  --surface-3: #2d2d31;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f0eb;
  --muted: #a4a09a;
  --soft: #d8d1c7;
  --accent: #e8aa78;
  --accent-2: #bf745a;
  --sage: #8fac9b;
  --danger: #ce6d70;
  --gold: #d9b56e;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(191, 116, 90, 0.16), transparent 34%),
    radial-gradient(circle at 90% 95%, rgba(143, 172, 155, 0.12), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#app.low-san-vision :is(
  h1, h2, h3, p, strong, small, label, button, input, textarea, select,
  .eyebrow, .call-status, .bubble, .stat-top, .day-counter, .tutorial-copy,
  .info-empty, .info-item, .toast, .stat-feedback
) {
  text-shadow:
    var(--san-text-ghost) 0 var(--san-text-blur) rgba(206, 109, 112, 0.3),
    calc(var(--san-text-ghost) * -1) 0 var(--san-text-blur) rgba(143, 172, 155, 0.22),
    0 0 var(--san-text-blur) currentColor;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

.splash-screen {
  position: relative;
  display: grid;
  overflow: hidden;
  padding: 32px;
  place-items: center;
  background:
    radial-gradient(circle at 22% 18%, rgba(191, 116, 90, 0.17), transparent 34%),
    linear-gradient(135deg, #171516 0%, #111112 68%);
}

.splash-screen::before,
.splash-screen::after,
.splash-orbit {
  position: absolute;
  border: 1px solid rgba(232, 170, 120, 0.12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.splash-screen::before {
  right: -210px;
  bottom: -360px;
  width: 720px;
  height: 720px;
  box-shadow: 0 0 0 90px rgba(232, 170, 120, 0.018), 0 0 0 190px rgba(232, 170, 120, 0.012);
}

.splash-screen::after {
  top: -320px;
  left: -260px;
  width: 620px;
  height: 620px;
}

.splash-orbit {
  right: 14%;
  bottom: 8%;
  width: 320px;
  height: 320px;
  border-color: rgba(143, 172, 155, 0.07);
}

.splash-content {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  text-align: center;
}

.splash-title {
  margin: 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(58px, 8vw, 112px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.96;
}

.splash-title-line {
  display: block;
  opacity: 0;
  transform: translateY(24px);
  animation: splash-title-reveal 2.2s cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.splash-title-line.second {
  color: var(--accent);
  animation-delay: 0.78s;
}

.splash-hit-area {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.splash-hit-area:focus-visible {
  outline: none;
}

.splash-entry {
  display: flex;
  margin-top: 52px;
  flex-direction: column;
  align-items: center;
  color: rgba(243, 240, 235, 0.72);
}

.splash-circle {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.065), transparent 38%),
    radial-gradient(circle, rgba(132, 129, 126, 0.1), rgba(132, 129, 126, 0.045) 62%, transparent 72%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.13), inset 0 0 18px rgba(255, 255, 255, 0.018);
  opacity: 0;
  backdrop-filter: blur(8px);
  animation:
    splash-circle-reveal 2.6s ease 2.65s forwards,
    splash-circle-float 7.2s ease-in-out 5.25s infinite;
}

.splash-circle::before,
.splash-circle::after {
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(208, 205, 201, 0.11);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.82);
  animation: splash-water-ring 5.8s ease-out 4.9s infinite;
}

.splash-circle::after {
  animation-delay: 7.8s;
}

.splash-enter-label {
  display: block;
  margin-top: 12px;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.32em;
  opacity: 0;
  transform: translateY(10px);
  animation: splash-enter-reveal 1.7s cubic-bezier(0.2, 0.72, 0.2, 1) 2.85s forwards;
}

.splash-hit-area:hover + .splash-content .splash-circle,
.splash-hit-area:focus-visible + .splash-content .splash-circle {
  background-color: rgba(132, 129, 126, 0.055);
}

.splash-hit-area:focus-visible + .splash-content .splash-circle {
  box-shadow: 0 0 0 3px rgba(232, 170, 120, 0.25), 0 16px 42px rgba(0, 0, 0, 0.22);
}

.splash-ripple {
  position: absolute;
  z-index: 4;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(232, 170, 120, 0.72);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  animation: splash-ripple-expand 0.88s ease-out forwards;
}

.splash-ripple::after {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(243, 240, 235, 0.42);
  border-radius: 50%;
  content: "";
  animation: splash-ripple-expand-inner 0.82s ease-out 0.12s forwards;
}

.splash-screen.is-entering .splash-content {
  animation: splash-content-leave 0.86s ease-out forwards;
}

@keyframes splash-title-reveal {
  from { opacity: 0; transform: translateY(24px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes splash-enter-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splash-circle-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes splash-circle-float {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-6px); }
  62% { transform: translateY(-5px); }
}

@keyframes splash-water-ring {
  0% { opacity: 0; transform: scale(0.82); }
  18% { opacity: 0.42; }
  72% { opacity: 0.12; }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes splash-ripple-expand {
  from { opacity: 0.9; transform: translate(-50%, -50%) scale(0.2); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(9); }
}

@keyframes splash-ripple-expand-inner {
  from { opacity: 0.7; transform: scale(0.4); }
  to { opacity: 0; transform: scale(5.8); }
}

@keyframes splash-content-leave {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.setup-screen {
  display: grid;
  padding: clamp(24px, 5vw, 64px);
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(191, 116, 90, 0.13), transparent 34%),
    radial-gradient(circle at 86% 88%, rgba(143, 172, 155, 0.08), transparent 32%),
    #121213;
}

.setup-hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: 8vw;
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.setup-hero::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(232, 170, 120, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(232, 170, 120, 0.025), 0 0 0 130px rgba(232, 170, 120, 0.02);
}

.brand-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(232, 170, 120, 0.35);
  border-radius: 16px;
  color: var(--accent);
  background: rgba(232, 170, 120, 0.08);
  font-size: 22px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.hero-copy h1 {
  max-width: 650px;
  margin: 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(50px, 6.7vw, 104px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.94;
}

.hero-copy h1 span {
  display: block;
  color: var(--accent);
}

.hero-copy .lede {
  max-width: 520px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-footnote {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 28px;
  color: #797671;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.setup-panel {
  display: flex;
  width: min(860px, 100%);
  min-height: auto;
  padding: 48px clamp(28px, 5vw, 76px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  flex-direction: column;
  justify-content: center;
  background: rgba(20, 20, 21, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(24px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC",
    "Microsoft YaHei", sans-serif;
}

.setup-panel .eyebrow {
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.setup-panel h2 {
  margin: 0 0 10px;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.setup-panel > p {
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: grid;
  gap: 9px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.field small {
  color: #74716d;
  font-weight: 400;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.2s, background 0.2s;
}

.field input::placeholder {
  color: #6f6d69;
  font-weight: 400;
}

.field input:hover,
.field input:focus {
  border-color: rgba(232, 170, 120, 0.52);
  background: rgba(255, 255, 255, 0.04);
}

.field input:disabled {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.015);
  color: #8f8b85;
  opacity: 1;
}

.field.emergency-name-field label,
.field.emergency-name-field input {
  color: #df666c;
}

.field.emergency-name-field input {
  border-color: rgba(223, 102, 108, 0.48);
  background: rgba(92, 27, 31, 0.16);
  text-shadow: 0 0 8px rgba(223, 102, 108, 0.24);
}

.field.emergency-name-field input:hover,
.field.emergency-name-field input:focus {
  border-color: rgba(223, 102, 108, 0.76);
  background: rgba(92, 27, 31, 0.22);
}

.difficulty-title {
  margin: 28px 0 12px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.difficulty-select-wrap {
  position: relative;
}

.difficulty-select-wrap::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 1px solid #aaa49c;
  border-bottom: 1px solid #aaa49c;
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.difficulty-select {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 16px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.difficulty-select:hover,
.difficulty-select:focus {
  border-color: rgba(232, 170, 120, 0.52);
  background: rgba(255, 255, 255, 0.04);
}

.difficulty-select[data-difficulty="human"],
.difficulty-option-human {
  color: var(--accent);
}

.difficulty-select[data-difficulty="loop"],
.difficulty-option-loop {
  color: #b86f72;
}

.difficulty-option {
  background: #1b1b1d;
}

.difficulty-option-rational {
  color: var(--text);
}

.difficulty-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.primary-button,
.secondary-button,
.ghost-button,
.choice-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #d88963);
  color: #201814;
  font-weight: 850;
  box-shadow: 0 12px 35px rgba(216, 137, 99, 0.2);
  transition: transform 0.2s, filter 0.2s;
}

.primary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none;
}

.start-button {
  width: 100%;
  margin-top: 24px;
}

.setup-panel .start-button {
  min-height: 52px;
  border: 1px solid rgba(232, 170, 120, 0.28);
  border-radius: 6px;
  background: #a66f52;
  color: #171210;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  box-shadow: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.setup-panel .start-button:hover {
  border-color: rgba(232, 170, 120, 0.52);
  background: #b77a59;
  transform: none;
  filter: none;
}

.setup-panel .start-button:disabled {
  border-color: rgba(255, 255, 255, 0.06);
  background: #2b2725;
  color: #6f6964;
  opacity: 1;
}

.intro-screen {
  display: grid;
  padding: 40px;
  place-items: center;
}

.intro-card {
  width: min(760px, 100%);
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(27, 27, 29, 0.9);
  box-shadow: var(--shadow);
}

.intro-time {
  display: flex;
  margin-bottom: 42px;
  color: var(--accent);
  font-size: 13px;
  justify-content: space-between;
}

.intro-card p.story-line {
  min-height: 150px;
  margin: 0;
  font-family: ui-serif, "Songti SC", serif;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.8;
}

.intro-actions {
  display: flex;
  margin-top: 36px;
  justify-content: flex-end;
}

.message-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  padding: 22px;
  place-items: center;
  background: rgba(5, 5, 6, 0.72);
  backdrop-filter: blur(14px);
}

.message-window {
  display: flex;
  width: min(620px, 100%);
  height: min(740px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  flex-direction: column;
  background: #1d1d20;
  box-shadow: var(--shadow);
}

.message-header {
  display: flex;
  height: 76px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.contact-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #e2ad89, #9c5f52);
  color: #211814;
  font-weight: 900;
}

.contact-block strong,
.contact-block small {
  display: block;
}

.contact-block small {
  margin-top: 3px;
  color: var(--muted);
}

.message-body {
  display: flex;
  flex: 1;
  gap: 12px;
  padding: 28px;
  overflow-y: auto;
  flex-direction: column;
}

.bubble {
  max-width: 76%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.55;
  animation: bubble-in 0.28s ease both;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble.friend {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  background: var(--surface-3);
}

.bubble.player {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: #b97859;
}

.typing {
  display: flex;
  width: 58px;
  gap: 4px;
  justify-content: center;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.reply-area {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: #18181a;
}

.reply-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.reply-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--soft);
  cursor: pointer;
}

.reply-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  border-color: rgba(232, 170, 120, 0.4);
  background: var(--surface-3);
}

.enter-button {
  width: 100%;
  margin-top: 10px;
}

.game-screen {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr;
}

.game-header {
  display: grid;
  min-height: 88px;
  padding: 14px 26px;
  padding-right: 116px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(210px, 0.85fr) minmax(650px, 2.7fr) minmax(145px, 0.65fr);
  gap: 18px;
  align-items: center;
  background: rgba(18, 18, 19, 0.9);
  backdrop-filter: blur(18px);
}

.game-brand strong,
.game-brand small {
  display: block;
}

.game-brand strong {
  font-family: ui-serif, "Songti SC", serif;
  font-size: 18px;
}

.game-brand small {
  margin-top: 5px;
  color: var(--muted);
}

.game-brand .game-difficulty[data-difficulty="human"] {
  color: var(--accent);
}

.game-brand .game-difficulty[data-difficulty="loop"] {
  color: #b86f72;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stat-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.stat-top {
  display: flex;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  justify-content: space-between;
}

.stat-top strong {
  display: inline-block;
  color: var(--text);
  font-size: 12px;
}

.stat-inline-delta {
  margin-left: 6px;
  color: #ef9a9d;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.stat-card.stat-changing {
  animation: stat-card-alert 1.02s ease-out both;
}

.stat-card.stat-changing .stat-top strong {
  animation: stat-number-alert 1.02s ease-out both;
}

.stat-card.stat-changing .meter span {
  animation: stat-meter-alert 1.02s ease-out both;
}

@keyframes stat-card-alert {
  0%, 100% {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: none;
    transform: scale(1);
  }
  20%, 58% {
    border-color: rgba(206, 109, 112, 0.58);
    background: rgba(75, 37, 39, 0.62);
    box-shadow: 0 0 16px rgba(206, 109, 112, 0.18);
    transform: scale(1.018);
  }
}

@keyframes stat-number-alert {
  0%, 100% { color: var(--text); transform: scale(1); }
  22%, 58% { color: #f4b2b4; transform: scale(1.1); }
}

@keyframes stat-meter-alert {
  0%, 100% { filter: brightness(1); }
  22%, 58% { filter: brightness(1.55); }
}

.meter {
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #101011;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.meter.san span,
.meter.anger span,
.meter.energy span,
.meter.stress span {
  background: rgba(243, 240, 235, 0.86);
}

.friend-meter {
  display: flex;
  height: 5px;
  gap: 3px;
}

.friend-pip {
  min-width: 0;
  flex: 1;
  border-radius: 10px;
  background: #101011;
}

.friend-pip.available {
  background: rgba(243, 240, 235, 0.86);
}

.day-counter {
  text-align: right;
}

.day-counter strong,
.day-counter small {
  display: block;
}

.day-counter strong {
  font-size: 20px;
}

.day-counter small {
  margin-top: 5px;
  color: var(--muted);
}

.game-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(560px, 1fr) 300px;
  transition: grid-template-columns 0.28s ease;
}

.game-layout.info-panel-collapsed {
  grid-template-columns: minmax(560px, 1fr) 58px;
}

.side-panel {
  padding: 24px;
  background: rgba(23, 23, 25, 0.82);
}

.side-panel.left {
  border-right: 1px solid var(--line);
}

.side-panel.right {
  position: sticky;
  top: 88px;
  display: flex;
  max-height: calc(100svh - 88px);
  align-self: start;
  overflow: hidden;
  border-left: 1px solid var(--line);
  flex-direction: column;
}

.info-expanded-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.info-collapsed-launch {
  display: none;
  width: 100%;
  min-height: 180px;
  padding: 14px 0;
  border: 0;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  writing-mode: vertical-rl;
}

.info-collapsed-launch strong {
  color: var(--accent);
  font-size: 12px;
}

.info-collapsed-launch i {
  margin-top: auto;
  font-size: 20px;
  font-style: normal;
}

.side-panel.right.is-collapsed {
  padding: 12px 8px;
}

.side-panel.right.is-collapsed .info-expanded-shell {
  display: none;
}

.side-panel.right.is-collapsed .info-collapsed-launch {
  display: flex;
}

.panel-title {
  display: flex;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  justify-content: space-between;
}

.panel-title-controls {
  display: flex;
  gap: 9px;
  align-items: center;
}

.info-panel-actions {
  display: grid;
  margin: -4px 0 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.info-panel-action {
  min-width: 0;
  height: 28px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  color: #96918b;
  cursor: pointer;
  font-size: 9px;
}

.info-panel-action:hover {
  border-color: rgba(232, 170, 120, 0.4);
  color: var(--accent);
}

.info-panel-content {
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.info-add-button {
  display: inline-flex;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
  gap: 3px;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  text-transform: none;
}

.info-add-button span {
  font-size: 15px;
  font-weight: 400;
}

.info-add-button:hover {
  border-color: rgba(232, 170, 120, 0.48);
  color: var(--accent);
}

.profile-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.profile-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-head .avatar {
  background: linear-gradient(145deg, var(--sage), #536d5f);
}

.profile-head strong,
.profile-head small {
  display: block;
}

.profile-head small {
  margin-top: 4px;
  color: var(--muted);
}

.mini-list {
  display: grid;
  margin-top: 18px;
  gap: 10px;
}

.mini-row {
  display: flex;
  color: var(--muted);
  font-size: 13px;
  justify-content: space-between;
}

.mini-row strong {
  color: var(--soft);
}

.friends-block {
  margin-top: 30px;
}

.friend-tokens {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.friend-token {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(143, 172, 155, 0.28);
  border-radius: 50%;
  background: rgba(143, 172, 155, 0.08);
  color: var(--sage);
  font-size: 12px;
}

.main-stage {
  display: flex;
  min-height: calc(100vh - 88px);
  padding: clamp(22px, 3vw, 46px);
  flex-direction: column;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 36px 36px;
}

.stage-top {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-end;
  justify-content: space-between;
}

.stage-top h2 {
  margin: 0;
  font-family: ui-serif, "Songti SC", serif;
  font-size: 30px;
  font-weight: 500;
}

.call-status {
  color: var(--muted);
  font-size: 12px;
}

.story-card {
  display: flex;
  flex: 1;
  min-height: 440px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-direction: column;
  justify-content: space-between;
  background: rgba(27, 27, 29, 0.94);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

@keyframes story-item-reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-card .story-line,
.intro-card .intro-actions,
.story-card > .dialogue-header,
.story-card > .dialogue-body,
.story-card .choice-button,
.story-card .story-sequence > .eyebrow,
.story-card .story-sequence > h3,
.story-card .story-sequence > p:not(.eyebrow),
.story-card .story-sequence .decision-card,
.story-card .incoming-call-content > h3,
.story-card .incoming-call-content > p,
.story-card .incoming-call-content > .missed-call-label,
.story-card .incoming-call-content > .answer-button,
.story-card .missed-message-scene > .message-header,
.story-card .missed-call-system,
.story-card .missed-message-body > .bubble,
.story-card .missed-message-scene > .reply-area {
  opacity: 0;
  transform: translateY(14px);
  animation: story-item-reveal 0.82s cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.intro-card .story-line,
.story-card > .dialogue-header,
.story-card .story-sequence > .eyebrow,
.story-card .incoming-call-content > h3,
.story-card .missed-message-scene > .message-header {
  animation-delay: 0.06s;
}

.story-card > .dialogue-body,
.story-card .story-sequence > h3,
.story-card .incoming-call-content > p,
.story-card .missed-call-system {
  animation-delay: 0.22s;
}

.intro-card .intro-actions,
.story-card .story-sequence > p:not(.eyebrow),
.story-card .incoming-call-content > .missed-call-label,
.story-card .incoming-call-content > .answer-button,
.story-card .missed-message-body > .bubble {
  animation-delay: 0.38s;
}

.story-card .choice-button,
.story-card .story-sequence .decision-card,
.story-card .missed-message-scene > .reply-area {
  animation-delay: 0.52s;
}

.story-card .choice-button:nth-child(2),
.story-card .story-sequence .decision-card:nth-child(2) { animation-delay: 0.64s; }
.story-card .choice-button:nth-child(3),
.story-card .story-sequence .decision-card:nth-child(3) { animation-delay: 0.76s; }
.story-card .choice-button:nth-child(4),
.story-card .story-sequence .decision-card:nth-child(4) { animation-delay: 0.88s; }
.story-card .story-sequence .decision-card:nth-child(5) { animation-delay: 1s; }
.story-card .story-sequence .decision-card:nth-child(6) { animation-delay: 1.12s; }
.story-card .story-sequence .decision-card:nth-child(7) { animation-delay: 1.24s; }
.story-card .story-sequence .decision-card:nth-child(8) { animation-delay: 1.36s; }

.app-shell.feedback-san {
  animation: san-nudge 0.34s ease-out both;
}

.app-shell.feedback-anger:not(.feedback-san) {
  animation: anger-stutter 0.32s steps(2, end) both;
}

.app-shell.feedback-san .story-card,
.app-shell.feedback-anger .story-card {
  animation: story-warning-glow 0.68s ease-out both;
}

@keyframes san-nudge {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-2px); }
  46% { transform: translateX(2px); }
  68% { transform: translateX(-1px); }
  84% { transform: translateX(1px); }
}

@keyframes anger-stutter {
  0%, 34%, 100% { transform: translateX(0); }
  35%, 68% { transform: translateX(1px); }
}

@keyframes story-warning-glow {
  0%, 100% {
    border-color: var(--line);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
  }
  34% {
    border-color: rgba(206, 109, 112, 0.42);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24), 0 0 22px rgba(206, 109, 112, 0.16);
  }
}

.incoming-call {
  display: grid;
  flex: 1;
  text-align: center;
  place-items: center;
}

.incoming-call.is-ringing .avatar {
  animation: incoming-avatar-pulse 1.45s ease-in-out infinite;
}

@keyframes incoming-avatar-pulse {
  0%, 100% { box-shadow: 0 0 0 12px rgba(232, 170, 120, 0.06); transform: scale(1); }
  50% { box-shadow: 0 0 0 20px rgba(232, 170, 120, 0.015); transform: scale(1.025); }
}

.incoming-call .avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  font-size: 30px;
  box-shadow: 0 0 0 12px rgba(232, 170, 120, 0.06);
}

.incoming-call h3 {
  margin: 0;
  font-size: 30px;
}

.incoming-call p {
  margin: 8px 0 30px;
  color: var(--muted);
}

.missed-call.is-hanging-up {
  animation: missed-call-dim 0.85s ease both;
}

.missed-call-label {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid rgba(206, 109, 112, 0.28);
  border-radius: 999px;
  background: rgba(206, 109, 112, 0.08);
  color: #dda0a2;
  font-size: 12px;
}

@keyframes missed-call-dim {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.5; transform: scale(0.985); }
}

.missed-message-scene {
  display: flex;
  min-height: 100%;
  margin: clamp(-48px, -4vw, -24px);
  overflow: hidden;
  border-radius: inherit;
  flex: 1;
  flex-direction: column;
  background: #1d1d20;
  animation: missed-message-enter 0.42s ease both;
}

@keyframes missed-message-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.missed-call-note {
  color: var(--danger);
  font-size: 12px;
}

.missed-message-body {
  min-height: 300px;
  justify-content: flex-end;
}

.emergency-message-scene .missed-message-body {
  width: min(680px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 30px 28px;
  justify-content: flex-start;
}

.emergency-message-scene,
.story-card .emergency-message-scene > .message-header,
.story-card .emergency-message-scene > .reply-area,
.story-card .emergency-message-scene .missed-message-body > .bubble {
  opacity: 1;
  transform: none;
  animation: none;
}

.emergency-message-scene .bubble {
  max-width: min(520px, 82%);
  flex: 0 0 auto;
}

.story-card .emergency-message-scene:not(.is-ringing) .missed-message-body > .bubble:last-child {
  animation: emergency-bubble-reveal 0.58s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

@keyframes emergency-bubble-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.missed-call-system {
  align-self: center;
  margin-bottom: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #77736e;
  font-size: 11px;
}

.missed-reply-area {
  min-height: 78px;
}

.missed-reply-area > span {
  display: block;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.emergency-reply-area {
  display: flex;
  align-items: center;
  justify-content: center;
}

.emergency-answer-button {
  width: min(320px, 100%);
}

.forced-reply {
  width: 100%;
  border-color: rgba(232, 170, 120, 0.3);
}

.answer-button {
  min-width: 190px;
}

.dialogue-header {
  display: flex;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.dialogue-speaker {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dialogue-body {
  display: flex;
  flex: 1;
  padding: 40px 0;
  align-items: center;
}

.dialogue-text {
  max-width: 760px;
  margin: 0;
  font-family: ui-serif, "Songti SC", serif;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.75;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice-button {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  min-height: 54px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  align-items: center;
  background: #242427;
  color: var(--text);
  box-shadow: none;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s, border-color 0.18s;
}

.choice-button:hover,
.choice-button:active,
.choice-button:focus {
  background: #242427;
  color: var(--text);
}

.choice-button:hover {
  transform: translateX(4px);
  border-color: rgba(232, 170, 120, 0.45);
}

@media (hover: none) {
  .choice-button:hover {
    transform: none;
    border-color: var(--line);
  }
}

.info-empty {
  padding: 28px 10px;
  color: #716e69;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.info-empty p {
  margin: 0;
}

.info-empty-add {
  min-height: 36px;
  margin-top: 18px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  font: inherit;
  cursor: pointer;
}

.info-empty-add:hover {
  border-color: rgba(232, 170, 120, 0.48);
  color: var(--accent);
}

.info-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.info-item + .info-item {
  margin-top: 10px;
}

.info-item-toolbar {
  display: flex;
  margin-bottom: 8px;
  color: #6f6b66;
  font-size: 10px;
  letter-spacing: 0.08em;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
}

.info-item-toolbar button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #77716c;
  font: inherit;
  cursor: pointer;
}

.info-item-toolbar button:hover {
  color: #b86f72;
}

.info-title-input,
.info-detail-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.016);
  color: var(--soft);
  font: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.info-title-input {
  height: 32px;
  padding: 0 7px;
  font-size: 13px;
  font-weight: 600;
}

.info-detail-input {
  min-height: 68px;
  margin-top: 4px;
  padding: 7px;
  resize: vertical;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.info-title-input:hover,
.info-detail-input:hover {
  background: rgba(255, 255, 255, 0.018);
}

.info-title-input:focus,
.info-detail-input:focus {
  border-color: rgba(232, 170, 120, 0.36);
  outline: none;
  background: rgba(255, 255, 255, 0.028);
}

.info-title-input::placeholder,
.info-detail-input::placeholder {
  color: #66625e;
}

.info-workspace-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  padding: 28px;
  place-items: center;
  background: rgba(7, 7, 8, 0.82);
  backdrop-filter: blur(10px);
  animation: info-workspace-backdrop-in 0.28s ease both;
}

.info-workspace {
  display: flex;
  width: min(980px, 100%);
  height: min(780px, calc(100svh - 56px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  flex-direction: column;
  background: #171719;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.62);
  animation: info-workspace-in 0.42s cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

.info-workspace-header {
  display: flex;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
  align-items: flex-end;
  justify-content: space-between;
}

.info-workspace-header p,
.info-workspace-toolbar p {
  margin: 0;
  color: var(--muted);
}

.info-workspace-header p {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.2em;
}

.info-workspace-header h2 {
  margin: 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: 30px;
  font-weight: 500;
}

.info-workspace-header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.info-workspace-header-actions strong {
  color: var(--text);
}

.info-workspace-header-actions button,
.info-workspace-add {
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  cursor: pointer;
}

.info-workspace-header-actions button:hover,
.info-workspace-add:hover {
  border-color: rgba(232, 170, 120, 0.46);
  color: var(--accent);
}

.info-workspace-toolbar {
  display: flex;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.info-workspace-toolbar p {
  font-size: 12px;
}

.info-workspace-content {
  display: grid;
  min-height: 0;
  padding: 24px 28px 32px;
  overflow-y: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
  overscroll-behavior: contain;
}

.info-workspace-content .info-item + .info-item {
  margin-top: 0;
}

.info-workspace-content .info-detail-input {
  min-height: 120px;
}

.info-workspace-content .info-empty {
  grid-column: 1 / -1;
}

@keyframes info-workspace-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes info-workspace-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 6, 0.7);
  pointer-events: none;
}

.tutorial-card {
  position: fixed;
  z-index: 102;
  width: min(410px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid rgba(232, 170, 120, 0.32);
  border-radius: 18px;
  background: #242427;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.tutorial-card.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tutorial-card.bottom {
  right: 28px;
  bottom: 28px;
}

.tutorial-count {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.tutorial-card h3 {
  margin: 11px 0 9px;
  font-size: 20px;
}

.tutorial-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.tutorial-card .tutorial-copy {
  margin-top: 14px;
  color: var(--soft);
  font-size: 16px;
  line-height: 1.85;
}

.tutorial-card .tutorial-copy em {
  color: var(--accent);
  font-style: normal;
  font-weight: 850;
}

.tutorial-actions {
  display: flex;
  margin-top: 20px;
  gap: 10px;
  justify-content: space-between;
}

.tutorial-actions.last-step {
  justify-content: flex-end;
}

.tutorial-highlight {
  position: relative;
  z-index: 101 !important;
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(5, 5, 6, 0.7) !important;
}

.san-ending-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(5, 5, 6, 0.78);
  backdrop-filter: blur(8px);
  animation: san-ending-backdrop-in 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.san-ending-dialog {
  width: min(560px, 100%);
  padding: 34px;
  border: 1px solid rgba(206, 109, 112, 0.26);
  border-radius: 18px;
  background: #18181a;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.72);
  text-align: center;
  animation: san-ending-dialog-in 1.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.28s both;
}

.san-ending-dialog p {
  margin: 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.65;
  white-space: nowrap;
}

.san-ending-dialog button {
  width: 100%;
  margin-top: 28px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: #242427;
  color: var(--soft);
  cursor: pointer;
  font-size: 20px;
  letter-spacing: 0.3em;
  transition: border-color 0.2s, background 0.2s;
}

.san-ending-dialog button:hover {
  border-color: rgba(206, 109, 112, 0.42);
  background: #2b2729;
}

.anger-ending-layer {
  position: fixed;
  inset: 0;
  z-index: 2300;
  overflow: hidden;
  isolation: isolate;
}

.anger-ending-white-stage {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: #f5f4f0;
  color: #171719;
}

.anger-paper-half {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #111113;
  will-change: transform;
}

.anger-paper-left {
  clip-path: polygon(0 0, 51% 0, 49.1% 8%, 50.8% 16%, 48.9% 25%, 50.9% 34%, 49% 44%, 51.1% 54%, 48.8% 65%, 50.8% 76%, 49% 88%, 50.9% 100%, 0 100%);
  transform-origin: left center;
  animation: anger-paper-tear-left 2.6s cubic-bezier(0.4, 0.02, 0.2, 1) forwards;
}

.anger-paper-right {
  clip-path: polygon(51% 0, 100% 0, 100% 100%, 50.9% 100%, 49% 88%, 50.8% 76%, 48.8% 65%, 51.1% 54%, 49% 44%, 50.9% 34%, 48.9% 25%, 50.8% 16%, 49.1% 8%);
  transform-origin: right center;
  animation: anger-paper-tear-right 2.6s cubic-bezier(0.4, 0.02, 0.2, 1) forwards;
}

.anger-paper-copy {
  position: absolute;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  pointer-events: none;
  user-select: none;
}

.anger-tear-seam {
  position: absolute;
  z-index: 3;
  top: -2%;
  left: calc(50% - 10px);
  width: 20px;
  height: 104%;
  background: #f5f4f0;
  clip-path: polygon(45% 0, 72% 8%, 38% 16%, 76% 25%, 34% 34%, 69% 44%, 31% 54%, 73% 65%, 36% 76%, 68% 88%, 43% 100%, 57% 100%, 84% 88%, 52% 76%, 88% 65%, 48% 54%, 85% 44%, 50% 34%, 89% 25%, 52% 16%, 86% 8%, 58% 0);
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.68));
  transform: scaleY(0);
  transform-origin: center;
  animation: anger-tear-seam-open 0.7s cubic-bezier(0.55, 0.03, 0.42, 0.98) forwards;
}

.anger-ending-dialog {
  width: min(480px, 100%);
  padding: 38px;
  border: 1px solid rgba(23, 23, 25, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(20, 18, 16, 0.16);
  text-align: center;
  animation: anger-ending-dialog-in 1.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.anger-ending-dialog p {
  margin: 0;
  color: #171719;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.5;
  white-space: nowrap;
}

.anger-ending-dialog button {
  width: 100%;
  margin-top: 30px;
  padding: 14px 18px;
  border: 1px solid #171719;
  border-radius: 5px;
  background: #171719;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.18em;
  transition: background 0.2s, transform 0.2s;
}

.anger-ending-dialog button:hover {
  background: #353539;
  transform: translateY(-1px);
}

@keyframes anger-tear-seam-open {
  0% { opacity: 0; transform: scaleY(0); }
  18% { opacity: 1; }
  100% { opacity: 1; transform: scaleY(1); }
}

@keyframes anger-paper-tear-left {
  0%, 17% { transform: translateX(0) rotate(0); }
  42% { transform: translateX(-7vw) rotate(-0.35deg); }
  100% { transform: translateX(-61vw) rotate(-2.2deg); }
}

@keyframes anger-paper-tear-right {
  0%, 17% { transform: translateX(0) rotate(0); }
  42% { transform: translateX(7vw) rotate(0.35deg); }
  100% { transform: translateX(61vw) rotate(2.2deg); }
}

@keyframes anger-ending-dialog-in {
  0% { opacity: 0; transform: translateY(22px) scale(0.975); }
  45% { opacity: 0.35; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.san-pour-layer {
  position: fixed;
  inset: 0;
  z-index: 2100;
  overflow: hidden;
  background: transparent;
  pointer-events: all;
}

.san-pour-sheet {
  position: absolute;
  inset: -3vh -3vw;
  background: #000;
  clip-path: polygon(0 0, 100% 0, 100% -8%, 92% -3%, 84% -9%, 76% 2%, 68% -5%, 60% 5%, 52% -2%, 44% 7%, 36% -5%, 28% 3%, 20% -7%, 12% 2%, 0 -4%);
  animation: san-black-water-pour 3.2s cubic-bezier(0.5, 0.02, 0.72, 0.62) forwards;
  filter: drop-shadow(0 10px 9px rgba(0, 0, 0, 0.9));
  will-change: clip-path;
}

.san-pour-sheet::before,
.san-pour-sheet::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 8% 20%, rgba(22, 22, 24, 0.48), transparent 24%),
    radial-gradient(ellipse at 31% 42%, rgba(17, 17, 19, 0.4), transparent 28%),
    radial-gradient(ellipse at 62% 24%, rgba(25, 25, 27, 0.42), transparent 22%),
    radial-gradient(ellipse at 88% 55%, rgba(15, 15, 17, 0.46), transparent 26%);
  content: "";
  opacity: 0.72;
  animation: san-black-water-surface 1.25s ease-in-out infinite alternate;
}

.san-pour-sheet::after {
  transform: translateX(9%) scale(1.12);
  opacity: 0.48;
  animation-delay: -0.58s;
}

.san-pour-rivulets {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.san-pour-rivulets span {
  --stream-delay: 0s;
  --stream-duration: 2.55s;
  position: absolute;
  top: -38vh;
  left: 6%;
  width: 7vw;
  min-width: 22px;
  max-width: 86px;
  height: 34vh;
  border-radius: 0 0 52% 48% / 0 0 24px 30px;
  background: #000;
  transform: translateY(-12vh) scaleX(0.82);
  transform-origin: top center;
  animation: san-black-rivulet var(--stream-duration) cubic-bezier(0.48, 0.02, 0.72, 0.58) var(--stream-delay) forwards;
  will-change: transform;
}

.san-pour-rivulets span::after {
  position: absolute;
  bottom: -1.6vw;
  left: 50%;
  width: 2.8vw;
  min-width: 10px;
  max-width: 28px;
  aspect-ratio: 0.78;
  border-radius: 48% 52% 56% 44% / 38% 42% 58% 62%;
  background: #000;
  content: "";
  transform: translateX(-50%) rotate(7deg);
}

.san-pour-rivulets span:nth-child(2) { --stream-delay: 0.18s; --stream-duration: 2.75s; left: 17%; width: 3.6vw; height: 43vh; }
.san-pour-rivulets span:nth-child(3) { --stream-delay: 0.06s; --stream-duration: 2.42s; left: 29%; width: 9vw; height: 29vh; }
.san-pour-rivulets span:nth-child(4) { --stream-delay: 0.34s; --stream-duration: 2.58s; left: 42%; width: 4.5vw; height: 49vh; }
.san-pour-rivulets span:nth-child(5) { --stream-delay: 0.11s; --stream-duration: 2.9s; left: 53%; width: 7.5vw; height: 37vh; }
.san-pour-rivulets span:nth-child(6) { --stream-delay: 0.28s; --stream-duration: 2.46s; left: 65%; width: 3vw; height: 46vh; }
.san-pour-rivulets span:nth-child(7) { --stream-delay: 0.02s; --stream-duration: 2.72s; left: 73%; width: 10vw; height: 31vh; }
.san-pour-rivulets span:nth-child(8) { --stream-delay: 0.22s; --stream-duration: 2.62s; left: 86%; width: 4vw; height: 45vh; }
.san-pour-rivulets span:nth-child(9) { --stream-delay: 0.08s; --stream-duration: 2.82s; left: 94%; width: 6vw; height: 35vh; }

.blackout-click-layer {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: transparent;
  cursor: crosshair;
  touch-action: manipulation;
}

.blackout-click-layer svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.blackout-click-layer.emergency-auto-blackout {
  cursor: wait;
  pointer-events: none;
}

.blackout-click-layer.is-revealing {
  cursor: default;
  pointer-events: none;
  animation: blackout-whole-reveal 0.9s ease-in forwards;
}

.blackout-hole {
  transform-box: fill-box;
  transform-origin: center;
  animation: blackout-hole-bloom 0.28s ease-out both;
}

@keyframes san-ending-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes san-ending-dialog-in {
  from { opacity: 0; transform: translateY(22px) scale(0.975); }
  45% { opacity: 0.42; }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes san-black-water-pour {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% -8%, 92% -3%, 84% -9%, 76% 2%, 68% -5%, 60% 5%, 52% -2%, 44% 7%, 36% -5%, 28% 3%, 20% -7%, 12% 2%, 0 -4%);
  }
  18% {
    clip-path: polygon(0 0, 100% 0, 100% 12%, 92% 20%, 84% 9%, 76% 25%, 68% 14%, 60% 29%, 52% 12%, 44% 24%, 36% 10%, 28% 27%, 20% 15%, 12% 22%, 0 9%);
  }
  45% {
    clip-path: polygon(0 0, 100% 0, 100% 41%, 92% 52%, 84% 38%, 76% 57%, 68% 43%, 60% 61%, 52% 40%, 44% 55%, 36% 36%, 28% 59%, 20% 45%, 12% 54%, 0 39%);
  }
  72% {
    clip-path: polygon(0 0, 100% 0, 100% 76%, 92% 84%, 84% 70%, 76% 91%, 68% 74%, 60% 95%, 52% 72%, 44% 88%, 36% 69%, 28% 93%, 20% 77%, 12% 89%, 0 72%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 112%, 92% 114%, 84% 110%, 76% 116%, 68% 112%, 60% 117%, 52% 111%, 44% 115%, 36% 110%, 28% 117%, 20% 112%, 12% 116%, 0 111%);
  }
}

@keyframes san-black-water-surface {
  from { transform: translate3d(-2%, -1%, 0) scale(1.04, 0.96); }
  to { transform: translate3d(2%, 1.5%, 0) scale(0.98, 1.05); }
}

@keyframes san-black-rivulet {
  0% { transform: translateY(-12vh) scaleX(0.78); }
  17% { transform: translateY(7vh) scaleX(1.08); }
  54% { transform: translateY(61vh) scaleX(0.9); }
  100% { transform: translateY(150vh) scaleX(1); }
}

@keyframes blackout-hole-bloom {
  from { opacity: 0; transform: scale(0.35); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes blackout-whole-reveal {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.decision-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
}

.decision-card:hover {
  border-color: rgba(143, 172, 155, 0.45);
}

.decision-card:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.decision-card.danger {
  border-color: rgba(196, 85, 85, 0.55);
}

.decision-card.danger:hover {
  border-color: rgba(225, 102, 102, 0.9);
}

.decision-card strong,
.decision-card small {
  display: block;
}

.decision-card small {
  margin-top: 7px;
  color: var(--muted);
}

.audio-controls {
  position: fixed;
  z-index: 140;
  right: 12px;
  bottom: 12px;
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  gap: 2px;
  background: rgba(24, 24, 26, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.save-controls {
  position: fixed;
  z-index: 140;
  top: 12px;
  right: 12px;
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  gap: 2px;
  background: rgba(24, 24, 26, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.save-control-button {
  min-width: 40px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.save-control-button:hover:not(:disabled) {
  border-color: rgba(232, 170, 120, 0.28);
  background: rgba(232, 170, 120, 0.07);
  color: var(--accent);
}

.save-control-button:disabled {
  color: #5f5c58;
  cursor: not-allowed;
}

.audio-toggle {
  display: flex;
  min-width: 43px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  gap: 3px;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #716e69;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.audio-toggle span {
  font-size: 11px;
  line-height: 1;
}

.audio-toggle small {
  font-size: 9px;
}

.audio-toggle:hover,
.audio-toggle.is-on {
  border-color: rgba(232, 170, 120, 0.2);
  background: rgba(232, 170, 120, 0.08);
  color: var(--accent);
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  top: 108px;
  max-width: 360px;
  padding: 14px 18px;
  border: 1px solid rgba(143, 172, 155, 0.3);
  border-radius: 12px;
  background: #273029;
  color: #dbe8df;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease both;
}

.stat-feedback {
  position: fixed;
  z-index: 121;
  top: 104px;
  left: 50%;
  min-width: 112px;
  padding: 10px 16px;
  border: 1px solid rgba(206, 109, 112, 0.38);
  border-radius: 999px;
  background: rgba(54, 28, 30, 0.94);
  color: #f0c4c5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.04em;
  pointer-events: none;
  transform: translateX(-50%);
  animation: stat-feedback-in 1.05s ease-out both;
}

@keyframes stat-feedback-in {
  0% { opacity: 0; transform: translate(-50%, -5px); }
  14%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -2px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .setup-screen { grid-template-columns: 1fr; }
  .setup-hero { min-height: 58vh; padding: 56px; border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-panel { min-height: auto; }
  .game-header { padding-right: 26px; grid-template-columns: 1fr; }
  .day-counter { text-align: left; }
  .game-layout,
  .game-layout.info-panel-collapsed { grid-template-columns: minmax(0, 1fr); }
  .side-panel.right {
    position: static;
    display: flex;
    max-height: min(640px, 72svh);
    grid-column: 1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .side-panel.right.is-collapsed {
    max-height: 54px;
  }

  .info-collapsed-launch {
    min-height: 30px;
    padding: 0 8px;
    flex-direction: row;
    justify-content: center;
    writing-mode: horizontal-tb;
  }

  .info-collapsed-launch i {
    margin-top: 0;
    margin-left: auto;
    transform: rotate(-90deg);
  }
}

@media (max-width: 760px) {
  .emergency-message-scene .missed-message-body {
    width: 100%;
    padding: 18px 14px;
  }

  .emergency-message-scene .bubble {
    max-width: 88%;
  }

  .anger-ending-dialog {
    padding: 30px 20px;
  }

  .anger-ending-dialog p {
    font-size: clamp(22px, 7vw, 30px);
  }

  .san-ending-dialog {
    padding: 26px 18px;
  }

  .san-ending-dialog p {
    white-space: nowrap;
    font-size: clamp(16px, 5.1vw, 20px);
    line-height: 1.5;
  }

  body,
  button,
  input,
  select,
  textarea,
  .setup-panel h2,
  .intro-card p.story-line,
  .game-brand strong,
  .stage-top h2,
  .dialogue-text,
  .story-sequence h3,
  .incoming-call h3 {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC",
      "Microsoft YaHei", sans-serif;
  }

  .splash-screen { padding: 24px; }
  .splash-title { font-size: clamp(50px, 16vw, 78px); }
  .splash-entry { margin-top: 42px; }
  .setup-screen { padding: 16px; }
  .setup-panel { padding: 36px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .intro-screen { padding: 16px; }
  .intro-card { padding: 28px; }
  .reply-grid { grid-template-columns: 1fr; }
  .game-header {
    min-height: 104px;
    padding: 8px 10px;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .game-brand {
    min-width: 0;
    padding-right: 92px;
  }
  .game-brand strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .game-brand small {
    margin-top: 2px;
    font-size: 9px;
  }
  .day-counter { display: none; }
  .stats-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }
  .stat-card {
    min-height: 42px;
    padding: 5px 6px;
    border-radius: 5px;
  }
  .stat-top {
    display: grid;
    min-width: 0;
    margin-bottom: 5px;
    gap: 1px;
    font-size: 8px;
    line-height: 1.15;
  }
  .stat-top > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .stat-top strong {
    font-size: 9px;
    font-variant-numeric: tabular-nums;
  }
  .stat-inline-delta {
    margin-left: 2px;
    font-size: 7px;
  }
  .meter,
  .friend-meter {
    height: 2px;
  }
  .friend-meter { gap: 2px; }
  .game-layout {
    display: flex;
    flex-direction: column;
  }
  .main-stage { order: 1; }
  .side-panel.right { order: 2; }
  .main-stage {
    height: calc(100svh - 104px);
    min-height: 0;
    padding: 10px;
  }
  .stage-top {
    min-height: 28px;
    margin-bottom: 7px;
    align-items: center;
  }
  .stage-top .eyebrow {
    margin-bottom: 0;
    font-size: 9px;
  }
  .stage-top h2 { font-size: 18px; }
  .call-status { font-size: 9px; }
  .story-card {
    min-height: 0;
    padding: 15px;
    overflow-y: auto;
    border-radius: 9px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  }
  .dialogue-header {
    padding-bottom: 10px;
  }
  .dialogue-body {
    padding: 16px 0;
  }
  .dialogue-text {
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 500;
    line-height: 1.55;
  }
  .choices { gap: 6px; }
  .choice-button {
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.4;
  }
  .side-panel.right {
    min-height: 0;
    max-height: min(620px, 72svh);
    padding: 18px 14px;
  }
  .side-panel.right.is-collapsed {
    min-height: 0;
    max-height: 48px;
    padding: 9px 10px;
  }
  .info-workspace-layer {
    padding: 0;
  }
  .info-workspace {
    width: 100%;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }
  .info-workspace-header {
    padding: 18px 16px 14px;
  }
  .info-workspace-header h2 { font-size: 25px; }
  .info-workspace-header-actions { gap: 9px; }
  .info-workspace-header-actions > span { display: none; }
  .info-workspace-toolbar {
    padding: 12px 16px;
  }
  .info-workspace-toolbar p { display: none; }
  .info-workspace-add { width: 100%; }
  .info-workspace-content {
    padding: 14px 16px 24px;
    grid-template-columns: 1fr;
  }
  .decision-grid { grid-template-columns: 1fr; }
  .decision-card {
    padding: 12px;
    border-radius: 7px;
  }
  .stat-feedback { top: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-title-line,
  .splash-entry,
  .splash-enter-label {
    opacity: 1;
    transform: none;
    animation: none;
    filter: none;
  }

  .splash-circle {
    opacity: 1;
    animation: none;
  }

  .splash-circle::before,
  .splash-circle::after {
    opacity: 0.1;
    transform: scale(1.2);
    animation: none;
  }

  .intro-card .story-line,
  .intro-card .intro-actions,
  .story-card > .dialogue-header,
  .story-card > .dialogue-body,
  .story-card .choice-button,
  .story-card .story-sequence > *,
  .story-card .incoming-call-content > *,
  .story-card .missed-message-scene > .message-header,
  .story-card .missed-call-system,
  .story-card .missed-message-body > .bubble,
  .story-card .missed-message-scene > .reply-area {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .splash-ripple,
  .splash-ripple::after {
    animation-duration: 0.2s;
  }

  .san-ending-modal-layer,
  .san-ending-dialog,
  .anger-ending-dialog,
  .blackout-hole {
    animation: none;
  }

  .anger-paper-left {
    animation: anger-paper-tear-left 0.8s ease-in forwards;
  }

  .anger-paper-right {
    animation: anger-paper-tear-right 0.8s ease-in forwards;
  }

  .anger-tear-seam {
    animation-duration: 0.25s;
  }

  .san-pour-sheet,
  .san-pour-rivulets span {
    animation-duration: 0.8s;
  }

  .san-pour-sheet::after {
    animation: none;
  }

  .app-shell.feedback-san,
  .app-shell.feedback-anger:not(.feedback-san) {
    animation: none;
  }

  .app-shell.feedback-san .story-card,
  .app-shell.feedback-anger .story-card {
    animation: story-warning-glow 0.68s ease-out both;
  }

  .stat-feedback {
    animation-name: stat-feedback-fade;
  }

  .stat-card.stat-changing {
    animation-name: stat-card-calm;
  }

  .stat-card.stat-changing .stat-top strong,
  .stat-card.stat-changing .meter span {
    animation: none;
  }

  @keyframes stat-card-calm {
    0%, 100% { border-color: var(--line); background: var(--surface); }
    18%, 78% { border-color: rgba(206, 109, 112, 0.58); background: rgba(75, 37, 39, 0.62); }
  }

  @keyframes stat-feedback-fade {
    0%, 100% { opacity: 0; }
    18%, 72% { opacity: 1; }
  }
}
