/* ==========================================================================
   《未央｜與你共度的每一刻》Luxury Modern Taipei Otome Visual Novel Theme
   ========================================================================== */

:root {
  --bg-deep: #0e0c14;
  --glass: rgba(17, 15, 25, 0.78);
  --glass-strong: rgba(15, 13, 22, 0.91);
  --glass-light: rgba(255, 255, 255, 0.07);
  --border: rgba(236, 206, 155, 0.22);
  --border-rose: rgba(242, 156, 180, 0.36);

  --text-main: #f8f3ec;
  --text-soft: #d5cbbf;
  --text-muted: #9e9389;

  --gold: #e8c589;
  --gold-bright: #f7dfb0;
  --rose: #f29cb4;
  --rose-deep: #d96d8e;
  --jade: #6fd3ae;
  --amber: #f4b761;
  --danger: #f06d7a;

  --font-serif: "Noto Serif TC", "PMingLiU", "Songti TC", Georgia, serif;
  --font-sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.58);
  --radius: 16px;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* Custom clear scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb {
  background: rgba(232, 197, 137, 0.52);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(242, 156, 180, 0.72);
}

/* ==========================================================================
   TITLE & CHARACTER CREATION SCREEN
   ========================================================================== */
#screen-title {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(242, 156, 180, 0.16), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(232, 197, 137, 0.14), transparent 50%),
              #0e0c14;
}

.title-bg {
  position: fixed;
  inset: 0;
  background: url('../assets/backgrounds/bg_taipei_date.jpg') center/cover no-repeat;
  filter: blur(6px) brightness(0.42) saturate(1.1);
  transform: scale(1.06);
  z-index: 0;
}

.title-shell {
  position: relative;
  z-index: 2;
  margin: auto 0;
  width: min(1080px, 100%);
  height: min(820px, calc(100vh - 36px));
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.title-preview {
  position: relative;
  height: 100%;
  min-height: 0;
  background: linear-gradient(175deg, rgba(242, 156, 180, 0.18), rgba(14, 12, 20, 0.92));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px 0;
  overflow: hidden;
}

.brand-tag {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.game-logo {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  background: linear-gradient(120deg, #fff5e2, var(--gold), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}

.preview-portrait-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 8px;
  overflow: hidden;
}

.preview-portrait-wrap img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.55));
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.preview-badge {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(15, 13, 22, 0.85);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  color: var(--gold-bright);
  backdrop-filter: blur(8px);
}

.title-form {
  padding: 22px 24px 20px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-gutter: stable;
}

.form-heading {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.gender-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gender-card {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.22s ease;
  text-align: left;
}

.gender-card:hover {
  border-color: var(--gold);
  background: rgba(232, 197, 137, 0.08);
}

.gender-card.active {
  border-color: var(--rose);
  background: linear-gradient(135deg, rgba(242, 156, 180, 0.18), rgba(232, 197, 137, 0.10));
  box-shadow: 0 0 0 1px rgba(242, 156, 180, 0.4);
}

.gender-card .gc-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.gender-card .gc-desc {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.45;
}

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

.diff-card {
  cursor: pointer;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  transition: all 0.2s ease;
}

.diff-card:hover {
  border-color: var(--gold);
  background: rgba(232, 197, 137, 0.09);
}

.diff-card.active {
  border-color: var(--rose);
  background: linear-gradient(135deg, rgba(242, 156, 180, 0.2), rgba(232, 197, 137, 0.12));
  box-shadow: 0 0 0 1px rgba(242, 156, 180, 0.4);
}

.dc-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.dc-money {
  font-size: 11px;
  color: var(--gold-bright);
  margin-top: 3px;
}

.bank-box {
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(240, 109, 122, 0.08);
  border: 1px solid rgba(240, 109, 122, 0.3);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.career-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(154, 188, 255, 0.07);
  border: 1px solid rgba(154, 188, 255, 0.24);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-soft);
}

/* Interactive Monthly Calendar Planner */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-month-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-bright);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal-cell {
  min-height: 54px;
  padding: 5px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  transition: all 0.16s ease;
}

.cal-cell:hover {
  border-color: var(--gold);
  background: rgba(232, 197, 137, 0.1);
}

.cal-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.cal-cell.today {
  border-color: var(--rose);
  background: rgba(242, 156, 180, 0.15);
}

