/* The Human Game (THG) — Premium Stylesheet */

/* Design Tokens & Custom Variables */
:root {
  --bg-color: #0A0A0B;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-panel-solid: #121212;
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glass-focus: rgba(255, 255, 255, 0.12);
  --text-primary: #e5e2e1;
  --text-muted: #c7c6ca;
  --text-dark: #313030;

  /* Stats Color Palette */
  --color-body: #00eefc;
  --color-security: #20c997;
  --color-connection: #8b5cf6;
  --color-esteem: #f43f5e;
  --color-purpose: #ffd700;

  /* State Gradients */
  --grad-body: linear-gradient(135deg, #00f0ff, #00dbe9);
  --grad-security: linear-gradient(135deg, #38d9a9, #20c997);
  --grad-connection: linear-gradient(135deg, #a78bfa, #8b5cf6);
  --grad-esteem: linear-gradient(135deg, #fb7185, #f43f5e);
  --grad-purpose: linear-gradient(135deg, #ffd700, #bf953f);

  /* Fonts */
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Geist', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;

  /* Curves */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* Custom oklab gradient support variables */
  --in-oklab: ;
}

@supports (linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

/* Base resets & box model */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #030408;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Font helpers */
.font-serif {
  font-family: var(--font-serif);
}

/* SPA Navigation Controller (Toggles screens) */
.screen {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.tab-home #screen-home { display: block; }
body.tab-play #screen-play { display: block; }
body.tab-discover #screen-discover { display: block; }
body.tab-community #screen-community { display: block; }
body.tab-profile #screen-profile { display: block; }

/* Responsive Container - Mobile-first aspect */
.app-container {
  width: 100vw;
  height: 100vh;
  max-width: 500px;
  background-color: var(--bg-color);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Header */
.app-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
}

.app-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffd700, #00eefc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.season-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.3);
  padding: 2px 6px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.header-right {
  display: flex;
  gap: 8px;
}

.stat-badge {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  padding: 4px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Main Display viewport */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-md) 85px var(--space-md); /* space for fixed navbar */
  scroll-behavior: smooth;
}

/* Glassmorphism Panel helper */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 
              inset 1px 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-panel:hover {
  border-color: var(--border-glass-focus);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 
              inset 1px 1px 0 rgba(255, 255, 255, 0.18);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, #00eefc, #00dbe9);
  color: #0A0A0B;
  box-shadow: 0 4px 12px rgba(0, 238, 252, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 238, 252, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary:disabled {
  background: #343a40;
  color: #868e96;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass-focus);
}

.btn-large {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-danger {
  background: rgba(250, 82, 82, 0.15);
  border: 1px solid rgba(250, 82, 82, 0.3);
  color: #ff8787;
}

.btn-danger:hover {
  background: rgba(250, 82, 82, 0.3);
}

.btn-glow {
  position: relative;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
  opacity: 0.8;
  animation: pulseGlow 2s infinite alternate;
  pointer-events: none;
}

/* --- SCREEN 1: HOME --- */
.home-layout {
  display: flex;
  flex-direction: column;
}

.room-card {
  padding: var(--space-sm);
  overflow: hidden;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.svg-wrapper {
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #030408;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

#room-svg {
  width: 100%;
  height: 100%;
}

.room-stats-summary {
  margin-top: 10px;
  text-align: center;
}

.room-descriptor {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
}

/* Home Action Buttons Card */
.daily-prompt-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(186, 75, 219, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.prompt-flag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffd43b;
  letter-spacing: 1.5px;
}

.prompt-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.prompt-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

/* Balance Display */
.balance-explanation {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.balance-display {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.balance-score-large {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #00eefc, #ffd700);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.balance-label-group {
  display: flex;
  flex-direction: column;
}

.balance-label-group .lbl {
  font-weight: 600;
  font-size: 1.1rem;
}

.balance-label-group .sub-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.balance-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  border-top: 1px solid var(--border-glass);
  padding-top: var(--space-xs);
  margin-top: 5px;
}

/* --- DYNAMIC SVG STATE TOGGLING --- */
svg .state-high {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
svg .state-low {
  display: block;
}

/* When high classes are set on body */
body.has-high-body svg .body-high { display: block; opacity: 1; }
body.has-high-body svg .body-low { display: none; }

body.has-high-security svg .security-high { display: block; opacity: 1; }
body.has-high-security svg .security-low { display: none; }

body.has-high-connection svg .connection-high { display: block; opacity: 1; }
body.has-high-connection svg .connection-low { display: none; }

body.has-high-esteem svg .esteem-high { display: block; opacity: 1; }
body.has-high-esteem svg .esteem-low { display: none; }

body.has-high-purpose svg .purpose-high { display: block; opacity: 1; }
body.has-high-purpose svg .purpose-low { display: none; }


/* --- SCREEN 2: PLAY ARENA --- */
.play-layout {
  position: relative;
  min-height: 400px;
}

.play-progress-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: var(--space-xs);
}

.progress-step {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  text-transform: uppercase;
  padding: 4px;
}

.progress-step.active {
  color: #00eefc;
  border-bottom: 2px solid #00eefc;
}

/* Scenarios view */
.scenario-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.scenario-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--text-muted);
}

.scenario-situation {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-top: 5px;
}

.choices-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.choice-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.01);
}

.choice-btn.selected {
  background: linear-gradient(135deg, rgba(0, 238, 252, 0.15), rgba(139, 92, 246, 0.15));
  border-color: #00eefc;
  box-shadow: 0 0 15px rgba(0, 238, 252, 0.25);
}

/* Scrubbing timeline Slider container */
.consequence-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: fadeIn 0.4s ease forwards;
}

.consequence-heading {
  font-size: 1.1rem;
  font-weight: 600;
}

.consequence-subheading {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -8px;
}

.timeline-slider-wrapper {
  margin: var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.timeline-ticks .tick {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dark);
  cursor: pointer;
  transition: color 0.2s;
}

.timeline-ticks .tick.active {
  color: #00eefc;
}

/* Scrubber Input Range styling */
.timeline-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #343a40;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f0ff, #00dbe9);
  box-shadow: 0 0 10px rgba(0, 238, 252, 0.5);
  transition: transform 0.1s;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Consequence Cards Cascade */
.timeline-cards-wrapper {
  min-height: 120px;
}

.consequence-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.con-card-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.con-card-detail {
  font-weight: 600;
  font-size: 1.05rem;
}

.con-card-delta {
  font-size: 0.9rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.con-card-delta.plus {
  background: rgba(32, 201, 151, 0.12);
  color: var(--color-security);
}

.con-card-delta.minus {
  background: rgba(250, 82, 82, 0.12);
  color: var(--color-body);
}

.tradeoff-detector {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: var(--space-sm);
  margin-top: 5px;
}

.tradeoff-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #a5b4fc;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.tradeoff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tradeoff-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
}

.consequence-narrative-text {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-left: 2px solid #00eefc;
  padding-left: 12px;
  margin-top: 10px;
}

/* Insight Screen */
.insight-reveal-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: fadeIn 0.4s ease forwards;
}

.insight-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ae3ec9;
  letter-spacing: 1px;
}

.insight-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: -10px;
}

.insight-summary {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.interactive-widget-box {
  padding: var(--space-md);
}

.widget-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

/* Interactive slider widget style */
.widget-slider-info {
  margin-top: var(--space-xs);
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
  color: #ffd43b;
  min-height: 45px;
}

/* Interactive Drag sorting style */
.widget-sort-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.sort-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}

.sort-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.sort-handle {
  color: var(--text-dark);
}

.widget-feedback {
  margin-top: var(--space-xs);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 20px;
}
.widget-feedback.success { color: var(--color-security); }
.widget-feedback.error { color: var(--color-body); }

/* Reflections */
.reflection-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space-sm);
}

.reflection-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

#reflection-textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 10px;
  outline: none;
  resize: none;
  font-size: 0.9rem;
}

