:root {
  --bg-main: #070b14;
  --bg-card: rgba(17, 25, 44, 0.78);
  --bg-card-solid: #11192c;
  --bg-elevated: rgba(30, 42, 68, 0.85);
  --bg-subtle: rgba(13, 20, 36, 0.88);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #6366f1;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.light-mode {
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-solid: #ffffff;
  --bg-elevated: #e2e8f0;
  --bg-subtle: #f8fafc;
  --border-color: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text-main: #0f172a;
  --text-muted: #64748b;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #17203d 0%, #050811 75%);
  font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Inter", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

#app-shell {
  width: 100%;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% 10%, rgba(99, 102, 241, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(168, 85, 247, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 95%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
    var(--bg-main);
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

/* Top Bar */
.top-bar {
  padding-top: calc(var(--safe-top) + 10px);
  padding-bottom: 10px;
  padding-left: 14px;
  padding-right: 14px;
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  color: #c4b5fd;
  -webkit-text-fill-color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.top-btn {
  background: rgba(30, 41, 69, 0.75);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.top-btn:active {
  transform: scale(0.94);
}

.top-btn.accent-amber {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
}

.top-btn.accent-cyan {
  border-color: rgba(6, 182, 212, 0.45);
  color: #67e8f9;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(8, 145, 178, 0.1));
}

.top-btn.accent-purple {
  border-color: rgba(168, 85, 247, 0.55);
  color: #e9d5ff;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(99, 102, 241, 0.18));
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2);
}

/* Compact Fast Action Toast Notification at BOTTOM of Screen with Close (✕) Button */
.action-toast-container {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 128px);
  left: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.action-toast {
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.55);
  border-left: 4px solid var(--accent-primary);
  border-radius: 14px;
  padding: 9px 10px 9px 12px;
  box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.65);
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
  animation: toastSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.action-toast.good {
  border-color: rgba(16, 185, 129, 0.5);
  border-left-color: var(--accent-green);
}

.action-toast.special, .action-toast.royal {
  border-color: rgba(245, 158, 11, 0.6);
  border-left-color: var(--accent-amber);
}

.action-toast.bad {
  border-color: rgba(244, 63, 94, 0.55);
  border-left-color: var(--accent-red);
}

.action-toast-badge {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  flex-shrink: 0;
  letter-spacing: 0.4px;
}

.action-toast.good .action-toast-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

.action-toast.special .action-toast-badge, .action-toast.royal .action-toast-badge {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
}

.action-toast.bad .action-toast-badge {
  background: rgba(244, 63, 94, 0.24);
  color: #fda4af;
}

.action-toast-text {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  color: #f1f5f9;
  flex: 1;
}

.action-toast-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.action-toast-close:active {
  background: rgba(244, 63, 94, 0.3);
  color: #fff;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* AI Avatar Wrapper & Customizable Overlay Layer */
.ai-avatar-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
}

.ai-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-avatar-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.ai-filter-warm { filter: saturate(1.18) sepia(0.12) contrast(1.04); }
.ai-filter-golden { filter: brightness(1.06) saturate(1.25) hue-rotate(-6deg); }
.ai-filter-cool { filter: saturate(1.1) hue-rotate(12deg) contrast(1.05); }
.ai-filter-cyber { filter: saturate(1.35) contrast(1.12) hue-rotate(18deg); }
.ai-filter-pastel { filter: brightness(1.08) saturate(0.9) contrast(0.96); }
.ai-filter-noir { filter: grayscale(0.88) contrast(1.2); }

/* Character Hero Identity Banner */
.char-banner {
  background: linear-gradient(180deg, rgba(22, 32, 58, 0.85) 0%, rgba(13, 20, 38, 0.9) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.char-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}

.avatar-box {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(168, 85, 247, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(139, 92, 246, 0.22);
  transition: transform 0.15s ease;
}

.avatar-box:active {
  transform: scale(0.94);
}

.avatar-box svg,
.avatar-box img,
.item-badge svg,
.item-badge img,
.avatar-studio-frame svg,
.avatar-studio-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-box.royal {
  border-color: var(--accent-amber);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 14px rgba(245, 158, 11, 0.35);
}

.avatar-box.prison {
  border-color: var(--accent-red);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 14px rgba(244, 63, 94, 0.35);
}

/* Avatar Studio & AI Portrait Gallery */
.avatar-studio-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.25), rgba(15, 23, 42, 0.92));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.avatar-studio-frame {
  width: 126px;
  height: 126px;
  border-radius: 26px;
  overflow: hidden;
  border: 2.5px solid #a855f7;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(168, 85, 247, 0.3);
  background: #1e293b;
  margin-bottom: 8px;
}

.seg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.seg-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.ai-portrait-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 6px 0 12px 0;
}

.ai-portrait-card {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: #0f172a;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1 / 1;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.ai-portrait-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-portrait-card.active {
  border-color: #a855f7;
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.4), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.ai-portrait-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.9) 0%, transparent 100%);
  color: #f8fafc;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  padding: 8px 2px 3px 2px;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px 0;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}