.cal-cell.selected {
  box-shadow: 0 0 0 2px var(--gold-bright);
  background: rgba(232, 197, 137, 0.18);
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.cal-tag {
  font-size: 9.5px;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 5px;
  background: rgba(232, 197, 137, 0.22);
  color: var(--gold-bright);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-tag.plan {
  background: rgba(242, 156, 180, 0.28);
  color: #ffe3ec;
}

.cal-panel {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.cal-act-btn {
  text-align: left;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: all 0.18s ease;
}

.cal-act-btn:hover {
  border-color: var(--rose);
  background: rgba(242, 156, 180, 0.16);
}

.cal-act-title {
  font-size: 12.8px;
  font-weight: 700;
  color: #fff;
}

.cal-act-sub {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

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

.field label {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
  text-overflow: ellipsis;
  transition: border-color 0.2s;
}

.salary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.salary-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--rose);
}

.field select option {
  background: #1a1726;
  color: #fff;
}

.field input:focus, .field select:focus {
  border-color: var(--rose);
}

/* Collapsible In-Game Guide Accordion */
.guide-details {
  background: rgba(232, 197, 137, 0.06);
  border: 1px solid rgba(232, 197, 137, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12.8px;
  line-height: 1.65;
  color: var(--text-soft);
}

.guide-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--gold-bright);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guide-details summary::-webkit-details-marker {
  display: none;
}

.guide-details summary::after {
  content: "展開教學 ▾";
  font-size: 11.5px;
  font-weight: 500;
  color: var(--rose);
}

.guide-details[open] summary::after {
  content: "收合教學 ▴";
}

.guide-steps {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-steps a {
  color: var(--rose);
  text-decoration: underline;
  font-weight: 600;
}

.guide-faq {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.55;
}

.key-input-row {
  display: flex;
  gap: 6px;
}

.key-input-row input {
  flex: 1;
}

.btn-eye {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 0 11px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
}

.btn-eye:hover {
  border-color: var(--gold);
  color: #fff;
}

.salary-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.salary-row input[type="range"] {
  flex: 1;
  accent-color: var(--rose);
}

.salary-val {
  min-width: 96px;
  text-align: right;
  font-size: 13px;
  color: var(--gold-bright);
  font-weight: 600;
}

.toggle-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(240, 109, 122, 0.08);
  border: 1px solid rgba(240, 109, 122, 0.24);
}

.toggle-box .tb-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffdce1;
}

.toggle-box .tb-desc {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  transition: 0.25s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
}

.switch input:checked + .slider {
  background: var(--rose-deep);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.title-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #e77b9b, #d89b5d);
  color: #16111c;
  box-shadow: 0 8px 24px rgba(231, 123, 155, 0.32);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--gold-bright);
}

.btn-secondary:hover {
  background: rgba(232, 197, 137, 0.16);
}

/* ==========================================================================
   MAIN VISUAL NOVEL STAGE
   ========================================================================== */
#screen-game {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
}

.stage-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: background-image 0.7s ease, filter 0.7s ease;
  animation: slowDrift 32s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes slowDrift {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.07) translate(-0.8%, -0.5%); }
}

.stage-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 10, 18, 0.62) 0%,
    rgba(12, 10, 18, 0.12) 28%,
    rgba(12, 10, 18, 0.22) 55%,
    rgba(10, 8, 16, 0.90) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* Character Portrait Layer */
.stage-character {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  padding-bottom: 185px;
}

#char-sprite {
  height: min(76vh, 660px);
  max-width: 92vw;
  object-fit: contain;
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.55));
  transition: opacity 0.35s ease, filter 0.45s ease, transform 0.45s ease;
  animation: gentleBreathe 5.2s ease-in-out infinite;
}

#char-sprite.mood-tired {
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.6)) saturate(0.84) brightness(0.92);
}

#char-sprite.mood-casual {
  filter: drop-shadow(0 18px 38px rgba(242, 186, 140, 0.22)) saturate(1.04) brightness(1.03);
}

#char-sprite.mood-blush {
  filter: drop-shadow(0 18px 42px rgba(242, 156, 180, 0.30)) saturate(1.07);
}

@keyframes gentleBreathe {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-4px) scale(1.007); }
}

/* ==========================================================================
   TOP HUD BAR
   ========================================================================== */
