/* =========================================================
   RESET & ROOT
========================================================= */

@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/fonts/Vazirmatn.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

:root {
  --bg: #07111f;

  --surface: #0d1929;
  --surface-2: #122238;
  --surface-3: #172a43;

  --text: #f8fafc;
  --muted: #9fb2c7;

  --blue: #38bdf8;
  --blue-dark: #0284c7;

  --green: #34d399;
  --red: #fb7185;
  --yellow: #fbbf24;
  --purple: #a78bfa;

  --border: rgba(148, 163, 184, 0.18);

  --radius: 20px;
}

/* =========================================================
   GENERAL
========================================================= */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family: IRANSans, "IRANSansX", Vazirmatn, Tahoma, Arial, sans-serif;

  color: var(--text);

  background:
    radial-gradient(
      circle at 80% 0%,
      rgba(14, 165, 233, 0.14),
      transparent 30%
    ),
    radial-gradient(
      circle at 10% 40%,
      rgba(139, 92, 246, 0.08),
      transparent 25%
    ),
    var(--bg);
}

button,
input {
  font-family: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.65);
  outline-offset: 3px;
}

body.modal-open {
  overflow: hidden;
}

.app {
  min-height: 100vh;
}

.app-footer {
  width: min(1400px, calc(100% - 48px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 22px 4px 30px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
}

.footer-brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.creator-credit strong {
  margin-right: 4px;
  color: var(--blue);
  font-weight: 700;
}

/* =========================================================
   TOPBAR
========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;

  min-height: 72px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 12px 28px;

  background: rgba(7, 17, 31, 0.88);

  backdrop-filter: blur(18px);

  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;

  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background: linear-gradient(135deg, #0ea5e9, #4f46e5);

  font-size: 23px;

  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.25);
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-description {
  display: block;

  margin-top: 2px;

  color: var(--muted);

  font-size: 0.72rem;
}

.top-stats {
  display: flex;

  gap: 10px;
}

.top-stat {
  min-width: 78px;

  padding: 8px 14px;

  text-align: center;

  border: 1px solid var(--border);

  border-radius: 13px;

  background: rgba(255, 255, 255, 0.04);
}

.top-stat-label {
  display: block;

  color: var(--muted);

  font-size: 0.68rem;
}

.top-stat-value {
  display: block;

  margin-top: 2px;

  font-weight: 800;
  font-size: 0.96rem;
}

/* =========================================================
   NAVIGATION
========================================================= */

.main-nav {
  position: sticky;
  top: 72px;
  z-index: 90;

  display: flex;
  justify-content: center;

  gap: 8px;

  padding: 10px 20px;

  overflow-x: auto;

  background: rgba(7, 17, 31, 0.93);

  border-bottom: 1px solid var(--border);
}

.nav-btn {
  flex-shrink: 0;

  padding: 9px 17px;

  border: none;
  border-radius: 10px;

  background: transparent;

  color: var(--muted);

  cursor: pointer;

  transition: 0.2s;
}

.nav-btn:hover {
  color: white;

  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: var(--blue);

  background: rgba(56, 189, 248, 0.13);
}

/* =========================================================
   PAGE
========================================================= */

.page {
  display: none;

  width: min(1400px, 100%);

  margin: auto;

  padding: 35px 24px 70px;
}

.page.active {
  display: block;
}

/* =========================================================
   HERO
========================================================= */

.hero {
  min-height: 420px;

  display: grid;
  grid-template-columns: 1.2fr 0.8fr;

  align-items: center;

  gap: 40px;

  padding: 35px 10px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  padding: 7px 13px;

  color: var(--blue);

  background: rgba(56, 189, 248, 0.1);

  border: 1px solid rgba(56, 189, 248, 0.2);

  border-radius: 999px;

  font-size: 0.8rem;
}

.hero h1 {
  max-width: 720px;

  margin: 18px 0 14px;

  font-size: clamp(2rem, 5vw, 4rem);

  line-height: 1.3;
}

.hero-highlight {
  color: transparent;

  background: linear-gradient(90deg, #38bdf8, #818cf8);

  background-clip: text;
  -webkit-background-clip: text;
}

.hero p {
  max-width: 690px;

  margin: 0;

  color: #afc3d8;

  font-size: 1rem;

  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;

  gap: 12px;

  margin-top: 28px;
}

/* =========================================================
   BUTTONS
========================================================= */

.btn-primary,
.btn-secondary,
.btn-danger {
  border: none;

  padding: 13px 21px;

  border-radius: 12px;

  font-weight: 700;

  cursor: pointer;

  transition: 0.2s;
}

.btn-primary {
  color: white;

  background: linear-gradient(135deg, #0ea5e9, #2563eb);

  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  color: white;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
  color: #fecdd3;

  background: rgba(251, 113, 133, 0.1);

  border: 1px solid rgba(251, 113, 133, 0.22);
}

.btn-danger:hover {
  background: rgba(251, 113, 133, 0.17);
}

/* =========================================================
   HERO ATOM
========================================================= */

.atom-visual {
  position: relative;

  min-height: 350px;

  display: grid;
  place-items: center;
}

.nucleus {
  position: absolute;

  width: 95px;
  height: 95px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: radial-gradient(circle at 30% 30%, #7dd3fc, #0369a1);

  font-size: 2rem;
  font-weight: 900;

  box-shadow: 0 0 60px rgba(56, 189, 248, 0.4);
}

.orbit {
  position: absolute;

  width: 280px;
  height: 110px;

  border: 1px solid rgba(125, 211, 252, 0.35);

  border-radius: 50%;

  animation: rotateOrbit 9s linear infinite;
}

.orbit-2 {
  transform: rotate(60deg);

  animation-duration: 11s;
}

.orbit-3 {
  transform: rotate(120deg);

  animation-duration: 13s;
}

.electron {
  position: absolute;

  width: 12px;
  height: 12px;

  top: -6px;
  left: 50%;

  border-radius: 50%;

  background: #e0f2fe;

  box-shadow: 0 0 15px #38bdf8;
}

@keyframes rotateOrbit {
  from {
    rotate: 0deg;
  }

  to {
    rotate: 360deg;
  }
}

/* =========================================================
   SECTIONS
========================================================= */

.section-header {
  margin-bottom: 24px;
}

.section-eyebrow {
  color: var(--blue);

  font-size: 0.8rem;
  font-weight: 700;
}

.section-header h2 {
  margin: 6px 0 7px;

  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.section-header p {
  margin: 0;

  color: var(--muted);

  line-height: 1.9;
}

/* =========================================================
   GAME CARDS
========================================================= */

.games-grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));

  gap: 16px;
}

.game-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.game-mode-toolbar div { display: grid; gap: 0.2rem; }
.game-mode-toolbar span { color: var(--muted); font-size: 0.9rem; }
.timed-mode-toggle {
  min-width: 7rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.timed-mode-toggle[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.question-timer {
  min-width: 4.8rem;
  color: var(--primary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.question-timer.warning { color: #dc2626; animation: timer-pulse 0.7s ease-in-out infinite alternate; }
@keyframes timer-pulse { to { transform: scale(1.08); } }

.timed-result { color: var(--muted); font-weight: 700; }

@media (max-width: 640px) {
  .game-mode-toolbar { align-items: stretch; flex-direction: column; }
  .timed-mode-toggle { width: 100%; }
}

.game-card {
  position: relative;

  min-height: 230px;

  padding: 22px;

  border: 1px solid var(--border);

  border-radius: var(--radius);

  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.025)
  );

  cursor: pointer;

  overflow: hidden;

  transition: 0.25s;
}

.game-card:hover {
  transform: translateY(-5px);

  border-color: rgba(56, 189, 248, 0.35);

  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.game-icon {
  width: 50px;
  height: 50px;

  display: grid;
  place-items: center;

  margin-bottom: 28px;

  border-radius: 14px;

  background: rgba(56, 189, 248, 0.1);

  font-size: 25px;
}

.game-card h3 {
  margin: 0 0 8px;
}

.game-card p {
  margin: 0;

  color: var(--muted);

  line-height: 1.75;

  font-size: 0.85rem;
}

.game-meta {
  position: absolute;

  right: 20px;
  bottom: 18px;
  left: 20px;

  display: flex;
  justify-content: space-between;

  color: #7896b0;

  font-size: 0.72rem;
}

/* =========================================================
   PERIODIC TABLE TOOLBAR
========================================================= */

.table-toolbar {
  display: flex;
  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 20px;
}

.search-box {
  flex: 1;

  min-width: 250px;

  padding: 12px 16px;

  border: 1px solid rgba(148, 163, 184, 0.28);

  border-radius: 12px;

  outline: none;

  background: #0e1a2b;

  color: #ffffff;
}

.search-box::placeholder {
  color: #7890a8;
}

.search-box:focus {
  border-color: rgba(56, 189, 248, 0.75);

  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

/* =========================================================
   LEGEND
========================================================= */

.legend {
  display: flex;
  flex-wrap: wrap;

  gap: 14px;

  margin-bottom: 22px;

  color: #a9bdd0;

  font-size: 0.73rem;
}

.legend-item {
  display: flex;
  align-items: center;

  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;
}

.alkali-dot {
  background: #ef657b;
}

.alkaline-dot {
  background: #eabf41;
}

.transition-dot {
  background: #38aee8;
}

.metalloid-dot {
  background: #27c8b7;
}

.nonmetal-dot {
  background: #36c98b;
}

.halogen-dot {
  background: #b779e8;
}

.noble-dot {
  background: #e76aa7;
}

.post-transition-dot {
  background: #6371bd;
}

.lanthanide-dot {
  background: #c07145;
}

.actinide-dot {
  background: #a95f51;
}

.unknown-dot {
  background: #64748b;
}

/* =========================================================
   PERIODIC TABLE
========================================================= */

.periodic-wrapper {
  direction: ltr;

  overflow-x: auto;

  padding: 18px 10px 35px;

  border-radius: 24px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025),
    rgba(255, 255, 255, 0.008)
  );
}

.periodic-table {
  direction: ltr;

  display: grid;

  grid-template-columns: repeat(18, minmax(58px, 1fr));

  gap: 6px;

  min-width: 1120px;
}

/* =========================================================
   ELEMENT CARD
========================================================= */

.periodic-table button.element,
.element {
  position: relative;

  aspect-ratio: 1;

  min-width: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  direction: rtl;

  border: 1px solid rgba(255, 255, 255, 0.2);

  border-radius: 9px;

  color: #f8fafc;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}

/* IMPORTANT:
   prevents default browser button text color */

.periodic-table button.element {
  color: #f8fafc;
}

.element:hover {
  z-index: 5;

  transform: translateY(-5px) scale(1.07);

  filter: brightness(1.18);

  border-color: rgba(255, 255, 255, 0.65);

  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

/* =========================================================
   ELEMENT TEXT
========================================================= */

.atomic-number {
  position: absolute;

  top: 4px;
  right: 6px;

  color: rgba(255, 255, 255, 0.78);

  font-size: 0.59rem;

  font-weight: 500;
}

.symbol {
  color: #ffffff;

  font-size: 1.35rem;

  font-weight: 900;

  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.element-name {
  max-width: 92%;

  margin-top: 2px;

  overflow: hidden;

  white-space: nowrap;

  text-overflow: ellipsis;

  color: rgba(255, 255, 255, 0.88);

  font-size: 0.54rem;
}

/* =========================================================
   PERIODIC TABLE COLORS
========================================================= */

/*
   Intentionally using solid-ish backgrounds instead
   of very transparent rgba values.
*/

.alkali {
  background: linear-gradient(145deg, #814052, #63303f);
}

.alkaline {
  background: linear-gradient(145deg, #78652d, #5f5124);
}

.transition {
  background: linear-gradient(145deg, #175b7d, #12445f);
}

.post-transition {
  background: linear-gradient(145deg, #404a83, #313966);
}

.metalloid {
  background: linear-gradient(145deg, #186b64, #12524d);
}

.nonmetal {
  background: linear-gradient(145deg, #17684d, #11503b);
}

.halogen {
  background: linear-gradient(145deg, #654087, #4d3168);
}

.noble {
  background: linear-gradient(145deg, #7d4261, #62344d);
}

.lanthanide {
  background: linear-gradient(145deg, #756523, #5c501c);
}

.actinide {
  background: linear-gradient(145deg, #78432f, #5e3425);
}

.unknown {
  background: linear-gradient(145deg, #465669, #354353);
}

/* =========================================================
   SEARCH DIMMING
========================================================= */

.element.hidden-search {
  opacity: 0.12;

  filter: grayscale(1) brightness(0.75);

  transform: none;
}

/* =========================================================
   MODAL
========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(2, 6, 23, 0.75);

  backdrop-filter: blur(10px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  width: min(900px, 100%);

  max-height: calc(100vh - 40px);

  overflow-y: auto;

  padding: 28px;

  border: 1px solid var(--border);

  border-radius: 24px;

  background: #101d30;

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
  float: left;

  width: 35px;
  height: 35px;

  border: none;
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);

  color: white;

  cursor: pointer;
}

.modal-element-symbol {
  width: 100px;
  height: 100px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 10px auto 20px;

  border: 1px solid rgba(56, 189, 248, 0.25);

  border-radius: 20px;

  background: rgba(56, 189, 248, 0.12);

  color: white;

  font-size: 2.8rem;
  font-weight: 900;
}

.modal h2 {
  margin-bottom: 5px;

  text-align: center;
}

.modal-subtitle {
  margin-bottom: 24px;

  text-align: center;

  color: var(--muted);
}

.element-details {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;
}

.detail-card {
  padding: 12px;

  border: 1px solid var(--border);

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.035);
}

.detail-card span {
  display: block;

  color: var(--muted);

  font-size: 0.72rem;
}

.detail-card strong {
  display: block;

  margin-top: 4px;

  color: #ffffff;
}

.detail-card-wide {
  grid-column: span 2;
}

.element-atom-model {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 24px;
}

.atom-model-nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #4f46e5);
  color: white;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
}

.atom-model-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 50%;
}

.atom-model-electron {
  position: absolute;
  z-index: 4;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #e0f2fe;
  box-shadow: 0 0 7px rgba(125, 211, 252, 0.8);
}

.element-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.element-story-grid section {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.element-story-grid h3,
.element-story-grid p {
  margin: 0;
}

.element-story-grid h3 {
  margin-bottom: 9px;
  font-size: 0.9rem;
}

.element-story-grid p {
  color: var(--muted);
  line-height: 1.8;
}

.isotope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.isotope-badge {
  direction: ltr;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.1);
  color: #c4b5fd;
  font-family: Arial, sans-serif;
}

.modal-actions,
.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-actions {
  margin-top: 18px;
}

.source-link {
  display: inline-block;
  text-decoration: none;
}

.comparison-panel {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.035);
}

.comparison-header h2 {
  margin: 5px 0 0;
}

.comparison-empty {
  margin: 22px 0 0;
  color: var(--muted);
}

.comparison-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  color: var(--muted);
  text-align: right;
}

.comparison-element-heading small {
  display: block;
  color: var(--blue);
  font-size: 1.5rem;
}

.particle-grid-single {
  grid-template-columns: minmax(180px, 320px);
  justify-content: center;
}

/* =========================================================
   GAME LAYOUT
========================================================= */

.game-layout {
  width: min(900px, 100%);

  margin: 20px auto;
}

.game-header {
  display: flex;
  align-items: center;

  gap: 15px;

  margin-bottom: 20px;
}

.back-button {
  padding: 10px 15px;

  border: none;
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);

  color: white;

  cursor: pointer;
}

.progress-track {
  flex: 1;

  height: 6px;

  overflow: hidden;

  border-radius: 50px;

  background: rgba(255, 255, 255, 0.07);
}

.progress-fill {
  width: 0;
  height: 100%;

  background: linear-gradient(90deg, #38bdf8, #6366f1);

  transition: width 0.3s;
}

.question-card {
  padding: 45px 35px;

  text-align: center;

  border: 1px solid var(--border);

  border-radius: 25px;

  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.018)
  );
}

.question-index {
  color: var(--muted);

  font-size: 0.8rem;
}

.question-title {
  margin: 18px auto 10px;

  font-size: clamp(1.5rem, 4vw, 2.4rem);

  line-height: 1.55;
}

.question-big-symbol {
  margin: 20px 0;

  color: var(--blue);

  font-size: 5rem;

  font-weight: 900;
}

.answer-options {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 12px;

  margin-top: 30px;
}

.answer-btn {
  min-height: 62px;

  padding: 10px 14px;

  border: 1px solid var(--border);

  border-radius: 13px;

  background: rgba(255, 255, 255, 0.04);

  color: white;

  font-size: 1rem;

  cursor: pointer;

  transition: 0.2s;
}

.answer-btn:hover {
  border-color: rgba(56, 189, 248, 0.4);

  background: rgba(56, 189, 248, 0.08);
}

.answer-btn.correct {
  border-color: rgba(52, 211, 153, 0.7);

  background: rgba(52, 211, 153, 0.15);

  color: #6ee7b7;
}

.answer-btn.wrong {
  border-color: rgba(251, 113, 133, 0.6);

  background: rgba(251, 113, 133, 0.14);

  color: #fda4af;
}

.feedback {
  min-height: 55px;

  margin-top: 20px;

  font-size: 0.9rem;

  line-height: 1.8;
}

.feedback.correct {
  color: var(--green);
}

.feedback.wrong {
  color: #fda4af;
}

/* =========================================================
   FIND ELEMENT GAME
========================================================= */

.find-instruction {
  margin-bottom: 25px;

  text-align: center;
}

.find-target {
  display: inline-block;

  margin-top: 5px;

  color: var(--blue);

  font-size: 1.7rem;

  font-weight: 900;
}

.game-periodic-table .element {
  cursor: crosshair;
}

.element.game-correct {
  outline: 3px solid #34d399;

  box-shadow: 0 0 25px rgba(52, 211, 153, 0.5);
}

.element.game-wrong {
  animation: shake 0.25s;
}

@keyframes shake {
  25% {
    translate: -5px 0;
  }

  75% {
    translate: 5px 0;
  }
}

/* =========================================================
   ATOM BUILDER
========================================================= */

.builder-help {
  margin: 10px auto 25px;

  color: var(--muted);

  line-height: 2;
}

.atom-builder-visual {
  min-height: 180px;

  display: grid;
  place-items: center;

  margin: 15px 0 25px;
}

.atom-core {
  width: 115px;
  height: 115px;

  display: grid;
  place-items: center;

  border: 3px solid rgba(125, 211, 252, 0.5);

  border-radius: 50%;

  background: radial-gradient(circle at 30% 30%, #7dd3fc, #0369a1 60%, #082f49);

  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.35),
    0 0 70px rgba(56, 189, 248, 0.18);
}

.atom-core span {
  font-size: 2.5rem;
  font-weight: 900;
}

.particle-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 12px;

  margin-top: 20px;
}

.particle-card {
  padding: 18px;

  border: 1px solid var(--border);

  border-radius: 16px;

  background: rgba(255, 255, 255, 0.035);
}

.particle-symbol {
  margin-bottom: 6px;

  color: var(--blue);

  font-size: 1.7rem;
}

.counter {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 15px;

  margin-top: 15px;
}

.counter button {
  width: 38px;
  height: 38px;

  border: none;
  border-radius: 10px;

  background: var(--surface-3);

  color: white;

  font-size: 1.4rem;

  cursor: pointer;
}

.counter span {
  min-width: 35px;

  font-size: 1.3rem;
  font-weight: 900;
}

.builder-submit {
  min-width: 180px;

  margin-top: 25px;
}

/* =========================================================
   ION BUILDER
========================================================= */

.ion-display {
  width: min(470px, 100%);

  margin: 25px auto;

  padding: 22px;

  border: 1px solid rgba(56, 189, 248, 0.18);

  border-radius: 20px;

  background: rgba(56, 189, 248, 0.05);
}

.ion-element {
  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 4px;
}

.ion-symbol {
  color: var(--blue);

  font-size: 4rem;

  font-weight: 900;
}

.ion-info {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;

  margin-top: 22px;
}

.ion-info > div {
  padding: 12px;

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.04);
}

.ion-info strong {
  display: block;

  margin-top: 4px;

  font-size: 1.4rem;
}

.electron-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  gap: 10px;
}

.electron-controls button {
  padding: 11px 17px;

  border: 1px solid var(--border);

  border-radius: 11px;

  background: var(--surface-2);

  color: white;

  cursor: pointer;
}

.electron-controls button:hover {
  border-color: rgba(56, 189, 248, 0.5);
}

.live-charge {
  min-height: 35px;

  margin-top: 18px;

  color: var(--yellow);

  font-weight: 700;
}

/* =========================================================
   PERIODIC TRENDS
========================================================= */

.trend-hint {
  width: min(650px, 100%);

  margin: 15px auto 25px;

  padding: 12px 18px;

  border: 1px solid rgba(167, 139, 250, 0.16);

  border-radius: 12px;

  background: rgba(167, 139, 250, 0.07);

  color: #c4b5fd;

  line-height: 1.8;

  font-size: 0.82rem;
}

.trend-options {
  width: min(620px, 100%);

  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 15px;

  margin: 30px auto 0;
}

.trend-element-card {
  position: relative;

  min-height: 185px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);

  border-radius: 18px;

  background: rgba(255, 255, 255, 0.035);

  color: white;

  cursor: pointer;

  transition: 0.2s;
}

.trend-element-card:hover {
  transform: translateY(-4px);

  border-color: rgba(56, 189, 248, 0.45);
}

.trend-element-card strong {
  color: var(--blue);

  font-size: 3rem;
}

.trend-element-card small {
  margin-top: 13px;

  color: var(--muted);
}

.trend-atomic {
  position: absolute;

  top: 12px;
  right: 15px;

  color: var(--muted);

  font-size: 0.8rem;
}

.trend-element-card.correct {
  border-color: #34d399;

  background: rgba(52, 211, 153, 0.13);
}

.trend-element-card.wrong {
  border-color: #fb7185;

  background: rgba(251, 113, 133, 0.13);
}

/* =========================================================
   BOND BUILDER
========================================================= */

.bond-game-label {
  display: inline-block;

  margin-bottom: 8px;

  padding: 6px 12px;

  border: 1px solid rgba(56, 189, 248, 0.22);

  border-radius: 999px;

  background: rgba(56, 189, 248, 0.08);

  color: var(--blue);

  font-size: 0.68rem;
  font-weight: 800;

  letter-spacing: 0.08em;
}

.bond-ion-pair {
  width: min(650px, 100%);

  display: grid;

  grid-template-columns: 1fr auto 1fr;

  align-items: center;

  gap: 18px;

  margin: 35px auto;
}

.bond-ion-card {
  position: relative;

  min-height: 230px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 20px;

  border-radius: 22px;

  overflow: hidden;
}

.cation-card {
  border: 1px solid rgba(56, 189, 248, 0.28);

  background: linear-gradient(
    160deg,
    rgba(56, 189, 248, 0.12),
    rgba(56, 189, 248, 0.025)
  );
}

.anion-card {
  border: 1px solid rgba(167, 139, 250, 0.28);

  background: linear-gradient(
    160deg,
    rgba(167, 139, 250, 0.12),
    rgba(167, 139, 250, 0.025)
  );
}

.bond-ion-type {
  position: absolute;

  top: 13px;

  color: var(--muted);

  font-size: 0.7rem;
}

.bond-ion-symbol {
  margin-bottom: 7px;

  font-size: 4rem;
  font-weight: 900;
}

.cation-card .bond-ion-symbol {
  color: #38bdf8;
}

.anion-card .bond-ion-symbol {
  color: #a78bfa;
}

.bond-ion-symbol sup {
  position: relative;

  top: -0.6em;

  margin-right: 3px;

  font-size: 1.15rem;
}

.bond-plus {
  color: var(--muted);

  font-size: 2rem;

  font-weight: 300;
}

.bond-counter {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 16px;

  margin-top: 22px;
}

.bond-counter button {
  width: 38px;
  height: 38px;

  border: 1px solid var(--border);

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);

  color: white;

  font-size: 1.3rem;

  cursor: pointer;

  transition: 0.2s;
}

.bond-counter button:hover {
  border-color: rgba(56, 189, 248, 0.5);

  background: rgba(56, 189, 248, 0.08);
}

.bond-counter span {
  min-width: 35px;

  font-size: 1.4rem;

  font-weight: 900;
}

/* =========================================================
   FORMULA LAB
========================================================= */

.formula-lab {
  width: min(600px, 100%);

  margin: 20px auto;

  padding: 25px;

  border: 1px solid var(--border);

  border-radius: 20px;

  background: rgba(255, 255, 255, 0.025);
}

.formula-label {
  display: block;

  margin-bottom: 8px;

  color: var(--muted);

  font-size: 0.75rem;
}

.formula-preview {
  min-height: 65px;

  display: flex;
  align-items: center;
  justify-content: center;

  direction: ltr;

  color: white;

  font-family: Arial, sans-serif;

  font-size: 3.2rem;

  font-weight: 800;
}

.formula-preview sub {
  position: relative;

  bottom: -0.15em;

  font-size: 0.45em;
}

.charge-equation {
  direction: ltr;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  gap: 8px;

  margin-top: 14px;

  color: var(--muted);

  font-family: Arial, sans-serif;

  font-size: 0.9rem;
}

.neutral-charge {
  color: var(--green);

  font-size: 1rem;
}

.unbalanced-charge {
  color: var(--red);

  font-size: 1rem;
}

.feedback-formula {
  display: inline-block;

  direction: ltr;

  margin: 5px 4px;

  color: white;

  font-family: Arial, sans-serif;

  font-size: 1.5rem;
}

.feedback-formula sub {
  font-size: 0.6em;
}

.bond-tip {
  width: min(620px, 100%);

  margin: 25px auto 0;

  padding: 12px 15px;

  border: 1px solid rgba(251, 191, 36, 0.16);

  border-radius: 12px;

  background: rgba(251, 191, 36, 0.055);

  color: #fcd34d;

  font-size: 0.78rem;

  line-height: 1.8;
}

/* =========================================================
   RESULTS
========================================================= */

.results {
  padding: 50px 25px;

  text-align: center;
}

.result-icon {
  font-size: 4rem;
}

.result-score {
  margin: 20px 0;

  color: var(--blue);

  font-size: 3rem;

  font-weight: 900;
}

.result-description {
  color: var(--muted);

  line-height: 1.9;
}

/* =========================================================
   PROFILE
========================================================= */

.profile-grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

  gap: 15px;
}

.profile-card {
  padding: 25px;

  border: 1px solid var(--border);

  border-radius: 18px;

  background: rgba(255, 255, 255, 0.035);
}

.profile-card-label {
  color: var(--muted);

  font-size: 0.8rem;
}

.profile-card-value {
  display: block;

  margin-top: 7px;

  font-size: 2rem;

  font-weight: 900;
}

.profile-actions {
  margin-top: 25px;
}

/* =========================================================
   LEARNING PATH & DAILY GOAL
========================================================= */

.daily-goal-card {
  margin-bottom: 34px;
  padding: 24px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.09), rgba(255, 255, 255, 0.025));
}

.daily-goal-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.daily-goal-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 15px;
  background: rgba(251, 191, 36, 0.12);
  font-size: 1.5rem;
}

.daily-goal-main h3,
.daily-goal-main p {
  margin: 0;
}

.daily-goal-main p {
  margin-top: 5px;
  color: var(--muted);
}

.daily-percent {
  color: var(--yellow);
  font-size: 1.4rem;
}

.daily-progress {
  height: 10px;
  margin: 20px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
}

.daily-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #facc15);
  transition: width 0.3s ease;
}

.daily-goal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.goal-options {
  display: flex;
  gap: 7px;
}

.goal-options button {
  min-width: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}

.goal-options button.active {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.13);
  color: var(--yellow);
}

.learning-path-list {
  width: min(900px, 100%);
  margin: 0 auto;
}

.learning-chapter {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  padding-bottom: 24px;
}

.learning-chapter:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 52px;
  right: 26px;
  bottom: -4px;
  width: 2px;
  background: var(--border);
}

.chapter-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.learning-chapter.unlocked .chapter-marker {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue);
}

.learning-chapter.complete .chapter-marker {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.13);
  color: var(--green);
}

.chapter-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.learning-chapter.locked .chapter-card {
  opacity: 0.62;
}

.chapter-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-icon {
  font-size: 1.7rem;
}

.chapter-heading h3,
.chapter-card > p {
  margin: 0;
}

.chapter-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.recommended-badge,
.locked-badge {
  margin-right: auto;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.recommended-badge {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue);
}

.locked-badge {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
}

.chapter-card > p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.chapter-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.chapter-progress-row .mastery-track {
  margin: 0;
}

.chapter-progress-row small {
  color: var(--muted);
}

.chapter-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
  margin-top: 18px;
}

.chapter-games button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: right;
  cursor: pointer;
}

.chapter-games button:not(:disabled):hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.07);
}

