/* ========================================
   灵叙 LingXv — Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --bg-primary: #020617;
  --bg-secondary: #0a1628;
  --bg-card: rgba(10, 22, 40, 0.75);
  --bg-glass: rgba(15, 25, 50, 0.6);
  --bg-modal: rgba(8, 18, 38, 0.92);
  --bg-input: rgba(5, 11, 29, 0.5);

  --accent-cyan: #00F0FF;
  --accent-cyan-dim: rgba(0, 240, 255, 0.15);
  --accent-purple: #7C3AED;
  --accent-blue: #3B82F6;
  --accent-green: #10B981;
  --accent-orange: #FB923C;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #475569;
  --text-cyan: #22D3EE;

  --border-default: rgba(100, 116, 139, 0.2);
  --border-hover: rgba(0, 240, 255, 0.4);

  --gradient-cta: linear-gradient(135deg, #7C3AED 0%, #3B82F6 50%, #7C3AED 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.08) 0%, transparent 60%);

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 20px rgba(0, 240, 255, 0.15);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  --transition-fast: 0.15s ease;
  --transition-default: 0.3s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: var(--radius-full);
}

/* ---------- Ambient ---------- */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 48px;
  background: rgba(5, 11, 29, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 4px var(--accent-green);
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 8px var(--accent-green);
  }
}

.status-text {
  font-size: 13px;
  color: var(--text-cyan);
  font-family: var(--font-mono);
}

.header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.header-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  font-size: 18px;
}

.header-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.header-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.header-connectivity {
  color: var(--accent-green);
  font-size: 12px;
  font-family: var(--font-mono);
}

.back-btn {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.back-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.round-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  padding: 4px 10px;
  border: 1px solid var(--accent-cyan-dim);
  border-radius: var(--radius-sm);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  text-align: center;
  position: relative;
  background: var(--gradient-glow);
}

.hero-mascot {
  width: 90px;
  height: 90px;
  margin-bottom: 28px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.hero-title {
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-title-en {
  font-weight: 300;
  opacity: 0.5;
  letter-spacing: 4px;
  font-size: 0.6em;
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.hero-divider-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--text-muted), transparent);
}

.hero-divider-diamond {
  width: 8px;
  height: 8px;
  border: 1px solid var(--text-muted);
  transform: rotate(45deg);
}

.hero-subtitle {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 15px;
}

.hero-tag {
  padding: 4px 16px;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-size: 14px;
  letter-spacing: 2px;
}

.hero-tag-separator {
  color: var(--text-muted);
}

.hero-tag-text {
  color: var(--text-secondary);
  letter-spacing: 4px;
}

.hero-welcome {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 6px;
  margin-bottom: 32px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 48px;
  background: var(--gradient-cta);
  background-size: 200% auto;
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all var(--transition-default);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.cta-button:hover {
  background-position: right center;
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.45);
  transform: translateY(-2px);
}

/* ========================================
   FILTERS
   ======================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 32px 24px;
  position: relative;
  z-index: 1;
}

.filter-pill {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-default);
  font-family: var(--font-sans);
}

.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(59, 130, 246, 0.2));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ========================================
   GAME CARDS
   ======================================== */
.cards-watermark {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(100, 116, 139, 0.15);
  letter-spacing: 8px;
  padding: 8px 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 32px 60px;
  position: relative;
  z-index: 1;
}

.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-default);
  overflow: hidden;
  text-decoration: none;
}

.game-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-4px);
}

.card-genre {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  width: fit-content;
}

.card-genre.campus {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}

.card-genre.horror {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
}

.card-genre.occult {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
}

.card-genre.ancient {
  background: rgba(234, 179, 8, 0.15);
  color: #FACC15;
}

.card-genre.survival {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
}

.card-genre.urban {
  background: rgba(6, 182, 212, 0.15);
  color: #22D3EE;
}

.card-genre.xianxia {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
}

.card-genre.fantasy {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
}

.card-genre.management {
  background: rgba(251, 146, 60, 0.15);
  color: #FB923C;
}

.card-genre.scifi {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
}

.card-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.3;
  padding: 20px 0;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-card {
  animation: fade-in-up 0.5s ease forwards;
  opacity: 0;
}

