﻿:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2a3d;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --border: #2d3a4f;
  --border-light: #3d4a5f;
  --danger: #ef4444;
  --success: #22c55e;
  --info: #3b82f6;
  --gradient-hero: linear-gradient(135deg, #0f1729 0%, #1a2340 50%, #0f1f2e 100%);
  --gradient-card: linear-gradient(180deg, rgba(26, 35, 64, 0.8) 0%, rgba(15, 23, 41, 0.9) 100%);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.light-mode {
  --bg-primary: #eef2f6;
  --bg-secondary: #f6f8fa;
  --bg-card: #fafcff;
  --bg-card-hover: #f0f4fa;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-dark: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.3);
  --border: #d1d9e6;
  --border-light: #9aa8b9;
  --gradient-hero: linear-gradient(135deg, #dce3f0 0%, #eef2f6 50%, #e2e8f0 100%);
  --gradient-card: linear-gradient(180deg, rgba(250,252,255,0.9) 0%, rgba(246,248,250,0.95) 100%);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .header-bar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: var(--border);
}

body.light-mode .tabs-bar {
  background: rgba(255, 255, 255, 0.95);
}

body.light-mode .tab-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .tab-btn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
}

body.light-mode .hero::before {
  background: radial-gradient(ellipse at 30% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(37, 99, 235, 0.04) 0%, transparent 60%);
}

body.light-mode .hero-badge {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
}

body.light-mode .hero h1 {
  background: linear-gradient(135deg, var(--accent), var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode .card:hover {
  box-shadow: var(--shadow-card), 0 0 20px rgba(37, 99, 235, 0.05);
}

body.light-mode .result-box {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

body.light-mode .canvas-container {
  background: #e2e8f0;
  border-color: var(--border);
}

body.light-mode .planet-stat {
  background: rgba(37, 99, 235, 0.08);
}

body.light-mode .ranking-list li.champion {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
}

body.light-mode .question-option:hover {
  background: rgba(37, 99, 235, 0.04);
}

body.light-mode .question-option.selected {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

body.light-mode .question-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}

body.light-mode .question-option.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

body.light-mode .comparison-table tr:hover td {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .space-object-card {
  background: linear-gradient(135deg, #e8edf5, #f0f4f8);
}

body.light-mode .chat-msg.bot {
  background: var(--bg-card-hover);
}

body.light-mode .game-hud > div {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border);
  color: var(--text-primary);
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-light); text-shadow: 0 0 8px var(--accent-glow); }

img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.header-logo span { background: linear-gradient(135deg, var(--accent), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.header-controls { display: flex; align-items: center; gap: 0.75rem; }

.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 1.1rem;
  transition: var(--transition);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); transform: translateY(-1px); }

.btn-admin {
  padding: 0.4rem 1rem; border-radius: 50px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 0.85rem; font-weight: 600;
  transition: var(--transition);
}
.btn-admin:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.btn-admin.active { background: var(--accent); color: #000; border-color: var(--accent); }

.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

#starfield { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

.hero-content { position: relative; z-index: 2; max-width: 800px; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-light), #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero p {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.tabs-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.tab-btn.active {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.search-wrapper {
  display: flex;
  align-items: center;
  margin-left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.25rem;
  flex-shrink: 0;
}
.search-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  width: 140px;
}
.search-wrapper button {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #000;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.search-wrapper button:hover { background: var(--accent-light); transform: scale(1.05); }

.main-content { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }

.tab-content { display: none; animation: fadeSlideIn 0.4s ease; }
.tab-content.active { display: block; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
}
.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-card), 0 0 20px rgba(245, 158, 11, 0.05);
  transform: translateY(-1px);
}

.card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin-left: 0.5rem;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  margin: 0.4rem 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.form-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.8rem; margin-bottom: 0.2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  transition: var(--transition);
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #000; }
.btn-primary:hover { box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-1px); }

.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { box-shadow: 0 0 16px rgba(239, 68, 68, 0.4); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { box-shadow: 0 0 16px rgba(34, 197, 94, 0.4); }

.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.6rem; font-size: 0.7rem; border-radius: 30px; }

.result-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box h3 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--text-primary); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