.chapter-games button:disabled {
  cursor: not-allowed;
}

.chapter-games small {
  color: var(--green);
}

.unlock-hint {
  font-size: 0.76rem;
}

.learning-report {
  margin-top: 42px;
}

.compact-header {
  margin-bottom: 20px;
}

.game-progress-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.game-progress-item {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.game-progress-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.game-progress-heading small,
.game-progress-footer small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.game-progress-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.1);
}

.game-progress-score {
  color: var(--blue);
  font-weight: 900;
}

.mastery-track {
  height: 7px;
  margin: 16px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
}

.mastery-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-dark), var(--green));
}

.game-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-progress-footer button,
.review-chip {
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--blue);
  cursor: pointer;
}

.game-progress-footer button {
  padding: 7px 13px;
}

.review-panel {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 18px;
  background: rgba(167, 139, 250, 0.045);
}

.review-panel h3 {
  margin: 0 0 16px;
}

.review-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-chip {
  min-width: 118px;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  text-align: right;
}

.review-chip strong {
  color: white;
  font-size: 1.2rem;
}

.review-chip span {
  color: var(--text);
}

.review-chip small,
.empty-report {
  color: var(--muted);
}

.empty-report {
  margin: 0;
}

.install-app-btn {
  color: var(--green);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;

    text-align: center;
  }

  .hero p {
    margin: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .atom-visual {
    min-height: 300px;
  }

  .topbar {
    padding: 10px 15px;
  }

  .brand-description {
    display: none;
  }
}