.top-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-pill {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.hud-time {
  color: var(--gold-bright);
  font-weight: 700;
}

.hud-loc {
  color: var(--text-soft);
}

.hud-p {
  font-size: 11px;
  color: var(--rose);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 7px;
}

/* Compact Vital Meters */
.vital-chip {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 5px 11px;
  min-width: 118px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.vital-chip:hover {
  border-color: var(--gold);
}

.vital-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 3px;
}

.vital-top strong {
  color: #fff;
  font-weight: 700;
}

.vital-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.vital-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.45s ease;
}

.fill-hp { background: linear-gradient(90deg, #52b891, #8ef0c8); }
.fill-hp.low { background: linear-gradient(90deg, #d94c5b, #ff8b96); }
.fill-hunger { background: linear-gradient(90deg, #e8a44d, #ffd280); }
.fill-hunger.high { background: linear-gradient(90deg, #e05361, #ff9966); }
.fill-money { background: linear-gradient(90deg, #d9a760, #ffe3a8); }

/* Tool Buttons */
.hud-btn {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: 11px;
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hud-btn:hover {
  background: rgba(232, 197, 137, 0.18);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.hud-btn.active {
  background: rgba(242, 156, 180, 0.22);
  border-color: var(--rose);
}

.unread-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Toast Notifications (fixed top-layer above ALL modals, drawers & overlays) */
#toast-container {
  position: fixed;
  top: 20px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(380px, 88vw);
}

.toast {
  background: rgba(24, 18, 38, 0.97);
  border: 1.5px solid var(--gold-bright);
  color: var(--gold-bright);
  padding: 11px 15px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  line-height: 1.5;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(242, 156, 180, 0.25);
  animation: toastIn 0.28s ease;
}

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

/* ==========================================================================
   BOTTOM DIALOGUE & ACTION CONSOLE
   ========================================================================== */
.dialogue-dock {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--dlg-width, 980px), 96vw);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: width 0.16s ease;
}

.dialogue-box {
  background: var(--dlg-bg, rgba(16, 13, 26, 0.88));
  border: 1px solid var(--dlg-border, var(--border));
  border-radius: var(--dlg-radius, 20px);
  padding: 16px 22px 14px;
  backdrop-filter: blur(var(--dlg-blur, 22px));
  box-shadow: var(--dlg-shadow, var(--shadow-lg));
  user-select: text;
  transition: background 0.18s ease, border-color 0.18s ease, border-radius 0.18s ease;
}

.dialogue-box.frame-romantic {
  border-width: 1.5px;
  box-shadow: 0 12px 38px rgba(242, 156, 180, 0.22), var(--shadow-lg);
}

.dialogue-box.frame-classic {
  border-width: 1.5px;
  outline: 1px solid rgba(232, 198, 138, 0.35);
  outline-offset: -5px;
}

.dialogue-box.frame-minimal {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.dialogue-box.light-theme .scene-title {
  color: #7d4c24;
  font-weight: 600;
}

.dialogue-box.light-theme .mood-pill {
  color: #9e3256;
  background: rgba(180, 62, 102, 0.12);
  border-color: rgba(180, 62, 102, 0.35);
}

.dialogue-box.light-theme .style-trigger-btn {
  color: #5c3a21;
  background: rgba(125, 76, 36, 0.1);
  border-color: rgba(125, 76, 36, 0.32);
}

.dialogue-box.light-theme .choices-row {
  border-top-color: rgba(40, 25, 35, 0.14);
}

.dialogue-box.light-theme .choice-btn {
  background: rgba(40, 25, 35, 0.07);
  border-color: rgba(125, 76, 36, 0.35);
  color: #241926;
}

.dialogue-box.light-theme .choice-btn:hover {
  background: rgba(242, 156, 180, 0.25);
  border-color: #c24b73;
}

.dialogue-box.light-theme .choice-badge {
  background: rgba(125, 76, 36, 0.14);
  color: #5c3a21;
}

.dialogue-header-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.style-trigger-btn {
  font-family: inherit;
  font-size: 11.5px;
  color: var(--gold-bright);
  background: rgba(232, 198, 138, 0.12);
  border: 1px solid rgba(232, 198, 138, 0.35);
  padding: 3px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.style-trigger-btn:hover {
  background: rgba(232, 198, 138, 0.26);
  transform: translateY(-1px);
}

.dialogue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.speaker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speaker-badge {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #191321;
  background: linear-gradient(120deg, var(--gold-bright), var(--rose));
  padding: 3px 14px;
  border-radius: 99px;
  letter-spacing: 0.08em;
}

.scene-title {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.mood-pill {
  font-size: 11.5px;
  color: var(--rose);
  background: rgba(242, 156, 180, 0.12);
  border: 1px solid rgba(242, 156, 180, 0.28);
  padding: 3px 10px;
  border-radius: 99px;
}

.story-scroll {
  height: min(var(--dlg-height, 190px), 58vh);
  max-height: 58vh;
  min-height: 80px;
  overflow-y: auto;
  padding-right: 6px;
  line-height: var(--dlg-line-height, 1.78);
  font-size: var(--dlg-font-size, 15px);
  font-family: var(--dlg-font-family, var(--font-sans));
  cursor: pointer;
  transition: height 0.12s ease;
}

.story-scroll p {
  margin-bottom: 8px;
  font-size: inherit;
  line-height: inherit;
  font-family: inherit;
}

.story-scroll p:last-child {
  margin-bottom: 0;
}

.para-narration {
  color: var(--dlg-text, var(--text-soft));
}

.para-dialogue {
  color: var(--dlg-dialogue-text, #fff8ee);
  font-weight: 500;
  padding-left: 10px;
  border-left: 2.5px solid var(--dlg-accent, var(--rose));
}

/* Primary 2 Choices (Prompt spec: 擇1) */
.choices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.choice-btn {
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(232, 197, 137, 0.28);
  border-radius: 13px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.choice-btn:hover {
  background: rgba(232, 197, 137, 0.16);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

.choice-btn.tone-rose {
  border-color: rgba(242, 156, 180, 0.42);
  background: rgba(242, 156, 180, 0.10);
}

.choice-btn.tone-rose:hover {
  background: rgba(242, 156, 180, 0.22);
}

.choice-btn.tone-warn {
  border-color: rgba(240, 109, 122, 0.65);
  background: rgba(240, 109, 122, 0.18);
}

.choice-btn.tone-gold {
  border-color: var(--gold-bright);
  background: linear-gradient(120deg, rgba(232, 197, 137, 0.24), rgba(242, 156, 180, 0.22));
}

.choice-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold-bright);
}

/* Action Strip & Free Input */
.control-bar {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.qa-btn {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.18s;
}

.qa-btn:hover {
  color: #fff;
  border-color: var(--rose);
  background: rgba(242, 156, 180, 0.16);
}

.chat-form {
  width: 100%;
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13.5px;
  outline: none;
  backdrop-filter: blur(16px);
}

.chat-input:focus {
  border-color: var(--rose);
}

.chat-send {
  background: linear-gradient(135deg, #e77b9b, #d89b5d);
  color: #16111c;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.chat-send:hover {
  filter: brightness(1.08);
}

/* ==========================================================================
   SLIDE-OVER STATUS DRAWER (Exact Prompt Status Card)
   ========================================================================== */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 94vw);
  background: rgba(14, 12, 22, 0.95);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(24px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -14px 0 40px rgba(0, 0, 0, 0.55);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 {
  font-family: var(--font-serif);
  color: var(--gold-bright);
  font-size: 17px;
}

.icon-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
}

.icon-close:hover {
  background: rgba(242, 156, 180, 0.25);
}

.status-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-row {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.8px;
  line-height: 1.5;
}

.status-k {
  color: var(--gold);
  font-weight: 600;
  margin-right: 6px;
}

.status-v {
  color: var(--text-main);
}

/* ==========================================================================
   MODALS (Phone Chat / Finance & Stock / History / Save & Settings / Intimacy Confirm)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 11, 0.72);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 86vh;
  background: rgba(18, 15, 28, 0.96);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.22s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--gold-bright);
}

.modal-body {
  padding: 18px 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   AUTHENTIC TAIWAN LINE APP CHAT UI
   ========================================================================== */
.modal-card.line-modal {
  width: min(440px, 98vw);
  max-height: 90vh;
  background: #172130;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
}

.modal-card.line-modal .modal-header {
  display: none;
}

.modal-card.line-modal .modal-body {
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: min(690px, 86vh);
}

.line-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: #141d2b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.line-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-back-btn {
  background: none;
  border: none;
  color: #e6eef8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.line-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 14%;
  background: linear-gradient(135deg, #2d384c, #49384a);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.line-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 14%;
  background: linear-gradient(135deg, #2d384c, #49384a);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.line-peer-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.line-peer-status {
  font-size: 11px;
  color: #9bb4d1;
  margin-top: 1px;
}

.line-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 11px;
  background: #16202e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  overflow: visible;
}

.line-feed {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 16px;
  background: linear-gradient(180deg, #1d2b40 0%, #24354e 100%);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.line-date-pill {
  align-self: center;
  background: rgba(11, 18, 28, 0.45);
  color: #d6e4f5;
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 99px;
  margin: 4px 0;
}

.line-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
}

.line-row.row-player {
  justify-content: flex-end;
}

.line-row.row-weiyang {
  justify-content: flex-start;
}

.line-meta {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  color: #b7cae0;
  line-height: 1.25;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.row-player .line-meta {
  align-items: flex-end;
}

.line-read-tag {
  color: #9ce883;
  font-weight: 600;
}

.line-bubble {
  max-width: 72%;
  padding: 9px 13px;
  font-size: 13.8px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.row-weiyang .line-bubble {
  background: #ffffff;
  color: #1c2026;
  border-radius: 4px 16px 16px 16px;
}

.row-player .line-bubble {
  background: #8ee56b;
  color: #12240d;
  border-radius: 16px 4px 16px 16px;
}

.line-sticker-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 10px;
  border-radius: 18px;
  min-width: 114px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.line-sticker-emoji {
  font-size: 38px;
  line-height: 1.1;
}

.line-sticker-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #2b2029;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 9px;
  border-radius: 99px;
}

.line-photo-card {
  max-width: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #101722;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.line-photo-card img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}

.line-photo-cap {
  padding: 7px 10px;
  font-size: 12px;
  color: #eef4fb;
  line-height: 1.4;
}

.line-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.14);
  color: #e4eef9;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11.5px;
}

.line-drawer {
  background: #131c29;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  max-height: 210px;
  overflow-y: auto;
  flex-shrink: 0;
}

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

.sticker-pick {
  cursor: pointer;
  border: none;
  border-radius: 14px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: transform 0.15s ease;
}

.sticker-pick:hover {
  transform: scale(1.05);
}

.sticker-pick span:first-child {
  font-size: 24px;
}

.sticker-pick span:last-child {
  font-size: 10.5px;
  font-weight: 700;
  color: #2b2029;
}

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

.photo-pick {
  cursor: pointer;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1b2638;
  text-align: left;
  padding: 0;
}

.photo-pick img {
  width: 100%;
  height: 66px;
  object-fit: cover;
  display: block;
}

.photo-pick-label {
  padding: 5px 8px;
  font-size: 11.5px;
  color: #f4f7fb;
}

.line-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #141d2b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.line-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.line-tool-btn:hover, .line-tool-btn.active {
  background: rgba(142, 229, 107, 0.25);
}

.line-text-inp {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13.5px;
  color: #fff;
  outline: none;
}

.line-text-inp:focus {
  border-color: #8ee56b;
}

.line-send-btn {
  background: #06c755;
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.line-send-btn:hover {
  filter: brightness(1.08);
}

.line-home-lock {
  padding: 13px 16px;
  background: #141d2b;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #b8cae0;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  flex-shrink: 0;
}

/* Global Financial News & Sector Stock Cards */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(232, 197, 137, 0.07);
  border: 1px solid rgba(232, 197, 137, 0.24);
}

.news-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(242, 156, 180, 0.22);
  color: var(--rose);
  margin-bottom: 4px;
}

.news-headline {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
}

.news-summary {
  font-size: 11.8px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.45;
}

.sector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.sector-card {
  text-align: left;
  cursor: pointer;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.18s ease;
}

.sector-card:hover {
  border-color: var(--gold);
}

.sector-card.active {
  border-color: var(--rose);
  background: rgba(242, 156, 180, 0.16);
  box-shadow: 0 0 0 1px rgba(242, 156, 180, 0.35);
}

.sector-code {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
}

.sector-name {
  font-size: 12.5px;
  color: #fff;
  font-weight: 600;
  margin-top: 2px;
}

.stock-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* Authentic Taiwan Stock Market Colors: Red = Up (漲), Green = Down (跌) */
.tw-up {
  color: #ff6b7a !important;
  font-weight: 700;
}

.tw-down {
  color: #5ee39c !important;
  font-weight: 700;
}

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

.sector-badge {
  display: inline-block;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(232, 197, 137, 0.16);
  color: var(--gold-bright);
  margin-left: 4px;
}

.dca-box {
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(111, 211, 174, 0.07);
  border: 1px solid rgba(111, 211, 174, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dca-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.holding-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
}

.btn-sell-sm {
  background: rgba(255, 107, 122, 0.16);
  border: 1px solid rgba(255, 107, 122, 0.45);
  color: #ffd7dc;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-sell-sm:hover {
  background: rgba(255, 107, 122, 0.32);
}

@media (max-width: 540px) {
  .form-grid,
  .gender-cards,
  .cal-action-grid {
    grid-template-columns: 1fr;
  }
  .diff-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dca-grid {
    grid-template-columns: 1fr;
  }
}

/* Menu Picker Cards & Category Tabs */
.menu-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.menu-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.16s ease;
}

.menu-tab:hover {
  border-color: var(--gold);
  color: #fff;
}

.menu-tab.active {
  background: linear-gradient(135deg, rgba(242, 156, 180, 0.26), rgba(232, 197, 137, 0.2));
  border-color: var(--rose);
  color: #fff;
  font-weight: 700;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item-btn {
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(232, 197, 137, 0.24);
  border-radius: 13px;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.18s ease;
}

.menu-item-btn:hover {
  background: rgba(232, 197, 137, 0.15);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

.menu-item-price {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--gold-bright);
}

/* Daytime Away Badge on Stage */
.away-badge {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(15, 13, 24, 0.78);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  padding: 14px 24px;
  border-radius: 18px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.away-badge strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gold-bright);
  margin-bottom: 4px;
}

.away-badge span {
  font-size: 12.5px;
  color: var(--text-soft);
}

/* Finance & Stock Panel */
.house-card {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 197, 137, 0.14), rgba(242, 156, 180, 0.08));
  border: 1px solid var(--border);
}

.big-money {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 4px 0 8px;
}

.progress-track {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold-bright));
  border-radius: 99px;
  transition: width 0.4s ease;
}

.stock-box {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stock-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.stock-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--gold-bright);
}

.stock-btn:hover {
  background: rgba(232, 197, 137, 0.22);
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.ledger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
}

.ledger-plus { color: var(--jade); font-weight: 600; }
.ledger-minus { color: var(--danger); font-weight: 600; }

/* Save Slots */
.slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slot-info strong {
  font-size: 13.5px;
  color: var(--gold-bright);
}

.slot-info div {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.slot-btns {
  display: flex;
  gap: 6px;
}

.slot-btns button {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  cursor: pointer;
}

.slot-btns button:hover {
  background: rgba(232, 197, 137, 0.2);
}

/* History Log */
.history-entry {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
  line-height: 1.65;
}

.history-meta {
  font-size: 11.5px;
  color: var(--gold);
  margin-bottom: 6px;
}

/* ==========================================================================
   ENDING OVERLAYS (HE Dream Home & BE Impermanence)
   ========================================================================== */
#ending-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 7, 13, 0.94);
  backdrop-filter: blur(12px);
  animation: fadeSlow 1.4s ease;
}

@keyframes fadeSlow {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ending-card {
  width: min(680px, 100%);
  text-align: center;
  padding: 36px 32px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(18, 15, 28, 0.92);
  box-shadow: var(--shadow-lg);
}

.ending-card.impermanence {
  background: rgba(10, 10, 14, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
}

.ending-tag {
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--gold);
  margin-bottom: 10px;
}

.ending-title {
  font-family: var(--font-serif);
  font-size: 28px;
  margin-bottom: 18px;
  color: #fff;
}

.ending-body {
  text-align: left;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-soft);
  max-height: 44vh;
  overflow-y: auto;
  margin-bottom: 22px;
  padding-right: 6px;
}

.ending-body p {
  margin-bottom: 10px;
}

.epilogue-quote {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.9;
  color: #f4eee4;
  margin: 22px 0;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 860px) {
  .title-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    max-height: none;
    overflow: visible;
    margin: 0;
  }
  .title-form {
    height: auto;
    overflow-y: visible;
    padding: 18px 18px 24px;
  }
  .title-preview {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 18px 18px 0;
  }
  .preview-portrait-wrap {
    min-height: 210px;
  }
  .preview-portrait-wrap img {
    max-height: 220px;
  }
  .choices-row {
    grid-template-columns: 1fr;
  }
  .stage-character {
    padding-bottom: 240px;
  }
  #char-sprite {
    height: min(56vh, 440px);
  }
  .vital-chip {
    min-width: 95px;
    padding: 4px 8px;
  }
}

@media (max-height: 660px) {
  .dialogue-box {
    padding: 11px 16px 10px;
  }
  .story-scroll {
    height: min(var(--dlg-height, 120px), 50vh);
    max-height: 50vh;
    min-height: 76px;
    font-size: var(--dlg-font-size, 13.5px);
    line-height: var(--dlg-line-height, 1.6);
  }
  .choices-row {
    margin-top: 8px;
    padding-top: 8px;
  }
  .choice-btn {
    padding: 7px 11px;
    font-size: 12.5px;
  }
  .stage-character {
    padding-bottom: 195px;
  }
  #char-sprite {
    height: min(64vh, 400px);
  }
}

/* ==========================================================================
   FRIDGE, HOME COOKING, SUPERMARKET, LIFESTYLE & FIXED BILLS UI
   ========================================================================== */
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(28, 22, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s ease, border-color 0.18s ease, background 0.18s ease;
}

button.menu-item:hover {
  background: rgba(44, 34, 66, 0.96);
  border-color: rgba(242, 156, 180, 0.55);
  transform: translateY(-1px);
}

.menu-item > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.menu-item strong {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.menu-item small {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.45;
}

.menu-price {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(232, 198, 138, 0.12);
  border: 1px solid rgba(232, 198, 138, 0.35);
  padding: 5px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.fridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.fridge-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fridge-chip.alcohol {
  background: rgba(242, 156, 180, 0.08);
  border-color: rgba(242, 156, 180, 0.3);
}

.fridge-chip .qty-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--jade);
}

.recipe-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-card.ready {
  border-color: rgba(111, 211, 174, 0.45);
  background: rgba(111, 211, 174, 0.06);
}

.ing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ing-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
}

.ing-tag.ok {
  border-color: rgba(111, 211, 174, 0.45);
  color: #a9f5d7;
}

.ing-tag.miss {
  border-color: rgba(242, 120, 140, 0.5);
  color: #ff9eb0;
}

.bundle-banner {
  background: linear-gradient(135deg, rgba(232, 198, 138, 0.16), rgba(242, 156, 180, 0.14));
  border: 1px solid rgba(232, 198, 138, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bills-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(232, 198, 138, 0.28);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px;
}

.bill-row {
  background: rgba(14, 10, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#sel-move-housing {
  background: rgba(18, 14, 30, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
}

#sel-move-housing option {
  background: #1a1529;
  color: #f6eff8;
}

.fill-health {
  background: linear-gradient(90deg, #43d39e, #8af2be);
}

.fill-health.warn {
  background: linear-gradient(90deg, #f3b859, #ffd88a);
}

.fill-health.low {
  background: linear-gradient(90deg, #f05d72, #ff8f9e);
}

/* ==========================================================================
   DIALOGUE BOX APPEARANCE CUSTOMIZER DRAWER
   ========================================================================== */
.style-drawer {
  width: min(360px, 92vw);
}

.style-controls {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.style-section {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.style-sec-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.style-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.style-slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-soft);
}

.style-slider-head strong {
  color: #fff;
}

.style-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--rose);
  cursor: pointer;
}

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

.swatch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.swatch-btn:hover,
.swatch-btn.active {
  border-color: var(--rose);
  background: rgba(242, 156, 180, 0.16);
}

.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.color-pick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.color-pick-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 6px 9px;
}

.color-pick-label input[type="color"] {
  width: 28px;
  height: 22px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.style-select {
  width: 100%;
  background: rgba(18, 14, 30, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
}

.style-select option {
  background: #1a1529;
  color: #f6eff8;
}

/* Shared Biweekly Shift Roster Badges on Calendar Cells */
.cal-roster {
  font-size: 9px;
  line-height: 1.15;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-roster.roster-both-off {
  background: rgba(242, 156, 180, 0.30);
  color: #ffd6e6;
  font-weight: 700;
}

.cal-roster.roster-p-off {
  background: rgba(111, 211, 174, 0.22);
  color: #aef2d7;
}

.cal-roster.roster-w-off {
  background: rgba(130, 180, 255, 0.22);
  color: #b7d7ff;
}

.cal-roster.roster-both-work {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
