/* ============================================================
   PlayCTF.in — style.css
   Theme: #111827 bg · #15ff00 green · #ffffff text · #000 shades
   Fonts: loaded via Google Fonts in header.php (add these):
     Inter 300/400/500/600/700
     Share Tech Mono 400
     Orbitron 700/900
   ============================================================ */

/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
  --bg:          #111827;
  --bg2:         #0d1520;
  --bg3:         #0a0f18;
  --bg4:         #1a2234;
  --green:       #15ff00;
  --green-dim:   rgba(21,255,0,0.15);
  --green-glow:  rgba(21,255,0,0.2);
  --green-10:    rgba(21,255,0,0.10);
  --green-5:     rgba(21,255,0,0.05);
  --green-dark:  #0db800;
  --white:       #ffffff;
  --gray1:       #e5e7eb;
  --gray2:       #9ca3af;
  --gray3:       #4b5563;
  --gray4:       #1f2937;
  --gray5:       #141e2e;
  --black:       #000000;
  --border:      rgba(21,255,0,0.2);
  --border-dim:  rgba(255,255,255,0.07);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.15);
  --yellow:      #fbbf24;
  --yellow-dim:  rgba(251,191,36,0.15);
  --purple:      #a855f7;
  --purple-dim:  rgba(168,85,247,0.15);
  --gold:        #FFD700;
  --silver:      #C0C0C0;
  --bronze:      #cd7f32;
  --font-display:  'Orbitron', monospace;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'Share Tech Mono', monospace;
  --r:    6px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-green: 0 0 20px rgba(21,255,0,0.15);
  --nav-h: 60px;
  --page-w: 1200px;
}

/* ============================================================
   2. RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.15s, opacity 0.15s;
}
a:hover { color: var(--white); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: #2a3a50; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dark); }

/* Selection */
::selection { background: var(--green-dim); color: var(--white); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ============================================================
   3. LAYOUT SHELL
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10,15,24,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-dim);
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.site-footer {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(21,255,0,0.08), transparent 34%),
    linear-gradient(180deg, #0b111c, #05070b);
  border-top: 1px solid rgba(21,255,0,0.18);
  margin-top: auto;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(21,255,0,0.12), transparent);
  height: 1px;
  bottom: auto;
  opacity: 0.8;
}

.footer-inner {
  position: relative;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 46px 24px 30px;
  display: grid;
  grid-template-columns: minmax(300px, 1.4fr) minmax(220px, 1fr) minmax(240px, 1fr);
  gap: 42px;
  align-items: start;
}

.footer-brand-block {
  max-width: 460px;
}
/* ============================================================
   Redesigned Footer Layout Fixes
   ============================================================ */
.footer-inner {
  position: relative;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 46px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* Force side-by-side on desktop using flex-wrap: nowrap */
.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: nowrap; 
}

.footer-brand-block {
  flex: 1;
  max-width: 500px;
}

.footer-subscribe-block {
  width: 100%;
  max-width: 400px;
}

/* Ensure headings match */
.footer-subscribe-block h2,
.footer-nav-group h2 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-subscribe-block p {
  font-size: 13px;
  color: var(--gray2);
  margin-bottom: 16px;
  line-height: 1.5;
}

.subscribe-form {
  display: flex;
  gap: 8px;
  width: 100%;
}
.subscribe-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border-dim);
  border-radius: var(--r);
  color: var(--white);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.subscribe-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,255,0,0.08);
}

/* Force exactly 3 columns for links on desktop */
.footer-links-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: start;
}

/* Grouping Copyright, Version, and Links */
.footer-bottom {
  position: relative;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap; /* Forces them to stay on a single line */
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--border-dim);
  padding-left: 20px;
}
.footer-bottom-links a {
  font-size: 12px;
  color: var(--gray3);
  font-family: var(--font-mono);
  transition: color 0.15s;
}
.footer-bottom-links a:hover {
  color: var(--green);
}

/* Responsive Mobile Adjustments */
@media (max-width: 900px) {
  .footer-top-row {
    flex-wrap: wrap; /* Allow stacking on smaller screens */
  }
  .footer-brand-block { max-width: 100%; }
  .footer-subscribe-block { max-width: 100%; }
  
  .footer-links-row {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
  }
}

@media (max-width: 600px) {
  .footer-links-row {
    grid-template-columns: 1fr; /* 1 column on mobile */
  }
  .subscribe-form { flex-direction: column; }
  .footer-bottom { justify-content: flex-start; text-align: left; }
  .footer-bottom-links { border-left: none; padding-left: 0; width: 100%; }
}
.footer-brand {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-display);
  color: var(--white) !important;
}

.footer-logo-wrap {
  width: 68px;
  height: 68px;
  padding: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(21,255,0,0.22);
  border-radius: var(--r-lg);
  box-shadow: 0 14px 36px rgba(0,0,0,0.28);
}

.footer-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(21,255,0,0.28));
}

.footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-brand-text strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: var(--white);
  letter-spacing: 0.04em;
}

.footer-brand-text small {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  letter-spacing: 0.04em;
}

.footer-blurb {
  margin-top: 18px;
  max-width: 34rem;
  color: var(--gray2);
  font-size: 14px;
  line-height: 1.75;
}

.footer-nav-group h2 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.footer-links-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-links a {
  color: var(--gray2);
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 10px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border-dim);
  border-radius: var(--r);
}
.footer-links a:hover {
  color: var(--green);
  border-color: rgba(21,255,0,0.28);
  background: rgba(21,255,0,0.06);
  text-shadow: none;
}

.footer-bottom {
  position: relative;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  margin: 0; /* Removes default paragraph spacing pushing it down */
  font-size: 12px;
  color: var(--gray3);
  font-family: var(--font-mono);
  white-space: nowrap; /* Prevents the text itself from breaking */
}
.footer-version {
  margin-left: 8px;
  font-size: 11px;
  color: var(--gray3);
}

