:root {
  --ink: #092f31;
  --deep: #082829;
  --teal: #0f6260;
  --teal-bright: #1e8e86;
  --jade: #75b78a;
  --cream: #f3eddf;
  --paper: #fffaf0;
  --coral: #e97862;
  --gold: #e6bc67;
  --muted: #68807d;
  --shadow: 0 22px 70px rgba(4, 30, 31, 0.24);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-status-pill {
  display: flex; width: 100%; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 9px 13px; border: 1px solid #bdd3cc;
  border-radius: 12px; background: #f8fcf6; color: #225c59; font-size: 12px; cursor: pointer;
}
.ai-practice-btn {
  margin: 8px 0 12px; padding: 8px 12px; color: #ffe3a0; background: rgba(232,190,96,.1);
  border: 1px solid rgba(232,190,96,.45); border-radius: 9px; font-size: 13px; cursor: pointer;
}
.ai-dialog {
  width: min(670px, calc(100vw - 24px)); max-width: none; height: min(850px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #89aaa0; border-radius: 22px;
  background: #f6f4ec; color: #163f3e; box-shadow: 0 30px 100px #001d2499;
}
.ai-dialog[open] { display: flex; flex-direction: column; }
.ai-dialog::backdrop { background: rgba(0,22,28,.7); backdrop-filter: blur(4px); }
.ai-header { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: #133f40; color: #fff; flex-shrink: 0; }
.ai-header img { width: 48px; height: 48px; object-fit: cover; border-radius: 14px; }
.ai-header h2 { margin: 3px 0 0; font-size: 20px; }
.ai-header small { color: #e6c981; font-size: 10px; letter-spacing: .1em; }
.ai-header button { margin-left: auto; flex-shrink: 0; width: 38px; height: 38px; border: 1px solid #ffffff44; background: #ffffff0d; color: white; border-radius: 50%; font-size: 25px; cursor: pointer; }
.ai-body { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.ai-caption { margin: 0 0 16px; color: #59736a; font-size: 12px; line-height: 1.7; }
.ai-messages { display: flex; flex-direction: column; gap: 14px; }
.ai-bubble { max-width: 90%; padding: 13px 16px; border-radius: 15px 15px 15px 4px; border: 1px solid #dce4da; background: white; overflow-wrap: anywhere; }
.ai-bubble small { font-size: 10px; color: #678077; }
.ai-bubble p { margin: 5px 0 0; font-size: 15px; line-height: 1.75; white-space: pre-wrap; }
.ai-bubble.from-player { align-self: flex-end; background: #dceee2; border-radius: 15px 15px 4px 15px; }
.ai-feedback { margin: 16px 0 0; padding: 13px; border-left: 3px solid #d5b56b; background: #eee8d6; font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.ai-footer { flex-shrink: 0; padding: 13px 22px 16px; background: #fcfbf7; border-top: 1px solid #dce4da; }
.ai-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; line-height: 1.6; color: #3d665d; }
.ai-consent input { margin-top: 3px; accent-color: #19645c; }
#ai-notice { margin: 7px 0; font-size: 11px; color: #7b6845; line-height: 1.6; }
#ai-input { display: block; width: 100%; resize: none; min-height: 74px; padding: 10px 12px; border: 1px solid #bbcfc5; border-radius: 11px; color: #193e3b; background: white; font: inherit; font-size: 16px; }
.ai-send-row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-send-row small { font-size: 11px; color: #688079; }
.ai-send-row button { border: none; border-radius: 9px; padding: 9px 18px; color: white; background: #21625d; cursor: pointer; }
.ai-dialog button:disabled { opacity: .5; cursor: default; }
.ai-return { display: block; margin: 12px auto 0; border: 0; background: transparent; color: #3e6c5f; font-size: 12px; cursor: pointer; }
#ai-settings { line-height: 1.85; font-size: 14px; }
#ai-config-state { padding: 14px; border-radius: 12px; background: #dceee2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 760px) {
  .ai-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 17px; }
  .ai-header { padding: 12px 14px; gap: 10px; }
  .ai-header h2 { font-size: 17px; }
  .ai-header img { width: 40px; height: 40px; }
  .ai-body { padding: 14px; }
  .ai-footer { padding: 10px 14px max(12px, env(safe-area-inset-bottom)); }
  .ai-bubble { max-width: 95%; padding: 11px 13px; }
  .ai-status-pill { font-size: 11px; text-align: left; }
  .ai-status-pill span:last-child { flex-shrink: 0; }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #071f21;
  color: var(--ink);
}

body {
  min-height: 100svh;
  overflow-x: hidden;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(255, 205, 97, 0.95);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

#app,
.screen {
  min-height: 100svh;
}

.title-screen {
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #dce8e2;
}

.title-art,
.title-gradient {
  position: absolute;
  inset: 0;
}

.title-art {
  background: url("assets/title-art.png") center center / cover no-repeat;
  transform: scale(1.01);
  animation: settle 1.4s cubic-bezier(.2,.8,.2,1) both;
}

.title-gradient {
  background:
    linear-gradient(90deg, rgba(4, 34, 35, 0.85) 0%, rgba(4, 34, 35, 0.45) 34%, rgba(4, 34, 35, 0.05) 64%),
    linear-gradient(0deg, rgba(4, 34, 35, 0.6) 0%, transparent 32%);
}

@keyframes settle {
  from { transform: scale(1.06); filter: saturate(.8); }
  to { transform: scale(1.01); filter: saturate(1); }
}

.title-copy {
  position: relative;
  z-index: 2;
  width: min(590px, 82vw);
  margin-left: clamp(36px, 8vw, 140px);
  color: white;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .23em;
  text-transform: uppercase;
}

.title-copy h1 {
  margin: 0;
  font-size: clamp(54px, 7vw, 104px);
  font-weight: 900;
  letter-spacing: -.06em;
  line-height: .94;
  text-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}

.title-copy h1 span {
  color: #f6d083;
}

.title-subtitle {
  max-width: 530px;
  margin: 28px 0 30px;
  color: rgba(255, 255, 255, .82);
  font-size: 16px;
  line-height: 1.85;
}

.title-actions,
.ending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-btn {
  color: var(--deep);
  background: linear-gradient(135deg, #f6d083, #edb95f);
  box-shadow: 0 12px 32px rgba(235, 177, 78, .28);
}

.primary-btn span {
  margin-left: 30px;
}

.ghost-btn {
  color: white;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.text-btn {
  margin-top: 22px;
  padding: 3px 0;
  color: rgba(255, 255, 255, .7);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.title-footer {
  position: absolute;
  z-index: 2;
  right: 32px;
  bottom: 24px;
  left: 32px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, .66);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
}

.game-screen {
  position: relative;
  display: grid;
  grid-template-rows: 72px 1fr 54px;
  overflow: hidden;
  background: var(--cream);
}

.planner-screen {
  display: grid;
  min-height: 100svh;
  grid-template-rows: 72px 1fr 48px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(117,183,138,.18), transparent 27%),
    linear-gradient(145deg, #f7f1e5, #e7eee9);
}

.planner-body {
  width: min(1220px, calc(100vw - 48px));
  min-height: 0;
  margin: 0 auto;
  padding: 22px 0 18px;
  overflow: auto;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.day-pill {
  position: relative;
  display: grid;
  min-height: 58px;
  place-items: center;
  padding: 8px;
  color: #657875;
  border: 1px solid rgba(15,98,96,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
}

.day-pill span {
  font-size: 10px;
}

.day-pill b {
  font-size: 14px;
}

.day-pill i {
  position: absolute;
  right: 9px;
  bottom: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.day-pill.done {
  color: var(--teal);
  background: rgba(218,237,226,.9);
}

.day-pill.done i {
  background: var(--jade);
}

.day-pill.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal), #164d4f);
  box-shadow: 0 10px 25px rgba(9,67,66,.2);
}

.day-pill.active i {
  background: var(--gold);
}

.day-pill.weekend:not(.active) {
  color: #875c38;
  background: rgba(245,225,189,.78);
}

.planner-hero {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 34px;
  align-items: center;
  padding: 24px 30px;
  color: white;
  border-radius: 22px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.05), transparent 42%),
    linear-gradient(135deg, #0a4d4c, #163a3d);
  box-shadow: 0 16px 40px rgba(5,48,49,.18);
}

.planner-hero .eyebrow {
  margin-bottom: 8px;
}

.planner-hero h2 {
  margin: 0;
  color: white;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.2;
}

.planner-hero p:not(.eyebrow) {
  max-width: 660px;
  margin: 11px 0 0;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  line-height: 1.75;
}

.meeting-readiness {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
}

.meeting-readiness > span,
.meeting-readiness small {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 9px;
  letter-spacing: .08em;
}

.meeting-readiness strong {
  display: block;
  margin: 2px 0 8px;
  color: var(--gold);
  font-size: 30px;
}

.readiness-bar {
  height: 7px;
  margin-bottom: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.13);
}

.readiness-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e9b854, #f6dd9a);
  transition: width .35s ease;
}

.planner-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  margin-top: 16px;
}

.planner-content > section,
.planner-aside > div {
  border: 1px solid rgba(13,82,80,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 30px rgba(31,65,61,.07);
}

.planner-content > section {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading span {
  color: var(--coral);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}

.section-heading h3 {
  margin: 3px 0 0;
  font-size: 24px;
}

.section-heading .slot-cost {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.action-card {
  position: relative;
  min-height: 128px;
  padding: 17px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  border: 1px solid rgba(10,86,83,.14);
  border-radius: 15px;
  background: linear-gradient(145deg, white, #f4f6f1);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15,98,96,.42);
  box-shadow: 0 12px 28px rgba(21,83,78,.12);
}

.action-card:disabled {
  cursor: not-allowed;
  filter: grayscale(.5);
  opacity: .48;
  transform: none;
}

.action-icon {
  display: grid;
  width: 35px;
  height: 35px;
  margin-bottom: 10px;
  place-items: center;
  color: white;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--teal-bright), var(--deep));
  font-size: 13px;
  font-weight: 900;
}

.action-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.action-gain {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 700;
}

.action-card.special {
  grid-column: 1 / -1;
  min-height: 140px;
  color: white;
  border: 0;
  background:
    linear-gradient(100deg, rgba(6,53,54,.96), rgba(18,97,91,.82)),
    url("assets/title-art.png") center 43% / cover;
}

.action-card.special .action-icon {
  color: var(--deep);
  background: var(--gold);
}

.action-card.special p,
.action-card.special .action-gain {
  color: rgba(255,255,255,.7);
}

.action-card.rest-card {
  background: linear-gradient(145deg, #fff7e9, #e7efe7);
}

.planner-aside {
  display: grid;
  align-content: start;
  gap: 12px;
}

.today-card,
.compact-stats {
  padding: 17px;
}

.today-card > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
}

.today-slots {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.today-slot {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: #eef2ee;
}

.today-slot span {
  color: var(--muted);
  font-size: 9px;
}

.today-slot b {
  font-size: 11px;
}

.today-slot.current {
  color: white;
  background: var(--teal);
}

.today-slot.current span {
  color: rgba(255,255,255,.62);
}

.today-slot.done {
  background: #e1eddf;
}

.compact-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.compact-stats div {
  padding: 10px;
  border-radius: 10px;
  background: #edf1ed;
}

.compact-stats span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.compact-stats b {
  color: var(--teal);
  font-size: 19px;
}

.planner-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 max(24px, calc((100vw - 1220px) / 2));
  color: rgba(255,255,255,.62);
  background: #082c2e;
  font-size: 10px;
}

.planner-footer span {
  color: var(--gold);
  font-weight: 700;
}

.planner-footer p {
  flex: 1;
  margin: 0;
}

.planner-footer strong {
  color: white;
}

.topbar {
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  color: white;
  background: linear-gradient(90deg, #062e30, #0c4647 48%, #062e30);
  box-shadow: 0 8px 24px rgba(5, 32, 33, .24);
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--deep);
  border-radius: 11px;
  background: var(--gold);
  font-weight: 900;
}

.brand-mini div {
  display: grid;
}

.brand-mini strong {
  font-size: 14px;
}

.brand-mini small {
  color: rgba(255, 255, 255, .45);
  font-size: 8px;
  letter-spacing: .17em;
}

.time-strip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.time-strip strong {
  color: var(--gold);
  font-size: 18px;
}

.time-strip .divider {
  width: 1px;
  height: 16px;
  margin: 0 8px;
  background: rgba(255,255,255,.28);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.icon-btn {
  height: 34px;
  padding: 0 12px;
  color: rgba(255, 255, 255, .76);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: 11px;
}

.icon-btn:hover {
  color: white;
  background: rgba(255,255,255,.12);
}

.scene {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background-color: #dce8e2;
  transition: background .55s ease;
}

.scene::before,
.scene::after {
  position: absolute;
  content: "";
  z-index: -2;
}

.scene::before {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 40%),
    linear-gradient(0deg, rgba(8,40,41,.22), transparent 45%);
}

.scene-noise {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.scene-meeting {
  background:
    linear-gradient(140deg, transparent 0 54%, rgba(28, 107, 107, .16) 54% 55%, transparent 55%),
    linear-gradient(#cfe4e1 0 48%, #aebcb7 48% 51%, #c3a57e 51%);
}

.scene-meeting .decor-one {
  position: absolute;
  top: 12%;
  right: 12%;
  width: 34%;
  height: 34%;
  border: 12px solid #f5f4eb;
  background: linear-gradient(140deg, #cce8ec, #5b979e);
  box-shadow: 0 12px 32px rgba(14, 56, 59, .14);
}

.scene-meeting .decor-two {
  position: absolute;
  right: 8%;
  bottom: 11%;
  width: 50%;
  height: 22%;
  transform: skewX(-18deg);
  border-radius: 16px;
  background: linear-gradient(180deg, #f3efe3, #d8c9af);
  box-shadow: -18px 22px 35px rgba(25, 51, 48, .16);
}

.scene-office {
  background: linear-gradient(#e6e2d5 0 55%, #b89973 55%);
}

.scene-office .decor-one,
.scene-doctor .decor-one,
.scene-pathology .decor-one {
  position: absolute;
  top: 10%;
  right: 10%;
  width: 44%;
  height: 43%;
  border: 9px solid rgba(255,255,255,.76);
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(46,73,70,.12) 47% 51%, transparent 51%),
    linear-gradient(135deg, #f8f7ef, #d8e3dd);
  box-shadow: 0 18px 60px rgba(37, 47, 43, .16);
}

.scene-office .decor-two,
.scene-doctor .decor-two,
.scene-pathology .decor-two {
  position: absolute;
  right: 7%;
  bottom: 12%;
  width: 52%;
  height: 14%;
  border-radius: 5px;
  background: linear-gradient(180deg, #d3b38f, #8f6c4c);
  box-shadow: 0 18px 24px rgba(64, 41, 22, .18);
}

.scene-campus {
  background:
    radial-gradient(circle at 72% 32%, rgba(255,255,255,.8) 0 4%, transparent 4%),
    linear-gradient(180deg, #71b7c3 0 48%, #80ad77 48% 70%, #c8b68b 70%);
}

.scene-campus .decor-one {
  position: absolute;
  top: 17%;
  right: 13%;
  width: 28%;
  height: 48%;
  border: 12px solid #dfe7df;
  background: #6d9296;
  box-shadow: 0 20px 40px rgba(10, 47, 46, .2);
}

.scene-campus .decor-two {
  position: absolute;
  top: 31%;
  left: 10%;
  width: 12%;
  height: 38%;
  border-radius: 60% 35% 10% 10%;
  background: #2d6f59;
  box-shadow: 160px 30px 0 #4a8962, 300px -8px 0 #2f755f;
}

.scene-doctor {
  background: linear-gradient(#eef0eb 0 56%, #c7b7a3 56%);
}

.scene-pathology {
  background: linear-gradient(#dce9e4 0 56%, #98a99f 56%);
}

.scene-pathology .decor-one {
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(16,68,67,.17) 49% 51%, transparent 51%),
    linear-gradient(#edf4f1, #c6dcd6);
}

.scene-lobby {
  background: linear-gradient(#d8e6e8 0 48%, #b7c6c7 48% 55%, #d9d2c4 55%);
}

.scene-lobby .decor-one {
  position: absolute;
  top: 0;
  right: 7%;
  width: 48%;
  height: 61%;
  border-right: 14px solid #edf2f0;
  border-left: 14px solid #edf2f0;
  background:
    repeating-linear-gradient(90deg, transparent 0 20%, rgba(49,87,86,.13) 20% 21%),
    linear-gradient(180deg, #d9ebee, #edf2f1);
}

.scene-home {
  background:
    radial-gradient(circle at 76% 18%, #fff9e3 0 7%, transparent 28%),
    linear-gradient(145deg, #9bb7ad, #ece4d3 60%);
}

.scene-home .decor-one {
  position: absolute;
  right: 11%;
  bottom: 15%;
  width: 42%;
  height: 45%;
  border: 18px solid #d8c8aa;
  background: linear-gradient(90deg, #f0eee7, #c8d7d0);
}

.scene-decor span {
  display: block;
}

.mission-card {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 28px;
  width: min(280px, 28vw);
  padding: 16px 18px;
  color: white;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 17px;
  background: rgba(6, 44, 45, .72);
  box-shadow: 0 14px 42px rgba(3, 29, 30, .18);
  backdrop-filter: blur(12px);
}

.mission-card > span,
.mission-card small {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 9px;
  letter-spacing: .13em;
}

.mission-card strong {
  display: block;
  margin: 5px 0 10px;
  font-size: 14px;
}

.mission-progress {
  height: 4px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.16);
}

.mission-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #f5da9c);
  transition: width .45s ease;
}

.character-stage {
  position: absolute;
  inset: 0 0 135px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.npc-avatar {
  position: relative;
  display: grid;
  width: clamp(175px, 22vw, 300px);
  aspect-ratio: .82;
  place-items: center;
  transform: translateX(17vw);
  border-radius: 50% 50% 42% 42%;
  color: white;
  background:
    radial-gradient(circle at 50% 32%, #f0c6a9 0 17%, transparent 17.4%),
    radial-gradient(circle at 50% 34%, #1e4d55 0 27%, transparent 27.5%),
    linear-gradient(145deg, #2c7c77 0 54%, #123b43 54%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.16), var(--shadow);
  overflow: hidden;
  animation: character-in .48s cubic-bezier(.18,.8,.3,1) both;
}

.npc-avatar::before {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 35%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 45% 50% 48% 52%;
  background: var(--skin, #eec3a6);
  box-shadow: 0 -15px 0 8px var(--hair, #173b41);
  content: "";
}

.npc-avatar::after {
  position: absolute;
  right: 28%;
  bottom: 8%;
  left: 28%;
  height: 53%;
  border-radius: 48% 48% 0 0;
  background: var(--coat, #e9ece7);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
  content: "";
}

.npc-avatar span {
  position: relative;
  z-index: 2;
  margin-top: 6%;
  color: rgba(255,255,255,.82);
  font-size: clamp(34px, 5vw, 66px);
  font-weight: 900;
  text-shadow: 0 3px 20px rgba(4,29,30,.3);
}

.npc-avatar i {
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
}

.npc-avatar.has-art {
  width: clamp(255px, 30vw, 430px);
  aspect-ratio: 1;
  border: 6px solid rgba(255,255,255,.58);
  border-radius: 34px;
  background: rgba(255,255,255,.28);
  box-shadow:
    0 30px 75px rgba(4, 38, 39, .25),
    0 8px 24px rgba(4, 38, 39, .14),
    inset 0 0 0 1px rgba(255,255,255,.7);
}

.npc-avatar.has-art::before,
.npc-avatar.has-art::after,
.npc-avatar.has-art > span {
  display: none;
}

.npc-avatar.has-art > i {
  inset: 10px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.44);
  border-radius: 22px;
  pointer-events: none;
}

.npc-avatar.has-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 27px;
}

.avatar-manager { --hair: #29434b; --coat: #254a51; }
.avatar-doctor { --hair: #30363a; --coat: #f2f3ed; background: linear-gradient(145deg, #64908c, #1d5455); }
.avatar-director { --hair: #3b2c23; --coat: #f5f1e8; background: linear-gradient(145deg, #b89258, #6b4d32); }
.avatar-colleague { --hair: #172e45; --coat: #dce8e1; background: linear-gradient(145deg, #438b83, #21535c); }
.avatar-nurse { --hair: #262b34; --coat: #efb0a7; background: linear-gradient(145deg, #e0a09a, #7e5860); }
.avatar-xiaoluo { --hair: #3a2c26; --coat: #0d5555; background: linear-gradient(145deg, #2e8179, #0b4649); }

@keyframes character-in {
  from { opacity: 0; transform: translateX(20vw) translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateX(17vw) translateY(0) scale(1); }
}

.dialogue-shell {
  position: absolute;
  z-index: 10;
  right: clamp(24px, 4vw, 70px);
  bottom: 26px;
  left: clamp(24px, 4vw, 70px);
  min-height: 154px;
  padding: 30px 96px 26px 34px;
  color: white;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(6, 43, 45, .96), rgba(8, 37, 43, .94));
  box-shadow: 0 24px 65px rgba(4, 31, 34, .34);
  backdrop-filter: blur(18px);
}

.speaker-row {
  position: absolute;
  top: -20px;
  left: 25px;
  display: flex;
  min-width: 280px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  border-radius: 12px 12px 3px 3px;
  background: linear-gradient(90deg, #c7a24f, #6d8a4a 72%, transparent 100%);
  box-shadow: 0 8px 18px rgba(5, 33, 34, .18);
}

.speaker-row span {
  color: rgba(255,255,255,.72);
  font-size: 9px;
  letter-spacing: .1em;
}

.speaker-row strong {
  font-size: 15px;
}

.auto-btn {
  position: absolute;
  left: calc(100% + 12px);
  padding: 5px 9px;
  color: #4b3a0e;
  border: 0;
  border-radius: 8px;
  background: #ffd45e;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.auto-btn[aria-pressed="true"] {
  color: white;
  background: var(--coral);
}

#dialogue-text {
  max-width: 900px;
  min-height: 52px;
  margin: 0;
  color: rgba(255,255,255,.91);
  font-size: clamp(14px, 1.45vw, 18px);
  line-height: 1.9;
}

.next-btn {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: grid;
  color: rgba(255,255,255,.56);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.next-btn b {
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  50% { transform: translate(3px, 3px); opacity: .7; }
}

.choices {
  display: grid;
  max-width: 780px;
  gap: 9px;
  margin-top: 4px;
}

.choice-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  padding: 10px 15px;
  color: #f7f5ed;
  text-align: left;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(35, 114, 111, .56), rgba(255,255,255,.04));
  cursor: pointer;
  transition: transform .17s ease, border-color .17s ease, background .17s ease;
}

.choice-btn:hover {
  transform: translateX(6px);
  border-color: rgba(244, 205, 112, .8);
  background: linear-gradient(90deg, rgba(48, 141, 132, .7), rgba(255,255,255,.07));
}

.choice-btn b {
  color: var(--gold);
}

.statusbar {
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  color: #daebe6;
  background: #06292c;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
}

.stat-chip span {
  color: rgba(255,255,255,.5);
  font-size: 9px;
}

.stat-chip b {
  color: #9ad0b0;
  font-size: 13px;
}

.stat-chip.energy b {
  color: #efc16b;
}

.chapter-line {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 9px;
  letter-spacing: .13em;
}

.chapter-line span {
  color: var(--gold);
}

.chapter-line i {
  width: 50px;
  height: 1px;
  background: rgba(255,255,255,.18);
}

.chapter-line strong {
  color: rgba(255,255,255,.54);
  font-weight: 500;
}

.panel-dialog,
.about-dialog {
  width: min(660px, calc(100vw - 28px));
  max-height: min(760px, calc(100svh - 40px));
  padding: 34px;
  color: var(--ink);
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel-dialog::backdrop,
.about-dialog::backdrop {
  background: rgba(3, 29, 31, .68);
  backdrop-filter: blur(6px);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: rgba(7, 54, 54, .07);
  cursor: pointer;
  font-size: 22px;
}

.panel-dialog h2,
.about-dialog h2 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.25;
}

.about-dialog > p:not(.eyebrow) {
  margin: 0 0 24px;
  color: #516764;
  line-height: 1.9;
}

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

.panel-card,
.relation-card,
.note-entry {
  padding: 16px;
  border: 1px solid rgba(16, 95, 92, .13);
  border-radius: 14px;
  background: white;
}

.panel-card small,
.relation-card small,
.note-entry small {
  color: var(--muted);
}

.panel-card strong {
  display: block;
  margin: 4px 0;
  color: var(--teal);
  font-size: 28px;
}

.mini-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 9px;
  background: #e6ece8;
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--jade));
}

.relation-list,
.notes-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  margin-top: 20px;
  overflow: auto;
}

.relation-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}

.relation-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--teal-bright), var(--deep));
  font-weight: 800;
}

.relation-avatar.has-photo {
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.86);
  background: #dce8e2;
  box-shadow: 0 4px 12px rgba(9,47,49,.14);
}

.relation-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.relation-card p,
.note-entry p {
  margin: 4px 0 0;
  color: #506662;
  font-size: 12px;
  line-height: 1.6;
}

.relation-score {
  color: var(--coral);
  font-weight: 800;
}

.note-entry {
  border-left: 4px solid var(--gold);
}

.note-entry b {
  color: var(--teal);
}

.empty-state {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed rgba(15,98,96,.25);
  border-radius: 14px;
}

.ending-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(103, 178, 144, .28), transparent 30%),
    linear-gradient(145deg, #062e31, #0b4542 58%, #173a3c);
}

.ending-orbit {
  position: absolute;
  width: min(76vw, 840px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 90px rgba(255,255,255,.018), 0 0 0 180px rgba(255,255,255,.012);
}

.ending-content {
  position: relative;
  z-index: 2;
  width: min(650px, calc(100vw - 36px));
}

.ending-rank {
  display: grid;
  width: 118px;
  height: 118px;
  margin: 0 auto 20px;
  place-items: center;
  color: var(--deep);
  border-radius: 38% 62% 55% 45%;
  background: linear-gradient(145deg, #f4d485, #e7b257);
  box-shadow: 0 20px 60px rgba(230, 179, 87, .24);
  font-size: 62px;
  font-weight: 900;
}

.ending-content h2 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 60px);
}

.ending-content > p:not(.eyebrow) {
  color: rgba(255,255,255,.7);
  line-height: 1.9;
}

.ending-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 30px 0;
}

.ending-stats div {
  padding: 14px 8px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  background: rgba(255,255,255,.06);
}

.ending-stats span {
  display: block;
  color: rgba(255,255,255,.46);
  font-size: 9px;
}

.ending-stats b {
  color: #f0ce82;
  font-size: 23px;
}

.ending-actions {
  justify-content: center;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  padding: 12px 18px;
  color: white;
  border-radius: 11px;
  background: rgba(7, 51, 52, .94);
  box-shadow: 0 16px 40px rgba(3, 25, 27, .24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: .25s ease;
  font-size: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .title-art {
    background-position: 36% center;
  }

  .title-gradient {
    background:
      linear-gradient(0deg, rgba(4,34,35,.94) 0%, rgba(4,34,35,.52) 58%, rgba(4,34,35,.15));
  }

  .title-copy {
    align-self: end;
    width: auto;
    margin: 0 24px 86px;
  }

  .title-copy h1 {
    font-size: clamp(54px, 18vw, 82px);
  }

  .title-subtitle {
    font-size: 13px;
    line-height: 1.75;
  }

  .title-footer {
    right: 20px;
    bottom: 18px;
    left: 20px;
  }

  .title-footer span:first-child {
    display: none;
  }

  .title-footer span:last-child {
    margin-left: auto;
  }

  .game-screen {
    grid-template-rows: 60px 1fr 48px;
  }

  .planner-screen {
    grid-template-rows: 60px 1fr 42px;
  }

  .planner-body {
    width: calc(100vw - 24px);
    padding: 12px 0;
  }

  .week-strip {
    gap: 4px;
    margin-bottom: 9px;
  }

  .day-pill {
    min-height: 45px;
    padding: 5px 2px;
    border-radius: 9px;
  }

  .day-pill span {
    font-size: 8px;
  }

  .day-pill b {
    font-size: 10px;
  }

  .day-pill i {
    right: 5px;
    bottom: 5px;
    width: 4px;
    height: 4px;
  }

  .planner-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
  }

  .planner-hero h2 {
    font-size: 23px;
  }

  .planner-hero p:not(.eyebrow) {
    font-size: 10px;
  }

  .meeting-readiness {
    padding: 12px;
  }

  .meeting-readiness strong {
    font-size: 22px;
  }

  .planner-content {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }

  .planner-content > section {
    padding: 15px;
    border-radius: 15px;
  }

  .section-heading {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .section-heading h3 {
    font-size: 20px;
  }

  .section-heading .slot-cost {
    max-width: 90px;
    text-align: right;
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .action-card {
    min-height: 125px;
    padding: 13px;
  }

  .action-card.special {
    min-height: 128px;
  }

  .planner-aside {
    grid-template-columns: 1fr 1fr;
  }

  .today-card,
  .compact-stats {
    padding: 12px;
  }

  .today-slot {
    grid-template-columns: 36px 1fr;
    padding: 8px;
  }

  .compact-stats {
    gap: 5px;
  }

  .compact-stats div {
    padding: 7px;
  }

  .compact-stats b {
    font-size: 16px;
  }

  .planner-footer {
    padding: 0 12px;
  }

  .planner-footer p {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    padding: 0 13px;
  }

  .brand-mini div,
  .time-strip .divider,
  #location-label {
    display: none;
  }

  .time-strip {
    justify-self: center;
  }

  .top-actions {
    grid-column: 2;
    justify-self: end;
  }

  .icon-btn {
    width: 34px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  .icon-btn::first-letter {
    color: rgba(255,255,255,.78);
  }

  .scene {
    min-height: 0;
  }

  .mission-card {
    top: 12px;
    left: 12px;
    width: 185px;
    padding: 11px 12px;
  }

  .mission-card strong {
    margin: 3px 0 7px;
    font-size: 12px;
  }

  .character-stage {
    inset: 0 0 185px;
  }

  .npc-avatar {
    width: min(54vw, 240px);
    transform: translate(12vw, 10px);
  }

  .npc-avatar.has-art {
    width: min(68vw, 290px);
    border-width: 4px;
    border-radius: 24px;
  }

  .npc-avatar.has-art img {
    border-radius: 19px;
  }

  .npc-avatar.has-art > i {
    inset: 7px;
    border-radius: 16px;
  }

  @keyframes character-in {
    from { opacity: 0; transform: translate(14vw, 25px) scale(.96); }
    to { opacity: 1; transform: translate(12vw, 10px) scale(1); }
  }

  .dialogue-shell {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-height: 178px;
    padding: 30px 54px 20px 20px;
    border-radius: 16px;
  }

  .speaker-row {
    left: 14px;
    min-width: 200px;
  }

  #dialogue-text {
    font-size: 13px;
    line-height: 1.75;
  }

  .choice-btn {
    grid-template-columns: 26px 1fr;
    padding: 8px 10px;
    font-size: 12px;
  }

  .statusbar {
    gap: 4px;
    padding: 0 8px;
  }

  .stat-chip {
    flex: 1;
    justify-content: center;
    padding: 4px 3px;
  }

  .stat-chip span {
    display: none;
  }

  .chapter-line {
    display: none;
  }

  .panel-dialog,
  .about-dialog {
    padding: 28px 20px 22px;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .ending-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .game-screen {
    grid-template-rows: 62px 1fr 48px;
  }

  .dialogue-shell {
    min-height: 132px;
    padding-top: 25px;
    padding-bottom: 18px;
  }

  .character-stage {
    inset-bottom: 120px;
  }

  .mission-card {
    top: 14px;
  }
}

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