/* ==========================================================================
   1. GLOBAL SYSTEM VARIABLES & CORE RESET
   ========================================================================== */
:root {
  /* Color Palette - Neon Dark Cyberpunk (DICE Manhwa Theme) */
  --bg-deep: #05030a;
  --bg-surface: #0c0817;
  --bg-card: rgba(18, 13, 33, 0.82);
  --bg-card-hover: rgba(28, 20, 51, 0.9);
  
  /* Neon Accents */
  --accent-purple: #a855f7;
  --accent-purple-glow: #c084fc;
  --accent-purple-dark: #581c87;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  /* Glassmorphism & Borders */
  --border-subtle: rgba(168, 85, 247, 0.2);
  --border-glowing: rgba(168, 85, 247, 0.6);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
  
  /* Typography */
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Exo 2', sans-serif;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Layout Constants */
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --bottom-nav-height: 68px;
}

/* Reset & Box Model */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

/* Starfield / Particle Background Canvas */
#starCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Custom Scrollbar for App Main Content */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(5, 3, 10, 0.5);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-purple-dark);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* ==========================================================================
   2. MAIN APPLICATION CONTAINER & FULLSCREEN OVERLAY
   ========================================================================== */
#appContainer {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px; /* Mobile Viewport Frame */
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: rgba(12, 8, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 0 0 50px rgba(168, 85, 247, 0.12);
}

/* Fullscreen Contract / Intro Modal */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(circle at center, #170d2c 0%, #05030a 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.intro-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glowing);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.25);
  padding: 2rem 1.5rem;
  border-radius: var(--border-radius-lg);
  text-align: center;
  width: 100%;
  max-width: 380px;
  animation: modalAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cube-badge {
  font-size: 2.5rem;
  margin-bottom: 0.2rem;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.intro-box h1.glitch {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 15px var(--accent-purple-glow);
  letter-spacing: 6px;
  margin-bottom: 0.2rem;
}

.intro-box .subtitle {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-heading);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.contract-card {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid var(--accent-purple);
  padding: 0.8rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.2rem;
  text-align: left;
}

.x-message {
  color: #e9d5ff;
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.4;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  margin-bottom: 1rem;
}

.input-group label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  color: var(--accent-purple-glow);
  letter-spacing: 1px;
}

.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.input-hint {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ==========================================================================
   3. SYSTEM HEADER & REALTIME TICKER
   ========================================================================== */
.system-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem;
  background: rgba(12, 8, 23, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Dicer Rank Badges */
.rank-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 1px;
}

.rank-f { background: #374151; color: #e5e7eb; border: 1px solid #4b5563; }
.rank-e { background: #1e3a8a; color: #bfdbfe; border: 1px solid #3b82f6; }
.rank-d { background: #065f46; color: #a7f3d0; border: 1px solid #10b981; }
.rank-c { background: #713f12; color: #fef08a; border: 1px solid #eab308; }
.rank-b { background: #7c2d12; color: #fed7aa; border: 1px solid #f97316; }
.rank-a { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }
.rank-s { 
  background: linear-gradient(135deg, #581c87, #a855f7); 
  color: #ffffff; 
  border: 1px solid var(--accent-purple-glow);
  box-shadow: 0 0 10px var(--accent-purple);
}

.user-meta h2 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.user-title {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.header-dp {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid var(--accent-purple);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.dp-icon {
  font-size: 1rem;
}

/* X Broadcast Marquee */
.x-broadcast {
  background: #080412;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.35rem 0.8rem;
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  z-index: 19;
}

.x-icon {
  color: var(--accent-purple-glow);
  font-family: var(--font-heading);
  font-weight: 900;
  margin-right: 0.5rem;
  white-space: nowrap;
}

marquee {
  color: #d8b4fe;
  font-style: italic;
  font-size: 0.75rem;
}

/* ==========================================================================
   4. PAGE VIEWPORT AREA & TRANSITIONS
   ========================================================================== */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(var(--bottom-nav-height) + 1rem);
  position: relative;
}

/* Hidden Pages vs Active Page Fade Animation */
.page {
  display: none;
}

.page.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: pageSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.page-header h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--accent-purple-glow);
  letter-spacing: 1px;
}

.page-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Base Card Style */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 1.1rem;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(168, 85, 247, 0.35);
}

/* ==========================================================================
   5. PAGE 1: DASHBOARD
   ========================================================================== */
.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.3), rgba(12, 8, 23, 0.6));
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--border-radius-lg);
}

.welcome-banner h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.welcome-banner p {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.sector-tag {
  background: var(--accent-purple-dark);
  color: #f3e8ff;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--accent-purple);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-icon {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-size: 1.2rem;
  opacity: 0.6;
}

.card-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.big-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-purple-glow);
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.stat-card small {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-family: var(--font-heading);
}

.quest-preview-text {
  font-size: 0.85rem;
  color: #e5e7eb;
  line-height: 1.4;
  margin-bottom: 0.8rem;
}

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

.quick-stats-card .quick-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.quick-stat-chips .chip {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.quick-stat-chips .chip strong {
  color: var(--accent-purple-glow);
  font-family: var(--font-heading);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.log-list {
  list-style: none;
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: #d1d5db;
  max-height: 120px;
  overflow-y: auto;
}

.log-list li {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 0.3rem;
  font-family: monospace;
}

/* ==========================================================================
   6. PAGE 2: ATTRIBUTES (SPECS)
   ========================================================================== */
.stats-container {
  display: flex;
  flex-direction: column;
  gap: 0.80rem;
}

.stat-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-name {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent-purple-glow);
}

.bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple-dark), var(--accent-purple-glow));
  box-shadow: 0 0 10px var(--accent-purple);
  transition: width 0.4s ease;
}