#reflection-textarea:focus {
  border-color: #00eefc;
}

.play-controls {
  display: flex;
  margin-top: var(--space-lg);
  gap: var(--space-xs);
}

.flex-spacer {
  flex: 1;
}

/* Daily complete overlay screen */
.daily-complete-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-color);
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.daily-complete-overlay .icon {
  font-size: 4rem;
  animation: floatIcon 3s infinite alternate;
}

.overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: var(--space-md);
}

/* --- SCREEN 3: DISCOVER --- */
.discover-header {
  margin-bottom: var(--space-md);
}

.discover-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

.discover-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-top: 4px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  letter-spacing: 0.5px;
}

.seasons-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.level-explorer-row {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.level-explorer-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.level-explorer-row.active {
  border-left: 3px solid #00eefc;
}

.level-left-info {
  display: flex;
  flex-direction: column;
}

.level-lbl-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.level-lbl-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.level-status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.level-status-pill.unlocked {
  background: rgba(32, 201, 151, 0.12);
  color: var(--color-security);
}

.insights-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.insight-log-card {
  padding: var(--space-md);
}

.insight-log-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd43b;
  margin-bottom: 4px;
}

.insight-log-card p {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-dark);
  font-size: 0.9rem;
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-md);
}

/* --- SCREEN 4: PROFILE --- */
.profile-balance-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.overall-balance-donut {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 6px solid #00eefc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 15px rgba(0, 238, 252, 0.3);
}