.footer-powered {
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.footer-powered span {
  color: var(--green);
}

/* Red "Submit a Report" call-to-action, always visible in the footer */
.footer-submit-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--red);
  box-shadow: 0 0 0 rgba(239,68,68,0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.footer-submit-report-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239,68,68,0.45);
  color: #fff;
}

/* ============================================================
   4. NAVBAR
   ============================================================ */
.navbar {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 24px;
  gap: 4px;
}

.navbar-brand { flex-shrink: 0; margin-right: 24px; }

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white) !important;
}
.navbar-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.navbar-logo span {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray2);
  padding: 6px 10px;
  border-radius: var(--r);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}
.nav-link.active { color: var(--green); }

.nav-admin {
  color: var(--yellow) !important;
}
.nav-admin:hover { color: var(--white) !important; }

.nav-cta {
  background: var(--green) !important;
  color: var(--black) !important;
  font-weight: 600;
  padding: 6px 14px !important;
}
.nav-cta:hover {
  background: var(--white) !important;
  box-shadow: var(--shadow-green);
}

/* Notification badge on nav */
.nav-notifications { position: relative; }
.badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font-mono);
}

/* User dropdown */
.navbar-user-menu { position: relative; margin-left: 8px; }

/* Keeps auth controls (Login/Sign Up, or the profile menu) pinned to the
   far right of the navbar regardless of how many links precede them. */
.navbar-align-right { margin-left: auto !important; }
.navbar-auth-buttons { display: flex; align-items: center; gap: 8px; }

.navbar-user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray4);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 5px 12px 5px 6px;
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.navbar-user-toggle:hover {
  border-color: var(--border);
  background: var(--bg4);
}

.navbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.navbar-user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  min-width: 160px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
}
.navbar-user-dropdown.open { display: block; }
.navbar-user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--gray2);
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.15s, color 0.15s;
}
.navbar-user-dropdown a:last-child { border-bottom: none; }
.navbar-user-dropdown a:hover {
  background: var(--green-5);
  color: var(--white);
}

/* Right-side navbar group (language switcher + user menu / auth buttons) */
.navbar-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language switcher (navbar + footer instances) */
.lang-switcher { position: relative; }

.lang-switcher-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray4);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 5px 10px;
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.lang-switcher-toggle:hover {
  border-color: var(--border);
  background: var(--bg4);
}
.lang-switcher-flag { font-size: 15px; line-height: 1; }
.lang-switcher-caret { flex-shrink: 0; opacity: 0.7; }
.lang-switcher-label { white-space: nowrap; }

.lang-switcher-dropdown {
  display: none;
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow);
  z-index: 2000;
}
.lang-switcher-dropdown.open { display: block; }
.lang-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--gray2);
  text-align: left;
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.15s, color 0.15s;
}
.lang-switcher-item:last-child { border-bottom: none; }
.lang-switcher-item:hover { background: var(--green-5); color: var(--white); }
.lang-switcher-item-active { color: var(--green); font-weight: 600; }
.lang-switcher-item-text { display: flex; flex-direction: column; line-height: 1.3; }
.lang-switcher-item-text small { color: var(--gray3, #666); font-weight: 400; }

/* Footer's copy of the switcher sits inline with the other footer-bottom text */
.footer-bottom .lang-switcher-toggle { background: transparent; }

/* Google Website Translator: keep the widget functional but fully invisible -
   we drive it entirely through our own .lang-switcher UI. Selectors are kept
   loose/duplicated on purpose - Google's own banner markup varies by version
   and a too-strict compound selector (e.g. requiring two classes at once)
   can silently fail to match and let the bar slip through. */
html body { top: 0 !important; } /* Google shifts <body> down to make room for its banner iframe */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
iframe[id^=":"][src*="translate.google"],
.skiptranslate > iframe,
body > .skiptranslate:first-child,
.goog-te-gadget-icon,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  position: absolute !important;
  top: -9999px !important;
}
.goog-text-highlight { background: none !important; box-shadow: none !important; }
#google_translate_element { display: none !important; }

/* Mobile hamburger */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  cursor: pointer;
}
.navbar-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--gray2);
  border-radius: 1px;
  transition: all 0.25s;
}
.navbar-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.navbar-toggle.is-open span:nth-child(2) { opacity: 0; }
.navbar-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   5. FLASH MESSAGES
   ============================================================ */