.stat-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.sub-specs {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.sub-specs strong {
  color: #e5e7eb;
}

.total-stats-bar {
  text-align: center;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid var(--accent-purple);
  padding: 0.9rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.total-stats-bar strong {
  color: var(--accent-purple-glow);
  font-size: 1.2rem;
  margin-left: 0.4rem;
}

/* ==========================================================================
   7. PAGE 3: 3D DICE ROLLER
   ========================================================================== */
.dice-stage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cube-stage {
  width: 100%;
  height: 170px;
  perspective: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cube {
  width: 80px;
  height: 80px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cube.rolling {
  animation: spinCube 0.6s infinite linear;
}

@keyframes spinCube {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

.face {
  position: absolute;
  width: 80px;
  height: 80px;
  background: rgba(18, 13, 33, 0.95);
  border: 2px solid var(--accent-purple);
  box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.5), 0 0 20px rgba(168, 85, 247, 0.3);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 14px;
}

.front  { transform: rotateY(0deg) translateZ(40px); }
.back   { transform: rotateY(180deg) translateZ(40px); }
.right  { transform: rotateY(90deg) translateZ(40px); }
.left   { transform: rotateY(-90deg) translateZ(40px); }
.top    { transform: rotateX(90deg) translateZ(40px); }
.bottom { transform: rotateX(-90deg) translateZ(40px); }

.roll-info {
  margin: 0.8rem 0;
  font-size: 0.85rem;
}

.roll-info small {
  color: var(--text-dim);
  display: block;
  font-size: 0.7rem;
}

.highlight {
  color: var(--accent-purple-glow);
  font-family: var(--font-heading);
}

.alloc-box {
  text-align: center;
}

.alloc-header h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.alloc-header p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.alloc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.alloc-btn {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid var(--accent-purple);
  color: #ffffff;
  padding: 0.7rem 0.4rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.alloc-btn:active {
  background: var(--accent-purple);
  transform: scale(0.95);
}

.system-msg {
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent-purple-glow);
  min-height: 1.2rem;
  font-weight: 600;
}

.probability-card h4 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.prob-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.prob-list strong {
  color: var(--text-main);
}

/* ==========================================================================
   8. PAGE 4: QUESTS (X SYSTEM & CHATGPT)
   ========================================================================== */
.generator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.generator-header h3 {
  font-family: var(--font-heading);
  font-size: 0.82rem;
}

.ai-badge {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  font-size: 0.58rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-heading);
}

.quest-generator-box p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.desire-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.desire-input-wrap input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 0.7rem 0.9rem;
  color: white;
  font-size: 0.82rem;
}

.desire-input-wrap input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.status-text {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  margin-top: 0.4rem;
}

.active-quest-panel {
  border-color: var(--accent-purple);
}

.quest-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.badge {
  background: var(--accent-purple-dark);
  color: #f3e8ff;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-heading);
}

.reward-badge {
  color: var(--accent-green);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
}

.quest-text {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
}

.quest-interactive-area {
  margin: 1rem 0;
}

.clicker-box {
  background: rgba(168, 85, 247, 0.15);
  border: 2px dashed var(--accent-purple);
  padding: 1.2rem;
  text-align: center;
  border-radius: var(--border-radius-md);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s ease;
}

.clicker-box:active {
  background: rgba(168, 85, 247, 0.35);
}

.penalty-warning-card h4 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--accent-red);
  margin-bottom: 0.3rem;
}