.game-card:nth-child(1) {
  animation-delay: 0.05s;
}

.game-card:nth-child(2) {
  animation-delay: 0.1s;
}

.game-card:nth-child(3) {
  animation-delay: 0.15s;
}

.game-card:nth-child(4) {
  animation-delay: 0.2s;
}

.game-card:nth-child(5) {
  animation-delay: 0.25s;
}

.game-card:nth-child(6) {
  animation-delay: 0.3s;
}

.game-card:nth-child(7) {
  animation-delay: 0.35s;
}

.game-card:nth-child(8) {
  animation-delay: 0.4s;
}

/* ========================================
   MODAL (Shared)
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-default);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 90%;
  max-width: 700px;
  background: var(--bg-modal);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-default);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.modal-title-icon {
  font-size: 22px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-prompt-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-prompt-icon {
  font-size: 18px;
  color: var(--accent-purple);
}

.modal-textarea-wrapper {
  margin-bottom: 12px;
}

.modal-textarea {
  width: 100%;
  min-height: 200px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.modal-textarea::placeholder {
  color: var(--text-muted);
}

.modal-textarea:focus {
  border-color: var(--border-hover);
}

.modal-textarea-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 4px;
  margin-bottom: 16px;
}

.modal-char-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

.modal-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-default);
}

.modal-launch-btn:hover {
  background: white;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.settings-section {
  margin-bottom: 20px;
}

.settings-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: block;
}

.settings-value {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
}

/* ========================================
   GAME PAGE — Header
   ======================================== */
.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: rgba(5, 11, 29, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
}

.game-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-header-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

.game-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.game-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  border-radius: var(--radius-full);
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.game-header-badge.location-badge {
  background: rgba(124, 58, 237, 0.08);
  color: #C084FC;
  border-color: rgba(124, 58, 237, 0.2);
}

.badge-icon {
  font-size: 11px;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

/* ========================================
   GAME PAGE — Dashboard Layout
   ======================================== */
.game-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* ---------- Shared Panel Styles ---------- */
.panel-left,
.panel-right {
  overflow-y: auto;
  padding: 16px;
  border-color: var(--border-default);
  background: var(--bg-secondary);
}

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

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

.panel-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.02);
}

.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.panel-section-body {
  padding: 10px 14px;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
  line-height: 1.6;
}

/* ---------- Character Card ---------- */
.char-card {
  text-align: center;
  padding: 20px 16px 16px;
  margin-bottom: 12px;
}

.char-avatar {
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
  transition: all var(--transition-default);
}

.char-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- NPC Cards (Enhanced — 参考 mokulab) ---------- */
.npc-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(100, 116, 139, 0.1);
  transition: background var(--transition-default);
}

.npc-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.npc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.08);
  border: 1.5px solid rgba(0, 240, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--accent-cyan);
}

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

.npc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.npc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.npc-relation {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(251, 146, 60, 0.15);
  color: #FB923C;
  font-weight: 500;
  white-space: nowrap;
}

.npc-mood {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.mood-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.mood-bar {
  flex: 1;
  height: 4px;
  background: rgba(100, 116, 139, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mood-fill {
  height: 100%;
  background: linear-gradient(90deg, #F87171, #FB923C, #34D399);
  border-radius: var(--radius-full);
  transition: width var(--transition-default);
}

.mood-val {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.npc-dialogue {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 2px;
}

.npc-dialogue::before {
  content: '💬 ';
  font-size: 10px;
}

/* ---------- Dialogue Text Highlight ---------- */
.dialogue-text {
  color: #FBBF24;
  font-style: italic;
}

/* ---------- NPC Detail Modal ---------- */
.npc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}

.npc-modal-overlay.active {
  display: flex;
}

.npc-modal {
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.npc-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 24px 16px;
  position: relative;
}

.npc-modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.08);
  border: 2px dashed rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.npc-modal-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.npc-modal-relation {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: rgba(251, 146, 60, 0.15);
  color: #FB923C;
  font-weight: 500;
  margin-top: 4px;
}

.npc-modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-default);
}

.npc-modal-close:hover {
  color: var(--text-primary);
}

/* Dual mood bars */
.npc-modal-bars {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.npc-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.npc-bar-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.npc-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 32px;
  flex-shrink: 0;
}

.npc-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(100, 116, 139, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.npc-bar-fill-friendly {
  height: 100%;
  background: linear-gradient(90deg, #34D399, #10B981);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.npc-bar-fill-love {
  height: 100%;
  background: linear-gradient(90deg, #F472B6, #EC4899);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.npc-bar-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  width: 28px;
  text-align: right;
}

/* Chat button */
.npc-modal-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 24px 16px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-default);
}

.npc-modal-chat-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
}

/* Info sections */
.npc-modal-section {
  padding: 12px 24px;
  border-top: 1px solid rgba(100, 116, 139, 0.1);
}

.npc-modal-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.npc-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.npc-modal-opinion {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 12px;
  background: rgba(100, 116, 139, 0.06);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-cyan);
}

