@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* =========================================
   COLORS
   Black + dark blue, with a clean blue accent
========================================= */

:root {
  --black: #05060a;
  --dark: #0a0c14;

  --navy-dark: #0c1120;
  --navy: #121a30;
  --navy-light: #1a2440;

  --text: #f2f3f7;
  --muted: #9aa0b4;

  --blue: #3b82f6;
  --blue-soft: #6ea1f7;

  --gray-btn: #1c1f27;

  --red: #b92b40;
}

/* =========================================
   RESET
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--black);
  color: var(--text);
  overflow-x: hidden;
}

/* =========================================
   NAVIGATION — just a bar with Login
========================================= */

.navbar {
  height: 64px;
  padding: 0 6%;
  display: flex;
  align-items: center;
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.login-link {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 8px 16px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: var(--gray-btn);
  transition: 0.2s;
}

.login-link:hover {
  background: #262a35;
  border-color: var(--blue-soft);
}

/* =========================================
   SHARED BUTTONS — dark gray + blue outline
========================================= */

.btn {
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: var(--gray-btn);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 13px 27px;
  cursor: pointer;
  transition: 0.2s;
}

.btn:hover {
  background: #262a35;
  border-color: var(--blue-soft);
}

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

.hero {
  height: 610px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: var(--navy-dark);
}

.hero-image {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    var(--navy-dark) 0%,
    #101733 45%,
    #16204a 100%
  );
}

.hero-image::after {
  content: "";
  position: absolute;
  width: 47%;
  height: 100%;
  right: 0;
  top: 0;
  background: linear-gradient(135deg, #141c3a, #1c2c5c);
}

.hero-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(5, 6, 10, 0.96) 0%,
    rgba(8, 9, 18, 0.9) 34%,
    rgba(12, 14, 32, 0.4) 70%,
    rgba(12, 14, 32, 0.1) 100%
  );
}

.hero-text {
  position: relative;
  z-index: 2;
  width: 1120px;
  max-width: 84%;
  margin: auto;
}

.hero h1 {
  font-size: clamp(55px, 7vw, 92px);
  line-height: 0.96;
  letter-spacing: -5px;
  font-weight: 800;
}

.hero h1 span {
  color: var(--blue-soft);
}