.color-swatch.active {
  transform: scale(1.16);
  border-color: #ffffff;
  box-shadow: 0 0 0 2.5px var(--accent-purple);
}

.style-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0 10px 0;
}

.style-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 0.71rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.style-pill-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
  border-color: #a855f7;
  color: #f3e8ff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

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

.char-name-row {
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.country-code-pill {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.char-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.status-pill {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pill.class-tag { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }
.status-pill.royal { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.status-pill.fame { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.35); }
.status-pill.prison { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.35); }

.char-right {
  text-align: right;
  flex-shrink: 0;
}

.bank-balance {
  font-weight: 900;
  font-size: 1.04rem;
  color: #34d399;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  text-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.bank-balance.negative {
  color: #fb7185;
  text-shadow: 0 0 14px rgba(244, 63, 94, 0.25);
}

.bank-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Demographics & Quick Collection Bar */
.demo-strip {
  background: rgba(11, 17, 32, 0.72);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 15px;
  font-size: 0.69rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Scrollable Life Log */
.life-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.year-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.year-header {
  font-weight: 800;
  font-size: 0.76rem;
  color: #818cf8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.year-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
  line-height: 1.45;
}

.log-entry {
  position: relative;
  padding-left: 13px;
  color: var(--text-main);
}

.log-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.log-entry.good { color: #6ee7b7; }
.log-entry.good::before { background: #10b981; box-shadow: 0 0 6px #10b981; }
.log-entry.bad { color: #fda4af; }
.log-entry.bad::before { background: #f43f5e; box-shadow: 0 0 6px #f43f5e; }
.log-entry.special { color: #fde68a; font-weight: 600; }
.log-entry.special::before { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.log-entry.royal { color: #e9d5ff; font-weight: 600; }
.log-entry.royal::before { background: #a855f7; box-shadow: 0 0 6px #a855f7; }

/* Stats Panel */
.stats-panel {
  background: rgba(13, 20, 38, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 15;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-label {
  width: 84px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.stat-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(30, 41, 69, 0.9);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.stat-val {
  width: 36px;
  text-align: right;
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* Bottom Navigation Dock (Raised to stay 100% clear of hosting badges & iPhone home bar) */
.bottom-nav {
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  padding-bottom: calc(var(--safe-bottom) + 58px);
  padding-left: 8px;
  padding-right: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 78px 1fr 1fr;
  align-items: center;
  z-index: 20;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 2px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, transform 0.1s ease;
}

.nav-btn:active {
  color: #ffffff;
  transform: scale(0.94);
}

.nav-svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-text {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.nav-badge {
  position: absolute;
  top: 1px;
  right: 14px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.45);
}

.age-btn-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.age-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  border: 3px solid #0b1120;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -20px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.age-btn:active {
  transform: scale(0.92);
}

.age-plus {
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1;
}

.age-label {
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Modal / Sheet System */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.modal-overlay.center-modal {
  justify-content: center;
  padding: 18px;
}

.modal-overlay.hidden {
  display: none !important;
}

.sheet-card {
  background: linear-gradient(180deg, #0f172a 0%, #070b14 100%);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  max-height: 89%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.65);
}

.sheet-header {
  background: rgba(17, 25, 44, 0.92);
  color: var(--text-main);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.96rem;
  border-bottom: 1px solid var(--border-color);
}

.sheet-close {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.sheet-body {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: calc(var(--safe-bottom) + 76px);
}

/* Event Popup */
.event-popup {
  background: linear-gradient(180deg, #131c33 0%, #0b1120 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  max-height: 90%;
  display: flex;
  flex-direction: column;
}

.event-top-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(168, 85, 247, 0.14));
  border-bottom: 1px solid var(--border-color);
  padding: 13px 16px;
}

.event-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #a5b4fc;
  font-weight: 800;
}

.event-title {
  font-size: 1.06rem;
  font-weight: 800;
  margin-top: 3px;
  color: var(--text-main);
}

.event-content {
  padding: 16px;
  overflow-y: auto;
}

.event-desc {
  font-size: 0.89rem;
  line-height: 1.52;
  color: var(--text-main);
  margin-bottom: 16px;
}

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

.choice-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

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

.choice-btn.green {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.choice-btn.red {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.choice-btn.gold {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #090d16;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
}
.choice-btn.purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.choice-btn.secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-main);
  box-shadow: none;
}

/* List Items */
.list-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.list-item:active {
  background: var(--bg-elevated);
  transform: scale(0.99);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.item-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(30, 41, 69, 0.85));
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #c7d2fe;
  flex-shrink: 0;
  text-transform: uppercase;
}

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

.item-title {
  font-weight: 700;
  font-size: 0.87rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mini-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 999px;
  margin-top: 5px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.item-right {
  text-align: right;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.78rem;
  color: #a5b4fc;
}

.section-label {
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: #94a3b8;
  margin: 8px 2px 2px 2px;
}

.slider-group {
  background: var(--bg-card);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.slider-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 5px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-primary);
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card-solid);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Prison Escape Grid */
.escape-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  background: #030712;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  margin: 8px auto;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
}

.escape-cell {
  background: #111827;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.escape-cell.wall { background: #374151; }
.escape-cell.exit { background: rgba(16, 185, 129, 0.2); border: 1px dashed #10b981; color: #34d399; }
.escape-cell.player { background: rgba(59, 130, 246, 0.3); border: 1px solid #60a5fa; color: #93c5fd; }
.escape-cell.guard { background: rgba(239, 68, 68, 0.3); border: 1px solid #f87171; color: #fca5a5; }

.dpad-controls {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 44px);
  gap: 6px;
  justify-content: center;
  margin: 8px auto;
}

.dpad-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

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

.info-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 10px 12px;
}

.info-box-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info-box-val {
  font-size: 0.88rem;
  font-weight: 800;
  margin-top: 3px;
}

/* =========================================================
   VISUAL GALLERY CARDS, HERO PREVIEWS & CATEGORY FILTER PILLS (v24)
   ========================================================= */
.shop-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px 6px 1px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shop-filter-bar::-webkit-scrollbar {
  display: none;
}

.shop-filter-pill {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 25, 44, 0.82);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.shop-filter-pill.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border-color: rgba(196, 181, 253, 0.55);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35);
}

.asset-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.asset-card {
  background: linear-gradient(180deg, rgba(22, 32, 56, 0.92) 0%, rgba(12, 18, 34, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.asset-card:active {
  transform: scale(0.97);
  border-color: rgba(129, 140, 248, 0.55);
}

.asset-card-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b1120;
  position: relative;
}

.asset-svg-art {
  width: 100%;
  height: 100%;
  display: block;
}

.asset-card-body {
  padding: 8px 9px 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.asset-card-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-card-sub {
  font-size: 0.67rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-card-footer {
  margin-top: auto;
  padding-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.asset-price-pill {
  font-size: 0.74rem;
  font-weight: 800;
  color: #34d399;
}

.asset-status-tag {
  font-size: 0.61rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.asset-hero-preview {
  width: 100%;
  max-height: 158px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  margin-bottom: 8px;
  background: #0b1120;
}

.item-thumb {
  width: 58px;
  height: 38px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  background: #0b1120;
}

.asset-summary-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.22) 0%, rgba(16, 185, 129, 0.14) 100%);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 14px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* =========================================================
   UNIVERSITY CAMPUS GRAPHICS, TIMED QUIZ & MEMORY GAME (v25)
   ========================================================= */
.campus-hero-banner {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  margin-bottom: 8px;
  background: #0b1120;
  position: relative;
}

.campus-hero-overlay {
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(11, 17, 32, 0.85) 0%, rgba(15, 23, 42, 0.96) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.uni-diff-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.uni-diff-badge.lvl-3 {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.45);
}
.uni-diff-badge.lvl-2 {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.uni-diff-badge.lvl-1 {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.45);
}

.quiz-timer-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 8px 0 10px 0;
}
.quiz-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #f43f5e);
  transition: width 0.25s linear;
}

.memory-seq-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 12px 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 12px;
  margin-bottom: 10px;
}

.memory-chip {
  padding: 6px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}

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

.memory-tile {
  padding: 11px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.memory-tile:active {
  transform: scale(0.95);
}
.memory-tile.picked {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
}
.memory-tile.wrong {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.7);
  color: #fda4af;
}

/* =========================================================
   v26: NPC BACKGROUND HERO, DISTANCE BADGES & FAMILY TREE
   ========================================================= */
.rel-dist-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fcd34d;
  white-space: nowrap;
}
.rel-dist-badge.visited {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

.npc-profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid var(--border-strong);
  margin-bottom: 10px;
}
.npc-hero-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(99, 102, 241, 0.45);
  background: #0f172a;
}
.npc-hero-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}
.npc-hero-meta {
  min-width: 0;
  flex: 1;
}
.npc-hero-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}
.npc-hero-role {
  font-size: 0.76rem;
  color: #c7d2fe;
  margin-top: 2px;
}
.npc-hero-loc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.npc-bio-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 12px;
}
.npc-bio-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #cbd5e1;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.npc-bio-list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dist-lock-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(180, 83, 9, 0.18));
  border: 1px solid rgba(245, 158, 11, 0.48);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #fde68a;
  margin: 8px 0 10px;
}

.family-tree-header {
  text-align: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-bottom: 12px;
}
.family-tree-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #f8fafc;
}
.family-tree-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 3px;
}

.family-tree-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.tree-gen-section {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 10px 8px;
}
.tree-gen-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 8px;
}
.tree-gen-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
}
.tree-couple-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.tree-heart {
  font-size: 1rem;
  flex-shrink: 0;
}
.tree-connector {
  display: flex;
  justify-content: center;
  height: 16px;
}
.tree-connector span {
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.65), rgba(99, 102, 241, 0.65));
}

.tree-node {
  width: 112px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.tree-node:active {
  transform: scale(0.96);
}
.tree-node.is-me {
  border-color: rgba(16, 185, 129, 0.8);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.22), rgba(30, 41, 59, 0.95));
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
}
.tree-node.is-dead {
  opacity: 0.68;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.85);
}
.tree-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 5px;
  background: #0f172a;
}
.tree-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tree-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  word-break: break-word;
}
.tree-role {
  font-size: 0.64rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-top: 2px;
}
.tree-meta {
  font-size: 0.61rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.25;
}