@media (max-width: 650px) {
  .particle-grid {
    grid-template-columns: 1fr;
  }

  .trend-options {
    grid-template-columns: 1fr;
  }

  .answer-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 25px 14px 60px;
  }

  .app-footer {
    width: calc(100% - 28px);
    flex-direction: column;
    text-align: center;
  }

  .top-stat:first-child {
    display: none;
  }

  .top-stat {
    min-width: 65px;

    padding: 7px 9px;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .question-card {
    padding: 35px 18px;
  }

  .daily-goal-card,
  .chapter-card {
    padding: 18px;
  }

  .modal {
    padding: 20px 16px;
  }

  .element-details,
  .element-story-grid {
    grid-template-columns: 1fr;
  }

  .detail-card-wide {
    grid-column: auto;
  }

  .comparison-panel {
    padding: 18px 12px;
    overflow-x: auto;
  }

  .comparison-table {
    min-width: 620px;
  }

  .daily-goal-actions,
  .daily-goal-actions .btn-primary {
    width: 100%;
  }

  .daily-goal-actions .btn-primary {
    text-align: center;
  }

  .learning-chapter {
    grid-template-columns: 38px 1fr;
    gap: 10px;
  }

  .chapter-marker {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .learning-chapter:not(:last-child)::before {
    top: 38px;
    right: 18px;
  }

  .chapter-heading {
    flex-wrap: wrap;
  }

  .recommended-badge,
  .locked-badge {
    margin-right: 0;
  }

  .bond-ion-pair {
    grid-template-columns: 1fr;

    gap: 12px;
  }

  .bond-plus {
    transform: rotate(90deg);

    font-size: 1.5rem;
  }

  .bond-ion-card {
    min-height: 200px;
  }

  .formula-preview {
    font-size: 2.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   ELEMENT DETAILS — COMPACT TABBED LAYOUT
========================================================= */

.element-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  border-color: rgba(125, 211, 252, 0.2);
  background: linear-gradient(145deg, #101f34, #0c1829);
}

.element-modal .modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  float: none;
  background: rgba(7, 17, 31, 0.68);
  backdrop-filter: blur(8px);
}

.element-modal-hero {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(380px, 520px);
  justify-content: center;
  align-items: center;
  gap: 52px;
  min-height: 228px;
  padding: 16px 34px 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 18% 45%, rgba(56, 189, 248, 0.17), transparent 33%),
    linear-gradient(120deg, rgba(56, 189, 248, 0.045), rgba(167, 139, 250, 0.06));
}

.element-modal-hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -190px;
  left: 36%;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.08);
  filter: blur(12px);
}