/* Shared memories timeline */
.npc-memory-item {
  padding: 6px 0;
}

.npc-memory-round {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 2px;
}

.npc-memory-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Memory emotional impact color coding */
.npc-memory-positive {
  border-left: 2px solid #00b894;
}

.npc-memory-negative {
  border-left: 2px solid #ff6b6b;
}

.npc-memory-neutral {
  border-left: 2px solid #636e72;
}

.npc-memory-positive,
.npc-memory-negative,
.npc-memory-neutral {
  padding-left: 8px;
  margin-bottom: 4px;
}

/* NPC Profile grid */
.npc-profile-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.npc-profile-item {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, .08);
}

/* NPC Tags (importance & status) */
.npc-modal-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.npc-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.npc-tag-core {
  background: rgba(108, 92, 231, .2);
  color: #a29bfe;
}

.npc-tag-major {
  background: rgba(0, 184, 148, .15);
  color: #55efc4;
}

.npc-tag-supporting {
  background: rgba(99, 110, 114, .2);
  color: #b2bec3;
}

.npc-tag-cameo {
  background: rgba(253, 203, 110, .15);
  color: #ffeaa7;
}

.npc-tag-injured {
  background: rgba(255, 165, 0, .2);
  color: #ffa500;
}

.npc-tag-missing {
  background: rgba(150, 150, 150, .2);
  color: #aaa;
}

.npc-tag-deceased {
  background: rgba(255, 0, 0, .15);
  color: #ff6b6b;
}

/* NPC status on cards */
.npc-status {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 4px;
}

.npc-status-injured {
  background: rgba(255, 165, 0, .2);
  color: #ffa500;
}

.npc-status-missing {
  background: rgba(150, 150, 150, .2);
  color: #aaa;
}

.npc-status-deceased {
  background: rgba(255, 0, 0, .15);
  color: #ff6b6b;
}

/* Remove button */
.npc-modal-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 24px 24px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.15);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-default);
}

.npc-modal-remove:hover {
  border-color: #F87171;
  color: #F87171;
}

/* ---------- NPC Private Chat UI ---------- */
.npc-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.npc-chat-back {
  background: none;
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text-secondary);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.npc-chat-back:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.npc-chat-avatar-sm {
  font-size: 20px;
}

.npc-chat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.npc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 250px;
  max-height: 400px;
}

.npc-chat-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
}

.npc-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.npc-chat-user {
  justify-content: flex-end;
}

.npc-chat-npc {
  justify-content: flex-start;
}

.npc-chat-avatar {
  font-size: 22px;
  flex-shrink: 0;
}

.npc-chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.npc-chat-bubble-user {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.npc-chat-bubble-npc {
  background: rgba(255, 255, 255, .06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, .08);
  border-bottom-left-radius: 4px;
}

.npc-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.npc-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .2s;
}

.npc-chat-input:focus {
  border-color: var(--accent-cyan);
}

.npc-chat-input::placeholder {
  color: var(--text-muted);
}

.npc-chat-send {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}

.npc-chat-send:hover {
  opacity: .85;
}

.npc-chat-send:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ---------- Attribute Rows ---------- */
.attr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(100, 116, 139, 0.08);
}

.attr-row:last-child {
  border-bottom: none;
}

.attr-key {
  font-size: 12px;
  color: var(--text-secondary);
}

.attr-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ---------- Goal Items ---------- */
.goal-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.goal-circle {
  color: var(--accent-cyan);
  font-size: 14px;
  flex-shrink: 0;
}