.flash-container {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flash-success {
  background: rgba(21,255,0,0.1);
  border: 1px solid rgba(21,255,0,0.3);
  color: var(--green);
}
.flash-error {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.flash-info {
  background: rgba(96,165,250,0.1);
  border: 1px solid rgba(96,165,250,0.3);
  color: #93c5fd;
}
.flash-warning {
  background: var(--yellow-dim);
  border: 1px solid rgba(251,191,36,0.3);
  color: var(--yellow);
}

.flash-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  padding: 0 0 0 12px;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: all 0.18s;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: var(--black);
  border-color: var(--green);
}
.btn-primary:hover {
  background: #fff;
  border-color: #fff;
  color: var(--black);
  box-shadow: var(--shadow-green);
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--green-10);
  border-color: var(--green);
  color: var(--green);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-lg  { padding: 12px 28px; font-size: 15px; }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-link {
  background: none;
  border: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-link:hover { color: var(--white); }
.btn-link-danger { color: var(--red) !important; }
.btn-link-danger:hover { color: #fca5a5 !important; }

.btn-mark-read {
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--green);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-mark-read:hover {
  background: var(--green-10);
  border-color: var(--green);
}

/* ============================================================
   7. BADGES (difficulty / status)
   ============================================================ */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge-easy   { background: rgba(21,255,0,0.12);   color: var(--green); }
.badge-medium { background: rgba(251,191,36,0.12); color: var(--yellow); }
.badge-hard   { background: rgba(239,68,68,0.12);  color: #f87171; }
.badge-insane { background: rgba(168,85,247,0.12); color: var(--purple); }
.badge-default { background: var(--gray4); color: var(--gray2); }

/* Notification/unread count badge */
.badge-count {
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

/* Role badge */
.role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.role-admin     { background: rgba(239,68,68,0.15);  color: #f87171; }
.role-moderator { background: rgba(168,85,247,0.15); color: #c084fc; }

/* ============================================================
   8. FORMS
   ============================================================ */
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray1);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="file"],
textarea,
select {
  display: block;
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border-dim);
  border-radius: var(--r);
  padding: 10px 14px;
  color: var(--white);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="file"] {
  padding: 8px 14px;
  cursor: pointer;
}
input[type="file"]::-webkit-file-upload-button {
  background: var(--gray4);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  color: var(--gray1);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  margin-right: 12px;
}
textarea { resize: vertical; min-height: 100px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,255,0,0.08);
}
input[disabled],
textarea[disabled],
select[disabled],
input[type="email"][disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray4);
}
input::placeholder,
textarea::placeholder { color: var(--gray3); }

/* stacked form layout (profile, create-team, create-topic etc) */
.stacked-form { display: flex; flex-direction: column; gap: 14px; }

/* auth form */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

/* checkbox label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray1);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  cursor: pointer;
  accent-color: var(--green);
  flex-shrink: 0;
}

/* form error / success */
.form-errors {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--r);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-error {
  font-size: 13px;
  color: #fca5a5;
}
.form-success {
  background: rgba(21,255,0,0.08);
  border: 1px solid rgba(21,255,0,0.25);
  border-radius: var(--r);
  padding: 14px;
}
.form-success p,
.form-success-msg {
  font-size: 14px;
  color: var(--green);
}
.form-hint {
  font-size: 12px;
  color: var(--gray2);
  margin-top: -4px;
}

/* inline form (used in team.php, topic.php for small action buttons) */
.inline-form { display: inline; }

/* filter search */
.filter-search { max-width: 320px; }

/* ============================================================
   9. CARDS & PANELS
   ============================================================ */
.dashboard-card {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color 0.2s;
}
.dashboard-card:hover { border-color: rgba(21,255,0,0.1); }

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.dashboard-card-header h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
}
.dashboard-card-link {
  font-size: 12px;
  color: var(--neon-green, #15ff00);
  white-space: nowrap;
}
.dashboard-card-link:hover { text-decoration: underline; }

.my-events-list { display: flex; flex-direction: column; gap: 10px; }
.my-events-item {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-md, 6px);
  padding: 10px 12px;
}
.my-events-item-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.my-events-item-title {
  font-weight: 600;
  color: var(--white);
}
.my-events-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim, #888);
}
.my-events-item-scoreboard-link {
  margin-left: auto;
  color: var(--neon-green, #15ff00);
}
.my-events-item-scoreboard-link:hover { text-decoration: underline; }

/* ============================================================
   10. AUTH PAGES (login, register, forgot-password, etc.)
   ============================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 120px);
  padding: 40px 16px;
}

.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--gray2);
  margin-bottom: 24px;
}

.auth-footer-link {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--gray2);
}

.auth-link-muted {
  font-size: 13px;
  color: var(--gray2);
}
.auth-link-muted:hover { color: var(--green); }

/* OAuth ("continue with Google/GitHub") buttons */
.auth-oauth-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-dim);
  background: var(--bg3);
  color: var(--white);
  transition: border-color 0.2s, background 0.2s;
}
.btn-oauth:hover { border-color: rgba(21,255,0,0.25); background: var(--bg2); }
.btn-oauth svg { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--gray3);
  font-size: 12px;
  margin: 4px 0 20px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-dim);
}
.auth-divider span { padding: 0 12px; }

/* ============================================================
   11. HERO (index.php)
   ============================================================ */
.hero {
  position: relative;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(21,255,0,0.07) 0%, transparent 65%),
              linear-gradient(180deg, var(--bg3) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-dim);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-dim) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 80px 24px 100px;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 58px);
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--gray2);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Stats strip below hero */
.stats-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border-dim);
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 36px;
  border-right: 1px solid var(--border-dim);
  transition: background 0.15s;
}
.stat-box:last-child { border-right: none; }
.stat-box:hover { background: var(--green-5); }

.stat-number {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--gray2);
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* Announcement banner */
.announcement-banner {
  background: rgba(251,191,36,0.08);
  border-bottom: 1px solid rgba(251,191,36,0.2);
}
.announcement-inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}
.announcement-inner strong { color: var(--yellow); }
.announcement-inner span  { color: var(--gray2); }

/* Home sections */
.home-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border-dim);
}
.home-section:last-child { border-bottom: none; }

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}
.home-section-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
}

/* ============================================================
   12. CHALLENGE CARDS (challenges.php, dashboard.php)
   ============================================================ */
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.challenge-card {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.challenge-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.challenge-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow), var(--shadow-green);
  color: var(--white);
}
.challenge-card:hover::before { transform: scaleX(1); }

.challenge-card-solved {
  border-color: rgba(21,255,0,0.2) !important;
}
.challenge-card-solved::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(21,255,0,0.03);
  pointer-events: none;
}

.challenge-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.challenge-category {
  font-size: 11px;
  color: var(--gray2);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.challenge-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.challenge-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
}

.challenge-card-points {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}
.challenge-card-solves {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray2);
}

/* =========================================================================
   Events
   ========================================================================= */

.events-page { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }

.events-header { margin-bottom: 20px; }
.events-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--white);
  margin-bottom: 4px;
}
.events-header p { color: var(--gray2); font-size: 13px; font-family: var(--font-mono); }

.events-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 12px;
}
.events-tab {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border-radius: 6px;
  color: var(--gray2);
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  transition: all 0.15s ease;
}
.events-tab:hover { color: var(--white); border-color: var(--border); }
.events-tab-active {
  color: var(--green);
  background: var(--green-5);
  border-color: var(--border);
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.event-card:hover { border-color: var(--border); transform: translateY(-2px); }
.event-card-cancelled { opacity: 0.55; }

.event-card-banner {
  height: 110px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg3);
}
.event-card-banner-placeholder {
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
}

.event-lock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(10, 15, 24, 0.85);
  border: 1px solid var(--border);
  color: var(--green);
}

.event-card-top {
  display: flex;
  gap: 6px;
  padding: 14px 16px 0;
}

.event-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--white);
  padding: 8px 16px 0;
}

.event-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray2);
}

.event-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 16px;
  margin-top: auto;
}
.event-card-participants {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray2);
}
.event-card-invited {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

.badge-upcoming  { background: var(--green-10); color: var(--green); }
.badge-ongoing   { background: var(--yellow-dim); color: var(--yellow); }
.badge-completed { background: var(--gray4); color: var(--gray2); }

/* --- event.php (single event page) -------------------------------------- */

.event-page { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

.event-back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray2);
  margin-bottom: 16px;
}
.event-back-link:hover { color: var(--green); }

.event-hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-dim);
  margin-bottom: 20px;
}
.event-hero-banner {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg3);
}
.event-hero-banner-placeholder {
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
}
.event-hero-content {
  padding: 20px 24px 24px;
  background: var(--bg2);
}
.event-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.event-hero-lock { display: inline-flex; align-items: center; gap: 4px; }
.event-hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--white);
  margin-bottom: 8px;
}
.event-hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.event-manage-link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
}

.event-countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}
.countdown-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  padding: 10px 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.countdown-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
}
.countdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 800px) {
  .event-body { grid-template-columns: 1fr; }
}

.event-main { display: flex; flex-direction: column; gap: 24px; }

.event-description, .event-participants {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 20px;
}
.event-description h2, .event-participants h2 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--white);
  margin-bottom: 12px;
}
.event-description p { color: var(--gray2); line-height: 1.6; font-size: 14px; }
.event-description-empty { font-style: italic; }
.event-participants-count { color: var(--gray2); font-size: 13px; font-weight: 400; }

.event-participant-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}
.event-participant {
  display: flex;
  align-items: center;
  gap: 10px;
}
.event-participant-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-dim);
}
.event-participant a { color: var(--white); font-size: 13px; }
.event-participant a:hover { color: var(--green); }

.event-sidebar { position: sticky; top: 16px; }
.event-cta-box {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.event-cta-form { margin: 0; }
.event-cta-note {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray2);
}

.event-challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.event-challenge-card { min-height: auto; }

.solved-ribbon {
  position: absolute;
  top: 10px;
  right: -24px;
  background: var(--green);
  color: var(--black);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 28px;
  transform: rotate(35deg);
  letter-spacing: 0.05em;
}

/* ============================================================
   13. CHALLENGES LIST PAGE (challenges.php)
   ============================================================ */
.challenges-page { }

.challenges-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.challenges-header h1,
.challenges-page > h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
}
.challenges-header p { font-size: 13px; color: var(--gray2); }

.challenges-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
}
.challenges-filters input,
.challenges-filters select { flex: 1; min-width: 140px; max-width: 240px; }

/* ============================================================
   14. SINGLE CHALLENGE PAGE (challenge.php)
   ============================================================ */
.challenge-page { }

.challenge-page-header {
  margin-bottom: 32px;
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--border-dim);
  background: linear-gradient(135deg, rgba(21,255,0,0.06), rgba(21,255,0,0) 60%);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg, 12px);
}
.challenge-page-breadcrumb {
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}
.challenge-page-breadcrumb a { color: var(--green); }

.challenge-page-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.challenge-page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.challenge-page-points {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}
.challenge-page-solves {
  font-size: 13px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.challenge-page-avgtime {
  font-size: 13px;
  color: var(--gray2);
  font-family: var(--font-mono);
  padding: 3px 10px;
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg, 999px);
  background: rgba(255,255,255,0.02);
}

.challenge-page-columns {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.challenge-description {
  font-size: 14px;
  color: var(--gray1);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.challenge-download {
  display: inline-flex;
  margin-top: 16px;
}

/* Flag form */
.flag-form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.flag-form input[type="text"] {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.05em;
}

/* Detail list (sidebar) */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.detail-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
  font-size: 13px;
  gap: 12px;
}
.detail-list li:last-child { border-bottom: none; }
.detail-list li span:first-child { color: var(--gray2); flex-shrink: 0; }
.detail-list li a { color: var(--green); text-align: right; }
.detail-list li span:last-child:not(:first-child) { color: var(--white); text-align: right; font-weight: 500; }

/* Solver list */
.solver-list { display: flex; flex-direction: column; gap: 8px; }
.solver-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.solver-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray2);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ============================================================
   15. DASHBOARD PAGE
   ============================================================ */