.penalty-warning-card p {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==========================================================================
   9. PAGE 5: ABILITIES (X-SKILLS REGISTRY)
   ========================================================================== */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.skill-card.locked {
  opacity: 0.55;
  filter: grayscale(0.8);
  border-color: rgba(255, 255, 255, 0.05);
}

.skill-card.unlocked {
  opacity: 1;
  filter: grayscale(0);
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
}

.skill-icon {
  font-size: 1.8rem;
}

.skill-titles h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.skill-type {
  font-size: 0.6rem;
  color: var(--accent-purple-glow);
  font-family: var(--font-heading);
  display: block;
}

.skill-status {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  background: #374151;
  color: #9ca3af;
}

.skill-card.unlocked .skill-status {
  background: var(--accent-purple-dark);
  color: #ffffff;
  border: 1px solid var(--accent-purple);
}

.skill-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.skill-reqs {
  font-size: 0.68rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

.skill-reqs strong {
  color: var(--accent-purple-glow);
}

/* ==========================================================================
   10. PAGE 6: LEADERBOARD & RANKINGS
   ========================================================================== */
.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rank-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 0.9rem;
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.rank-row.is-user {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.15);
}

.rank-row-num {
  font-family: var(--font-heading);
  color: var(--accent-purple-glow);
  font-weight: 900;
  width: 28px;
}

.rank-row-name {
  flex: 1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rank-row-score {
  font-family: var(--font-heading);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.rank-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.rank-summary small {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.rank-tiers-card h4 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tier-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-family: var(--font-heading);
}

.tier {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
}

.tier-s { color: #f0abfc; border-left: 2px solid #a855f7; }
.tier-a { color: #fca5a5; border-left: 2px solid #ef4444; }
.tier-b { color: #fdba74; border-left: 2px solid #f97316; }
.tier-c { color: #fde047; border-left: 2px solid #eab308; }
.tier-d { color: #6ee7b7; border-left: 2px solid #10b981; }
.tier-f { color: #d1d5db; border-left: 2px solid #6b7280; }

/* ==========================================================================
   11. BUTTON STYLES & FIXED BOTTOM NAVIGATION
   ========================================================================== */
/* Generic Action Buttons */
.glow-btn, .action-btn, .accent-btn {
  background: linear-gradient(135deg, var(--accent-purple-dark), var(--accent-purple));
  color: #ffffff;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: var(--border-radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.35);
  transition: all 0.15s ease;
  width: 100%;
}

.glow-btn:hover, .action-btn:hover, .accent-btn:hover {
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.6);
}

.glow-btn:active, .action-btn:active, .accent-btn:active {
  transform: scale(0.97);
}

.glow-btn:disabled {
  opacity: 0.4;
  box-shadow: none;
  cursor: not-allowed;
}

.action-btn {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid var(--accent-purple);
  padding: 0.5rem 0.9rem;
  font-size: 0.72rem;
  width: auto;
}

.accent-btn {
  background: linear-gradient(135deg, #0284c7, var(--accent-cyan));
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.35);
}

/* Fixed Bottom Navigation Bar (6 Tabs) */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--bottom-nav-height);
  background: rgba(8, 5, 18, 0.96);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  z-index: 100;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  height: 100%;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.1s ease;
}

.nav-icon {
  font-size: 1.15rem;
}

.nav-label {
  font-size: 0.58rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-btn:hover {
  color: var(--text-muted);
}

.nav-btn.active {
  color: var(--accent-purple-glow);
  text-shadow: 0 0 10px var(--accent-purple);
}

.nav-btn.active .nav-icon {
  transform: translateY(-2px);
   }