.hero-text p {
  width: 500px;
  max-width: 100%;
  margin-top: 27px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-button {
  margin-top: 29px;
}

/* =========================================
   INTRO
========================================= */

.intro {
  padding: 120px 8%;
  background: var(--dark);
}

.intro-inner {
  max-width: 1120px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: start;
}

.label {
  color: var(--blue-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.intro h2 {
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
  letter-spacing: -3px;
}

.intro-description {
  padding-top: 30px;
}

.intro-description p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
  max-width: 500px;
}

.intro-description p + p {
  margin-top: 20px;
}

/* =========================================
   FEATURE SECTIONS (alternating, via order)
========================================= */

.feature {
  max-width: 1180px;
  margin: auto;
  padding: 125px 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  align-items: center;
}

.feature-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  overflow: hidden;
}

.red-image {
  background: linear-gradient(135deg, #8f2033, #bd3047);
}

.feature-text {
  max-width: 500px;
}

.feature-text h2 {
  font-size: clamp(40px, 4.5vw, 62px);
  line-height: 0.98;
  letter-spacing: -3px;
}

.description {
  margin-top: 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

/* =========================================
   THREE PRINCIPLES
========================================= */

.principles {
  padding: 105px 7%;
  background: var(--navy-dark);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.principles > .label {
  margin-bottom: 65px;
}

.principle-row {
  max-width: 1050px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.principle {
  padding: 0 50px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.principle:last-child {
  border-right: none;
}

.principle-icon {
  height: 65px;
  color: var(--blue-soft);
  font-size: 47px;
  margin-bottom: 23px;
}

.principle h3 {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
}

.principle p {
  margin: 16px auto 0;
  max-width: 240px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* =========================================
   CLOSING
========================================= */

.closing {
  padding: 150px 20px;
  text-align: center;
  background: linear-gradient(180deg, var(--black), var(--navy-dark));
}

.closing h2 {
  font-size: clamp(48px, 6vw, 80px);
  line-height: 0.97;
  letter-spacing: -4px;
}

.closing h2 span {
  color: var(--blue-soft);
}

.closing > p:not(.label) {
  max-width: 550px;
  margin: 28px auto;
  color: var(--muted);
  line-height: 1.7;
}

/* =========================================
   FOOTER
========================================= */

footer {
  min-height: 110px;
  padding: 35px 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-infinity {
  font-size: 28px;
  color: var(--blue-soft);
}

.footer-brand strong {
  display: block;
  font-size: 13px;
}

.footer-brand small {
  display: block;
  margin-top: 3px;
  color: #666a7b;
  font-size: 10px;
}

.footer-links {
  display: flex;
  gap: 25px;
}

.footer-links a {
  color: #737687;
  text-decoration: none;
  font-size: 11px;
}

.footer-links a:hover {
  color: white;
}

/* =========================================
   LANDING PAGE MOBILE
========================================= */

@media (max-width: 850px) {
  .hero-text {
    max-width: 88%;
  }

  .hero-image::after {
    width: 70%;
    opacity: 0.45;
  }

  .intro-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .feature {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .feature.reverse .feature-image {
    order: -1;
  }

  .principle-row {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .principle {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 45px;
  }

  .principle:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
  }
}

@media (max-width: 500px) {
  .hero {
    height: 650px;
  }

  .hero h1 {
    letter-spacing: -3px;
  }

  .intro,
  .feature {
    padding-left: 7%;
    padding-right: 7%;
  }
}

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

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  text-align: center;
  border-radius: 16px;
}

.login-card h1 {
  margin-bottom: 10px;
}

.subtitle {
  margin-bottom: 30px;
}

.google-button {
  width: 100%;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  border: none;
  border-radius: 8px;

  background: white;
  color: #222;

  font-family: inherit;
  font-size: 16px;
  font-weight: 600;

  cursor: pointer;
}

.google-button:hover {
  opacity: 0.9;
}

.google-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.google-icon {
  font-size: 20px;
  font-weight: bold;
  color: #4285f4;
}

.error {
  margin-top: 15px;
  color: #ff5555;
}

.info {
  margin-top: 20px;
  font-size: 13px;
  opacity: 0.6;
}

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

.navbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 300; /* keeps navbar + hamburger above the side panel */
}

.navbar-left {
  display: flex;
  align-items: center;
}

.logo {
  color: inherit;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
}

.navbar-right {
  display: flex;
  align-items: center;
}

.account-menu {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 9px;

  border: none;
  background: transparent;
  color: inherit;

  padding: 7px 10px;
  border-radius: 10px;

  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}

.account-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-profile-picture {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-arrow {
  font-size: 14px;
}

/* =========================================
   ACCOUNT DROPDOWN
========================================= */

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;

  width: 280px;

  background: #17171d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;

  padding: 8px;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);

  display: none;
  z-index: 1000;
}

.dropdown.show {
  display: block;
}

.dropdown-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.dropdown-profile-picture {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-user strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.dropdown-user small {
  display: block;
  opacity: 0.55;
  font-size: 12px;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.dropdown-item {
  display: block;
  width: 100%;

  padding: 11px 12px;

  border: none;
  border-radius: 8px;

  background: transparent;
  color: inherit;

  text-decoration: none;
  text-align: left;

  font-family: inherit;
  font-size: 14px;

  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sign-out {
  color: #ff6262;
}

/* =========================================
   HAMBURGER + SIDE PANEL
========================================= */

.hamburger-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  margin-right: 14px;
}

.hamburger-button span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: var(--dark);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding-top: 70px; /* matches the account navbar's 70px height */
}

.side-panel.open {
  transform: translateX(0);
}

/* Ready-made style for whatever you add inside .side-panel later */
.side-panel-item {
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 20px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.side-panel-item:hover {
  background: var(--gray-btn);
  color: var(--text);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 150;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

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

/*
   IMPORTANT:
   Everything here is scoped to .home-container
   so it cannot interfere with index.html's
   original .hero styles.
*/

.home-container {
  max-width: 1100px;
  margin: 0 auto;

  padding: 80px 25px;
}

.home-container .hero {
  height: auto;

  position: static;
  overflow: visible;

  display: block;

  background: transparent;

  text-align: center;

  margin-bottom: 65px;
}

.home-container .hero h1 {
  font-size: 42px;

  line-height: 1.3;
  letter-spacing: normal;

  margin: 0 0 18px 0;
}

.home-container .hero p {
  width: auto;
  max-width: 700px;

  margin: 0 auto;

  color: var(--muted);

  font-size: 17px;
  line-height: 1.7;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.home-card {
  padding: 32px;

  border-radius: 16px;

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

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

.home-card h2 {
  margin: 0 0 18px 0;

  font-size: 22px;
  line-height: 1.3;
}

.home-card p {
  margin: 0 0 25px 0;

  color: var(--muted);

  font-size: 15px;
  line-height: 1.7;

  min-height: 75px;
}

.home-card-button {
  margin-top: 0;

  padding: 10px 16px;

  border: none;
  border-radius: 8px;

  font-family: inherit;

  cursor: pointer;
}

/* =========================================
   ACCOUNT SETTINGS
========================================= */

.back-button {
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
}

.back-button:hover {
  opacity: 1;
}

.account-container {
  max-width: 650px;
  margin: 0 auto;
  padding: 50px 20px;
}

.settings-card {
  padding: 35px;

  border-radius: 18px;

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

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

.settings-card h1 {
  margin-bottom: 8px;
}

.settings-subtitle {
  opacity: 0.55;
  margin-bottom: 35px;
}

/* Profile */

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;

  margin-bottom: 40px;
}

.large-profile-picture {
  width: 120px;
  height: 120px;

  border-radius: 50%;
  object-fit: cover;

  margin-bottom: 15px;
}

.change-picture-button {
  padding: 9px 15px;

  border-radius: 8px;

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

  cursor: pointer;

  font-size: 14px;
}

.change-picture-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

/* Settings */

.setting-section {
  margin-bottom: 25px;
}

.setting-section label {
  display: block;

  font-size: 14px;
  font-weight: 600;

  margin-bottom: 8px;
}

.setting-input-row {
  display: flex;
  gap: 10px;
}

.setting-section input,
.setting-input-row input {
  width: 100%;

  padding: 12px;

  border-radius: 8px;

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

  background: rgba(0, 0, 0, 0.2);

  color: inherit;

  font-family: inherit;
  font-size: 15px;

  outline: none;
}

.setting-section input:focus,
.setting-input-row input:focus {
  border-color: var(--blue);
}

.setting-input-row button {
  padding: 0 20px;

  border: none;
  border-radius: 8px;

  font-family: inherit;

  cursor: pointer;
}

.setting-section small {
  display: block;
  margin-top: 7px;
  opacity: 0.45;
}

/* =========================================
   CUSTOM GRADE DROPDOWN
========================================= */

.custom-select {
  position: relative;
  flex: 1;
}

.custom-select-trigger {
  width: 100%;

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

  padding: 12px;

  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);

  background: rgba(0, 0, 0, 0.2);

  color: var(--text);

  font-family: inherit;
  font-size: 15px;

  cursor: pointer;
}

.custom-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--blue);
}

.custom-select-arrow {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;

  max-height: 260px;
  overflow-y: auto;

  background: #12141c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);

  padding: 6px;

  display: none;
  z-index: 50;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-option {
  display: block;
  width: 100%;

  padding: 10px 12px;

  border: none;
  border-radius: 6px;

  background: transparent;
  color: var(--text);

  text-align: left;

  font-family: inherit;
  font-size: 14px;

  cursor: pointer;
}

.custom-select-option:hover {
  background: var(--gray-btn);
}

.custom-select-option.selected {
  background: var(--gray-btn);
  color: var(--blue-soft);
  font-weight: 600;
}

/* Account info */

.account-info {
  margin-top: 35px;
  padding-top: 25px;

  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-info h2 {
  font-size: 18px;
  margin-bottom: 15px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;

  padding: 12px 0;

  font-size: 14px;
}

.info-row span {
  opacity: 0.55;
}

.info-row strong {
  max-width: 65%;

  overflow: hidden;

  text-overflow: ellipsis;
}

/* Status */

.status-message {
  min-height: 20px;

  margin: 20px 0;

  font-size: 14px;
}

/* Sign out */

.danger-button {
  width: 100%;

  padding: 12px;

  border: none;
  border-radius: 8px;

  background: var(--red);

  color: white;

  font-family: inherit;

  cursor: pointer;
}

.danger-button:hover {
  opacity: 0.9;
}

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

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

@media (max-width: 700px) {
  .navbar {
    padding: 0 15px;
  }

  .account-button span:not(.dropdown-arrow) {
    display: none;
  }

  .settings-card {
    padding: 25px 20px;
  }

  .home-container .hero h1 {
    font-size: 32px;
  }
}

@media (max-width: 500px) {
  .home-container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .setting-input-row {
    flex-direction: column;
  }

  .setting-input-row button {
    padding: 12px;
  }
}
/* =========================================
   GROUPS + LEADERBOARDS
========================================= */

.side-panel-title {
  padding: 0 20px 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.groups-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 25px;
}

.groups-header {
  text-align: center;
  margin-bottom: 55px;
}

.groups-header h1 {
  font-size: 48px;
  margin: 8px 0 12px;
}

.groups-header p {
  color: var(--muted);
  font-size: 16px;
}

/* =========================================
   GROUP ACTIONS
========================================= */

.group-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 70px;
}

.group-action-card {
  padding: 30px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.group-action-card h2 {
  font-size: 21px;
  margin-bottom: 12px;
}

.group-action-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 22px;
}

.group-action-card input {
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  margin-bottom: 10px;
}

.group-action-card input:focus {
  border-color: var(--blue);
}

.group-primary-button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.group-primary-button:hover {
  opacity: 0.9;
}

.group-primary-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.group-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================
   MY GROUPS
========================================= */

.my-groups-section {
  margin-bottom: 70px;
}

.section-title-row {
  margin-bottom: 20px;
}

.section-title-row h2 {
  margin-top: 6px;
  font-size: 30px;
}

.my-group-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}

.my-group-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(59, 130, 246, 0.5);
}

.my-group-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  font-size: 21px;
}

.my-group-info {
  flex: 1;
}

.my-group-info strong {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}

.my-group-info span {
  color: var(--muted);
  font-size: 12px;
}

.group-owner-badge {
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-soft);
  font-size: 10px;
  font-weight: 700;
}

.group-card-arrow {
  color: var(--muted);
  font-size: 18px;
}

.group-loading,
.group-empty,
.group-error {
  padding: 25px;
  text-align: center;
  color: var(--muted);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.group-error {
  color: #ff6262;
}

/* =========================================
   LEADERBOARDS
========================================= */

.leaderboard-section,
.group-leaderboard-section {
  padding: 30px;
  margin-top: 40px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.leaderboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 25px;
}

.leaderboard-label {
  color: var(--blue-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.leaderboard-header h2 {
  margin-top: 7px;
  font-size: 27px;
}

.leaderboard-header p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.leaderboard-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.leaderboard-controls label {
  color: var(--muted);
  font-size: 13px;
}

.leaderboard-controls select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #12141c;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.leaderboard-table {
  width: 100%;
}

.leaderboard-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 45px minmax(180px, 1fr) 90px 100px 120px;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-heading {
  min-height: 40px;
  border-top: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaderboard-student {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.leaderboard-student strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-picture {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.leaderboard-rank {
  color: var(--muted);
  font-weight: 700;
}

.leaderboard-stat {
  font-variant-numeric: tabular-nums;
}

.leaderboard-loading,
.leaderboard-empty,
.leaderboard-error {
  padding: 35px;
  text-align: center;
  color: var(--muted);
}

.leaderboard-error {
  color: #ff6262;
}

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

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

  .leaderboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-row {
    grid-template-columns:
      35px
      minmax(130px, 1fr)
      55px
      75px
      90px;

    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .groups-container {
    padding: 45px 18px;
  }

  .groups-header h1 {
    font-size: 36px;
  }

  .leaderboard-section,
  .group-leaderboard-section {
    padding: 18px 10px;
  }

  .leaderboard-row {
    grid-template-columns:
      28px
      minmax(110px, 1fr)
      45px
      60px
      70px;

    gap: 5px;
    padding: 8px 5px;
    font-size: 11px;
  }

  .leaderboard-picture {
    width: 30px;
    height: 30px;
  }

  .leaderboard-student {
    gap: 6px;
  }

  .leaderboard-heading {
    font-size: 9px;
  }

  .leaderboard-controls {
    width: 100%;
  }

  .leaderboard-controls select {
    flex: 1;
  }
}
/* =========================================
GROUP SIDEBAR
========================================= */

.side-panel-section {
  width: 100%;
}

.side-panel-title {
  padding: 18px 20px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.side-panel-dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.side-panel-dropdown-button.active {
  background: var(--gray-btn);
  color: var(--text);
}

.side-panel-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.side-panel-submenu.open {
  max-height: 150px;
}

.side-panel-subitem {
  display: block;
  padding: 10px 20px 10px 44px;

  color: var(--muted);
  text-decoration: none;

  font-size: 13px;
}

.side-panel-subitem:hover {
  background: var(--gray-btn);
  color: var(--text);
}

/* =========================================
  LEADERBOARDS
  ========================================= */

.leaderboard-section {
  margin-bottom: 70px;
}

.leaderboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 30px;

  margin-bottom: 20px;
}

.leaderboard-header h2 {
  margin-bottom: 7px;

  font-size: 26px;
}

.leaderboard-header p {
  color: var(--muted);
  font-size: 14px;
}

.leaderboard-controls {
  display: flex;
  gap: 12px;
}

.leaderboard-controls > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-controls label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.leaderboard-controls select {
  min-width: 150px;

  padding: 10px 12px;

  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);

  background: #12141c;
  color: var(--text);

  font-family: inherit;
  font-size: 13px;

  cursor: pointer;
}

.leaderboard-controls select:focus {
  outline: none;
  border-color: var(--blue);
}

.leaderboard {
  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;

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

.leaderboard-row {
  min-height: 70px;

  display: grid;
  grid-template-columns:
    45px
    46px
    1fr
    auto;

  align-items: center;

  gap: 14px;

  padding: 10px 18px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  color: var(--muted);

  font-size: 15px;
  font-weight: 700;

  text-align: center;
}

.leaderboard-profile-picture {
  width: 42px;
  height: 42px;

  border-radius: 50%;

  object-fit: cover;
}

.leaderboard-user strong {
  display: block;

  font-size: 14px;
}

.leaderboard-user small {
  display: block;

  margin-top: 4px;

  color: var(--muted);

  font-size: 11px;
}

.leaderboard-stat {
  min-width: 80px;

  text-align: right;
}

.leaderboard-stat strong {
  display: block;

  font-size: 15px;
}

.leaderboard-stat small {
  display: block;

  margin-top: 3px;

  color: var(--muted);

  font-size: 10px;
}

.leaderboard-loading,
.leaderboard-empty {
  padding: 30px;

  text-align: center;

  color: var(--muted);

  font-size: 14px;
}

/* =========================================
  GROUP PAGES
  ========================================= */

.group-page-container {
  max-width: 850px;

  margin: 0 auto;

  padding: 50px 20px;
}

.group-page-card {
  padding: 35px;

  border-radius: 18px;

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

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

.group-page-card h1 {
  margin-bottom: 8px;
}

.group-action-section {
  margin-top: 30px;
}

.group-action-section h2 {
  margin-bottom: 8px;

  font-size: 20px;
}

.group-action-section p {
  margin-bottom: 18px;

  color: var(--muted);

  font-size: 14px;

  line-height: 1.6;
}

.group-input-row {
  display: flex;

  gap: 10px;
}

.group-input-row input {
  flex: 1;

  min-width: 0;

  padding: 12px;

  border-radius: 8px;

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

  background: rgba(0, 0, 0, 0.2);

  color: var(--text);

  font-family: inherit;

  font-size: 14px;

  outline: none;
}

.group-input-row input:focus {
  border-color: var(--blue);
}

.group-input-row button {
  padding: 0 22px;

  border: none;

  border-radius: 8px;

  background: var(--blue);

  color: white;

  font-family: inherit;

  font-weight: 600;

  cursor: pointer;
}

.group-input-row button:hover {
  opacity: 0.9;
}

.group-input-row button:disabled {
  opacity: 0.5;

  cursor: wait;
}

.group-page-divider {
  height: 1px;

  margin: 35px 0;

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

.my-groups-section {
  margin-top: 40px;

  padding-top: 30px;

  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.my-groups-section h2 {
  margin-bottom: 15px;

  font-size: 20px;
}

.my-group-card {
  display: flex;

  flex-direction: column;

  gap: 5px;

  margin-bottom: 10px;

  padding: 15px;

  border-radius: 10px;

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

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

  color: var(--text);

  text-decoration: none;
}

.my-group-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.my-group-card strong {
  font-size: 15px;
}

.my-group-card span {
  color: var(--blue-soft);

  font-size: 12px;

  font-weight: 600;
}

.my-group-card small {
  color: var(--muted);

  font-size: 11px;
}

.groups-empty {
  padding: 20px;

  border-radius: 10px;

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

  color: var(--muted);

  text-align: center;

  font-size: 13px;
}

/* =========================================
  GROUP HEADER
  ========================================= */

.group-heading {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 40px;
}

.group-heading p {
  color: var(--muted);

  font-size: 13px;
}

.group-member-count {
  display: flex;

  flex-direction: column;

  align-items: center;

  padding: 12px 18px;

  border-radius: 10px;

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

.group-member-count strong {
  font-size: 20px;
}

.group-member-count span {
  color: var(--muted);

  font-size: 10px;
}

.group-leaderboard-section {
  margin-bottom: 45px;
}

/* =========================================
  GROUP MEMBER LIST
  ========================================= */

.group-members-section {
  padding-top: 30px;

  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.group-members-section h2 {
  margin-bottom: 7px;

  font-size: 20px;
}

.group-members-section > p {
  margin-bottom: 18px;

  color: var(--muted);

  font-size: 13px;
}

.group-member-row {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  padding: 14px 0;

  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.group-member-row strong {
  display: block;

  font-size: 13px;
}

.group-member-row small {
  display: block;

  margin-top: 4px;

  color: var(--muted);

  font-size: 11px;
}

.group-member-row code {
  max-width: 55%;

  overflow: hidden;

  text-overflow: ellipsis;

  color: var(--muted);

  font-family: monospace;

  font-size: 11px;
}

/* =========================================
  RESPONSIVE GROUPS / LEADERBOARDS
  ========================================= */

@media (max-width: 700px) {
  .leaderboard-header {
    flex-direction: column;

    align-items: stretch;
  }

  .leaderboard-controls {
    flex-direction: column;
  }

  .leaderboard-controls select {
    width: 100%;
  }

  .group-input-row {
    flex-direction: column;
  }

  .group-input-row button {
    padding: 12px;
  }

  .group-heading {
    align-items: flex-start;
  }

  .group-member-row {
    align-items: flex-start;

    flex-direction: column;
  }

  .group-member-row code {
    max-width: 100%;
  }
}

@media (max-width: 500px) {
  .group-page-card {
    padding: 25px 20px;
  }

  .leaderboard-row {
    grid-template-columns:
      30px
      40px
      1fr
      auto;

    gap: 8px;

    padding: 10px;
  }

  .leaderboard-profile-picture {
    width: 36px;
    height: 36px;
  }

  .leaderboard-stat {
    min-width: 55px;
  }
}
/* =========================================
   GROUPS SIDEBAR
========================================= */

.sidebar-section {
  width: 100%;
  padding: 6px 14px;
}

.sidebar-dropdown-button {
  width: calc(100% - 4px);
  display: flex;
  align-items: center;
  justify-content: space-between;

  background: var(--blue);
  color: white;

  border-radius: 8px;
  padding: 12px 14px;
}

.sidebar-dropdown-button:hover {
  background: var(--blue);
  color: white;
  opacity: 0.9;
}

.sidebar-dropdown-button > a {
  flex: 1;
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-dropdown-arrow {
  background: none;
  border: none;
  color: white;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s ease;
}

.sidebar-dropdown-arrow.open {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: none;
  margin-top: 18px;
  padding-left: 0;
}

.sidebar-submenu.open {
  display: block;
}

.sidebar-subitem {
  display: block;

  background: var(--blue);
  color: white;

  border-radius: 8px;
  padding: 12px 14px;

  text-align: center;
  font-size: 13px;
  font-weight: 600;
  opacity: 1;
}

.sidebar-subitem:hover {
  background: var(--blue);
  color: white;
  opacity: 0.9;
}

/* =========================================
   LEADERBOARDS
========================================= */

.leaderboard-section {
  margin-top: 70px;
  padding: 30px;

  border-radius: 16px;

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

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

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

  margin-bottom: 25px;
}

.leaderboard-header h2 {
  font-size: 25px;
  margin-bottom: 6px;
}

.leaderboard-header p {
  color: var(--muted);
  font-size: 14px;
}

.leaderboard-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;

  margin-bottom: 20px;
}

.leaderboard-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-control label {
  font-size: 12px;
  color: var(--muted);
}

.leaderboard-control select {
  padding: 10px 12px;

  border-radius: 8px;

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

  background: #12141c;

  color: var(--text);

  font-family: inherit;

  cursor: pointer;
}

.leaderboard-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;

  border-collapse: collapse;

  font-size: 14px;
}

.leaderboard-table th {
  text-align: left;

  padding: 12px;

  color: var(--muted);

  font-size: 12px;

  font-weight: 600;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-table td {
  padding: 14px 12px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-rank {
  width: 50px;

  color: var(--muted);

  font-weight: 700;
}

.leaderboard-player-info {
  display: flex;
  align-items: center;

  gap: 10px;

  font-weight: 600;
}

.leaderboard-avatar {
  width: 32px;
  height: 32px;

  border-radius: 50%;

  object-fit: cover;
}

.leaderboard-loading,
.leaderboard-empty {
  text-align: center;

  color: var(--muted);

  padding: 30px !important;
}

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

.groups-container {
  max-width: 900px;

  margin: 0 auto;

  padding: 55px 25px;
}

.groups-page-header {
  text-align: center;

  margin-bottom: 40px;
}

.groups-page-header h1 {
  font-size: 42px;

  margin-bottom: 10px;
}

.groups-page-header p {
  color: var(--muted);
}

/* =========================================
   GROUP ACTION CARDS
========================================= */

.group-action-card {
  padding: 30px;

  margin-bottom: 25px;

  border-radius: 16px;

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

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

.group-action-card h2 {
  margin-bottom: 8px;
}

.group-action-card p {
  color: var(--muted);

  font-size: 14px;

  margin-bottom: 20px;
}

.group-action-card input {
  width: 100%;

  padding: 12px;

  margin-bottom: 12px;

  border-radius: 8px;

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

  background: rgba(0, 0, 0, 0.2);

  color: var(--text);

  font-family: inherit;

  font-size: 15px;

  outline: none;
}

.group-action-card input:focus {
  border-color: var(--blue);
}

.group-action-card button {
  padding: 11px 18px;

  border: none;

  border-radius: 8px;

  background: var(--blue);

  color: white;

  font-family: inherit;

  font-weight: 600;

  cursor: pointer;
}

.group-action-card button:hover {
  opacity: 0.9;
}

.group-action-card button:disabled {
  opacity: 0.5;

  cursor: wait;
}

.group-status {
  min-height: 20px;

  margin-top: 12px !important;

  margin-bottom: 0 !important;

  color: var(--text) !important;
}

/* =========================================
   MY GROUPS
========================================= */

.my-groups-section {
  margin-top: 45px;
}

.my-groups-section > h2 {
  margin-bottom: 20px;
}

.my-groups-list {
  display: flex;

  flex-direction: column;

  gap: 25px;
}

.groups-loading,
.groups-empty {
  color: var(--muted);

  text-align: center;

  padding: 25px;
}

/* =========================================
   GROUP CARD
========================================= */

.group-card {
  padding: 25px;

  border-radius: 16px;

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

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

.group-card-header {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 25px;
}

.group-card-header h3 {
  font-size: 22px;

  margin-bottom: 5px;
}

.group-card-header p {
  color: var(--muted);

  font-size: 13px;
}

.group-code {
  text-align: right;

  flex-shrink: 0;
}

.group-code span {
  display: block;

  color: var(--muted);

  font-size: 11px;

  margin-bottom: 4px;
}

.group-code strong {
  font-size: 20px;

  letter-spacing: 2px;

  color: var(--blue-soft);
}

.group-leaderboard {
  border-top: 1px solid rgba(255, 255, 255, 0.08);

  padding-top: 20px;
}

.group-leaderboard-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  gap: 15px;

  margin-bottom: 15px;
}

.group-leaderboard-header h4 {
  font-size: 16px;
}

.group-leaderboard-controls {
  display: flex;

  gap: 8px;

  flex-wrap: wrap;
}

.group-leaderboard-controls select {
  padding: 8px 10px;

  border-radius: 7px;

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

  background: #12141c;

  color: var(--text);

  font-family: inherit;

  font-size: 12px;
}

.group-leaderboard-wrapper {
  overflow-x: auto;
}

/* =========================================
   GROUP MOBILE
========================================= */

@media (max-width: 600px) {
  .leaderboard-section {
    padding: 20px;
  }

  .leaderboard-header {
    display: block;
  }

  .group-card {
    padding: 20px;
  }

  .group-card-header {
    align-items: flex-start;

    flex-direction: column;
  }

  .group-code {
    text-align: left;
  }

  .group-leaderboard-header {
    align-items: flex-start;

    flex-direction: column;
  }

  .groups-container {
    padding-left: 20px;

    padding-right: 20px;
  }
}
/* =========================================
   GROUP SIDEBAR BUTTONS
========================================= */

.sidebar-group-buttons {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* White Groups button */
.sidebar-group-button {
  flex: 1;

  display: flex;
  align-items: center;

  padding: 12px 14px;

  border-radius: 8px;

  background: white;
  color: #111 !important;

  text-decoration: none;

  font-size: 14px;
  font-weight: 600;

  transition: 0.2s ease;
}

.sidebar-group-button:hover {
  background: #e8e8e8;
}

/* White arrow button */
.sidebar-group-arrow {
  width: 42px;
  height: 42px;

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

  border: none;
  border-radius: 8px;

  background: white;
  color: #111;

  font-family: inherit;
  font-size: 13px;

  cursor: pointer;

  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-group-arrow:hover {
  background: #e8e8e8;
}

.sidebar-group-arrow.open {
  transform: rotate(180deg);
}

/* Create / Join Group button */
.sidebar-create-button {
  display: block;

  width: 100%;

  margin-top: 8px;

  padding: 11px 14px;

  border-radius: 8px;

  background: white;
  color: #111 !important;

  text-decoration: none;

  text-align: center;

  font-size: 13px;
  font-weight: 600;

  transition: 0.2s ease;
}

.sidebar-create-button:hover {
  background: #e8e8e8;
}

/* =========================================================
   PROGRAMMATH DEMO
   Added without removing or changing the existing site CSS.
   ========================================================= */
.math-page {
  min-height: calc(100vh - 70px);
  padding: 70px 20px 100px;
  background: radial-gradient(
      circle at 50% 0%,
      rgba(59, 130, 246, 0.1),
      transparent 38%
    ),
    var(--black);
}
.math-container {
  width: min(900px, 100%);
  margin: 0 auto;
}
.math-header {
  text-align: center;
  margin-bottom: 35px;
}
.math-header .label {
  margin-bottom: 12px;
}
.math-header h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -3px;
}
.math-header p {
  max-width: 650px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}
.math-card {
  position: relative;
  z-index: 10;
  overflow: visible !important;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28);
}
.math-controls {
  position: relative;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}
.math-control {
  position: relative;
  z-index: 100;
  min-width: 0;
}
.math-control label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.math-button {
  width: 100%;
  margin-top: 5px;
  padding: 13px 16px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: 700 14px/1.2 "Inter", sans-serif;
  cursor: pointer;
  transition: 0.2s ease;
}
.math-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.math-button:active {
  transform: translateY(0);
}
.math-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.custom-select {
  position: relative;
  z-index: 100;
  flex: 1;
  min-width: 0;
}
.custom-select.open {
  z-index: 10000;
}
.custom-select-trigger {
  position: relative;
  z-index: 2;
  min-height: 46px;
  user-select: none;
}
.custom-select-options {
  z-index: 10001 !important;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.custom-select-option {
  white-space: normal;
  line-height: 1.35;
}
.math-question {
  position: relative;
  z-index: 1;
  margin-top: 25px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}
.math-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.math-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue-soft);
  font-size: 10px;
  font-weight: 700;
}
.math-question h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.45;
}
.math-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}
.math-choice {
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: 600 14px/1.4 "Inter", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}
.math-choice:hover {
  border-color: rgba(59, 130, 246, 0.65);
  background: rgba(59, 130, 246, 0.09);
}
.math-choice.correct {
  border-color: #35c46a;
  background: rgba(53, 196, 106, 0.12);
}
.math-choice.wrong {
  border-color: #e25565;
  background: rgba(226, 85, 101, 0.12);
}
.math-choice:disabled {
  cursor: default;
}
.math-feedback {
  min-height: 24px;
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.6;
}
.math-feedback.correct {
  color: #69e38f;
}
.math-feedback.wrong {
  color: #ff737f;
}
.math-explanation {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}
.math-empty {
  margin-top: 25px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}
.math-error {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 85, 101, 0.35);
  border-radius: 8px;
  background: rgba(226, 85, 101, 0.08);
  color: #ff737f;
  font-size: 13px;
}
.math-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.math-page,
.math-container,
.math-card,
.math-controls,
.math-control,
.custom-select {
  overflow: visible !important;
}
@media (max-width: 650px) {
  .math-page {
    padding: 45px 15px 70px;
  }
  .math-card {
    padding: 20px;
  }
  .math-controls,
  .math-choices {
    grid-template-columns: 1fr;
  }
  .math-question {
    padding: 20px;
  }
}
/* =========================================================
   PROGRAMMATH
   ========================================================= */

.programmath-page {
  min-height: 100vh;
  padding: 50px 20px 70px;
}

.programmath-container {
  width: min(1050px, 94%);
  margin: 0 auto;
}

.programmath-hero {
  text-align: center;
  margin-bottom: 35px;
}

.programmath-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  opacity: 0.65;
  margin-bottom: 10px;
}

.programmath-hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
}

.programmath-hero h1 span {
  color: #ffd800;
}

.programmath-hero p {
  max-width: 700px;
  margin: 15px auto 0;
  line-height: 1.7;
  opacity: 0.75;
}

.programmath-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.programmath-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.programmath-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  opacity: 0.65;
}

.programmath-select {
  position: relative;
}

.programmath-select-button {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;

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

  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;

  background: rgba(0, 0, 0, 0.25);
  color: inherit;

  font: inherit;
  font-weight: 600;

  cursor: pointer;
  transition: 0.2s ease;
}

.programmath-select-button:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.programmath-select-arrow {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.programmath-select.is-open .programmath-select-arrow {
  transform: rotate(180deg);
}

.programmath-select-menu {
  display: none;

  position: absolute;
  z-index: 100;

  top: calc(100% + 7px);
  left: 0;
  right: 0;

  max-height: 320px;
  overflow-y: auto;

  padding: 6px;

  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;

  background: #11151c;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.programmath-select.is-open .programmath-select-menu {
  display: block;
}

.programmath-option {
  width: 100%;

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

  gap: 15px;

  padding: 12px;

  border: 0;
  border-radius: 8px;

  background: transparent;
  color: inherit;

  text-align: left;
  font: inherit;

  cursor: pointer;
}

.programmath-option:hover,
.programmath-option.selected {
  background: rgba(255, 216, 0, 0.12);
}

.programmath-option.selected {
  color: #ffd800;
}

.programmath-option small {
  opacity: 0.5;
  font-size: 11px;
  text-align: right;
}

.programmath-generate {
  width: 100%;

  min-height: 55px;

  border: 0;
  border-radius: 10px;

  background: #ffd800;
  color: #111;

  font: inherit;
  font-weight: 800;
  letter-spacing: 0.5px;

  cursor: pointer;

  transition: transform 0.15s ease, filter 0.15s ease;
}

.programmath-generate:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.programmath-generate:active {
  transform: translateY(0);
}

.programmath-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.programmath-status {
  min-height: 24px;

  margin: 18px 0;

  text-align: center;

  font-size: 14px;
  opacity: 0.7;
}

.programmath-question {
  margin-top: 25px;

  padding: 28px;

  border-radius: 16px;

  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.programmath-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 20px;
}

.programmath-tag {
  padding: 6px 10px;

  border-radius: 999px;

  background: rgba(255, 216, 0, 0.1);
  color: #ffd800;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.programmath-question h2 {
  margin: 0 0 25px;

  font-size: clamp(21px, 3vw, 30px);

  line-height: 1.4;
}

.programmath-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.programmath-choice {
  min-height: 58px;

  padding: 14px 18px;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;

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

  font: inherit;
  font-weight: 600;

  cursor: pointer;

  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.programmath-choice:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 216, 0, 0.5);
  transform: translateY(-1px);
}

.programmath-choice.correct {
  background: rgba(50, 200, 100, 0.15);
  border-color: rgba(50, 200, 100, 0.6);
}

.programmath-choice.wrong {
  background: rgba(220, 70, 70, 0.15);
  border-color: rgba(220, 70, 70, 0.6);
}

.programmath-choice:disabled {
  cursor: default;
}

.programmath-feedback {
  margin-top: 20px;

  font-size: 20px;
  font-weight: 800;
}

.programmath-feedback.correct {
  color: #55d98b;
}

.programmath-feedback.wrong {
  color: #ff6b6b;
}

.programmath-explanation {
  margin-top: 10px;

  line-height: 1.6;
  opacity: 0.75;
}

.programmath-error {
  padding: 15px;

  border-radius: 10px;

  background: rgba(220, 70, 70, 0.12);
  border: 1px solid rgba(220, 70, 70, 0.3);

  color: #ff7777;

  text-align: center;
}

@media (max-width: 700px) {
  .programmath-page {
    padding: 30px 12px 50px;
  }

  .programmath-card {
    padding: 20px;
  }

  .programmath-controls {
    grid-template-columns: 1fr;
  }

  .programmath-choices {
    grid-template-columns: 1fr;
  }

  .programmath-option {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .programmath-option small {
    text-align: left;
  }
}
.leaderboard-player {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