.overall-balance-donut .balance-num {
  font-size: 1.75rem;
  font-weight: 800;
}

.overall-balance-donut .balance-lbl {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.balance-details {
  flex: 1;
}

.balance-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 4px 0 8px 0;
}

.profile-xp-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xp-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.xp-bar-outer {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.xp-bar-inner {
  height: 100%;
  background: #ae3ec9;
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stats-bars-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.stat-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.bar-outer {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow: hidden;
}

.bar-inner {
  height: 100%;
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-body-bar { background: var(--grad-body); }
.stat-security-bar { background: var(--grad-security); }
.stat-connection-bar { background: var(--grad-connection); }
.stat-esteem-bar { background: var(--grad-esteem); }
.stat-purpose-bar { background: var(--grad-purpose); }

/* The Mirror noticed pattern cards */
.mirror-cards-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mirror-card {
  background: linear-gradient(135deg, rgba(252, 196, 25, 0.05), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(252, 196, 25, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  animation: fadeIn 0.3s ease;
}

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

.mirror-header h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-purpose);
}

.mirror-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(252, 196, 25, 0.15);
  color: var(--color-purpose);
  padding: 2px 6px;
  border-radius: 4px;
}

.mirror-desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.mirror-evidence {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 8px;
  display: block;
}

.mirror-action {
  margin-top: 10px;
  display: inline-flex;
}

/* Reflection History List */
.reflections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reflection-log-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
}

.ref-log-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-bottom: 4px;
  font-weight: 600;
}

.ref-log-scenario {
  color: var(--text-muted);
  font-weight: 600;
}

.ref-log-text {
  font-size: 0.9rem;
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.4;
  color: var(--text-primary);
  margin-top: 4px;
}

.danger-zone {
  border-color: rgba(250, 82, 82, 0.2);
}

/* Bottom Tab Navigation elements */
.app-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 65px;
  background: rgba(10, 10, 11, 0.9);
  border-top: 1px solid var(--border-glass);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 10;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

.nav-tab .icon {
  font-size: 1.25rem;
  transition: transform 0.2s;
}

.nav-tab .label {
  font-size: 0.7rem;
  font-weight: 600;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: #00eefc;
}

.nav-tab.active .icon {
  transform: scale(1.15);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  background-color: #00eefc;
  border-radius: 50%;
  box-shadow: 0 0 6px #00eefc;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.start-stagger .stagger-in-1 { animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 0.04s; }
.start-stagger .stagger-in-2 { animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 0.08s; }
.start-stagger .stagger-in-3 { animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 0.12s; }
.start-stagger .stagger-in-4 { animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: 0.16s; }

@keyframes pulseGlow {
  from { box-shadow: 0 0 10px rgba(99, 102, 241, 0.2); }
  to { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
}

@keyframes floatIcon {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@keyframes activeGlowPulse {
  0% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0px rgba(0, 238, 252, 0.1); border-color: rgba(255,255,255,0.03); }
  50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 238, 252, 0.4); border-color: rgba(0, 238, 252, 0.3); }
  100% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0px rgba(0, 238, 252, 0.1); border-color: rgba(255,255,255,0.03); }
}

