:root {
  /* Eye-Care Warm Daylight Smartphone Palette */
  --bg-outer: #e5e2da;
  --bg-phone: #f4f2ec;
  --bg-header: rgba(251, 250, 247, 0.94);
  --bg-surface: #ffffff;
  --bg-elevated: #edeae1;
  --bg-soft-card: #ece9e0;
  --border-subtle: rgba(30, 41, 59, 0.09);
  --border-strong: rgba(30, 41, 59, 0.16);
  --text-main: #1f2937;
  --text-body: #334155;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-blue-soft: #e0f2fe;
  --accent-green: #15803d;
  --accent-green-soft: #dcfce7;
  --accent-amber: #b45309;
  --accent-amber-soft: #fef3c7;
  --accent-red: #be123c;
  --accent-red-soft: #ffe4e6;
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.045), 0 1px 2px rgba(15, 23, 42, 0.03);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

.hidden {
  display: none !important;
}

.app-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100dvh;
  background: radial-gradient(circle at 50% 0%, #f1efe8 0%, #dcd8ce 100%);
}

.phone-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  background: var(--bg-phone);
  overflow: hidden;
  contain: layout style;
}

@media (min-width: 520px) {
  .phone-shell {
    height: min(94dvh, 880px);
    border-radius: 34px;
    border: 5px solid #2b2d31;
    box-shadow:
      0 24px 60px rgba(31, 41, 55, 0.18),
      0 4px 12px rgba(31, 41, 55, 0.08);
  }
}

/* Soft Eye-Care High-Anxiety Pulse (GPU opacity-only, zero CPU box-shadow repaint) */
.phone-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 36px rgba(225, 29, 72, 0.34);
  opacity: 0;
  will-change: opacity;
  z-index: 40;
  transition: opacity 0.3s ease;
}

.phone-shell.anxiety-critical::after {
  opacity: 1;
  animation: anxietyOpacityPulse 1.4s ease-in-out infinite;
}

@keyframes anxietyOpacityPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

@keyframes subtleShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2px, 0, 0); }
  75% { transform: translate3d(2px, 0, 0); }
}

.msg-shake-urgent {
  animation: subtleShake 0.38s ease-in-out 2;
  border-color: rgba(225, 29, 72, 0.42) !important;
}

/* Realistic Smartphone Top Status Bar */
.phone-statusbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px 3px;
  background: var(--bg-header);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  user-select: none;
}

.sb-clock {
  letter-spacing: 0.2px;
}

.sb-notch {
  width: 78px;
  height: 16px;
  border-radius: 999px;
  background: #1f2329;
}

.sb-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sb-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 9px;
}

.sb-signal i {
  display: block;
  width: 2px;
  background: var(--text-main);
  border-radius: 1px;
}
.sb-signal i:nth-child(1) { height: 3px; }
.sb-signal i:nth-child(2) { height: 5px; }
.sb-signal i:nth-child(3) { height: 7px; }
.sb-signal i:nth-child(4) { height: 9px; }

.sb-net {
  font-size: 10px;
  font-weight: 800;
}

.sb-battery {
  position: relative;
  width: 19px;
  height: 10px;
  border: 1.5px solid var(--text-main);
  border-radius: 3px;
  padding: 1px;
}

.sb-battery::after {
  content: "";
  position: absolute;
  right: -3.5px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: var(--text-main);
  border-radius: 0 1px 1px 0;
}

.sb-battery-fill {
  display: block;
  width: 82%;
  height: 100%;
  background: #16a34a;
  border-radius: 1.5px;
}

/* Top OS Header */
.os-header {
  flex-shrink: 0;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 5px 12px 9px;
  z-index: 20;
}

.legal-edu-ribbon {
  font-size: 10.5px;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: 8px;
  padding: 3px 8px;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.os-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.os-brand {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.pill-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.pill-btn:active {
  transform: scale(0.95);
}

.pill-lang {
  background: var(--accent-blue-soft);
  border-color: rgba(2, 132, 199, 0.22);
  color: var(--accent-blue);
}

.pill-btn.is-fast {
  background: var(--accent-amber-soft);
  border-color: rgba(180, 83, 9, 0.25);
  color: var(--accent-amber);
}

.pill-reset {
  color: var(--text-muted);
}

.pill-legal {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.45);
  color: #b45309;
  font-weight: 800;
}

.pill-btn.is-muted {
  opacity: 0.65;
}

/* Stats HUD */
.stats-hud {
  display: grid;
  grid-template-columns: auto 1.25fr 1fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.day-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  background: var(--text-main);
  color: #ffffff;
  padding: 6px 9px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.val-danger { color: var(--accent-red); }
.val-warn { color: var(--accent-amber); }
.val-good { color: var(--accent-green); }

/* Identity Strip */
.identity-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 11.5px;
}

.id-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-body);
  flex-shrink: 0;
}