.atom-visual-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.atom-visual-wrap::before {
  content: "";
  position: absolute;
  width: 225px;
  height: 225px;
  top: -4px;
  border: 1px solid rgba(56, 189, 248, 0.08);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08), transparent 68%);
  box-shadow: inset 0 0 35px rgba(56, 189, 248, 0.035);
}

.element-modal .element-atom-model {
  width: 210px;
  height: 210px;
  margin: 0;
}

.atom-model-aura {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.17), transparent 68%);
  filter: blur(12px);
}

.element-modal .atom-model-nucleus {
  width: 58px;
  height: 58px;
  grid-template-rows: 1fr auto;
  padding: 9px 4px 7px;
  background: radial-gradient(circle at 32% 25%, #a5f3fc, #0ea5e9 38%, #4338ca 100%);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.08), 0 0 32px rgba(56, 189, 248, 0.55);
}

.element-modal .atom-model-nucleus strong { line-height: 1; font-size: 1.35rem; }
.element-modal .atom-model-nucleus span { opacity: 0.8; font-size: 0.55rem; direction: ltr; }

.atom-model-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 50%;
  translate: -50% -50%;
  transform-origin: center;
}

.element-modal .atom-model-electron {
  width: 6px;
  height: 6px;
  background: #ecfeff;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.13), 0 0 8px #38bdf8;
  animation: electron-glow 1.8s ease-in-out infinite alternate;
}

@keyframes electron-glow {
  to { opacity: 0.62; box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.1), 0 0 4px #38bdf8; }
}

.shell-legend {
  display: flex;
  justify-content: center;
  gap: 5px;
  min-height: 25px;
  margin-top: -8px;
}

.shell-legend span {
  min-width: 27px;
  padding: 3px 6px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.07);
  color: #bae6fd;
  font: 600 0.68rem Arial, sans-serif;
}

.atom-model-note {
  width: min(225px, 100%);
  margin-top: 5px;
  color: #86a4bf;
  text-align: center;
  font-size: 0.61rem;
  line-height: 1.55;
}

.element-identity { position: relative; z-index: 2; width: 100%; }
.element-modal-kicker { color: var(--blue); font-size: 0.75rem; font-weight: 800; }

.element-title-row {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 10px 0 20px;
}

.element-modal .modal-element-symbol {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  margin: 0;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.13));
  box-shadow: inset 0 0 25px rgba(56, 189, 248, 0.08);
  font-size: 2.25rem;
}

.element-modal h2 { margin: 0 0 3px; text-align: right; font-size: 2rem; }
.element-modal .modal-subtitle { margin: 0; color: #7dd3fc; text-align: right; font-size: 0.9rem; }

.element-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.element-quick-facts > span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.76rem;
}
.element-quick-facts strong { color: white; }

.hero-compare-button {
  position: absolute;
  top: 70px;
  left: 16px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 11px;
  background: rgba(7, 17, 31, 0.52);
  color: #bae6fd;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: 0.2s ease;
}

.hero-compare-button:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
  transform: translateY(-1px);
}

.hero-compare-button.selected {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}

