:root {
  /* Developer / GitHub / OriginTree structural tokens */
  --bg-page: #f6f8fa; /* GitHub Light bg */
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;

  /* Borders & Shadows */
  --border-color: #d0d7de;
  --border-light: #e5e7eb;
  --shadow-card: 0 1px 3px rgba(27, 31, 36, 0.04);
  --shadow-btn: 0 1px 0 rgba(27, 31, 36, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  
  /* Corner radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* OriginTree Brand Blue */
  --primary: #4da3ff;
  --primary-hover: #3a96fa;
  --primary-active: #2b84e8;
  --primary-subtle: rgba(77, 163, 255, 0.1);

  /* Secondary & Accents */
  --secondary: #0984e3;
  --purple-accent: #6c5ce7;

  /* Typography */
  --text-main: #24292f;
  --text-muted: #57606a;
  
  /* Statuses */
  --success: #1a7f37;
  --success-bg: #dafbe1;
  --danger: #cf222e;
  --danger-bg: #ffebe9;
  --warning: #9a6700;
  --warning-bg: #fff8c5;
}

/* 1. Pro Universal CSS Reset (Prevents all mobile overflow bugs) */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

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

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 2. Cards & Panels */
.card, .glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 24px;
  width: 100%;
  max-width: 100%;
}

/* 3. Headers & Typography */
h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-main);
  word-wrap: break-word;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-main);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

p.subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* 4. Buttons */
.btn, .btn-primary, .btn-outline, .btn-secondary {
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: 0.2s all;
  text-decoration: none !important;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: 1px solid rgba(27, 31, 36, 0.15);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:active {
  background-color: var(--primary-active);
}

.btn-secondary, .btn-outline {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

.btn-secondary:hover, .btn-outline:hover {
  background-color: var(--bg-hover);
}

.btn-disabled {
  background-color: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  cursor: not-allowed;
  opacity: 0.7;
}

/* 5. Inputs & Forms */
form {
  width: 100%;
  max-width: 100%;
}

.search-input, .form-input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 14px;
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(208, 215, 222, 0.2);
  transition: 80ms all;
  display: block;
}

.search-input:focus, .form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
  width: 100%;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

/* 6. Badges & Tags */
.status-badge {
  padding: 2px 8px;
  border-radius: 2em;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(27, 31, 36, 0.15);
  background-color: var(--success-bg);
  color: var(--success);
  display: inline-block;
}

.status-badge.coming-soon {
  background-color: var(--warning-bg);
  color: var(--warning);
  border-color: #d4a72c;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.category-tag {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* 7. Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

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

.nav-toggle {
  display: none;
}

.nav-brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  transition: 0.2s color;
}

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

/* 8. Layout Grids */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 32px auto;
  padding: 0 20px;
}

.hero-section {
  text-align: center;
  padding: 60px 20px;
  width: 100%;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
  width: 100%;
}

/* 9. XP Bar */
.xp-bar-container {
  width: 100%;
  background: var(--border-light);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.5s ease;
}

/* 10. Footer */
.footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  background: var(--bg-card);
  margin-top: auto;
  width: 100%;
}

/* 11. Pro Mobile Responsive Layout Adjustments */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
  
  .nav-header {
    width: 100%;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 18px;
    color: var(--text-main);
    cursor: pointer;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    margin-top: 12px;
  }

  .nav-links.open {
    display: flex;
  }

  .main-content {
    margin: 20px auto;
    padding: 0 12px;
  }

  .card, .glass-panel {
    padding: 18px 14px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  h1 { font-size: 20px; }
  h2 { font-size: 16px; }

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