/* ---------- Event Timeline ---------- */
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}

.event-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent-purple);
  flex-shrink: 0;
}

.event-text {
  flex: 1;
  min-width: 0;
}

.event-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.event-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.event-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

/* Event importance colors */
.event-high {
  background: #ff4757;
  box-shadow: 0 0 6px rgba(255, 71, 87, .5);
}

.event-medium {
  background: var(--accent-purple);
}

.event-low {
  background: var(--text-muted);
}

/* Goal status styles */
.goal-done .goal-circle {
  color: #2ed573;
}

.goal-done span:last-child {
  text-decoration: line-through;
  opacity: .6;
}

.goal-failed .goal-circle {
  color: #ff4757;
}

.goal-failed span:last-child {
  text-decoration: line-through;
  opacity: .5;
}

/* ---------- Asset Items ---------- */
.asset-item {
  padding: 4px 0;
  font-size: 12px;
  cursor: default;
  color: var(--text-secondary);
}

/* ========================================
   GAME PAGE — Center Panel
   ======================================== */
.panel-center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

/* Welcome Screen */
.center-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px 32px;
  gap: 12px;
}

.welcome-icon {
  font-size: 64px;
  opacity: 0.5;
  margin-bottom: 8px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.welcome-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 500px;
}

.welcome-genre {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  margin: 4px 0;
}

.style-selector {
  margin: 16px 0;
}

.style-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.style-btns {
  display: flex;
  gap: 8px;
}

.style-btn {
  padding: 10px 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-default);
  font-family: var(--font-sans);
}

.style-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.style-btn.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.start-btn {
  padding: 16px 48px;
  border: none;
  background: linear-gradient(135deg, #0891B2, #06B6D4);
  color: white;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-default);
  letter-spacing: 2px;
  margin-top: 8px;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  scroll-behavior: smooth;
}

.chat-bubble {
  margin-bottom: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.85;
  animation: fade-in-up 0.3s ease forwards;
}

.chat-bubble.ai {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.chat-bubble.user {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--text-primary);
  margin-left: 40px;
}

.bubble-content {
  word-break: break-word;
}

.status-tag {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--accent-cyan-dim);
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 2px;
}

/* Streaming cursor */
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--accent-cyan);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ========================================
   GAME PAGE — Actions Area
   ======================================== */
.actions-area {
  padding: 0 20px 16px;
  border-top: 1px solid var(--border-default);
  background: rgba(5, 11, 29, 0.6);
  backdrop-filter: blur(10px);
}

.actions-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.actions-toggle:hover {
  color: var(--text-primary);
}

.actions-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

.toggle-arrow {
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.actions-list {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-bottom: 12px;
}

.actions-list.expanded {
  display: grid;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-default);
  text-align: left;
}

.action-card:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: rgba(0, 240, 255, 0.04);
  transform: translateX(4px);
}

.action-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.action-text {
  flex: 1;
  line-height: 1.4;
}

/* Custom Input */
.custom-input-area {
  display: flex;
  gap: 10px;
}

.custom-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.custom-input::placeholder {
  color: var(--text-muted);
}

.custom-input:focus {
  border-color: var(--border-hover);
}

.custom-send-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, #0891B2, #06B6D4);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-default);
}

.custom-send-btn:hover {
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.custom-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   MOBILE-ONLY COMPONENTS (hidden by default)
   ======================================== */
.mobile-stats-bar {
  display: none;
}

.mobile-tab-bar {
  display: none;
}

.mobile-settings-panel {
  display: none;
}

/* ---------- Mobile Stats Bar ---------- */
.mobile-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.15);
  flex-shrink: 0;
}

/* ---------- Mobile Settings Panel ---------- */
.mobile-settings-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-default);
  text-decoration: none;
}

.mobile-settings-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1100px) {
  .game-dashboard {
    grid-template-columns: 220px 1fr 220px;
  }
}