.element-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 17, 31, 0.48);
}

.element-tab {
  min-width: max-content;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.element-tab.active {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.1);
  color: var(--blue);
}

.element-modal-content {
  min-height: 0;
  max-height: none;
  padding: 18px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(56, 189, 248, 0.45) transparent;
  scrollbar-width: thin;
}

.element-modal-content::-webkit-scrollbar { width: 7px; }
.element-modal-content::-webkit-scrollbar-track { background: transparent; }
.element-modal-content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.38);
  background-clip: padding-box;
}
.element-modal-content::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

.element-tab-panel[hidden] { display: none; }

.element-modal .compact-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.element-modal .detail-card {
  min-height: 70px;
  padding: 11px 13px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.element-modal .detail-card-wide { grid-column: span 3; }
.element-modal .detail-card span { font-size: 0.7rem; }
.element-modal .detail-card strong { font-size: 1.02rem; }
.configuration-card { border-color: rgba(56, 189, 248, 0.22); }

.scientific-value {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.electron-configuration {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  color: #e0f2fe !important;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.93rem !important;
  line-height: 1.65;
}

.electron-configuration sup { color: #67e8f9; font-size: 0.68em; }
.electron-configuration .orbital { display: inline-block; white-space: nowrap; }
.predicted-label { margin-right: 7px; color: var(--muted); font-family: inherit; }

.shell-distribution { display: flex !important; align-items: center; gap: 5px; }
.shell-distribution bdi { min-width: 1.25rem; text-align: center; }
.shell-distribution i { color: rgba(125, 211, 252, 0.45); font-style: normal; }

.physical-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
}

.physical-feature-grid article {
  display: grid;
  min-height: 132px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.physical-feature-grid article > span { font-size: 1.45rem; }
.physical-feature-grid small { color: var(--muted); }
.physical-feature-grid strong { font-size: 1.15rem; }
.data-note { margin: 14px 0 0; color: var(--muted); font-size: 0.75rem; }

.element-modal .element-story-grid { grid-template-columns: 1fr 1fr; margin: 0; }
.element-modal .element-story-grid section { position: relative; min-height: 115px; padding: 16px 52px 16px 16px; }
.element-modal .element-story-grid .story-wide { grid-column: 1 / -1; min-height: auto; }
.story-icon { position: absolute; top: 15px; right: 15px; font-size: 1.3rem; }

.element-modal .modal-actions {
  min-height: 56px;
  margin: 0;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: rgba(7, 17, 31, 0.72);
}

.element-modal .source-link {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.modal-source-note { color: var(--muted); font-size: 0.68rem; }

/* =========================================================
   GUIDED GAME CATALOG
========================================================= */

.game-recommendation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  background: linear-gradient(125deg, rgba(56, 189, 248, 0.13), rgba(99, 102, 241, 0.07));
}

.recommendation-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 17px;
  background: rgba(56, 189, 248, 0.13);
  font-size: 1.8rem;
}
.game-recommendation span { color: var(--blue); font-size: 0.72rem; font-weight: 800; }
.game-recommendation h3 { margin: 3px 0; font-size: 1.25rem; }
.game-recommendation p { margin: 0; color: var(--muted); font-size: 0.83rem; }

.game-catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 18px;
}
.game-catalog-toolbar > div:first-child { display: grid; gap: 3px; min-width: 180px; }
.game-catalog-toolbar span { color: var(--muted); font-size: 0.75rem; }

.game-filter-bar {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: thin;
}
.game-filter-bar button {
  min-width: max-content;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}
.game-filter-bar button.active { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.12); color: var(--blue); }

.game-catalog { display: grid; gap: 30px; }
.game-catalog-group > header { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.game-catalog-group > header h3 { margin: 0 0 3px; }
.game-catalog-group > header p { margin: 0; color: var(--muted); font-size: 0.78rem; }
.game-catalog-group > header > span { color: var(--muted); font-size: 0.75rem; }

.game-catalog .games-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.game-catalog .game-card { min-height: 245px; }
.recommended-game-card { border-color: rgba(56, 189, 248, 0.25); }
.game-card-badge { position: absolute; top: 19px; left: 18px; padding: 5px 8px; border-radius: 999px; background: rgba(52, 211, 153, 0.11); color: var(--green); font-size: 0.65rem; }
.game-card-status { position: absolute; right: 20px; bottom: 48px; font-size: 0.68rem; }
.game-card-status.strong { color: var(--green); }
.game-card-status.learning { color: var(--yellow); }
.game-card-status.focus { color: var(--red); }
.game-card-status.new { color: var(--muted); }

/* =========================================================
   CLEAR LEARNING REPORT
========================================================= */

.learning-summary {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(320px, 1.15fr);
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid rgba(56, 189, 248, 0.23);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(167, 139, 250, 0.045));
}

.accuracy-ring {
  --accuracy: 0deg;
  position: relative;
  width: 116px;
  height: 116px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  text-align: center;
  background: conic-gradient(var(--blue) var(--accuracy), rgba(148, 163, 184, 0.12) 0);
}
.accuracy-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #0d1929; }
.accuracy-ring strong, .accuracy-ring span { position: relative; z-index: 1; }
.accuracy-ring strong { font-size: 1.45rem; }
.accuracy-ring span { color: var(--muted); font-size: 0.7rem; }
.learning-summary-copy h2 { margin: 5px 0 7px; font-size: 1.35rem; }
.learning-summary-copy p { margin: 0; color: var(--muted); line-height: 1.8; font-size: 0.8rem; }

.learning-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.insight-card { display: grid; gap: 3px; min-height: 104px; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255, 255, 255, 0.03); }
.insight-card span { font-size: 0.68rem; }
.insight-card small { color: var(--muted); line-height: 1.5; }
.insight-card.strength span { color: var(--green); }
.insight-card.focus span { color: var(--yellow); }

.game-progress-list { display: grid; grid-template-columns: 1fr; gap: 18px; }
.performance-group { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255, 255, 255, 0.025); }
.performance-group.focus { border-color: rgba(251, 113, 133, 0.2); }
.performance-group.strong { border-color: rgba(52, 211, 153, 0.18); }
.performance-group > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.performance-group > header h3, .performance-group > header p { margin: 0; }
.performance-group > header p { margin-top: 2px; color: var(--muted); font-size: 0.72rem; }
.performance-group > header > span { padding: 5px 9px; border-radius: 999px; background: rgba(148, 163, 184, 0.09); color: var(--muted); font-size: 0.68rem; }
.performance-list { display: grid; gap: 7px; }

.performance-list .game-progress-item {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.game-progress-main { display: grid; grid-template-columns: minmax(150px, 0.55fr) minmax(120px, 1fr); align-items: center; gap: 14px; }
.game-progress-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.67rem; }
.game-progress-main .mastery-track { margin: 0; }
.performance-list .game-progress-item > button { padding: 7px 12px; border: 1px solid rgba(56, 189, 248, 0.22); border-radius: 9px; background: rgba(56, 189, 248, 0.08); color: var(--blue); font: inherit; font-size: 0.72rem; cursor: pointer; }

/* =========================================================
   GUIDE
========================================================= */

.guide-heading { max-width: 720px; }
.guide-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.guide-steps article { display: flex; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 17px; background: rgba(255, 255, 255, 0.03); }
.guide-steps article > span { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: rgba(56, 189, 248, 0.12); color: var(--blue); font-weight: 900; }
.guide-steps h3 { margin: 3px 0 7px; font-size: 0.95rem; }
.guide-steps p { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.75; }

.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.guide-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)); }
.guide-card-icon { font-size: 1.8rem; }
.guide-card h3 { margin: 12px 0 5px; }
.guide-card ul { flex: 1; margin: 8px 0 20px; padding-right: 19px; color: var(--muted); font-size: 0.8rem; line-height: 1.9; }
.guide-card .btn-secondary { align-self: flex-start; }