.id-name {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cohort Ticker */
.cohort-ticker {
  width: 100%;
  margin-top: 7px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-body);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: background-color 0.15s ease;
}

.cohort-ticker:hover {
  background: #f8f7f3;
}

.cohort-ticker-main {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  min-width: 0;
}

.cohort-ticker-main span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cohort-toggle-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-alive { background: #16a34a; }
.dot-hooked { background: #d97706; }
.dot-wrecked { background: #e11d48; }
.dot-legend { background: #0284c7; }

.cohort-drawer {
  margin-top: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 9px 11px;
  max-height: 205px;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
}

.cohort-header-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cohort-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}

.cohort-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
}

.tag-alive { background: var(--accent-green-soft); color: var(--accent-green); }
.tag-hooked { background: var(--accent-amber-soft); color: var(--accent-amber); }
.tag-wrecked { background: var(--accent-red-soft); color: var(--accent-red); }
.tag-legend { background: var(--accent-blue-soft); color: var(--accent-blue); }

.cohort-item-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.cohort-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Main Game View */
.game-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.message-stream {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Subtle native iOS/LINE custom scrollbar */
.message-stream::-webkit-scrollbar,
.ending-view::-webkit-scrollbar {
  width: 5px;
}
.message-stream::-webkit-scrollbar-thumb,
.ending-view::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.25);
  border-radius: 999px;
}

.system-intro-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(135deg, #fbfaf6 0%, #f5f1e6 100%);
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-body);
  box-shadow: var(--shadow-card);
}

.intro-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.intro-role-pill {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #6b7280;
  background: rgba(31, 41, 55, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
}

.intro-mood-pill {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 9px;
  border-radius: 999px;
}

.intro-role-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.3;
}

.system-intro-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: #4b5563;
}

.msg-art-wrap {
  width: 100%;
  margin-bottom: 9px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #eae7df;
}

.msg-art-wrap img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 1px;
}

.day-divider span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(30, 41, 59, 0.06);
  padding: 3px 11px;
  border-radius: 999px;
}

/* Everyday Smartphone Message Bubble Cards */
.msg-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 12px 13px;
  box-shadow: var(--shadow-card);
}