/* v27: Dual Family Tree Branches (Maternel / Paternel) & Physiology Hub */
.tree-dual-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tree-branch-col {
  border-radius: 10px;
  padding: 7px 5px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.tree-branch-col.mat {
  border-color: rgba(244, 114, 182, 0.35);
}
.tree-branch-col.pat {
  border-color: rgba(56, 189, 248, 0.35);
}
.tree-branch-head {
  font-size: 0.64rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
}
.tree-branch-head.mat {
  background: rgba(244, 114, 182, 0.16);
  color: #f9a8d4;
}
.tree-branch-head.pat {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}
.tree-branch-pill {
  display: inline-block;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-top: 2px;
}
.tree-branch-pill.mat {
  background: rgba(244, 114, 182, 0.18);
  color: #fbcfe8;
}
.tree-branch-pill.pat {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}
.tree-empty-branch {
  font-size: 0.72rem;
  color: #64748b;
  padding: 8px 0;
}

.physio-hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(16, 185, 129, 0.42);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}
.physio-hero-stage {
  font-size: 0.88rem;
  color: #f8fafc;
}
.physio-hero-sub {
  font-size: 0.74rem;
  color: #cbd5e1;
  margin-top: 4px;
}
.physio-gauge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.physio-gauge {
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 9px 10px;
}
.physio-gauge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  color: #e2e8f0;
  margin-bottom: 6px;
}
.physio-bar-wrap {
  width: 100%;
  height: 7px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.physio-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.diet-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.diet-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.24);
  cursor: pointer;
}
.diet-card.active {
  border-color: rgba(16, 185, 129, 0.78);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(30, 41, 59, 0.94));
}
.diet-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #f8fafc;
}
.diet-cost {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6ee7b7;
}
.diet-desc {
  font-size: 0.71rem;
  color: #94a3b8;
  margin-top: 3px;
}