.chemistry-help { margin-top: 34px; }
.chemistry-help details { margin-bottom: 8px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.chemistry-help summary { cursor: pointer; font-weight: 800; }
.chemistry-help details[open] { border-color: rgba(56, 189, 248, 0.22); }
.chemistry-help p { margin: 12px 0 0; color: var(--muted); line-height: 1.85; }

@media (max-width: 900px) {
  .learning-summary { grid-template-columns: auto 1fr; }
  .learning-insights { grid-column: 1 / -1; }
  .guide-steps { grid-template-columns: 1fr 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .modal-overlay { padding: 8px; }
  .element-modal { max-height: calc(100vh - 16px); border-radius: 20px; }
  .element-modal-hero { grid-template-columns: 150px 1fr; justify-content: stretch; gap: 10px; min-height: 180px; padding: 12px 16px; }
  .element-modal .element-atom-model { width: 150px; height: 150px; transform: scale(0.72); }
  .shell-legend { display: none; }
  .element-title-row { gap: 10px; margin-bottom: 12px; }
  .element-modal .modal-element-symbol { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; font-size: 1.55rem; }
  .element-modal h2 { font-size: 1.35rem; }
  .hero-compare-button { top: 58px; left: 12px; }
  .element-quick-facts > span { padding: 5px 8px; }
  .element-modal-content { max-height: calc(100vh - 350px); padding: 14px; }
  .element-modal .compact-details { grid-template-columns: 1fr 1fr; }
  .element-modal .detail-card-wide { grid-column: 1 / -1; }
  .physical-feature-grid { grid-template-columns: 1fr 1fr; }
  .game-recommendation { grid-template-columns: auto 1fr; }
  .game-recommendation .btn-primary { grid-column: 1 / -1; text-align: center; }
  .game-catalog-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .learning-summary { grid-template-columns: 1fr; text-align: center; }
  .accuracy-ring { margin: auto; }
  .learning-insights { grid-column: auto; text-align: right; }
  .game-progress-main { grid-template-columns: 1fr; gap: 7px; }
  .performance-list .game-progress-item { grid-template-columns: auto 1fr auto; }
  .performance-list .game-progress-item > button { grid-column: 2 / -1; justify-self: start; }
}

@media (max-width: 480px) {
  .element-modal-hero { grid-template-columns: 112px 1fr; }
  .element-modal .element-atom-model { margin-right: -20px; transform: scale(0.58); }
  .element-modal-kicker, .element-quick-facts > span:nth-child(2) { display: none; }
  .hero-compare-button { width: 38px; height: 38px; justify-content: center; padding: 0; }
  .hero-compare-button span:last-child { display: none; }
  .element-tabs { padding-inline: 12px; }
  .element-modal-content { max-height: calc(100vh - 320px); }
  .element-modal .modal-actions { padding: 10px 12px; }
  .element-modal .modal-actions > * { flex: 1; padding-inline: 8px; text-align: center; font-size: 0.72rem; }
  .element-modal .element-story-grid { grid-template-columns: 1fr; }
  .element-modal .element-story-grid .story-wide { grid-column: auto; }
  .guide-steps { grid-template-columns: 1fr; }
  .learning-insights { grid-template-columns: 1fr; }
}

/* =========================================================
   HOME — ELEMENTINO LAB EXPERIENCE
========================================================= */

#homePage {
  width: min(1500px, 100%);
}

#homePage .hero {
  position: relative;
  min-height: 570px;
  grid-template-columns: minmax(430px, 1.05fr) minmax(410px, 0.95fr);
  gap: clamp(35px, 6vw, 90px);
  margin-bottom: 64px;
  padding: clamp(42px, 6vw, 78px);
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 34px;
  background:
    radial-gradient(circle at 14% 24%, rgba(99, 102, 241, 0.18), transparent 28%),
    radial-gradient(circle at 86% 78%, rgba(14, 165, 233, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(17, 34, 56, 0.92), rgba(8, 19, 34, 0.96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.025);
}

#homePage .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.23;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
}

#homePage .hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  left: -190px;
  bottom: -230px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(56, 189, 248, 0.025), 0 0 0 110px rgba(56, 189, 248, 0.018);
}

.hero-content {
  position: relative;
  z-index: 2;
}

#homePage .hero-badge {
  gap: 9px;
  padding: 8px 13px;
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.075);
  color: #a7f3d0;
  font-size: 0.75rem;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: badge-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes badge-pulse { to { opacity: 0.45; transform: scale(0.8); } }

#homePage .hero h1 {
  max-width: 720px;
  margin: 20px 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1.22;
  letter-spacing: -0.035em;
}

#homePage .hero-highlight {
  display: inline;
  background: linear-gradient(90deg, #38bdf8 0%, #60a5fa 45%, #a78bfa 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

#homePage .hero p {
  max-width: 700px;
  color: #b6c9dc;
  font-size: 1.02rem;
  line-height: 2.05;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.hero-stats > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}
.hero-stats strong { color: white; font-size: 1.05rem; }
.hero-stats span { color: var(--muted); font-size: 0.7rem; }

#homePage .hero-actions { margin-top: 24px; }
#homePage .hero-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding-inline: 22px; }

.hero-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  color: #7692ac;
  font-size: 0.67rem;
}

.hero-lab {
  position: relative;
  z-index: 2;
  perspective: 1200px;
}

.hero-lab-glow {
  position: absolute;
  inset: 8% 5%;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.16));
  filter: blur(55px);
}

.lab-window {
  position: relative;
  width: min(500px, 100%);
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 25px;
  background: rgba(7, 17, 31, 0.86);
  box-shadow: 0 35px 85px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.045);
  transform: rotateY(3deg) rotateX(1deg);
  translate: 0 0;
  animation: lab-window-float 4.5s ease-in-out infinite alternate;
  transition: transform 0.35s ease, border-color 0.35s ease;
}
.hero-lab:hover .lab-window { transform: rotateY(0) rotateX(0) translateY(-4px); border-color: rgba(125, 211, 252, 0.38); }

@keyframes lab-window-float {
  to { translate: 0 -7px; }
}

.lab-scanline {
  position: absolute;
  z-index: 8;
  top: 42px;
  right: 0;
  left: 0;
  height: 1px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.6), transparent);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  animation: lab-scan 3.2s ease-in-out infinite;
}

@keyframes lab-scan {
  0%, 12% { translate: 0 0; opacity: 0; }
  22% { opacity: 0.55; }
  76% { opacity: 0.2; }
  88%, 100% { translate: 0 305px; opacity: 0; }
}

.lab-window-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: #6f8ba5;
  font: 700 0.6rem "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.12em;
}
.window-dots { display: flex; gap: 5px; direction: ltr; }
.window-dots i { width: 7px; height: 7px; border-radius: 50%; background: #334155; }
.window-dots i:first-child { background: #fb7185; }
.window-dots i:nth-child(2) { background: #fbbf24; }
.window-dots i:last-child { background: #34d399; }
.lab-live { justify-self: end; display: flex; align-items: center; gap: 5px; color: var(--green); font-family: inherit; letter-spacing: 0; }
.lab-live i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.lab-workspace {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 18px;
  min-height: 214px;
  padding: 22px;
  background: radial-gradient(circle at 22% 50%, rgba(56, 189, 248, 0.09), transparent 35%);
}

.featured-element {
  --element-color: #38bdf8;
  position: relative;
  width: 142px;
  height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--element-color) 48%, transparent);
  border-radius: 22px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--element-color) 25%, #122238), rgba(79, 70, 229, 0.14));
  box-shadow: inset 0 0 35px color-mix(in srgb, var(--element-color) 10%, transparent), 0 18px 35px rgba(0, 0, 0, 0.2);
  transition: opacity 0.16s ease, scale 0.16s ease, border-color 0.3s ease, background 0.3s ease;
}
.featured-element.changing { opacity: 0.2; scale: 0.94; }
.featured-element::after { content: ""; position: absolute; width: 90px; height: 90px; top: -55px; left: -35px; border-radius: 50%; background: rgba(125, 211, 252, 0.12); }
.featured-atomic { position: absolute; top: 12px; right: 14px; color: #7dd3fc; font-size: 0.75rem; }
.featured-element strong { font: 800 3.7rem "Segoe UI", Arial, sans-serif; line-height: 1; }
.featured-element > span:not(.featured-atomic) { margin-top: 6px; font-weight: 800; }
.featured-element small { margin-top: 3px; color: var(--muted); font-size: 0.64rem; }

.lab-readout { min-width: 0; }
.readout-kicker { color: var(--blue); font-size: 0.64rem; font-weight: 800; }
.lab-readout h3 { margin: 7px 0 17px; font-size: 1.04rem; line-height: 1.75; }
.shell-preview { display: flex; align-items: center; gap: 7px; direction: ltr; }
.shell-preview span { padding: 5px 8px; border: 1px solid rgba(56, 189, 248, 0.2); border-radius: 8px; background: rgba(56, 189, 248, 0.07); color: #bae6fd; font: 700 0.72rem Arial, sans-serif; }
.shell-preview i { color: rgba(125, 211, 252, 0.35); font-style: normal; }
.readout-bars { display: grid; gap: 6px; margin-top: 20px; direction: ltr; }
.readout-bars i { height: 5px; border-radius: 999px; background: linear-gradient(90deg, rgba(56, 189, 248, 0.75), rgba(99, 102, 241, 0.25)); transition: width 0.45s ease; }
.readout-bars i:nth-child(2) { width: 72%; }
.readout-bars i:nth-child(3) { width: 45%; }

.mini-periodic {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 0 18px 18px;
  direction: ltr;
}
.mini-element { position: relative; display: grid; min-height: 47px; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: rgba(255, 255, 255, 0.025); color: #8ca6bf; font: inherit; cursor: pointer; transition: 0.22s ease; }
.mini-element:hover { border-color: rgba(125, 211, 252, 0.35); color: white; translate: 0 -2px; }
.mini-element b { font: 800 0.82rem "Segoe UI", Arial, sans-serif; }
.mini-element small { position: absolute; top: 4px; left: 5px; font-size: 0.48rem; }
.mini-element.active { border-color: rgba(52, 211, 153, 0.3); color: var(--green); background: rgba(52, 211, 153, 0.07); }
.mini-element.selected { border-color: rgba(56, 189, 248, 0.5); color: white; background: rgba(56, 189, 248, 0.16); box-shadow: 0 0 20px rgba(56, 189, 248, 0.12); animation: selected-element 1.4s ease-in-out infinite alternate; }

@keyframes selected-element {
  to { border-color: rgba(103, 232, 249, 0.8); box-shadow: 0 0 24px rgba(56, 189, 248, 0.25); }
}

.lab-mission {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 17px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}
.mission-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(167, 139, 250, 0.1); }
.lab-mission div { display: grid; gap: 1px; }
.lab-mission small { color: var(--muted); font-size: 0.58rem; }
.lab-mission strong { font-size: 0.76rem; }
.mission-progress { padding: 5px 8px; border-radius: 999px; background: rgba(56, 189, 248, 0.08); color: var(--blue); font-size: 0.6rem; }

#homePage > section:not(.hero) { position: relative; padding-inline: 8px; }
#homePage > section:not(.hero) .section-header { max-width: 720px; }
#homeGames { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1050px) {
  #homePage .hero { grid-template-columns: 1fr; gap: 45px; padding: 52px; text-align: center; }
  #homePage .hero p { margin-inline: auto; }
  .hero-stats, #homePage .hero-actions, .hero-footnote { justify-content: center; }
  .hero-lab { width: min(560px, 100%); margin: auto; }
  #homeGames { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}

@media (max-width: 600px) {
  #homePage .hero { min-height: auto; margin-bottom: 42px; padding: 34px 18px; border-radius: 24px; }
  #homePage .hero h1 { font-size: clamp(2.15rem, 12vw, 3.25rem); }
  #homePage .hero p { font-size: 0.88rem; line-height: 1.95; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .hero-stats > div { grid-template-columns: 1fr; gap: 1px; padding: 9px 5px; }
  #homePage .hero-actions, #homePage .hero-actions button { width: 100%; }
  .hero-footnote { gap: 7px 13px; }
  .lab-window { transform: none; border-radius: 20px; }
  .lab-workspace { grid-template-columns: 105px 1fr; gap: 12px; min-height: 175px; padding: 16px; }
  .featured-element { width: 105px; height: 125px; border-radius: 17px; }
  .featured-element strong { font-size: 2.8rem; }
  .lab-readout h3 { margin-bottom: 10px; font-size: 0.83rem; }
  .readout-bars { margin-top: 12px; }
  .mini-periodic { grid-template-columns: repeat(4, 1fr); padding: 0 14px 14px; }
  .mini-element { min-height: 42px; }
  .lab-mission { grid-template-columns: auto 1fr; }
  .mission-progress { display: none; }
}

@media (max-width: 390px) {
  .lab-readout h3 { display: none; }
  .shell-preview { flex-wrap: wrap; justify-content: center; }
}

/* =========================================================
   HOME QUICK START JOURNEY
========================================================= */

.quick-start-section {
  isolation: isolate;
  position: relative;
  margin-top: 18px;
  padding: clamp(22px, 4vw, 46px);
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 32px;
  background:
    radial-gradient(circle at 12% 10%, rgba(99, 102, 241, 0.15), transparent 31%),
    radial-gradient(circle at 89% 20%, rgba(14, 165, 233, 0.11), transparent 28%),
    linear-gradient(145deg, rgba(15, 29, 49, 0.94), rgba(6, 17, 31, 0.97));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.035);
}

.quick-start-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.quick-start-glow {
  position: absolute;
  top: -130px;
  left: 12%;
  z-index: -1;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.12);
  filter: blur(80px);
  animation: quick-glow-drift 7s ease-in-out infinite alternate;
}

@keyframes quick-glow-drift {
  to { translate: 80px 45px; scale: 1.15; opacity: 0.65; }
}

.quick-start-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  min-height: 255px;
  margin-bottom: 22px;
}