@media (max-width: 900px) {
  .game-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .panel-left .panel-section,
  .panel-left .char-card {
    min-width: 200px;
    margin-bottom: 0;
  }

  .panel-right {
    border-left: none;
    border-top: 1px solid var(--border-default);
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .panel-right .panel-section {
    min-width: 200px;
    margin-bottom: 0;
  }

  .game-header-badge.location-badge {
    display: none;
  }
}

/* ---------- Mobile Breakpoint (768px) ---------- */
@media (max-width: 768px) {

  /* === Homepage === */
  .header {
    padding: 0 16px;
  }

  .header-title {
    display: none;
  }

  .hero {
    padding: 48px 16px 24px;
  }

  .hero-mascot {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
  }

  .hero-title {
    letter-spacing: 4px;
  }

  .hero-welcome {
    letter-spacing: 3px;
    font-size: 12px;
    margin-bottom: 20px;
  }

  .hero-divider {
    margin: 10px 0;
  }

  .cta-button {
    padding: 14px 36px;
    font-size: 15px;
  }

  .filters {
    padding: 12px 16px;
    gap: 8px;
  }

  .filter-pill {
    padding: 6px 14px;
    font-size: 12px;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 12px 40px;
  }

  .game-card {
    padding: 16px;
    min-height: 160px;
  }

  .card-icon {
    font-size: 36px;
    padding: 12px 0;
  }

  .card-title {
    font-size: 14px;
  }

  .card-desc {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  .modal {
    width: 95%;
    padding: 20px;
  }

  .modal-textarea {
    min-height: 150px;
  }

  /* === Game Page Header === */
  .game-header {
    padding: 0 12px;
  }

  .game-header-title {
    font-size: 13px;
  }

  .game-header-left {
    gap: 8px;
  }

  .game-header-right {
    display: none;
  }

  .game-header-badge.location-badge {
    display: none;
  }

  .header-action-btn span:last-child {
    display: none;
  }

  /* === Mobile Stats Bar === */
  .mobile-stats-bar {
    display: none;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
    background: rgba(5, 11, 29, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    scrollbar-width: none;
  }

  .mobile-stats-bar::-webkit-scrollbar {
    display: none;
  }

  .mobile-stats-bar.visible {
    display: flex;
  }

  /* === Mobile Tab Bar === */
  .mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: none;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    background: rgba(5, 11, 29, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-default);
  }

  .mobile-tab-bar.visible {
    display: flex;
  }

  .mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tab.active {
    color: var(--accent-cyan);
  }

  .mobile-tab-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-tab-label {
    font-size: 10px;
    font-weight: 500;
  }

  /* === Game Dashboard — Mobile Layout === */
  .game-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
  }

  .game-dashboard.has-stats {
    height: calc(100vh - 52px - 40px);
    height: calc(100dvh - 52px - 40px);
  }

  /* On mobile hide 900px horizontal scroll overrides */
  .panel-left,
  .panel-right {
    overflow-x: visible;
    overflow-y: auto;
    display: block;
    border: none;
    padding: 16px;
  }

  .panel-left .panel-section,
  .panel-left .char-card,
  .panel-right .panel-section {
    min-width: unset;
    margin-bottom: 12px;
  }

  /* === Mobile Tab Panel Switching === */
  .game-dashboard .panel-left,
  .game-dashboard .panel-right,
  .game-dashboard .mobile-settings-panel {
    display: none !important;
  }

  .game-dashboard .panel-center {
    display: flex !important;
  }

  /* Story tab (default) */
  .game-dashboard[data-active-tab="story"] .panel-center {
    display: flex !important;
  }

  /* Connections tab */
  .game-dashboard[data-active-tab="connections"] .panel-center {
    display: none !important;
  }

  .game-dashboard[data-active-tab="connections"] .panel-left {
    display: block !important;
  }

  .game-dashboard[data-active-tab="connections"] .panel-left [data-section="character"],
  .game-dashboard[data-active-tab="connections"] .panel-left [data-section="attributes"] {
    display: none !important;
  }

  /* Attributes tab */
  .game-dashboard[data-active-tab="attributes"] .panel-center {
    display: none !important;
  }

  .game-dashboard[data-active-tab="attributes"] .panel-left {
    display: block !important;
  }

  .game-dashboard[data-active-tab="attributes"] .panel-left [data-section="connections"] {
    display: none !important;
  }

  /* Events tab */
  .game-dashboard[data-active-tab="events"] .panel-center {
    display: none !important;
  }

  .game-dashboard[data-active-tab="events"] .panel-right {
    display: block !important;
  }

  .game-dashboard[data-active-tab="events"] .panel-right [data-section="goals"],
  .game-dashboard[data-active-tab="events"] .panel-right [data-section="assets"] {
    display: none !important;
  }

  /* Assets tab */
  .game-dashboard[data-active-tab="assets"] .panel-center {
    display: none !important;
  }

  .game-dashboard[data-active-tab="assets"] .panel-right {
    display: block !important;
  }

  .game-dashboard[data-active-tab="assets"] .panel-right [data-section="events"] {
    display: none !important;
  }

  /* Settings tab */
  .game-dashboard[data-active-tab="settings"] .panel-center {
    display: none !important;
  }

  .game-dashboard[data-active-tab="settings"] .mobile-settings-panel {
    display: block !important;
    padding: 16px;
    overflow-y: auto;
    background: var(--bg-secondary);
  }

  /* === Game Page — Compact Styles === */
  .center-welcome {
    padding: 24px 16px;
  }

  .welcome-icon {
    font-size: 48px;
  }

  .welcome-title {
    font-size: 20px;
  }

  .welcome-desc {
    font-size: 12px;
  }

  .style-btns {
    flex-wrap: wrap;
    justify-content: center;
  }

  .style-btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  .start-btn {
    padding: 14px 36px;
    font-size: 15px;
  }

  .chat-messages {
    padding: 12px 14px;
  }

  .chat-bubble {
    padding: 14px 16px;
    font-size: 13px;
  }

  .chat-bubble.user {
    margin-left: 20px;
  }

  .actions-area {
    padding: 0 12px 12px;
    padding-bottom: calc(12px + 56px + env(safe-area-inset-bottom));
  }

  .actions-list.expanded {
    grid-template-columns: 1fr;
  }

  .action-card {
    padding: 10px 14px;
    font-size: 12px;
  }

  .custom-input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .custom-send-btn {
    padding: 10px 14px;
  }

  /* === NPC Modal Mobile === */
  .npc-modal {
    width: 95vw;
    max-height: 85vh;
  }
}

/* ---------- Extra Small Screens (420px) ---------- */
@media (max-width: 420px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    letter-spacing: 2px;
  }

  .hero-title-en {
    font-size: 0.5em;
  }

  .cta-button {
    width: 100%;
    justify-content: center;
  }

  .game-header-badge {
    padding: 3px 8px;
    font-size: 10px;
  }
}