.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-welcome {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
}
.dashboard-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.dashboard-avatar-wrap { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.dashboard-level-emoji {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 0 10px rgba(21, 255, 0, 0.4);
}
.dashboard-welcome h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.dashboard-subtitle {
  font-size: 13px;
  color: var(--gray2);
}
.dashboard-subtitle strong { color: var(--green); }

/* XP progress */
.dashboard-progress {
  padding: 0 2px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.progress-bar {
  height: 6px;
  background: var(--gray4);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  border-radius: 3px;
  transition: width 1s ease;
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
}

/* Stats grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border); }
.stat-card .stat-number {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--gray2);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-align: center;
}

/* Two-column layout */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.dashboard-main-col { display: flex; flex-direction: column; gap: 20px; }
.dashboard-side-col { display: flex; flex-direction: column; gap: 20px; }

/* Solve list */
.solve-list { display: flex; flex-direction: column; gap: 0; }
.solve-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
  font-size: 13px;
}
.solve-list li:last-child { border-bottom: none; }
.solve-list li a { color: var(--white); font-weight: 500; }
.solve-list li a:hover { color: var(--green); }
.solve-meta {
  font-size: 11px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.solve-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Team summary card */
.team-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  transition: opacity 0.15s;
}
.team-summary:hover { opacity: 0.8; color: var(--white); }
.team-summary-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  object-fit: cover;
  border: 1px solid var(--border-dim);
}
.team-summary strong { display: block; font-size: 14px; font-weight: 600; }
.team-summary span  { font-size: 12px; color: var(--green); font-family: var(--font-mono); }

/* Notification preview list */
.notification-preview-list { display: flex; flex-direction: column; gap: 0; }
.notification-preview-list li {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
  gap: 3px;
}
.notification-preview-list li:last-child { border-bottom: none; }
.notification-preview-list a,
.notification-preview-list span { font-size: 13px; color: var(--gray1); }
.notification-preview-list a:hover { color: var(--green); }
.notif-time {
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
}

/* Badge grid */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg3);
  border: 1px solid var(--border-dim);
  border-radius: var(--r);
  text-align: center;
  transition: border-color 0.15s;
  cursor: default;
}
.badge-item:hover { border-color: var(--border); }
.badge-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-10);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}
.badge-name {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--gray2);
  line-height: 1.3;
  text-align: center;
}

/* ============================================================
   16. LEADERBOARD PAGE
   ============================================================ */
.leaderboard-page { display: flex; flex-direction: column; gap: 24px; }

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.leaderboard-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
}

/* Tabs */
.leaderboard-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  padding: 4px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-dim);
  width: fit-content;
}
.leaderboard-tabs form,
.leaderboard-filter-form,
.forum-filters form,
.pagination form {
  display: contents;
}
.tab {
  padding: 7px 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray2);
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.tab-button,
.page-button,
.leaderboard-time-button {
  border: 0;
  background: transparent;
  font-family: inherit;
}
.tab:hover { color: var(--white); }
.tab-active, .tab.tab-active {
  background: var(--green);
  color: var(--black) !important;
  font-weight: 600;
}

.leaderboard-time-button {
  padding: 8px 12px;
  border-right: 1px solid #333;
  font-size: 0.9em;
  text-decoration: none;
}

/* My rank card */
.my-rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(21,255,0,0.06);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 14px;
}
.my-rank-card .rank {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  min-width: 48px;
}
.my-rank-card .username { font-weight: 500; flex: 1; }
.my-rank-card .points {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--green);
  font-weight: 700;
}

/* Leaderboard table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.leaderboard-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--gray2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(21,255,0,0.03);
  border-bottom: 1px solid var(--border-dim);
  white-space: nowrap;
}
.leaderboard-table tbody tr {
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.15s;
}
.leaderboard-table tbody tr:last-child { border-bottom: none; }
.leaderboard-table tbody tr:hover { background: var(--green-5); }
.leaderboard-table tbody td { padding: 12px 16px; font-size: 13px; }

.leaderboard-row-self { background: rgba(21,255,0,0.05) !important; }

.rank-cell {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray2);
  width: 60px;
}
.rank-medal { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.rank-medal-1 { color: var(--gold);   background: rgba(255,215,0,0.12); }
.rank-medal-2 { color: var(--silver); background: rgba(192,192,192,0.12); }
.rank-medal-3 { color: var(--bronze); background: rgba(205,127,50,0.12); }

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-cell a { color: var(--white); font-weight: 500; }
.name-cell a:hover { color: var(--green); }

.points-cell {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  text-align: right;
}

/* Mini leaderboard (homepage) */
.mini-leaderboard { display: flex; flex-direction: column; gap: 0; }
.mini-leaderboard li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-bottom: none;
  font-size: 13px;
  transition: background 0.15s;
}
.mini-leaderboard li:first-child { border-radius: var(--r) var(--r) 0 0; }
.mini-leaderboard li:last-child  { border-bottom: 1px solid var(--border-dim); border-radius: 0 0 var(--r) var(--r); }
.mini-leaderboard li:hover { background: var(--green-5); }
.mini-leaderboard .rank {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray2);
  width: 28px;
  flex-shrink: 0;
}
.mini-leaderboard .username { flex: 1; color: var(--white); font-weight: 500; }
.mini-leaderboard .points {
  font-family: var(--font-mono);
  color: var(--green);
  font-weight: 700;
}

/* ============================================================
   17. PROFILE PAGE
   ============================================================ */
.profile-page { display: flex; flex-direction: column; gap: 20px; }