/* v28: Skill Mini-Games (Sports Timing Bar & Music Pads) */
.timing-track {
  position: relative;
  height: 36px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid var(--border-strong);
  overflow: hidden;
  margin: 14px 0 6px;
}
.timing-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.55), rgba(5, 150, 105, 0.78));
  border-left: 2px solid #6ee7b7;
  border-right: 2px solid #6ee7b7;
}
.timing-cursor {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 8px;
  margin-left: -4px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.95);
}
.music-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.music-pad {
  padding: 18px 8px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.music-pad:active {
  transform: scale(0.94);
}

/* v29: Reorganized Jobs, Special Career Packs Portal & Actor/Sports/Politics Studios */
.jobs-locked-details {
  margin-top: 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  padding: 8px 10px;
}
.jobs-locked-summary {
  font-size: 0.78rem;
  font-weight: 800;
  color: #94a3b8;
  cursor: pointer;
  list-style: none;
}
.special-packs-portal {
  padding: 13px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(245, 158, 11, 0.55);
  cursor: pointer;
  margin-bottom: 8px;
  transition: transform 0.12s ease;
}
.special-packs-portal:active {
  transform: scale(0.98);
}
.special-packs-portal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.special-packs-portal-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: #fde68a;
}
.special-packs-portal-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 3px;
  line-height: 1.35;
}
.pack-status-pill {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
  white-space: nowrap;
}
.career-pack-card {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  margin-bottom: 10px;
}
.career-pack-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.career-pack-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: #f8fafc;
}
.career-pack-tag {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
}
.actor-hero-card {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(30, 41, 59, 0.96));
  border: 1px solid rgba(245, 158, 11, 0.45);
  margin-bottom: 10px;
}
.actor-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.actor-hero-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: #f8fafc;
}
.actor-hero-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 2px;
}