/* ========================================
   Toast Notifications
   ======================================== */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastIn 0.4s ease-out, toastOut 0.4s ease-in forwards;
  animation-delay: 0s, 2.6s;
  pointer-events: auto;
  white-space: nowrap;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-connection {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.toast-event {
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.toast-asset {
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* ---------- Item Confirmation Popup ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.confirm-overlay.active {
  display: flex;
}

.confirm-popup {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  animation: confirmIn .3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

.confirm-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  position: relative;
}

.confirm-badge svg {
  width: 26px;
  height: 26px;
}

.confirm-badge::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: badgePulse 2s ease-in-out infinite;
}

.confirm-badge-connection {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
}

.confirm-badge-connection::after {
  border-color: rgba(108, 92, 231, .3);
}

.confirm-badge-event {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
}

.confirm-badge-event::after {
  border-color: rgba(255, 107, 107, .3);
}

.confirm-badge-goal {
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: #fff;
}

.confirm-badge-goal::after {
  border-color: rgba(0, 184, 148, .3);
}

.confirm-badge-asset {
  background: linear-gradient(135deg, #fdcb6e, #e17055);
  color: #fff;
}

.confirm-badge-asset::after {
  border-color: rgba(253, 203, 110, .3);
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: .6;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.confirm-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.confirm-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn {
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.confirm-accept {
  background: linear-gradient(135deg, #2ed573, #17c0eb);
  color: #fff;
}

.confirm-accept:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(46, 213, 115, .4);
}

.confirm-reject {
  background: rgba(255, 255, 255, .08);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.confirm-reject:hover {
  background: rgba(255, 71, 87, .2);
  color: #ff4757;
}

@keyframes confirmIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}