.msg-card.is-entering,
.player-bubble.is-entering,
.feedback-card.is-entering {
  animation: fadeSlideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.channel-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.channel-sms .channel-badge { background: #e2e8f0; color: #334155; }
.channel-line .channel-badge { background: #dcfce7; color: #15803d; }
.channel-dm .channel-badge { background: #f3e8ff; color: #7e22ce; }
.channel-call .channel-badge { background: #ffe4e6; color: #be123c; }
.channel-gov .channel-badge { background: #fef3c7; color: #b45309; }
.channel-email .channel-badge { background: #e0f2fe; color: #0369a1; }

.msg-sender {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-body-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.msg-svg-box {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--text-body);
  background: var(--bg-phone);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px;
}

.msg-text {
  font-size: 14px;
  line-height: 1.58;
  color: var(--text-main);
  word-break: break-word;
}

.inline-url {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 1px 5px;
  border-radius: 5px;
  word-break: break-all;
}

/* LINE/iMessage Soft Mint Player Reply Bubble */
.player-bubble {
  align-self: flex-end;
  max-width: 85%;
  background: #d9f4e4;
  border: 1px solid #b5e7ca;
  color: #14532d;
  padding: 9px 13px;
  border-radius: 18px 18px 5px 18px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.46;
  box-shadow: 0 1px 3px rgba(20, 83, 45, 0.06);
}

.player-bubble.is-panic {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #881337;
}

/* Soft Warm Outcome & Debrief Card */
.feedback-card {
  background: var(--bg-soft-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-body);
}

.delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.delta-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.delta-good { background: var(--accent-green-soft); color: var(--accent-green); }
.delta-bad { background: var(--accent-red-soft); color: var(--accent-red); }
.delta-warn { background: var(--accent-amber-soft); color: var(--accent-amber); }

.tactic-tip-box {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.tactic-tip-box.is-real {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.tactic-tip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
}

.tactic-tip-box.is-real .tactic-tip-head {
  color: #047857;
}

.tactic-tag-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-main);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.tactic-tip-body {
  font-size: 12px;
  line-height: 1.52;
  color: var(--text-body);
}

/* Typing Dots */
.typing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: bounceDot 0.9s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.14s; }
.typing-dots i:nth-child(3) { animation-delay: 0.28s; }

@keyframes bounceDot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* GPU-Accelerated Timer Bar */
.timer-bar-wrap {
  flex-shrink: 0;
  padding: 7px 14px 5px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.timer-bar-wrap.is-critical {
  background: #fff1f2;
  border-top-color: rgba(225, 29, 72, 0.25);
}

.timer-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent-amber);
  margin-bottom: 5px;
}

.timer-bar-wrap.is-critical .timer-label-row {
  color: var(--accent-red);
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: anxietyOpacityPulse 0.8s infinite;
}

.timer-track {
  height: 5px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.timer-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  will-change: transform;
  background: linear-gradient(90deg, #f59e0b, #e11d48);
  border-radius: 999px;
}

/* Bottom Thumb Action Dock */
.action-dock {
  flex-shrink: 0;
  padding: 9px 13px max(12px, env(safe-area-inset-bottom));
  background: var(--bg-header);
  border-top: 1px solid var(--border-subtle);
  min-height: 66px;
}

.typing-dock-hint {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.choices-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1.5px solid #e2dfd6;
  border-radius: 14px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.42;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform 0.12s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.choice-btn:hover {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.choice-btn:active {
  transform: scale(0.985);
}

.choice-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  width: 21px;
  height: 21px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-primary-continue {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.2px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
  transition: transform 0.12s ease;
}

.btn-primary-continue:active {
  transform: scale(0.985);
}

.btn-primary-continue.is-final {
  background: linear-gradient(135deg, #e11d48, #be123c);
  box-shadow: 0 3px 10px rgba(225, 29, 72, 0.24);
}

/* Ending View + Retro 4:5 Card */
.ending-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 13px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card-4x5 {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  background: #fbfaf6;
  color: #1f2937;
  border: 1px solid #d6d3cb;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  border-radius: 16px;
}

.slip-art-frame {
  position: relative;
  width: 100%;
  height: 188px;
  border: 1px solid rgba(31, 41, 55, 0.14);
  background: #eae7df;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.slip-art-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slip-top-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.slip-top-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
}

.slip-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rarity-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: #dc2626;
}

.rarity-SSR { background: #d97706; }
.rarity-SR { background: #b91c1c; }
.rarity-R { background: #2563eb; }
.rarity-N { background: #64748b; }

.quad-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
}

.slip-profile-line {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.slip-headline {
  margin: 2px 0 3px;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.24;
  color: #111827;
}

.slip-subtitle {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.42;
  color: #4b5563;
}

.slip-percentile-banner {
  padding: 6px 10px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 9px;
}
.slip-percentile-banner.is-lose {
  background: #fff1f2;
  color: #be123c;
}
.slip-percentile-banner.is-win {
  background: #ecfdf5;
  color: #047857;
}

.slip-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.85fr;
  padding: 6px 0;
  border-top: 1px solid rgba(31, 41, 55, 0.08);
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.slip-metric {
  padding: 2px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slip-metric + .slip-metric {
  border-left: 1px solid rgba(31, 41, 55, 0.08);
}

.m-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.m-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 800;
  color: #111827;
}

.m-debt { color: #dc2626; }
.m-ok { color: #059669; }

.slip-fatal-box {
  background: #f3f1ea;
  border-radius: 10px;
  padding: 8px 10px;
}

.fatal-k {
  font-size: 10px;
  font-weight: 800;
  color: #b91c1c;
  margin-bottom: 2px;
}

.fatal-v {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #1f2937;
}

.slip-summary-note {
  font-size: 11.5px;
  line-height: 1.48;
  color: #475569;
}

.slip-cohort-box {
  padding-top: 7px;
  border-top: 1px solid rgba(31, 41, 55, 0.08);
}

.cohort-k {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 4px;
}

.slip-cohort-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.slip-cohort-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.32;
  color: #334155;
}

.c-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.slip-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  padding-top: 4px;
}

.slip-stamp-overlay {
  position: absolute;
  right: 14px;
  top: 164px;
  width: 78px;
  height: 78px;
  transform: rotate(-12deg);
  pointer-events: none;
  opacity: 0.9;
  z-index: 6;
}

.seal-svg {
  width: 100%;
  height: 100%;
}

/* Ending Actions */
.ending-actions-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-export-card {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.25);
}

.ending-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-secondary {
  min-height: 42px;
  border: 1.5px solid #e2dfd6;
  background: var(--bg-surface);
  color: var(--text-main);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}

.micro-monetize-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
}

.btn-micro {
  width: 100%;
  min-height: 40px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 7px 10px;
}

.btn-micro.is-tea {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.legal-disclaimer {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

/* Clean Porcelain Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 60;
}

.modal-panel {
  width: 100%;
  max-width: 420px;
  max-height: 85dvh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px;
  color: var(--text-main);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-head h3 {
  margin: 0;
  font-size: 15.5px;
}

.modal-close-x {
  background: var(--bg-phone);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 8px 0 12px;
}

.codex-progress-wrap {
  margin: 6px 0 10px;
}

.codex-progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin-top: 5px;
}

.codex-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #0284c7);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.codex-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.codex-filter-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-phone);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.codex-filter-btn.is-active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

.codex-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.codex-card {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 11px;
  background: #faf9f5;
}

.codex-card.is-locked {
  border-style: dashed;
  background: #f5f4ef;
}

.codex-thumb-wrap {
  width: 100%;
  height: 132px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(31, 41, 55, 0.12);
  margin-bottom: 8px;
  background: #eae7df;
}

.codex-thumb-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.codex-clue-box {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.48;
  color: #64748b;
}

.codex-card-btn {
  margin-top: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.codex-card-btn:hover {
  background: #f8f7f3;
}

.codex-empty-msg {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 20px 10px;
}

.codex-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.codex-quad {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.codex-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.codex-desc {
  font-size: 11.5px;
  color: var(--text-body);
  line-height: 1.45;
}

.export-img-wrap {
  display: flex;
  justify-content: center;
}

.export-preview-img {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.pay-mock-box {
  background: #f8f7f3;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-blue);
  font-weight: 700;
}

.pay-mock-status {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-green);
}

.pay-mock-status.is-warn {
  color: #b45309;
}

.pay-tier-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.pay-tiers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pay-tier-btn {
  border: 1.5px solid #e2dfd6;
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.pay-tier-btn.is-selected {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

.pay-legal-note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

.chaos-hints-box {
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chaos-hints-k {
  font-size: 11.5px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.02em;
}

.chaos-hints-item {
  font-size: 12px;
  line-height: 1.45;
  color: #78350f;
  font-weight: 600;
}

.intro-legal-note {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 600;
}

.legal-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-modal-item {
  background: #f8f7f3;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
}

.legal-modal-k {
  font-size: 12.5px;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 3px;
}

.legal-modal-v {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-body);
}

/* ---------- Educational Anti-Scam Landing View ---------- */
.landing-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 20px;
  background: linear-gradient(180deg, #f8f7f2 0%, #efede4 100%);
  display: flex;
  flex-direction: column;
}

.landing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px 15px 15px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.landing-hero-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 10px 12px;
}

.landing-grandma-img {
  width: 68px;
  height: 84px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(120, 53, 15, 0.18));
}

.landing-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.landing-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.landing-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.landing-subtitle {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-body);
}

.landing-edu-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.landing-edu-heading {
  font-size: 12.5px;
  font-weight: 900;
  color: #92400e;
}

.landing-rule {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
}

.landing-rule-t {
  font-size: 12px;
  font-weight: 800;
  color: #78350f;
  margin-bottom: 2px;
}

.landing-rule-d {
  font-size: 11.5px;
  line-height: 1.48;
  color: #451a03;
}

.landing-hotline {
  font-size: 11.5px;
  line-height: 1.45;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 8px 10px;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.btn-start-game {
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 13px 16px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-start-game:active {
  transform: scale(0.985);
}

.btn-landing-codex {
  width: 100%;
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  background: #f8f7f3;
  cursor: pointer;
}

/* ---------- Persistent Situation Context Bar & Action Prompt ---------- */
.situation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: #f3f1ea;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  line-height: 1.2;
}

.sit-role {
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sit-pill {
  flex-shrink: 0;
  font-weight: 800;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 999px;
}

.sit-pill.is-chain {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.sit-pill.is-review {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.chain-followup-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 3px 8px;
  margin-bottom: 6px;
}

.action-prompt-hint {
  font-size: 11.5px;
  font-weight: 800;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  padding: 5px 10px;
  margin-bottom: 7px;
  line-height: 1.35;
}

/* ---------- Tabikaeru-Style Grandma Home & Yard Stage ---------- */
.hero-model-stage {
  display: flex;
  flex-direction: column;
  border-bottom: 1.5px solid #e2d5be;
  background: #f8f3e8;
  flex-shrink: 0;
}

.tabi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 250, 240, 0.96);
  border-bottom: 1px solid #eadfcd;
  flex-wrap: nowrap;
}

.tabi-mini-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.tabi-day-mini {
  font-size: 9.5px;
  font-weight: 900;
  color: #ffffff;
  background: #1e293b;
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
}

.tabi-stat-mini {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.tabi-stat-mini b {
  font-weight: 900;
}

.tabi-mini-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tabi-clover-pill {
  font-size: 11.5px;
  font-weight: 900;
  color: #15803d;
  background: #dcfce7;
  border: 1.5px solid #86efac;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.tabi-scene-home,
.tabi-scene-yard {
  position: relative;
  height: 168px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.tabi-scene-home {
  background-image:
    linear-gradient(180deg, rgba(255, 250, 240, 0.25) 0%, rgba(255, 252, 245, 0.35) 100%),
    url("../assets/grandma_home_bg.jpg");
}

.tabi-scene-yard {
  background-image:
    linear-gradient(90deg, rgba(255, 252, 245, 0.12) 0%, rgba(255, 252, 245, 0.24) 100%),
    url("../assets/grandma_yard_bg.jpg");
  justify-content: space-between;
}

.tabi-room-bubble {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
}

.tabi-teapot-hotspot {
  position: absolute;
  left: 56.5%;
  top: 59%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 46px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.tabi-teapot-hotspot:disabled {
  cursor: default;
}

.teapot-steam {
  display: flex;
  gap: 3px;
  height: 14px;
  align-items: flex-end;
  transition: transform 0.2s ease;
}

.teapot-steam span {
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 4px rgba(217, 119, 6, 0.35);
  animation: steamRise 1.6s infinite ease-in-out;
}

.teapot-steam span:nth-child(2) {
  animation-delay: 0.4s;
  height: 11px;
}

.teapot-steam span:nth-child(3) {
  animation-delay: 0.8s;
}

@keyframes steamRise {
  0% { transform: translateY(2px) scaleY(0.8); opacity: 0.2; }
  50% { transform: translateY(-5px) scaleY(1.2); opacity: 0.88; }
  100% { transform: translateY(-10px) scaleY(0.9); opacity: 0; }
}

.teapot-hover-glow {
  width: 44px;
  height: 32px;
  margin-top: -3px;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.95)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
}

.teapot-hover-glow path {
  fill: rgba(254, 240, 138, 0.16);
  stroke: #fbbf24;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tabi-teapot-hotspot:not(:disabled):hover .teapot-hover-glow,
.tabi-teapot-hotspot:not(:disabled):focus-visible .teapot-hover-glow,
.tabi-teapot-hotspot.is-brewing .teapot-hover-glow {
  opacity: 1;
  transform: scale(1.1);
}

.tabi-teapot-hotspot:not(:disabled):hover .teapot-steam,
.tabi-teapot-hotspot.is-brewing .teapot-steam {
  transform: scale(1.12);
}

.tabi-teapot-hotspot.is-brewing .teapot-steam span {
  background: #fde047;
  animation-duration: 0.7s;
}

.clover-float-pop {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  font-size: 13px;
  font-weight: 900;
  color: #15803d;
  text-shadow: 0 1px 0 #ffffff, 0 2px 6px rgba(255, 255, 255, 0.9);
  animation: cloverPopUp 0.85s ease-out forwards;
}

@keyframes cloverPopUp {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -28px) scale(1.12); opacity: 0; }
}

.postcard-frame {
  background: #fffdf7;
  border: 2px solid #d6c5a9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.postcard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 1.5px dashed #d97706;
}

.postcard-place {
  font-size: 13.5px;
  font-weight: 900;
  color: #78350f;
}

.postcard-stamp {
  font-size: 11px;
  font-weight: 900;
  color: #991b1b;
  border: 1.5px solid #dc2626;
  border-radius: 8px;
  padding: 2px 7px;
  transform: rotate(-4deg);
  background: rgba(255, 255, 255, 0.85);
}

.postcard-body {
  padding: 10px 12px;
}

.tabi-away-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 250, 240, 0.78);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.tabi-away-badge {
  background: #ffffff;
  border: 2px solid #f59e0b;
  color: #92400e;
  font-size: 12.5px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.tabi-clover-patch {
  position: relative;
  width: 58%;
  height: 100%;
}

.tabi-sprout-btn {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(21, 128, 61, 0.25);
  transition: transform 0.12s ease;
}

.tabi-sprout-btn:active {
  transform: scale(0.85);
}

.tabi-sprout-btn.is-four-leaf {
  background: #fef08a;
  box-shadow: 0 0 0 2px #f59e0b, 0 4px 10px rgba(245, 158, 11, 0.35);
}

.tabi-mailbox-hotspot {
  position: absolute;
  left: 90.8%;
  top: 44.5%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 3;
}

.tabi-mailbox-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.95)) drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
}

.tabi-mailbox-outline path {
  fill: rgba(254, 240, 138, 0.16);
  stroke: #fbbf24;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tabi-mailbox-hotspot:hover .tabi-mailbox-outline,
.tabi-mailbox-hotspot:focus-visible .tabi-mailbox-outline {
  opacity: 1;
  transform: scale(1.06);
}

.tabi-mail-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.tabi-subtle-hint {
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #7c6b53;
  background: #f5efe3;
  border-top: 1px solid #eae0ce;
  text-align: center;
  line-height: 1.3;
}

.tabi-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  background: #efe6d5;
  border-top: 1px solid #dfd2bc;
}

.tabi-btn-group {
  display: flex;
  gap: 6px;
}

.tabi-action-btn,
.tabi-scene-toggle {
  border: 1.5px solid #cbb799;
  background: #fffdf8;
  color: #5c4024;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.tabi-scene-toggle {
  background: #15803d;
  border-color: #166534;
  color: #ffffff;
}

.tabi-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tabi-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #faf8f3;
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 9px 11px;
}

.tabi-item-info {
  flex: 1;
  min-width: 0;
}

.tabi-item-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
}

.tabi-item-desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 2px;
}

.tabi-item-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  padding: 7px 11px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  background: #15803d;
  cursor: pointer;
}

.tabi-item-btn:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.tabi-packed-box {
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 10px;
}

.grandma-souvenir-pill {
  font-size: 10.5px;
  font-weight: 800;
  color: #78350f;
  background: rgba(255, 251, 235, 0.92);
  border: 1px solid #fcd34d;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

#hero-model-canvas {
  position: absolute;
  bottom: 8px;
  left: 22%;
  transform: translateX(-50%);
  z-index: 4;
  width: 66px;
  height: 92px;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#hero-model-canvas:active {
  cursor: grabbing;
}

.hero-floor-shadow {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.32) 0%, rgba(15, 23, 42, 0) 72%);
  pointer-events: none;
}

.hero-cutout-wrap {
  position: relative;
  width: 64px;
  height: 88px;
  will-change: transform;
  transform-origin: center bottom;
}

.hero-3d-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(15, 23, 42, 0.22));
}

.hero-stage-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-mood-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.hero-mood-badge.is-nervous {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.hero-mood-badge.is-panic {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.hero-mood-badge.is-smug {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.hero-speech-bubble {
  font-size: 11.5px;
  line-height: 1.38;
  font-weight: 700;
  color: var(--text-body);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px 9px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.npc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #1e293b;
  background: #ffffff;
}

.msg-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