/* ==========================================================================
   PHASE 6: DUOLINGO UI & ANIMATION UPGRADES
   ========================================================================== */

/* 1. Milestone Path (Tree) Styling */
.milestone-tree {
  background: linear-gradient(135deg, rgba(25, 28, 48, 0.45), rgba(11, 13, 25, 0.65));
  position: relative;
  overflow: visible;
}

.tree-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) 0;
  position: relative;
}

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.3s ease;
  z-index: 2;
}

/* Winding stagger layout like Duolingo */
#node-stabilize { transform: translateX(30px); }
#node-connect { transform: translateX(0); }
#node-become { transform: translateX(-30px); }
#node-purpose { transform: translateX(0); }

.node-circle-wrap {
  position: relative;
  width: 70px;
  height: 70px;
}

.node-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141729;
  color: var(--text-dark);
  cursor: not-allowed;
  position: absolute;
  top: 5px;
  left: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.3s, box-shadow 0.3s, color 0.3s;
  border: 2px solid rgba(255, 255, 255, 0.03);
}

.tree-node.active .node-circle {
  background: #252a4a;
  color: var(--text-primary);
  cursor: pointer;
  animation: activeGlowPulse 3s infinite ease-in-out;
}

.tree-node.current .node-circle {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0, 238, 252, 0.4);
}

.tree-node.current .node-circle::after {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 2px dashed #00eefc;
  animation: rotateDashed 10s linear infinite;
}

/* Level color markers */
.tree-node[data-level="SURVIVE"].active .node-circle { background: var(--grad-body); }
.tree-node[data-level="STABILIZE"].active .node-circle { background: var(--grad-security); }
.tree-node[data-level="CONNECT"].active .node-circle { background: var(--grad-connection); }
.tree-node[data-level="BECOME"].active .node-circle { background: var(--grad-esteem); }
.tree-node[data-level="PURPOSE"].active .node-circle { background: var(--grad-purpose); }

.tree-node.active .node-circle:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 15px rgba(255, 255, 255, 0.1);
}

.node-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 4px;
}

.progress-ring-fill {
  fill: none;
  stroke-width: 4px;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Progress ring fill colors */
.tree-node[data-level="SURVIVE"] .progress-ring-fill { stroke: var(--color-body); }
.tree-node[data-level="STABILIZE"] .progress-ring-fill { stroke: var(--color-security); }
.tree-node[data-level="CONNECT"] .progress-ring-fill { stroke: var(--color-connection); }
.tree-node[data-level="BECOME"] .progress-ring-fill { stroke: var(--color-esteem); }
.tree-node[data-level="PURPOSE"] .progress-ring-fill { stroke: var(--color-purpose); }

.node-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tree-node.active .node-label {
  color: var(--text-primary);
}

.tree-connector {
  width: 4px;
  height: 40px;
  background: #141729;
  margin: -2px 0;
  z-index: 1;
  position: relative;
  border-radius: 2px;
}

.tree-connector.active {
  background: linear-gradient(to bottom, #00eefc, #ffd700);
}

/* Stagger connectors */
#connector-1 { transform: translateX(15px) rotate(32deg); height: 48px; }
#connector-2 { transform: translateX(15px) rotate(-32deg); height: 48px; }
#connector-3 { transform: translateX(-15px) rotate(-32deg); height: 48px; }
#connector-4 { transform: translateX(-15px) rotate(32deg); height: 48px; }

/* 2. Details Popover */
.node-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 260px;
  background: rgba(15, 17, 30, 0.95);
  border: 1px solid var(--border-glass-focus);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  text-align: center;
}

.node-popover.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.popover-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffd43b;
  letter-spacing: 1px;
}

.node-popover h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: -5px;
}

.node-popover p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.popover-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 5px;
}

/* 3. Sliding Screen Transitions */
.play-card {
  position: relative;
  overflow: hidden;
}