.profile-header-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  flex-wrap: wrap;
}
.profile-header-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  flex-shrink: 0;
}
.profile-header-info { flex: 1; min-width: 0; }
.profile-header-info h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}
.profile-fullname {
  font-size: 14px;
  color: var(--gray2);
  margin-bottom: 6px;
}
.profile-meta {
  font-size: 13px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.profile-meta strong { color: var(--green); }
.profile-team { font-size: 13px; color: var(--gray2); margin-top: 6px; }
.profile-team a { color: var(--green); }

.profile-bio {
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  font-size: 14px;
  color: var(--gray1);
  line-height: 1.7;
}

.profile-columns {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.profile-main-col { display: flex; flex-direction: column; gap: 20px; }
.profile-side-col { display: flex; flex-direction: column; gap: 20px; }

/* ============================================================
   18. TEAMS PAGES
   ============================================================ */
.teams-page { display: flex; flex-direction: column; gap: 24px; }
.teams-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.teams-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.team-card {
  background: var(--bg2);
  overflow: hidden;
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.2s, transform 0.2s;
}
.team-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  color: var(--white);
}
.team-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  object-fit: cover;
  border: 1px solid var(--border-dim);
  flex-shrink: 0;
}
.team-card-body { flex: 1; min-width: 0; }
.team-card-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.team-card-desc {
  word-break: break-word;        /* Breaks long continuous strings like 'uuuuuu...' */
  overflow-wrap: break-word;     /* Standards-compliant wrapping */
  display: -webkit-box;          /* Truncates cleanly after 2 lines */
  -webkit-line-clamp: 2;         
  -webkit-box-orient: vertical;  
  overflow: hidden;              
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--gray2);
  line-height: 1.5;
  margin-bottom: 8px;
}
.team-card-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--gray2);
  font-family: var(--font-mono);
}

/* Single team page */
.team-page { display: flex; flex-direction: column; gap: 20px; }

.team-header-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  flex-wrap: wrap;
}
.team-header-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.team-header-info { flex: 1; min-width: 0; }
.team-header-info h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.team-meta { font-size: 13px; color: var(--gray2); }
.team-meta a { color: var(--green); }

.team-header-actions { margin-left: auto; flex-shrink: 0; }

.team-columns {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.team-main-col { display: flex; flex-direction: column; gap: 20px; }
.team-side-col { display: flex; flex-direction: column; gap: 20px; }

/* Member list */
.member-list { display: flex; flex-direction: column; gap: 0; }
.member-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
  font-size: 13px;
  flex-wrap: wrap;
}
.member-list li:last-child { border-bottom: none; }
.member-list li a { color: var(--white); font-weight: 500; }
.member-list li a:hover { color: var(--green); }
.member-points {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
}
.member-actions {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

/* ============================================================
   19. FORUM
   ============================================================ */
.forum-page { display: flex; flex-direction: column; gap: 20px; }

.forum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.forum-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}

.forum-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-dim);
}

/* Forum topic table */
.forum-topic-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.forum-topic-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--gray2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(21,255,0,0.02);
}
.forum-topic-table tbody tr {
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.15s;
}
.forum-topic-table tbody tr:last-child { border-bottom: none; }
.forum-topic-table tbody tr:hover { background: var(--green-5); }
.forum-topic-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--gray2);
  vertical-align: top;
}
.forum-topic-cell a {
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}
.forum-topic-cell a:hover { color: var(--green); }
.forum-topic-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
  margin-top: 4px;
}
.pin-icon, .lock-icon { font-size: 12px; margin-right: 4px; }

/* Topic page */
.topic-page { display: flex; flex-direction: column; gap: 24px; }

.topic-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-dim);
}
.forum-breadcrumb {
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}
.forum-breadcrumb a { color: var(--green); }
.topic-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.3;
}
.topic-meta {
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.topic-meta a { color: var(--green); }

.mod-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Forum posts */
.post-list { display: flex; flex-direction: column; gap: 14px; }

.forum-post {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}
.forum-post:hover { border-color: rgba(21,255,0,0.1); }

.forum-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border-dim);
}
.forum-post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-dim);
  flex-shrink: 0;
}
.forum-post-author a { color: var(--white); font-weight: 500; font-size: 13px; }
.forum-post-level {
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
  margin-left: auto;
}

.forum-post-body {
  padding: 16px;
  font-size: 14px;
  color: var(--gray1);
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.forum-post-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-dim);
}
.forum-post-time {
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
  margin-right: auto;
}

/* Reply section */
.reply-section {
  padding-top: 8px;
}

/* ============================================================
   20. NOTIFICATIONS PAGE
   ============================================================ */
.notifications-page { display: flex; flex-direction: column; gap: 24px; }
.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notifications-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}

.notification-full-list { display: flex; flex-direction: column; gap: 0; }

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-bottom: none;
  transition: background 0.15s;
}
.notification-item:first-child { border-radius: var(--r) var(--r) 0 0; }
.notification-item:last-child  { border-bottom: 1px solid var(--border-dim); border-radius: 0 0 var(--r) var(--r); }
.notification-item:hover { background: var(--green-5); }

.notification-unread {
  background: rgba(21,255,0,0.04) !important;
  border-left: 2px solid var(--green) !important;
}

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  margin-top: 2px;
}

.notification-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.notification-message {
  font-size: 13px;
  color: var(--gray1);
  line-height: 1.5;
}
a.notification-message:hover { color: var(--green); }
.notification-time {
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
}
.notification-mark-form { flex-shrink: 0; }

/* ============================================================
   21. MY CTFs PAGE
   ============================================================ */
.my-ctfs-page { display: flex; flex-direction: column; gap: 24px; }
.my-ctfs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.my-ctfs-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}

.my-ctfs-list { display: flex; flex-direction: column; gap: 12px; }

.my-ctf-item {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.15s;
}
.my-ctf-item:hover { border-color: rgba(21,255,0,0.1); }
.my-ctf-main { flex: 1; min-width: 0; }
.my-ctf-main h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}
.my-ctf-meta {
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
}

.admin-comment-box {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg3);
  border-left: 2px solid var(--yellow);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13px;
}
.admin-comment-box strong { color: var(--yellow); font-size: 12px; }
.admin-comment-box p { color: var(--gray1); margin-top: 4px; line-height: 1.5; }

.my-ctf-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.reviewed-time {
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
}

/* ============================================================
   22. SUBMIT CTF / FORM PAGE CARD
   ============================================================ */
.submit-ctf-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 0;
}
.form-page-card {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  padding: 36px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow);
}
.form-page-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 24px;
  letter-spacing: 0.03em;
}