.quick-start-intro .section-header {
  margin: 0;
}

.quick-start-intro .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.07);
}

.quick-start-intro .section-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
  animation: quick-status-pulse 1.8s ease-in-out infinite;
}

@keyframes quick-status-pulse {
  50% { scale: 1.45; opacity: 0.55; }
}

.quick-start-intro h2 {
  max-width: 720px;
  margin-top: 13px;
  font-size: clamp(1.8rem, 3.4vw, 3.1rem);
  line-height: 1.42;
  letter-spacing: -0.04em;
  background: linear-gradient(105deg, #fff 25%, #bae6fd 72%, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.quick-start-intro .section-header > p {
  max-width: 750px;
  font-size: 0.96rem;
}

.quick-route-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.quick-route-summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aac0d4;
  font-size: 0.7rem;
  white-space: nowrap;
}

.quick-route-summary b {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.08);
  color: #7dd3fc;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.62rem;
}

.quick-route-summary > i {
  width: clamp(12px, 3vw, 48px);
  height: 1px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), rgba(99, 102, 241, 0.15));
}

.quick-atom-stage {
  position: relative;
  min-height: 245px;
  margin: 0;
  display: grid;
  place-items: center;
}

.quick-atom-aura {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.07) 45%, transparent 72%);
  filter: blur(9px);
  animation: quick-atom-breathe 3.6s ease-in-out infinite alternate;
}

@keyframes quick-atom-breathe {
  to { scale: 1.12; opacity: 0.62; }
}

.quick-atom-visual {
  width: 310px;
  min-height: 210px;
  transform: scale(0.72);
}

.quick-atom-visual .nucleus {
  background: radial-gradient(circle at 28% 24%, #a5f3fc, #0ea5e9 42%, #4338ca 88%);
  box-shadow: 0 0 0 9px rgba(56, 189, 248, 0.055), 0 0 65px rgba(56, 189, 248, 0.38);
}

.quick-atom-visual .orbit {
  border-color: rgba(125, 211, 252, 0.29);
}

.quick-atom-stage figcaption {
  position: absolute;
  bottom: 0;
  display: grid;
  gap: 2px;
  color: #7793ab;
  text-align: center;
  font-size: 0.58rem;
}

.quick-atom-stage figcaption span {
  color: #7dd3fc;
  font-weight: 800;
}

.quick-start-path {
  position: relative;
  height: 1px;
  margin: 2px 4.5% 24px;
  overflow: visible;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), rgba(129, 140, 248, 0.35), transparent);
}

.quick-start-path span {
  position: absolute;
  top: -2px;
  right: 10%;
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #7dd3fc;
  box-shadow: 0 0 15px #38bdf8;
  animation: quick-path-scan 8.5s ease-in-out infinite;
}

@keyframes quick-path-scan {
  50% { right: calc(90% - 34px); background: #818cf8; }
}

.quick-start-section #homeGames {
  counter-reset: quick-step;
  position: relative;
  gap: 18px;
}

.quick-start-section #homeGames .game-card {
  counter-increment: quick-step;
  min-height: 255px;
  padding: 24px;
  border-color: rgba(148, 163, 184, 0.15);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 4%, rgba(56, 189, 248, 0.12), transparent 27%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.quick-start-section #homeGames .game-card::before {
  content: "مرحله ۰" counter(quick-step);
  position: absolute;
  top: 23px;
  left: 22px;
  color: #7897b1;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.quick-start-section #homeGames .game-card::after {
  content: "شروع تمرین ←";
  position: absolute;
  bottom: 20px;
  left: 22px;
  color: #7dd3fc;
  font-size: 0.66rem;
  font-weight: 800;
  opacity: 0;
  translate: 8px 0;
  transition: 0.22s ease;
}

.quick-start-section #homeGames .game-card:hover,
.quick-start-section #homeGames .game-card:focus-visible {
  transform: translateY(-8px);
  border-color: rgba(56, 189, 248, 0.42);
  background:
    radial-gradient(circle at 85% 5%, rgba(56, 189, 248, 0.19), transparent 30%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025));
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(56, 189, 248, 0.06);
}

.quick-start-section #homeGames .game-card:hover::after,
.quick-start-section #homeGames .game-card:focus-visible::after {
  opacity: 1;
  translate: 0;
}

.quick-start-section #homeGames .game-card:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

.quick-start-section #homeGames .game-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 30px;
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.08));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.17);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.quick-start-section #homeGames .game-card:hover .game-icon {
  transform: rotate(-5deg) scale(1.08);
  box-shadow: 0 12px 35px rgba(56, 189, 248, 0.15);
}

.quick-start-section #homeGames .game-card h3 {
  font-size: 1.12rem;
}

.quick-start-section #homeGames .game-meta {
  bottom: 20px;
  transition: opacity 0.2s ease;
}

.quick-start-section #homeGames .game-card:hover .game-meta {
  opacity: 0.32;
}

@media (max-width: 900px) {
  .quick-start-intro { grid-template-columns: 1fr 235px; gap: 20px; }
  .quick-atom-stage { min-height: 215px; }
  .quick-atom-visual { transform: scale(0.6); }
}

@media (max-width: 680px) {
  .quick-start-section { padding: 25px 16px; border-radius: 24px; }
  .quick-start-intro { grid-template-columns: 1fr; text-align: center; }
  .quick-start-intro .section-header > p { margin-inline: auto; }
  .quick-route-summary { justify-content: center; }
  .quick-atom-stage { min-height: 185px; margin-top: -8px; }
  .quick-atom-visual { min-height: 190px; transform: scale(0.56); }
  .quick-atom-stage figcaption { bottom: -3px; }
  .quick-start-path { margin-top: 20px; }
  .quick-start-section #homeGames .game-card { min-height: 235px; }
}