.scenario-container,
.consequence-container,
.insight-reveal-container {
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease;
}

/* Slide classes */
.slide-out-left {
  transform: translateX(-110%) !important;
  opacity: 0 !important;
  position: absolute;
  width: 100%;
}

.slide-in-right {
  animation: slideInFromRight 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 4. Floating Stat Indicators */
.floating-delta {
  position: absolute;
  font-size: 1rem;
  font-weight: 800;
  color: white;
  pointer-events: none;
  z-index: 1000;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: floatUpAndFade 1.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.floating-delta.plus {
  background: var(--grad-security);
  border: 1px solid rgba(32, 201, 151, 0.3);
}

.floating-delta.minus {
  background: var(--grad-body);
  border: 1px solid rgba(250, 82, 82, 0.3);
}

/* 5. Confetti Celebration Overlay */
.celebration-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 6, 12, 0.9);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-lg);
  animation: fadeIn 0.3s ease forwards;
}

#confetti-canvas {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

.celebration-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  text-align: center;
  background: rgba(20, 24, 45, 0.85);
  border: 1px solid var(--border-glass-focus);
  padding: var(--space-lg) var(--space-md);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
  animation: scaleUpConfetti 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.emoji-crown {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 10px;
  animation: bounceScale 2s infinite alternate;
}

.xp-gain-display {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: var(--space-md) 0;
}

.xp-bubble {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--grad-esteem);
  box-shadow: 0 0 15px rgba(186, 75, 219, 0.4);
}

.xp-bubble.courage-bubble {
  background: var(--grad-purpose);
  box-shadow: 0 0 15px rgba(252, 196, 25, 0.4);
}

/* 6. Dynamic Character SVG Postures */
#human-character .char-state {
  display: none;
}

/* Priority rule based on body classes */
body.char-state-stressed #human-character .char-stressed { display: block !important; }
body.char-state-happy #human-character .char-happy { display: block !important; }
body.char-state-studious #human-character .char-studious { display: block !important; }

/* Default fallback */
body.char-state-neutral #human-character .char-neutral { display: block !important; }

/* Spotlight Spotlight effect on choices */
.choice-btn {
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.03) 0%, rgba(25, 28, 48, 0.45) 100%);
  border: 1px solid var(--border-glass);
}

.choice-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

/* KEYFRAMES */
@keyframes rotateDashed {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slideInFromRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes floatUpAndFade {
  0% { transform: translateY(0) scale(0.9); opacity: 0; }
  20% { transform: translateY(-10px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-50px) scale(0.9); opacity: 0; }
}

@keyframes scaleUpConfetti {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes bounceScale {
  0% { transform: scale(1); }
  100% { transform: scale(1.15) rotate(5deg); }
}

/* ==========================================================================
   PHASE 7: REIGNS SWIPE CARD DECK STYLING
   ========================================================================== */

.swipe-deck-container {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 320px;
  margin: var(--space-md) auto;
  perspective: 1000px;
}

.swipe-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12), inset -1px -1px 0 rgba(0, 238, 252, 0.2), 0 10px 30px rgba(0, 0, 0, 0.4);
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  z-index: 2;
}

.swipe-card.dragging {
  cursor: grabbing;
  transition: none !important;
}

.swipe-card .card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-lg);
  box-sizing: border-box;
  justify-content: space-between;
}

.swipe-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.swipe-card .scenario-situation {
  flex-grow: 1;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: var(--space-md) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.swipe-prompt-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: pulseIndicator 1.5s infinite alternate;
  pointer-events: none;
}

/* Swipe Overlays / Hints */
.swipe-hint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-lg);
  box-sizing: border-box;
  text-align: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.hint-left {
  background: linear-gradient(135deg, rgba(250, 82, 82, 0.95), rgba(11, 13, 25, 0.8));
  border: 2px solid rgba(250, 82, 82, 0.5);
  border-radius: var(--radius-lg);
}

.hint-right {
  background: linear-gradient(135deg, rgba(32, 201, 151, 0.95), rgba(11, 13, 25, 0.8));
  border: 2px solid rgba(32, 201, 151, 0.5);
  border-radius: var(--radius-lg);
}