/* ============================================================
   23. EMPTY STATES & MISC
   ============================================================ */
.empty-state {
  font-size: 14px;
  color: var(--gray2);
  text-align: center;
  padding: 32px 16px;
  font-style: italic;
}
.empty-state a { font-style: normal; color: var(--green); }

.empty-state-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  gap: 12px;
}
.empty-state-page h1 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--white);
}
.empty-state-page p { color: var(--gray2); font-size: 15px; }

.link-more {
  font-size: 13px;
  color: var(--green);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.link-more:hover { color: var(--white); }

/* Mini avatar (shared everywhere) */
.mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-dim);
  flex-shrink: 0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0;
}
.page-link {
  padding: 7px 16px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--green);
  transition: all 0.15s;
}
.page-link:hover {
  background: var(--green-10);
  border-color: var(--border);
  color: var(--green);
}
.page-status {
  font-size: 13px;
  color: var(--gray2);
  font-family: var(--font-mono);
}

/* ============================================================
   24. ADMIN PANEL
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.admin-sidebar {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.admin-sidebar-header {
  padding: 14px 16px;
  background: var(--green-5);
  border-bottom: 1px solid var(--border-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--gray2);
  border-bottom: 1px solid var(--border-dim);
  transition: all 0.15s;
}
.admin-nav a:last-child { border-bottom: none; }
.admin-nav a:hover,
.admin-nav a.active {
  background: var(--green-5);
  color: var(--white);
}
.admin-nav a.active { color: var(--green); border-left: 2px solid var(--green); }

.admin-content { display: flex; flex-direction: column; gap: 24px; }

.admin-page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

/* ============================================================
   24b. ADMIN APPROVAL QUEUE (admin/approvals.php)
   ============================================================ */
.approval-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.approval-card {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.approval-card:hover { border-color: rgba(21,255,0,0.1); }

.approval-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.approval-card-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  margin-right: auto;
}

.approval-points {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

/* Ensure this matches your CSS breakpoint for mobile */
@media (max-width: 768px) {
  /* When the JS adds the .active class, force it to display */
  .navbar-links.active {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 60px; /* Adjust based on your header height */
    left: 0;
    width: 100%;
    background-color: #11141a; /* Match your theme's dark background */
    padding: 1rem;
    z-index: 999;
  }
}

.approval-meta {
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.approval-meta a { color: var(--green); }

.approval-description {
  font-size: 14px;
  color: var(--gray1);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.approval-actions {
  border-top: 1px solid var(--border-dim);
  padding-top: 14px;
}

.approval-action-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.approval-action-form textarea {
  min-height: 64px;
}

.approval-action-buttons {
  display: flex;
  gap: 10px;
}

/* ============================================================
   24d. LEGAL PAGES
   ============================================================ */
.legal-page {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-header {
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(21,255,0,0.1), transparent),
    var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
}

.legal-header p {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--white);
}

.legal-header span {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray2);
}

.legal-content {
  padding: 28px;
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
}

.legal-content h2 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--white);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  color: var(--gray1);
  font-size: 14px;
  line-height: 1.8;
}

/* ============================================================
   24c. GENERIC MULTI-FIELD FORM ROW (admin/create-challenge.php,
   submit-ctf.php — points / difficulty / category side by side)
   ============================================================ */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  align-items: start;
}
.form-row > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row label { margin-bottom: 0; }

/* ============================================================
   25. ANIMATIONS & UTILITIES
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.35s ease both; }

@keyframes greenPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21,255,0,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(21,255,0,0); }
}
.pulse-green { animation: greenPulse 2s infinite; }

/* ============================================================
   26. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .challenge-page-columns {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand-block {
    grid-column: 1 / -1;
  }
  .challenge-page-side { order: -1; }
  .dashboard-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-columns { grid-template-columns: 1fr; }
  .team-columns { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
}

@media (max-width: 768px) {
  :root { --page-w: 100%; }
  .site-main { padding: 20px 16px 48px; }

  .navbar-toggle { display: flex; }
  .navbar-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg3);
    border-bottom: 1px solid var(--border-dim);
    padding: 8px 0;
    z-index: 999;
    box-shadow: var(--shadow);
  }
  .navbar-links.is-open { display: flex; }
  .nav-link { padding: 10px 20px; border-radius: 0; }
  .navbar-user-menu { margin-left: 0; }
  .navbar-user-dropdown {
    position: static;
    box-shadow: none;
    border-radius: 0;
    background: var(--bg4);
  }


  .dashboard-columns { grid-template-columns: 1fr; }
  .challenge-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .dashboard-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .challenges-filters { flex-direction: column; }
  .challenges-filters input,
  .challenges-filters select { max-width: 100%; }
  .flag-form { flex-direction: column; }
  .auth-card { padding: 28px 20px; }
  .form-page-card { padding: 24px 20px; }
  .hero-inner { padding: 56px 16px 72px; }
  .leaderboard-table thead th:nth-child(3),
  .leaderboard-table tbody td:nth-child(3) { display: none; }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .footer-brand-block,
  .footer-brand {
    margin: 0 auto;
  }
  .footer-brand {
    justify-content: center;
  }
  .footer-links {
    justify-content: center;
    align-items: center;
  }
  .footer-logo-wrap {
    width: 62px;
    height: 62px;
  }
  .footer-brand-text strong {
    font-size: 23px;
  }
  .footer-blurb {
    margin-left: auto;
    margin-right: auto;
  }
  .footer-bottom {
    justify-content: center;
    text-align: center;
  }
  .stats-strip { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
  .stat-box { padding: 16px 24px; flex-shrink: 0; }
  .my-ctf-item { flex-direction: column; }
  .my-ctf-status { align-items: flex-start; }
  .approval-card-header h3 { margin-right: 0; width: 100%; }
  .approval-action-buttons { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-inner {
    padding: 36px 16px 24px;
  }
  .footer-brand {
    flex-direction: column;
    text-align: center;
  }
  .footer-links-inline {
    gap: 8px;
  }
  .footer-links a {
    font-size: 12px;
    padding: 7px 9px;
  }
  .dashboard-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-header-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-header-info h1 { justify-content: center; }
  .pagination { flex-direction: column; gap: 8px; }
}

/* =========================================================================
   Profile v2 — hero card, stat boxes, badge grid, social links
   ========================================================================= */