.toast-container {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  color: var(--text-primary);
  font-size: 0.9rem;
  animation: toastIn 0.4s ease;
  max-width: 360px;
}
.toast.success { border-color: var(--success); }
.toast.info { border-color: var(--info); }
.toast.error { border-color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { box-shadow: 0 0 24px var(--accent-glow); transform: translateY(-3px); }

footer {
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: left;
}

.footer-grid h3 { color: var(--accent); font-size: 0.95rem; margin-bottom: 0.75rem; }
.footer-grid p { font-size: 0.8rem; line-height: 1.8; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.news-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.news-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.news-card img { width: 100%; height: 160px; object-fit: cover; border-bottom: 1px solid var(--border); }

.news-content { padding: 1rem; }
.news-content .title { font-weight: 600; color: var(--text-primary); margin-bottom: 0.3rem; }
.news-content .date { font-size: 0.75rem; color: var(--text-secondary); }
.news-content .desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.5rem; }

.iframe-fallback { position: relative; }
.iframe-fallback-msg { text-align: center; padding: 0.5rem 1rem; color: var(--text-secondary); font-size: 0.8rem; background: var(--bg-card); border-radius: 0 0 var(--radius-sm) var(--radius-sm); border: 1px solid var(--border); border-top: none; margin-top: -5px; }

.canvas-container { background: #050a14; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

canvas { max-width: 100%; height: auto; display: block; }

.planet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.planet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.planet-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.planet-card .bar { height: 4px; }
.planet-card .icon { font-size: 2.5rem; text-align: center; padding: 1rem 0.5rem 0; }
.planet-card .info { padding: 0.5rem 0.8rem 0.8rem; }
.planet-card .info h3 { font-size: 0.95rem; margin-bottom: 0.2rem; color: var(--text-primary); }
.planet-card .info p { font-size: 0.75rem; color: var(--text-secondary); }

.planet-stat {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  margin: 0.1rem;
  color: var(--text-secondary);
}

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  display: none;
  animation: fadeSlideIn 0.3s ease;
}
.detail-panel.open { display: block; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.detail-item {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}
.detail-item .label { font-size: 0.7rem; color: var(--text-secondary); }
.detail-item .value { font-size: 1rem; font-weight: 700; color: var(--accent); }

.comparison-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.85rem; }
.comparison-table th, .comparison-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; }
.comparison-table th { color: var(--accent); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.comparison-table tr:hover td { background: rgba(255,255,255,0.02); }

.chat-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  height: 350px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.chat-msg { margin: 0.5rem 0; padding: 0.6rem 1rem; border-radius: 16px; max-width: 85%; clear: both; line-height: 1.5; font-size: 0.9rem; }
.chat-msg.user { background: var(--accent); color: #000; float: right; }
.chat-msg.bot { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); float: left; }

.ranking-list { list-style: none; padding: 0; }
.ranking-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  margin: 0.3rem 0;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  transition: var(--transition);
}
.ranking-list li:hover { border-left-color: var(--accent); }
.ranking-list li.champion {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), transparent);
  font-weight: 700;
}
.ranking-list li.champion::before { content: "👑"; margin-right: 0.3rem; }

.question-option {
  display: block;
  width: 100%;
  margin: 0.6rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition);
}
.question-option:hover { border-color: var(--accent); background: rgba(245, 158, 11, 0.05); }
.question-option.selected { border-color: var(--accent); background: rgba(245, 158, 11, 0.1); }
.question-option.correct { border-color: var(--success); background: rgba(34, 197, 94, 0.1); }
.question-option.wrong { border-color: var(--danger); background: rgba(239, 68, 68, 0.1); }

.progress-bar { width: 100%; height: 6px; background: var(--bg-card); border-radius: 3px; margin: 1rem 0; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 3px; width: 0%; transition: width 0.5s ease; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.gallery-item:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; border-bottom: 1px solid var(--border); }
.gallery-item .caption { padding: 0.75rem; text-align: center; }
.gallery-item .caption h3 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.gallery-item .caption p { font-size: 0.75rem; color: var(--text-secondary); }