.hint-up {
  background: linear-gradient(135deg, rgba(186, 75, 219, 0.95), rgba(11, 13, 25, 0.8));
  border: 2px solid rgba(186, 75, 219, 0.5);
  border-radius: var(--radius-lg);
}

.swipe-hint .hint-dir {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--space-xs);
}

.swipe-hint .hint-choice-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.4;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Slide triggers */
.swipe-card.slide-out-left {
  transform: translate(-180%, 20px) rotate(-30deg) !important;
  opacity: 0 !important;
}

.swipe-card.slide-out-right {
  transform: translate(180%, 20px) rotate(30deg) !important;
  opacity: 0 !important;
}

.swipe-card.slide-out-up {
  transform: translate(0, -180%) scale(0.9) !important;
  opacity: 0 !important;
}

@keyframes pulseIndicator {
  from { opacity: 0.4; transform: scale(0.98); }
  to { opacity: 0.8; transform: scale(1.02); }
}

/* ==========================================================================
   PHASE 8: COMMUNITY / FORUM HUB STYLING
   ========================================================================== */

.community-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Profile Card */
.forum-profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(25, 28, 48, 0.45));
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.forum-avatar-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--grad-esteem);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 15px rgba(186, 75, 219, 0.4);
}

.forum-profile-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forum-user-tier-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forum-username {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.forum-tier-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffd43b;
  background: rgba(252, 196, 25, 0.15);
  border: 1px solid rgba(252, 196, 25, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.forum-rep-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.forum-rep-count strong {
  color: #339af0;
}

/* Navigation Switch Toggles */
.forum-toggle-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.forum-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.forum-toggle-btn.active {
  background: var(--bg-panel-solid);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Debates Header */
.active-debate-header {
  border-left: 3px solid var(--color-body);
}

.active-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--color-body);
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 6px;
}

.active-debate-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.active-debate-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Interactive Poll */
.poll-question {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.poll-option-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.poll-option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.poll-results-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poll-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poll-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.poll-bar-text {
  color: var(--text-muted);
}

.poll-bar-pct {
  color: #ffd43b;
  font-weight: 800;
}

.poll-bar-outer {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  overflow: hidden;
}

.poll-bar-inner {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #00eefc, #ffd700);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Discussion Feed */
.feed-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--space-md);
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar styling for comments feed */
.comments-list::-webkit-scrollbar {
  width: 4px;
}
.comments-list::-webkit-scrollbar-track {
  background: transparent;
}
.comments-list::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 2px;
}

.comment-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-sm);
  animation: fadeIn 0.3s ease;
}

.comment-card.user-comment {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.02);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-author {
  font-weight: 800;
  color: #a5b4fc;
}

.comment-card.user-comment .comment-author {
  color: #da77f2;
}

.comment-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 4px;
  border-radius: 2px;
}

.comment-time {
  color: var(--text-dark);
  font-weight: 600;
}

.comment-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-primary);
  word-break: break-word;
}

.comment-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-glass);
  padding-top: var(--space-md);
}

#forum-comment-textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 10px;
  outline: none;
  resize: none;
  font-size: 0.85rem;
}

#forum-comment-textarea:focus {
  border-color: #00eefc;
}

/* Strategy Guides list */
.guides-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border-left: 2px solid #be4bdb;
  transition: all 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
}

.guide-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

.guide-card-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.guide-meta {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 600;
}

.guide-meta span {
  color: var(--text-muted);
}

.guide-summary {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.guide-expanded-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  margin-top: 4px;
}

.guide-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.btn-upvote {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-upvote:hover {
  background: rgba(0, 238, 252, 0.08);
  border-color: rgba(0, 238, 252, 0.3);
  color: var(--text-primary);
}

.btn-upvote.upvoted {
  background: rgba(0, 238, 252, 0.18);
  border-color: #00eefc;
  color: #00eefc;
}

.guide-expand-link {
  font-size: 0.75rem;
  color: #00eefc;
  font-weight: 700;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* Badges section styling */
.badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: all 0.3s ease;
}

.badge-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  filter: grayscale(100%);
  opacity: 0.4;
  transition: all 0.3s ease;
}