@media (max-width: 390px) {
  .quick-route-summary { gap: 6px; }
  .quick-route-summary span { gap: 4px; font-size: 0.62rem; }
  .quick-route-summary b { width: 25px; height: 25px; }
}

/* =========================================================
   ACCOUNT & AUTHENTICATION
========================================================= */

.account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 152px;
  padding: 7px 9px 7px 13px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.09), rgba(99, 102, 241, 0.05));
  color: var(--text);
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: 0.2s ease;
}

.account-button:hover,
.account-button:focus-visible {
  border-color: rgba(56, 189, 248, 0.45);
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.08));
  transform: translateY(-1px);
}

.account-button:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
.account-button > span:last-child { display: grid; gap: 1px; }
.account-button small { color: var(--muted); font-size: 0.56rem; }
.account-button strong { max-width: 105px; overflow: hidden; font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.account-button-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #0ea5e9, #4f46e5);
  color: white;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 7px 20px rgba(14, 165, 233, 0.18);
}

.account-button.authenticated { border-color: rgba(52, 211, 153, 0.25); }
.account-button.authenticated .account-button-avatar { background: linear-gradient(145deg, #10b981, #0ea5e9); }

body.auth-open { overflow: hidden; }
.auth-modal[hidden] { display: none; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 23, 0.78);
  backdrop-filter: blur(14px);
  animation: auth-fade-in 0.2s ease both;
}

@keyframes auth-fade-in { from { opacity: 0; } }

.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(370px, 1.08fr);
  width: min(920px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 28px;
  background: #0a1728;
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.55), inset 0 1px rgba(255, 255, 255, 0.04);
  animation: auth-card-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes auth-card-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

.auth-close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(5, 15, 29, 0.62);
  color: #dbeafe;
  font: 300 1.4rem Arial, sans-serif;
  cursor: pointer;
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 600px;
  padding: 38px;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 15%, rgba(129, 140, 248, 0.25), transparent 30%),
    radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.2), transparent 34%),
    linear-gradient(155deg, #162341, #0c1e35 60%, #09233a);
}

.auth-showcase::before,
.auth-showcase::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 50%;
  pointer-events: none;
}
.auth-showcase::before { width: 330px; height: 125px; bottom: 55px; left: -90px; transform: rotate(32deg); }
.auth-showcase::after { width: 240px; height: 240px; top: -140px; right: -90px; }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; direction: ltr; }
.auth-brand span, .auth-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.25);
}
.auth-brand strong { font: 800 1rem "Segoe UI", Arial, sans-serif; }
.auth-showcase > div:nth-child(2) { position: relative; z-index: 1; margin-block: 35px 20px; }
.auth-eyebrow { color: #7dd3fc; font-size: 0.72rem; font-weight: 800; }
.auth-showcase h2 { margin: 10px 0; font-size: clamp(1.65rem, 3vw, 2.4rem); line-height: 1.45; }
.auth-showcase p { margin: 0; color: #adc2d5; font-size: 0.82rem; line-height: 1.9; }
.auth-benefits { position: relative; z-index: 1; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.auth-benefits li { display: flex; align-items: center; gap: 10px; }
.auth-benefits li > i { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 9px; background: rgba(52, 211, 153, 0.12); color: #6ee7b7; font-style: normal; font-size: 0.7rem; }
.auth-benefits span { display: grid; gap: 1px; }
.auth-benefits strong { font-size: 0.76rem; }
.auth-benefits small { color: #829eb6; font-size: 0.62rem; }
.auth-showcase .auth-privacy { position: relative; z-index: 1; margin-top: 25px; color: #7895ae; font-size: 0.61rem; }

.auth-main {
  min-height: 600px;
  padding: 46px clamp(28px, 5vw, 56px) 34px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.06), transparent 30%),
    #0a1728;
}

.auth-header { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.auth-logo { display: none; }
.auth-header h2 { margin: 0 0 4px; font-size: 1.45rem; }
.auth-header p { margin: 0; color: var(--muted); font-size: 0.75rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 4px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255, 255, 255, 0.025); }
.auth-tabs[hidden] { display: none; }
.auth-tabs button { padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 0.76rem; font-weight: 800; cursor: pointer; }
.auth-tabs button.active { background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(79, 70, 229, 0.13)); color: #e0f2fe; box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.13); }
.auth-message { margin-bottom: 15px; padding: 10px 12px; border: 1px solid rgba(125, 211, 252, 0.17); border-radius: 10px; background: rgba(56, 189, 248, 0.07); color: #bae6fd; font-size: 0.7rem; line-height: 1.7; }
.auth-message[hidden] { display: none; }
.auth-message.error { border-color: rgba(251, 113, 133, 0.22); background: rgba(251, 113, 133, 0.08); color: #fecdd3; }
.auth-form { display: grid; gap: 15px; }
.auth-form[hidden] { display: none; }
.auth-form label { display: grid; gap: 7px; }
.auth-form label > span { color: #c8d7e5; font-size: 0.69rem; font-weight: 700; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > i { position: absolute; right: 13px; color: #6f91ac; font: 700 0.72rem Arial, sans-serif; }
.auth-input input {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 42px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  outline: 0;
  background: rgba(4, 13, 26, 0.68);
  color: white;
  font: inherit;
  font-size: 0.77rem;
  transition: 0.18s ease;
}
.auth-input input::placeholder { color: #60778e; }
.auth-input input:focus { border-color: rgba(56, 189, 248, 0.65); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08); }
.auth-input button { position: absolute; left: 8px; width: 31px; height: 31px; border: 0; border-radius: 8px; background: transparent; color: #7994ab; cursor: pointer; }
.password-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 1px; }
.password-strength i { height: 3px; border-radius: 99px; background: rgba(148, 163, 184, 0.15); }
.password-strength i.active { background: linear-gradient(90deg, #38bdf8, #34d399); }
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 47px;
  margin-top: 3px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  color: white;
  font: inherit;
  font-size: 0.77rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.17);
}
.auth-submit:hover { transform: translateY(-1px); filter: brightness(1.08); }
.auth-submit:disabled { cursor: wait; opacity: 0.65; }
.auth-submit.loading span { opacity: 0.65; }
.auth-submit.loading i { animation: auth-loading 0.7s linear infinite; }
@keyframes auth-loading { to { rotate: 360deg; } }
.auth-switch, .auth-terms { margin: 2px 0 0; color: var(--muted); text-align: center; font-size: 0.64rem; }
.auth-switch button { border: 0; background: transparent; color: #7dd3fc; font: inherit; font-weight: 800; cursor: pointer; }

.account-view { display: grid; justify-items: center; text-align: center; }
.account-view[hidden] { display: none; }
.account-check { display: grid; width: 25px; height: 25px; place-items: center; margin-bottom: -12px; translate: 26px 0; border: 3px solid #0a1728; border-radius: 50%; background: #10b981; color: white; font-size: 0.62rem; }
.account-view .account-avatar { display: grid; width: 76px; height: 76px; place-items: center; margin-bottom: 14px; border-radius: 24px; background: linear-gradient(145deg, #0ea5e9, #4f46e5); font-size: 1.8rem; font-weight: 900; box-shadow: 0 15px 38px rgba(14, 165, 233, 0.2); }
.account-view > small { color: #34d399; font-size: 0.65rem; font-weight: 800; }
.account-view h2 { margin: 7px 0 2px; }
.account-view > p { margin: 0 0 20px; color: var(--muted); font: 0.7rem "Segoe UI", Arial, sans-serif; }
.account-sync { display: flex; align-items: center; gap: 7px; margin-bottom: 22px; padding: 8px 11px; border-radius: 999px; background: rgba(52, 211, 153, 0.07); color: #9bd9c5; font-size: 0.62rem; }
.account-sync i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.account-view .auth-submit { width: 100%; }
.auth-logout { margin-top: 12px; border: 0; background: transparent; color: #fb7185; font: inherit; font-size: 0.67rem; cursor: pointer; }

@media (max-width: 880px) {
  .topbar { gap: 10px; }
  .account-button { min-width: auto; padding-left: 9px; }
  .account-button > span:last-child { display: none; }
  .auth-card { grid-template-columns: 1fr; width: min(520px, 100%); overflow-y: auto; }
  .auth-showcase { display: none; }
  .auth-main { min-height: auto; overflow: visible; }
  .auth-logo { display: grid; }
}

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; }
  .brand { flex: 1; }
  .account-button { order: 2; }
  .top-stats { order: 3; width: 100%; }
  .top-stat { flex: 1; min-width: 0; padding: 6px 8px; }
  .main-nav { top: 124px; }
  .auth-modal { padding: 8px; }
  .auth-card { max-height: calc(100vh - 16px); border-radius: 20px; }
  .auth-main { padding: 62px 20px 25px; }
  .auth-close { top: 14px; left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal, .auth-card { animation: none; }
}