/* =========================================================
   v30: TABBED OCCUPATION NAVIGATION, PROMO RANK & DEEP HUBS
   ========================================================= */
.occ-tabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.occ-tabs-bar::-webkit-scrollbar {
  display: none;
}
.occ-tab-btn {
  flex: 1 0 auto;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.14s ease;
}
.occ-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.34), rgba(16, 185, 129, 0.24));
  border-color: rgba(129, 140, 248, 0.78);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.22);
}

.occ-subtabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 8px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.occ-subtabs-bar::-webkit-scrollbar {
  display: none;
}
.occ-subtab-btn {
  flex: 1 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.65);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.12s ease;
}
.occ-subtab-btn.active {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.72);
  color: #6ee7b7;
}
.occ-subtab-btn.gold-active.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: rgba(245, 158, 11, 0.75);
  color: #fde68a;
}

.promo-rank-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(129, 140, 248, 0.45);
  margin-bottom: 8px;
}
.promo-rank-banner.is-major {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(16, 185, 129, 0.16));
  border-color: rgba(245, 158, 11, 0.75);
}
.promo-rank-title {
  font-size: 0.8rem;
  font-weight: 900;
  color: #f8fafc;
}
.promo-rank-sub {
  font-size: 0.7rem;
  color: #cbd5e1;
  margin-top: 2px;
}
.promo-rank-pill {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  white-space: nowrap;
}
.promo-rank-banner.is-major .promo-rank-pill {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(251, 191, 36, 0.8);
  color: #fef08a;
}

.ceo-kpi-card {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(16, 185, 129, 0.45);
  margin-bottom: 10px;
}
.costar-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 800;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
  margin-top: 4px;
}
.hub-input-field {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
}
body.light-mode .occ-tab-btn {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
body.light-mode .occ-tab-btn.active {
  background: linear-gradient(135deg, #4f46e5, #059669);
  color: #ffffff;
}
body.light-mode .occ-subtab-btn {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}
body.light-mode .occ-subtab-btn.active {
  background: #d1fae5;
  color: #065f46;
  border-color: #10b981;
}
body.light-mode .promo-rank-banner {
  background: #eef2ff;
  border-color: #a5b4fc;
}
body.light-mode .promo-rank-title {
  color: #1e293b;
}
body.light-mode .promo-rank-sub {
  color: #475569;
}
body.light-mode .hub-input-field {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