.badge-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-info h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  transition: color 0.3s ease;
}

.badge-info p {
  font-size: 0.65rem;
  color: var(--text-dark);
  line-height: 1.25;
}

/* Unlocked Badge styles */
.badge-item.unlocked {
  background: linear-gradient(135deg, rgba(51, 154, 240, 0.08), rgba(25, 28, 48, 0.45));
  border-color: rgba(51, 154, 240, 0.3);
  box-shadow: 0 4px 12px rgba(51, 154, 240, 0.08);
}

.badge-item.unlocked .badge-icon-box {
  background: rgba(51, 154, 240, 0.15);
  border-color: rgba(51, 154, 240, 0.4);
  filter: grayscale(0%);
  opacity: 1;
  box-shadow: 0 0 10px rgba(51, 154, 240, 0.3);
}

.badge-item.unlocked .badge-info h5 {
  color: var(--text-primary);
}

.badge-item.unlocked .badge-info p {
  color: var(--text-muted);
}

/* --- CHOICE ACCESSIBILITY BUTTON PANEL --- */
.choice-buttons-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  width: 100%;
}

.choice-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-color);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
}

.choice-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass-focus);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.choice-btn .choice-dir-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.choice-btn[data-dir="left"] .choice-dir-badge {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
}

.choice-btn[data-dir="right"] .choice-dir-badge {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.choice-btn[data-dir="up"] .choice-dir-badge {
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
}

/* Sidebar Hides by default (Mobile-first) */
.sidebar-logo {
  display: none;
}

.app-sidebar-right {
  display: none;
}

/* --- Responsive Desktop Grid (Three Columns) --- */
@media (min-width: 1024px) {
  /* Three column grid container */
  .app-container {
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr 340px;
    grid-template-rows: 1fr;
    border-left: none;
    border-right: none;
    box-shadow: none;
    overflow: hidden;
  }

  /* Hide mobile header */
  .app-header {
    display: none !important;
  }

  /* Restyle nav bar as left sidebar */
  .app-nav {
    position: static;
    height: 100%;
    grid-template-columns: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid var(--border-glass);
    padding: var(--space-lg) var(--space-md);
    gap: var(--space-xs);
    background: #0A0A0B;
  }

  /* Sidebar logo section */
  .sidebar-logo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--space-xl);
    padding-left: var(--space-xs);
  }

  /* Sidebar buttons */
  .nav-tab {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 14px 20px;
    gap: var(--space-md);
    border-radius: var(--radius-md);
    width: 100%;
    transition: background-color 0.2s, color 0.2s;
  }

  .nav-tab .icon {
    font-size: 1.35rem;
    margin: 0;
  }

  .nav-tab .label {
    font-size: 0.95rem;
    font-weight: 700;
  }

  .nav-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
  }

  .nav-tab.active {
    background: rgba(0, 238, 252, 0.08);
    color: #00eefc;
  }

  /* Hide the active dot on sidebar */
  .nav-tab.active::after {
    display: none !important;
  }

  /* Main viewport panel layout */
  .app-main {
    padding: var(--space-xl) var(--space-lg);
    background-color: var(--bg-color);
  }

  .screen-content {
    max-width: 800px;
    margin: 0 auto;
  }

  /* Right Sidebar Panel styling */
  .app-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-md);
    background-color: #0A0A0B;
    border-left: 1px solid var(--border-glass);
    overflow-y: auto;
    height: 100%;
  }

  .sidebar-widget {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
  }

  .widget-title {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
    margin-bottom: 4px;
  }

  .league-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .league-rank {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffd700;
  }

  .league-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .quest-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }

  .quest-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .quest-text {
    color: var(--text-primary);
  }

  .quest-val {
    color: var(--text-muted);
  }

  .quest-xp-bar {
    background: #ffd700;
  }

  .quest-bal-bar {
    background: #00eefc;
  }

  .sidebar-stat-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
  }

  .sidebar-stat-badge strong {
    color: var(--text-primary);
    font-weight: 800;
  }
}