.profile-hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.profile-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--green-10) 0%, transparent 70%);
  pointer-events: none;
}
.profile-hero-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.profile-avatar-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  flex-shrink: 0;
}
.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--green);
  box-shadow: var(--shadow-green);
}
.profile-level-emoji {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 0 14px rgba(21, 255, 0, 0.45);
}
.profile-hero-info { flex: 1; min-width: 220px; }
.profile-hero-info h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--white);
  flex-wrap: wrap;
}
.profile-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--green-10);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}
.profile-team-line { margin-top: 8px; font-size: 13px; color: var(--gray2); }
.profile-team-line a { color: var(--green); }

/* Stat boxes */
.profile-stats-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 14px;
  margin-top: 26px;
}
.profile-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 18px 12px;
  background: var(--bg3);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  transition: transform 0.15s, border-color 0.15s;
}
.profile-stat-box:hover { transform: translateY(-3px); border-color: var(--border); }
.profile-stat-box .stat-icon { font-size: 22px; line-height: 1; }
.profile-stat-box .stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--white);
  line-height: 1.1;
}
.profile-stat-box .stat-caption {
  font-size: 10.5px;
  color: var(--gray2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-stat-box--rank {
  background: linear-gradient(160deg, rgba(21, 255, 0, 0.14), var(--bg3));
  border: 1px solid var(--green);
  box-shadow: var(--shadow-green);
}
.profile-stat-box--rank .stat-value {
  font-size: 44px;
  color: var(--green);
  text-shadow: 0 0 18px rgba(21, 255, 0, 0.55);
}
.profile-stat-box--rank .stat-caption { color: var(--green); }

/* Social links */
.profile-social-row {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border-dim);
  color: var(--gray1);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.social-icon-btn:hover {
  color: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(21, 255, 0, 0.3);
  transform: translateY(-2px);
}

/* Badge grid v2 (image-based) */
.badge-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}
.badge-card-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--bg3);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  text-align: center;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.badge-card-v2:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-green);
  transform: translateY(-3px);
}
.badge-card-v2 img { width: 56px; height: 56px; }
.badge-card-v2 .badge-name-v2 {
  font-size: 12px;
  color: var(--gray1);
  font-weight: 600;
  line-height: 1.3;
}

.form-hint-icon { opacity: 0.7; margin-right: 4px; }

@media (max-width: 860px) {
  .profile-stats-row { grid-template-columns: repeat(2, 1fr); }
  .profile-stat-box--rank { grid-column: span 2; }
}

@media (max-width: 480px) {
  .profile-hero-top { flex-direction: column; text-align: center; }
  .profile-hero-info h1 { justify-content: center; }
  .profile-social-row { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   26. NEW FEATURES: team join requests, side-by-side settings
   cards, next-level progress on profile, solves pie chart
   ============================================================ */

/* Disabled-looking "Request Pending" pill on team.php */
.btn-disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.btn-link-success { color: var(--green) !important; }
.btn-link-success:hover { color: #7dffb0 !important; }

/* Join Requests approval queue (team.php owner sidebar) */
.join-request-list { display: flex; flex-direction: column; gap: 0; }
.join-request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
}
.join-request-item:last-child { border-bottom: none; }
.join-request-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.join-request-info a {
  color: var(--white);
  font-weight: 600;
  font-size: 13px;
}
.join-request-meta {
  font-size: 11px;
  color: var(--gray2);
  font-family: var(--font-mono);
}
.join-request-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

/* Next-level progress bar on profile.php */
.profile-level-progress {
  background: var(--bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-level-progress .progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray2);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.profile-level-caption {
  font-size: 12px;
  color: var(--gray2);
}
.profile-level-caption strong { color: var(--green); }

/* Solves-by-category pie chart on profile.php */
.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.pie-chart-svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}
.pie-total-number {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  fill: var(--white);
}
.pie-total-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--gray2);
  letter-spacing: 0.04em;
}
.pie-legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 160px;
}
.pie-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray1);
}
.pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.pie-legend-label { flex: 1; }
.pie-legend-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray2);
}

/* Side-by-side settings cards on profile.php (Update Avatar + Change
   Password), instead of stacking full-width in the narrow sidebar */
.profile-side-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  align-items: start;
}
.profile-side-cards-row .dashboard-card { padding: 16px; }
.profile-side-cards-row .dashboard-card-header h2 { font-size: 12px; }
.profile-side-cards-row .stacked-form { gap: 10px; }

@media (max-width: 420px) {
  .profile-side-cards-row { grid-template-columns: 1fr; }
}

/* Overlay background */
#desktop-notice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
}

/* Hidden state */
#desktop-notice-overlay.hidden {
  display: none !important;
}

/* The popup box */
.desktop-notice-box {
  background: #111827;
  padding: 24px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.desktop-notice-box h3 {
  margin-top: 0;
  color: #15ff00;
  font-size: 1.2rem;
}

.desktop-notice-box p {
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Buttons */
#close-notice-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

#close-notice-btn:hover {
  color: #333;
}

#got-it-btn {
  background: #1eff00;
  color: #000000;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

#got-it-btn:hover {
  background: #0056b3;
}