.kbd {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.moon-canvas { background: #050a14; border-radius: 50%; display: block; margin: 0 auto; max-width: 200px; border: 2px solid var(--border); }

.moon-info { text-align: center; margin-top: 0.75rem; font-size: 0.95rem; }
.moon-info span { font-weight: 700; color: var(--accent); }

.fact-card {
  font-size: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
}

.space-object-card {
  background: linear-gradient(135deg, #0f1729, #1a2340);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}
.space-object-card h3 { font-size: 1.6rem; color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }

.constellation-canvas { background: #050510; border-radius: var(--radius); width: 100%; max-width: 600px; border: 1px solid var(--border); display: block; margin: 0 auto; }

.constellation-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0; }
.constellation-selector button {
  padding: 0.4rem 1rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: var(--transition);
}
.constellation-selector button:hover { border-color: var(--accent); color: var(--text-primary); }
.constellation-selector button.active { background: var(--accent); color: #000; border-color: var(--accent); }

.admin-panel { display: none; margin-top: 1rem; padding: 1rem; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }

.loader { text-align: center; padding: 2rem; color: var(--text-secondary); }
.loader::after { content: ''; display: inline-block; width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-left: 0.5rem; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.evento-item {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.evento-item:last-child { border-bottom: none; }
.evento-item strong { min-width: 130px; color: var(--accent); flex-shrink: 0; font-size: 0.85rem; }
.evento-item span { flex: 1; font-size: 0.9rem; }
.evento-item small { color: var(--text-secondary); text-align: right; flex-shrink: 0; max-width: 40%; font-size: 0.8rem; }

.mision-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  transition: var(--transition);
}
.mision-card:hover { border-color: var(--border-light); }
.mision-card .icon { font-size: 2rem; flex-shrink: 0; }
.mision-card .body strong { color: var(--text-primary); }
.mision-card .body small { color: var(--text-secondary); }
.mision-card .body p { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.3rem; }

.suggest-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.suggest-btn:hover { border-color: var(--accent); color: var(--accent); }

.space-history {
  font-size: 0.95rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.game-container { position: relative; display: flex; flex-direction: column; align-items: center; }
#gameCanvas { background: #050a14; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; max-width: 800px; aspect-ratio: 1/1; cursor: crosshair; }
.game-hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.75rem 1rem; pointer-events: none;
}
.game-hud > div {
  background: rgba(0,0,0,0.6); padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem; color: #fff; pointer-events: auto;
}
.game-hud .level-badge { color: var(--accent); font-weight: 700; }
.game-hud .score-badge strong { color: var(--accent); }
.game-hud .lives-badge { font-size: 1.1rem; letter-spacing: 3px; }
.game-name-input {
  position: absolute; bottom: 50%; left: 50%; transform: translate(-50%, 50%);
  background: rgba(0,0,0,0.85); padding: 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--accent); text-align: center; z-index: 10;
  display: none; min-width: 280px;
}
.game-name-input h3 { color: var(--accent); margin-bottom: 0.75rem; font-size: 1.2rem; }
.game-name-input input { margin-bottom: 0.5rem; }
.game-over-overlay {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); z-index: 5;
  flex-direction: column; gap: 0.5rem;
}
.game-over-overlay h2 { color: var(--danger); font-size: 2rem; }
.game-over-overlay p { color: #fff; font-size: 1.1rem; }
.mobile-controls { display: none; width: 100%; max-width: 500px; margin: 0.5rem auto; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.mobile-arrow { width: 64px; height: 64px; font-size: 1.8rem; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); touch-action: manipulation; }
.shoot-btn { height: 64px; padding: 0 1.5rem; font-size: 1.2rem; background: var(--danger); color: white; border: none; border-radius: var(--radius); touch-action: manipulation; }
.lives-display { font-size: 1.4rem; letter-spacing: 4px; }

.quiz-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.quiz-header h3 { font-size: 0.95rem; margin: 0; color: var(--text-secondary); }
.quiz-header h3 strong { color: var(--accent); }
.quiz-header .timer { color: var(--accent); font-size: 1rem; }

/* AULA VIRTUAL */
.aula-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.aula-course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.aula-course-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.aula-course-img {
  height: 140px;
  position: relative;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}

.aula-course-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.aula-course-body {
  padding: 1rem;
}

.aula-course-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.aula-course-teacher {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.aula-course-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modulo-card {
  transition: var(--transition);
}

.lecciones-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.leccion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.leccion-item:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.04);
}
.leccion-item.completed {
  border-left: 3px solid var(--success);
  opacity: 0.85;
}

.leccion-status {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.leccion-info {
  flex: 1;
}
.leccion-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.leccion-modal-box {
  max-width: 720px !important;
}

/* NOTIFICATIONS */
.notification-wrapper {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  line-height: 1;
}

.notification-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 2rem);
  max-height: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}

.notification-dropdown.open {
  display: flex;
}

.notification-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover {
  background: var(--bg-card-hover);
}

.notif-item.unread {
  border-left: 3px solid var(--accent);
}

.notif-item .notif-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.notif-item .notif-body {
  flex: 1;
  font-size: 0.8rem;
}

.notif-item .notif-body .notif-text {
  color: var(--text-primary);
}

.notif-item .notif-body .notif-time {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

/* FOROS */
.foro-tab-btn {
  padding: 0.4rem 1rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.foro-tab-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.foro-tab-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.foro-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.foro-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.foro-post-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}

.foro-post-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.foro-post-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.foro-post-reply {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
}

.foro-post-reply .reply-author {
  color: var(--accent);
  font-weight: 600;
}

.foro-new-post-area {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.foro-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* GENIALLY */
.genially-container {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 0;
  height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.genially-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* TUTOR */
#tutorChatBox {
  height: 250px;
}

/* AULA SUB-TABS */
.aula-sub-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  border: 1px solid rgba(255,255,255,0.08);
}
.aula-sub-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}
.aula-sub-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.aula-sub-btn.active {
  background: var(--accent-gradient, linear-gradient(135deg, #3b82f6, #8b5cf6));
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.aula-sub-content { display: none; }
.aula-sub-content.active { display: block; }

/* BIBLIOTECA */
.biblioteca-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.biblio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.biblio-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.biblio-card .biblio-cover {
  height: 200px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  border-bottom: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  position: relative;
}

.biblio-card .biblio-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
}

.biblio-card .biblio-body {
  padding: 1rem;
}

.biblio-card .biblio-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.biblio-card .biblio-body .biblio-category {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.biblio-card .biblio-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.3rem;
}

.biblio-card .biblio-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.biblio-viewer-box {
  max-width: 900px !important;
  width: 95vw !important;
}

.biblio-stat-card {
  text-align: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.biblio-stat-card .num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}
.biblio-stat-card .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

@media (max-width: 768px) {
  .header-bar { padding: 0.5rem 1rem; }
  .header-logo { font-size: 0.95rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tabs-bar { padding: 0.4rem 0.5rem; gap: 0.15rem; }
  .tab-btn { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
  .search-wrapper input { width: 80px; }
  .card { padding: 1.25rem; }
  .card h2 { font-size: 1.2rem; }
  .mobile-controls { display: flex; }
  .hero { min-height: 40vh; padding: 5rem 1rem 3rem; }
  .planet-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .gallery-item img { height: 120px; }
  .news-grid { grid-template-columns: 1fr; }
  .toast-container { right: 1rem; left: 1rem; }
  .toast { max-width: 100%; }
  .evento-item { flex-wrap: wrap; }
  .evento-item strong { min-width: 0; width: 100%; }
  .evento-item small { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .notification-dropdown {
    position: fixed;
    top: 56px;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-height: 60vh;
  }
  .biblioteca-grid { grid-template-columns: 1fr; }
  .biblio-viewer-box { width: 100vw !important; max-width: 100vw !important; border-radius: 0 !important; }
  .biblio-viewer-box iframe { height: 70vh !important; }
  .auth-gate-box > div > div { grid-template-columns: 1fr !important; }
}

/* CHAT */
.chat-msg { margin-bottom: 0.4rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.9rem; line-height: 1.4; }
.chat-msg .chat-user { font-weight: 700; color: var(--accent); font-size: 0.8rem; }
.chat-msg .chat-time { font-size: 0.7rem; color: var(--text-secondary); margin-left: 0.5rem; }
.chat-msg.user { background: rgba(59, 130, 246, 0.15); margin-left: 2rem; }
.chat-msg.bot { background: rgba(34, 197, 94, 0.1); margin-right: 2rem; }
.chat-msg.system { background: rgba(245, 158, 11, 0.1); text-align: center; font-style: italic; }

/* AUTH GATE */
#authGateOverlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#authGateOverlay.hidden { display: none; }
.auth-gate-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-card);
}

