:root {
  --bg: #08090b;
  --bg-soft: #0d1012;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef1f0;
  --text-dim: #8b9a95;
  --accent: #39ff9d;
  --accent-dim: #1f8f5c;
  --accent-glow: rgba(57, 255, 157, 0.25);
  --nav-h: 72px;
  --font-mono: "JetBrains Mono", "D2Coding", monospace;
  --font-sans: "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 0.28s ease;
}

body.page-loaded {
  opacity: 1;
}

body.page-leaving {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }
}

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

.resize-no-transition,
.resize-no-transition * {
  transition: none !important;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar.scrolled {
  background: rgba(8, 9, 11, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.logo-bracket {
  color: var(--accent);
  margin-right: 2px;
}

.logo-cursor {
  color: var(--accent);
  margin-left: 2px;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

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

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.nav-cta::after {
  display: none;
}

.nav-link-admin {
  color: #ffb03c;
}

.nav-link-admin::after {
  background: #ffb03c;
}

.nav-link-admin:hover {
  color: #ffcb73;
}

/* ---------- Admin nav dropdown (hover-only — the link itself still
   navigates straight to the dashboard on click) ---------- */
.nav-admin {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Invisible bridge over the gap between the link and the menu below it,
   so the mouse stays "inside" .nav-admin (and the menu stays open) while
   crossing from one to the other instead of hitting a dead zone. */
.nav-admin::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  min-width: 210px;
  height: 12px;
}

.nav-profile-menu.nav-admin-menu {
  min-width: 210px;
}

.nav-admin-menu .nav-profile-item {
  white-space: nowrap;
}

.nav-admin:hover .nav-admin-menu,
.nav-admin:focus-within .nav-admin-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- Toast notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(13, 16, 18, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 48px -26px rgba(0, 0, 0, 0.7);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.toast-error {
  border-color: rgba(255, 90, 90, 0.5);
  color: #ff8080;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.25s ease;
  }
}

/* ---------- Confirm modal (destructive admin actions) ---------- */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.confirm-modal-overlay.show {
  opacity: 1;
}

.confirm-modal {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid rgba(255, 90, 90, 0.35);
  background: var(--bg-soft);
  box-shadow: 0 32px 64px -24px rgba(0, 0, 0, 0.8);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.confirm-modal-overlay.show .confirm-modal {
  transform: translateY(0) scale(1);
}

.confirm-modal-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.confirm-modal-kicker-danger {
  color: #ff8080;
}

.confirm-modal-title {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 10px;
}

.confirm-modal-message {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirm-modal-message strong {
  color: var(--text);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-modal-btn {
  padding: 9px 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.confirm-modal-cancel:hover,
.confirm-modal-cancel:focus-visible {
  border-color: var(--accent-dim);
  color: var(--text);
}

.confirm-modal-primary {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.confirm-modal-primary:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.confirm-modal-danger {
  border-color: rgba(255, 90, 90, 0.5);
  color: #ff8080;
}

.confirm-modal-danger:hover {
  border-color: #ff8080;
  background: rgba(255, 90, 90, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .confirm-modal-overlay,
  .confirm-modal {
    transition: none;
  }
}

.reveal-value-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.reveal-value-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.reveal-value-input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- Nav profile menu (post-login CTA replacement) ---------- */
.nav-profile {
  position: relative;
}

/* Same gap-bridge trick as .nav-admin — keeps the menu open while the
   mouse crosses the space between the trigger and the menu below it. */
.nav-profile::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  min-width: 170px;
  height: 12px;
}

.nav-profile-trigger {
  display: flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-profile-trigger:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 20px -8px var(--accent-glow);
}

.nav-profile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.nav-profile-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.nav-profile-nick {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.2;
  transition: color 0.2s ease;
}

.nav-profile-trigger:hover .nav-profile-nick {
  color: var(--accent);
}

.nav-profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 16, 18, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 48px -26px rgba(0, 0, 0, 0.7);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -6px) scale(0.96);
  transform-origin: top center;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.nav-profile:hover .nav-profile-menu,
.nav-profile:focus-within .nav-profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .nav-profile-menu {
    transition: opacity 0.18s ease, visibility 0.18s;
    transform: translate(-50%, 0) scale(1);
  }
}

.nav-profile-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-profile-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.nav-profile-item:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-profile-item.nav-profile-logout:hover {
  color: #ff8080;
  background: rgba(255, 90, 90, 0.08);
}

.nav-profile-divider {
  height: 1px;
  margin: 4px 4px;
  background: var(--line);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

/* Icons stay put on hover — only the button itself lifts. A per-icon
   slide direction can't match every icon's own meaning (arrows, plus
   signs, etc.), so it's simplest to leave icons static everywhere. */
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px -6px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-secondary svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.btn-secondary:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px -6px var(--accent-glow);
  transform: translateY(-2px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nav-h) 24px 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, black 40%, transparent 85%);
}

.glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  max-width: 140vw;
  max-height: 140vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(40px);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(2.75rem, 10vw, 6.5rem);
  letter-spacing: 2px;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 0 40px var(--accent-glow);
}

.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 400;
  color: var(--text-dim);
  max-width: 34ch;
}

/* ---------- Login ---------- */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 24px;
  padding: 44px 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 16, 18, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.apply-card {
  max-width: 560px;
}

/* ---------- Profile page ---------- */
.profile-page {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
  overflow: hidden;
}

.profile-page-inner {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 28px;
  align-items: start;
}

.profile-card {
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 16, 18, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 0.7);
  text-align: center;
  /* border-color/box-shadow are set inline by js/profile.js, cycling
     through the tier palette — this just makes each swap a smooth
     fade instead of a hard cut, echoing the neon glow on the mesh. */
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

/* Avatar left, name/student ID next, tier badge pushed to the far
   right of the same row. */
.profile-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  text-align: left;
}

.profile-header-text {
  flex: 1;
  min-width: 0;
}

.profile-avatar-btn {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar-btn:hover,
.profile-avatar-btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 20px -6px var(--accent-glow);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-avatar-edit svg {
  width: 14px;
  height: 14px;
  color: var(--text);
}

.profile-avatar-btn:hover .profile-avatar-edit,
.profile-avatar-btn:focus-visible .profile-avatar-edit {
  opacity: 1;
}

/* Same [hidden]-vs-author-display fix as .profile-save-btn above —
   needed since the edit pencil overlay is hidden via the `hidden`
   attribute (not just opacity) when viewing another member's profile. */
.profile-avatar-edit[hidden] {
  display: none;
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.profile-student-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Shown instead of .profile-student-id when viewing another member's
   profile (see js/profile.js) — their student ID/email/phone stay
   private, but the nickname is public flair shown everywhere else
   (ranking board, First Blood, solved-problem list). */
.profile-view-nickname {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 4px;
}

/* Sits at the far right of the avatar/name row — colored/labeled/cycled
   to match the solved-score tier (see js/profile.js). */
.profile-tier-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1px;
  transition: color 0.6s ease, background 0.6s ease, box-shadow 0.6s ease;
}

.profile-tier-badge:empty {
  display: none;
}

.profile-tier-badge.tier-none {
  color: var(--text-dim);
  background: rgba(139, 154, 149, 0.12);
  box-shadow: 0 0 14px -6px rgba(139, 154, 149, 0.4);
}

.profile-tier-badge.tier-bronze {
  color: #d99a5b;
  background: rgba(184, 115, 51, 0.15);
  box-shadow: 0 0 14px -6px rgba(184, 115, 51, 0.6);
}

.profile-tier-badge.tier-silver {
  color: #dfe5e8;
  background: rgba(196, 204, 209, 0.12);
  box-shadow: 0 0 14px -6px rgba(196, 204, 209, 0.55);
}

.profile-tier-badge.tier-gold {
  color: #ffcf5c;
  background: rgba(255, 176, 60, 0.15);
  box-shadow: 0 0 14px -6px rgba(255, 176, 60, 0.6);
}

.profile-tier-badge.tier-diamond {
  color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 16px -6px var(--accent-glow);
}

.profile-tier-badge.tier-master {
  color: #cbb2ff;
  background: rgba(185, 140, 255, 0.18);
  box-shadow: 0 0 16px -6px rgba(185, 140, 255, 0.45);
}

.profile-form {
  text-align: left;
  margin-top: 47px;
}

/* Tighter than the shared .form-field spacing (used by login/apply too)
   — only scoped here so the profile card can be trimmed to line up
   with the bottom of the 업적/내가 푼 문제 cards without affecting
   those other forms. */
.profile-form .form-field {
  margin-bottom: 14px;
}

.profile-password-section {
  margin-bottom: 16px;
}

.profile-password-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 2px;
  border: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.profile-password-toggle:hover,
.profile-password-toggle:focus-visible {
  color: var(--text);
}

.profile-password-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.profile-password-toggle.open svg {
  transform: rotate(180deg);
}

/* Expand/collapse via grid-template-rows (0fr -> 1fr) rather than the
   `hidden` attribute — animating `display` directly isn't possible, and
   this trick animates a natural "height: auto" without JS needing to
   measure scrollHeight. The inner wrapper clips content and fades in
   during the transition; padding-top lives here (not on the outer
   element) so it animates open/closed along with the height instead of
   leaving a fixed gap when collapsed. */
.profile-password-fields {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}

.profile-password-fields.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.profile-password-fields-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 14px;
}

.profile-password-fields .form-field {
  margin-bottom: 14px;
}

.profile-password-submit {
  width: 100%;
}

/* Study track — no label anymore, just the track name centered, colored
   by track and (see js/profile.js) cycled through all three so every
   track color can be previewed without needing three different accounts. */
.profile-track-block {
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  transition: border-color 0.6s ease, background 0.6s ease, color 0.6s ease;
}

.profile-track-block.track-0day {
  border-color: rgba(92, 225, 255, 0.4);
  background: linear-gradient(160deg, rgba(92, 225, 255, 0.14), transparent 70%);
  color: #5ce1ff;
}

.profile-track-block.track-1day {
  border-color: rgba(255, 176, 60, 0.45);
  background: linear-gradient(160deg, rgba(255, 176, 60, 0.16), transparent 70%);
  color: #ffcf5c;
}

.profile-track-block.track-nday {
  border-color: rgba(185, 140, 255, 0.45);
  background: linear-gradient(160deg, rgba(185, 140, 255, 0.16), transparent 70%);
  color: #cbb2ff;
}

/* Join date on the left, days-since-joining on the right. */
.profile-joined-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 2px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.profile-joined-date {
  color: var(--text-dim);
}

.profile-dday {
  color: var(--accent);
  font-weight: 700;
}

/* 저장하기 + 홈으로/랭킹으로, 나란히 — 하나만 보일 때(다른 회원 프로필
   읽기 전용 모드에서 저장 버튼이 숨겨질 때)는 남은 버튼이 flex:1로 전체
   폭을 채운다. grid였다면 숨긴 열의 빈 칸이 그대로 남아 버튼이 반쪽만
   차지해 보였다. */
.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.profile-save-btn,
.profile-back {
  flex: 1;
  justify-content: center;
}

/* .btn-primary's `display: inline-flex` otherwise beats the UA
   `[hidden]{display:none}` rule at equal specificity — see the same
   fix already applied to .lab-solved-badge/.lab-attachment-card/
   .lab-detail elsewhere in this file. Needed here because js/profile.js
   hides this button via the `hidden` attribute when viewing another
   member's (read-only) profile. */
.profile-save-btn[hidden] {
  display: none;
}

.profile-state {
  padding: 20px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.profile-state[hidden] {
  display: none;
}

.profile-state-error {
  color: #ff8080;
}

.profile-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Achievements and solved-problems share this same flat card look —
   the tier color lives in the mesh/glow/profile-card/nav instead. */
.profile-side-card {
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  min-height: 160px;
}

.profile-side-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 6px 0 10px;
  color: var(--text);
}

.profile-side-count {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.profile-side-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: 8px;
}

/* Pushes the score to the far right of the title row instead of just
   trailing the count inline. */
.profile-side-title-split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.profile-side-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Bounded height + internal scroll so neither card grows without limit
   as achievements/solved problems pile up over time. The achievement
   grid's cap is sized to exactly two rows (10 badges) so that's what
   shows on load — scrolling reveals the rest instead of hiding them. */
.achievement-grid,
.solved-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.achievement-grid::-webkit-scrollbar,
.solved-list::-webkit-scrollbar {
  width: 6px;
}

.achievement-grid::-webkit-scrollbar-track,
.solved-list::-webkit-scrollbar-track {
  background: transparent;
}

.achievement-grid::-webkit-scrollbar-thumb,
.solved-list::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 999px;
}

.solved-list {
  max-height: 260px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-right: 4px;
  max-height: 210px;
}

.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.achievement-badge:hover {
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.achievement-badge svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.achievement-badge span {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Achievements not yet earned: same badge shape, dimmed and locked. */
.achievement-badge.locked {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.015);
  opacity: 0.5;
}

.achievement-badge.locked svg,
.achievement-badge.locked span {
  color: var(--text-dim);
}

.achievement-badge.locked:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.03);
}

/* The tiered demo badge swaps class every couple seconds (see
   js/profile.js) — a slower transition than the default hover speed
   makes that swap read as a smooth color shift, not a hard cut. */
#tierCycleBadge {
  transition: border-color 1s ease, background 1s ease, box-shadow 1s ease;
}

.achievement-tier-label {
  font-family: var(--font-mono);
  font-size: 0.62rem !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
}

/* Tiered achievements (e.g. 출석왕) reuse the same badge, but the
   background/border/icon color step up a level each time the tier
   does — bronze -> silver -> gold -> diamond. */
.achievement-badge.tier-bronze {
  border-color: rgba(184, 115, 51, 0.55);
  background: linear-gradient(160deg, rgba(184, 115, 51, 0.35), rgba(140, 90, 43, 0.12));
}

.achievement-badge.tier-bronze svg,
.achievement-badge.tier-bronze .achievement-tier-label {
  color: #d99a5b;
}

.achievement-badge.tier-bronze:hover {
  border-color: #d99a5b;
  background: linear-gradient(160deg, rgba(184, 115, 51, 0.5), rgba(140, 90, 43, 0.2));
}

.achievement-badge.tier-silver {
  border-color: rgba(196, 204, 209, 0.5);
  background: linear-gradient(160deg, rgba(196, 204, 209, 0.3), rgba(142, 154, 163, 0.1));
}

.achievement-badge.tier-silver svg,
.achievement-badge.tier-silver .achievement-tier-label {
  color: #dfe5e8;
}

.achievement-badge.tier-silver:hover {
  border-color: #dfe5e8;
  background: linear-gradient(160deg, rgba(196, 204, 209, 0.45), rgba(142, 154, 163, 0.18));
}

.achievement-badge.tier-gold {
  border-color: rgba(255, 176, 60, 0.6);
  background: linear-gradient(160deg, rgba(255, 176, 60, 0.32), rgba(166, 124, 30, 0.12));
}

.achievement-badge.tier-gold svg,
.achievement-badge.tier-gold .achievement-tier-label {
  color: #ffcf5c;
}

.achievement-badge.tier-gold:hover {
  border-color: #ffcf5c;
  background: linear-gradient(160deg, rgba(255, 176, 60, 0.48), rgba(166, 124, 30, 0.2));
}

.achievement-badge.tier-diamond {
  border-color: var(--accent-dim);
  background: linear-gradient(160deg, rgba(57, 255, 157, 0.32), rgba(58, 220, 255, 0.16));
  box-shadow: 0 0 16px -4px var(--accent-glow);
}

.achievement-badge.tier-diamond svg,
.achievement-badge.tier-diamond .achievement-tier-label {
  color: var(--accent);
}

.achievement-badge.tier-diamond:hover {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(57, 255, 157, 0.48), rgba(58, 220, 255, 0.24));
  box-shadow: 0 0 24px -4px var(--accent-glow);
}

.achievement-badge.tier-master {
  border-color: rgba(185, 140, 255, 0.6);
  background: linear-gradient(160deg, rgba(185, 140, 255, 0.35), rgba(124, 58, 237, 0.15));
  box-shadow: 0 0 16px -4px rgba(185, 140, 255, 0.45);
}

.achievement-badge.tier-master svg,
.achievement-badge.tier-master .achievement-tier-label {
  color: #cbb2ff;
}

.achievement-badge.tier-master:hover {
  border-color: #cbb2ff;
  background: linear-gradient(160deg, rgba(185, 140, 255, 0.5), rgba(124, 58, 237, 0.25));
  box-shadow: 0 0 26px -4px rgba(185, 140, 255, 0.55);
}

.solved-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-right: 4px;
}

/* An almost-opaque dark backing (not the ~2% white the card interior
   normally uses) so each row stays legible no matter which tier color
   is showing through the card behind it — a light tint like silver or
   gold was washing the text out otherwise. */
.solved-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 9, 11, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.solved-item:hover {
  border-color: var(--accent-dim);
  background: rgba(8, 9, 11, 0.75);
}

.solved-category {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.solved-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.solved-points {
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* First blood: first to solve that challenge — a distinct red so it
   doesn't get confused with the tier palette (bronze/silver/gold/etc). */
.solved-item.first-blood {
  border-color: rgba(255, 59, 92, 0.4);
  background: linear-gradient(160deg, rgba(255, 59, 92, 0.18), rgba(8, 9, 11, 0.6));
}

.solved-item.first-blood:hover {
  border-color: rgba(255, 59, 92, 0.6);
  background: linear-gradient(160deg, rgba(255, 59, 92, 0.24), rgba(8, 9, 11, 0.72));
}

.first-blood-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 59, 92, 0.15);
  color: #ff5c7a;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.first-blood-badge svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* ---------- Member "coming soon" placeholder pages ---------- */
.placeholder-main {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nav-h) 24px 80px;
  overflow: hidden;
  text-align: center;
}

.placeholder-glow {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 600px;
  height: 600px;
  max-width: 130vw;
  max-height: 130vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  filter: blur(50px);
  z-index: 0;
}

.placeholder-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 480px;
}

.placeholder-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--accent-dim);
}

.placeholder-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--text);
}

.placeholder-title .accent {
  color: var(--accent);
}

.placeholder-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.login-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.login-title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.login-form {
  text-align: left;
}

.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.form-field input {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field textarea {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field select {
  padding: 12px 38px 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.03);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9a95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field select:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field select option {
  background: var(--bg-soft);
  color: var(--text);
}

.form-field.has-error select {
  border-color: rgba(255, 90, 90, 0.5);
}

.field-hint {
  margin-top: -4px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Standing rule (not just this one form): every .field-error renders
   inside its own .form-field's box via absolute positioning, so a
   validation message popping up never pushes or reflows neighboring
   fields — this is what broke the admin wargame form's row when an
   error appeared. Apply this same pattern to any new field-level error
   UI added later unless told otherwise. */
.field-error {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 90, 90, 0.35);
  background: rgba(20, 8, 8, 0.92);
  font-size: 0.72rem;
  line-height: 1.4;
  color: #ff8080;
  z-index: 5;
  pointer-events: none;
}

.form-field.has-error input {
  border-color: rgba(255, 90, 90, 0.5);
}

.form-field.has-error .pill-option span {
  border-color: rgba(255, 90, 90, 0.5);
}

.form-field.has-error .field-error {
  display: block;
}

.consent-box {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 12px;
}

.consent-box-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 10px;
}

.consent-box-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.consent-box-list li {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-left: 14px;
  position: relative;
}

.consent-box-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}

.consent-box-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
}

.checkbox-option span {
  cursor: default;
}

.checkbox-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-option input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.checkbox-option input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #06110b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-option input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.password-toggle svg[hidden] {
  display: none;
}

.pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-option {
  position: relative;
}

.pill-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pill-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.pill-option input:hover + span {
  border-color: var(--accent-dim);
  color: var(--text);
}

.pill-option input:checked + span {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.pill-option input:focus-visible + span {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 90, 90, 0.4);
  border-radius: 6px;
  background: rgba(255, 90, 90, 0.08);
  color: #ff8080;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.form-error[hidden] {
  display: none;
}

.form-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.form-success {
  padding: 4px 0 8px;
}

.form-success[hidden] {
  display: none;
}

.form-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.form-success-icon svg {
  width: 26px;
  height: 26px;
}

.form-success-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.form-success-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
}

.login-divider-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-divider-text {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1px;
  white-space: nowrap;
}

.login-apply {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.login-apply p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ---------- Sections ---------- */
.section {
  padding: 120px 24px;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  scroll-margin-top: var(--nav-h);
}

.section.in-view {
  opacity: 1;
  transform: none;
}

.section-alt {
  background: var(--bg-soft);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 4px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  line-height: 1.35;
  margin-bottom: 24px;
}

.section-title .accent {
  color: var(--accent);
}

.section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-title-row .section-title {
  margin-bottom: 0;
}

.section-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 40px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 60px;
  align-items: start;
}

.about-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.about-table {
  width: 100%;
  border-collapse: collapse;
}

.about-table th,
.about-table td {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 0.95rem;
}

.about-table tr:first-child th,
.about-table tr:first-child td {
  border-top: none;
}

.about-table th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  width: 40%;
}

.about-table td {
  font-weight: 700;
  color: var(--text);
}

.about-text .section-lead {
  margin-bottom: 0;
}

/* Activities */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 24px;
}

@property --activity-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.activity-card {
  position: relative;
  border-radius: 10px;
  padding: 32px 28px;
  background: var(--bg);
  border: 2px solid transparent;
  border-image-slice: 1;
  border-image-source: conic-gradient(
    from var(--activity-angle),
    var(--line) 0deg,
    var(--line) 108deg,
    var(--accent-dim) 140deg,
    var(--accent) 164deg,
    var(--accent) 172deg,
    var(--accent-dim) 180deg,
    var(--line) 180deg,
    var(--line) 288deg,
    var(--accent-dim) 320deg,
    var(--accent) 344deg,
    var(--accent) 352deg,
    var(--accent-dim) 360deg
  );
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: activity-border-spin 5s linear infinite;
}

.activity-card:nth-child(2) {
  animation-delay: -1.7s;
}

.activity-card:nth-child(3) {
  animation-delay: -3.4s;
}

@keyframes activity-border-spin {
  to {
    --activity-angle: 360deg;
  }
}

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

.activity-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -26px var(--accent-glow);
}

.activity-index {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 20px;
  transition: text-shadow 0.25s ease;
}

.activity-card:hover .activity-index {
  text-shadow: 0 0 12px var(--accent-glow);
}

.activity-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.activity-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-dim);
  min-height: 4.85rem;
}

/* Study */
.study-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 24px;
}

.study-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 36px 28px;
  background: var(--bg);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.study-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 85% 0%, var(--accent-glow) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.study-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -28px var(--accent-glow);
}

.study-card:hover::before {
  opacity: 1;
}

.study-day {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  text-shadow: 0 0 24px var(--accent-glow);
  transition: text-shadow 0.3s ease;
}

.study-card:hover .study-day {
  text-shadow: 0 0 12px var(--accent), 0 0 36px var(--accent-glow);
}

.study-card-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-dim);
  min-height: 4.85rem;
}

/* Hover-reveal detail panel (shared by activity + study cards) */
/* Expands in-flow (CSS grid 0fr -> 1fr) so it only ever pushes the
   card's own content — it can never float over neighboring cards or
   the section below. */
.card-detail-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.activity-card:hover .card-detail-wrap,
.study-card:hover .card-detail-wrap {
  grid-template-rows: 1fr;
}

.card-detail {
  overflow: hidden;
  min-height: 0;
}

.card-detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    repeating-linear-gradient(45deg, rgba(57, 255, 157, 0.05) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text-dim);
}

.card-detail-media svg {
  width: 28px;
  height: 28px;
  opacity: 0.7;
}

.card-detail-text {
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-dim);
}

@media (prefers-reduced-motion: reduce) {
  .card-detail-wrap {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.social-link:hover {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- Admin ---------- */

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
}

/* 지원서 승인/멤버 관리 tables need more room than the default 1200px —
   7 data columns plus a 처리 cell that (as of the reset-password button)
   holds 3 unwrapped action buttons no longer fits at 1200 and forces the
   table into horizontal scroll. Widened just for these two pages rather
   than every .admin-main page, most of which don't need it. */
#applicationsPage,
#membersPage {
  max-width: 1400px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 24px;
}

.admin-tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-tab:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.admin-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  background: var(--bg-soft);
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-table th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

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

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-actions-cell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.admin-attachment-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-attachment-link {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.admin-attachment-link:hover {
  text-decoration: underline;
}

/* A row's title linking out to its edit page (notices/wargames/CTF
   events) — same look as .admin-attachment-link but a separate class so
   the attachment-download click handler (which targets
   .admin-attachment-link specifically) never intercepts it. */
.admin-row-link {
  color: var(--accent);
  font-weight: 600;
}

.admin-row-link:hover {
  text-decoration: underline;
}

.admin-attachment-none {
  color: var(--text-dim);
}

.admin-attachment-remove {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-attachment-remove:hover {
  border-color: rgba(255, 90, 90, 0.6);
  color: #ff8080;
  background: rgba(255, 90, 90, 0.08);
}

.admin-attachment-upload {
  cursor: pointer;
}

.admin-attachment-upload-btn {
  padding: 4px 10px;
  font-size: 0.72rem;
}

.admin-action-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-action-approve:hover,
.admin-action-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.admin-action-reject:hover {
  border-color: rgba(255, 90, 90, 0.6);
  color: #ff8080;
  background: rgba(255, 90, 90, 0.08);
}

.admin-action-promote:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.admin-action-demote:hover {
  border-color: rgba(255, 176, 60, 0.6);
  color: #ffb03c;
  background: rgba(255, 176, 60, 0.08);
}

.admin-action-withdraw:hover {
  border-color: rgba(255, 90, 90, 0.6);
  color: #ff8080;
  background: rgba(255, 90, 90, 0.08);
}

.admin-action-reset-pw:hover {
  border-color: rgba(90, 200, 255, 0.6);
  color: #5ac8ff;
  background: rgba(90, 200, 255, 0.08);
}

.admin-action-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.admin-row-admin td {
  color: #c792ff;
}

.admin-row-admin:hover {
  background: rgba(199, 146, 255, 0.08);
}

.admin-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.admin-status-pending {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
}

.admin-status-approved {
  color: var(--accent);
  background: var(--accent-glow);
}

.admin-status-rejected {
  color: #ff8080;
  background: rgba(255, 90, 90, 0.1);
}

.admin-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.admin-state[hidden] {
  display: none;
}

.admin-state-error {
  color: #ff8080;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.admin-stat-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.admin-stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.admin-stat-value {
  margin-top: 10px;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}

.admin-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.admin-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.tier-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tier-chart-row {
  display: grid;
  grid-template-columns: 70px 1fr 60px;
  align-items: center;
  gap: 14px;
}

.tier-chart-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.tier-chart-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.tier-chart-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.tier-chart-count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: right;
}

/* Keep the numeric keyboard/validation of type="number" but drop the
   browser's up/down stepper — direct typing only. Used by the
   container-port field on wargame-write.html. */
.form-field input[type="number"]::-webkit-inner-spin-button,
.form-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-field input[type="number"] {
  -moz-appearance: textfield;
}

/* Category/difficulty pickers on wargame-write.html — a fully custom
   listbox (js/admin.js's initWgSelect), not a native <select>. A native
   select's OPEN dropdown popup is drawn by the OS/browser and can't be
   themed at all, which was the actual complaint (the closed box already
   looked fine) — this swaps in plain HTML for the open menu so every
   part of it matches the dark theme. One flat neutral look for every
   value (border var(--line), faint background, dim text) — the same
   look "Misc" always had — rather than a different accent color per
   category/difficulty. */
.wg-select {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.wg-select:focus,
.wg-select:focus-visible {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.wg-select:hover {
  box-shadow: 0 0 0 1px var(--accent-dim) inset;
}

.wg-select-caret {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.wg-select[aria-expanded="true"] .wg-select-caret {
  transform: rotate(180deg);
}

.wg-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7);
  max-height: 260px;
  overflow-y: auto;
}

.wg-select-menu[hidden] {
  display: none;
}

/* Plain uniform text — same color as any other dropdown/list item on
   the site. Only the closed trigger box tints by value (see
   .wg-select.wg-tint-* below); the open option list stays neutral. */
.wg-select-menu [role="option"] {
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.wg-select-menu [role="option"]:hover,
.wg-select-menu [role="option"][aria-selected="true"] {
  background-color: rgba(255, 255, 255, 0.07);
}

.admin-quicklinks-panel {
  margin-top: 24px;
}

/* Grid (not flex-wrap) so the 5 buttons always share one row at equal
   width and never wrap onto their own centered line — flex-wrap did
   that as soon as the row's total width (~1000px) didn't fit the
   viewport, which stranded the last button alone and looked like
   everything had collapsed toward the middle. */
.admin-quicklinks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.admin-quicklink {
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Lab (wargames) ---------- */
.lab-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.lab-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.lab-filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lab-filter-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.lab-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.lab-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, padding-right 0.2s ease;
}

.lab-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

/* Personal solved status — uses the card's otherwise-empty right edge as
   a full-height accent rail, so a member can tell their own solved/
   unsolved problems apart at a glance without reading the (separate,
   site-wide) First Blood badge. */
.lab-card-solved-mark {
  display: none;
}

.lab-card-solved {
  padding-right: 66px;
}

.lab-card-solved .lab-card-solved-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52px;
  background: linear-gradient(180deg, rgba(57, 255, 157, 0.12), rgba(57, 255, 157, 0.03));
  border-left: 1px solid rgba(57, 255, 157, 0.18);
  color: var(--accent);
}

.lab-card-solved .lab-card-solved-mark svg {
  width: 24px;
  height: 24px;
}

.lab-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lab-card-category {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.lab-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 4px;
}

.lab-fb-badge {
  align-self: flex-start;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.lab-fb-badge-solved {
  color: var(--accent);
  background: var(--accent-glow);
}

.lab-fb-badge-unsolved {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
}

.lab-card-meta {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.lab-card-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
}

.lab-instance {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lab-instance-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.lab-instance-url-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lab-instance-url {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-all;
}

.lab-instance-url:hover {
  text-decoration: underline;
}

.lab-instance-conn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.lab-instance-conn-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.lab-instance-conn-value {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  word-break: break-all;
}

.lab-instance-copy-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lab-instance-copy-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.lab-instance-expiry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.lab-instance-expiry svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.lab-flag-submit label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.lab-flag-row {
  display: flex;
  gap: 8px;
}

.lab-flag-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.lab-flag-input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.lab-submit-btn {
  flex: 0 0 auto;
}

.lab-stop-btn {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lab-stop-btn:hover {
  border-color: rgba(255, 90, 90, 0.6);
  color: #ff8080;
  background: rgba(255, 90, 90, 0.08);
}

/* ---------- Lab detail (lab-wargame.html) ---------- */
.lab-detail-main {
  max-width: 760px;
}

.lab-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.lab-back-link svg {
  width: 15px;
  height: 15px;
}

.lab-back-link:hover {
  color: var(--accent);
}

.lab-detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.lab-detail[hidden] {
  display: none;
}

.lab-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lab-category-pill {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lab-category-web {
  color: var(--accent);
  background: var(--accent-glow);
}

.lab-category-pwn {
  color: #ff8080;
  background: rgba(255, 90, 90, 0.1);
}

.lab-category-reversing {
  color: #c792ff;
  background: rgba(199, 146, 255, 0.1);
}

.lab-category-forensic {
  color: #ffb03c;
  background: rgba(255, 176, 60, 0.1);
}

.lab-category-crypto {
  color: #5cc8ff;
  background: rgba(92, 200, 255, 0.1);
}

.lab-category-misc {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
}

.lab-points-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}

.lab-detail-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 10px;
}

.lab-detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lab-difficulty-badge {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.lab-difficulty-bronze {
  color: #d99a5b;
  background: rgba(184, 115, 51, 0.15);
}

.lab-difficulty-silver {
  color: #dfe5e8;
  background: rgba(196, 204, 209, 0.12);
}

.lab-difficulty-gold {
  color: #ffcf5c;
  background: rgba(255, 176, 60, 0.15);
}

.lab-difficulty-diamond {
  color: var(--accent);
  background: var(--accent-glow);
}

.lab-difficulty-master {
  color: #cbb2ff;
  background: rgba(185, 140, 255, 0.18);
}

.lab-detail-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.lab-detail-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-dim);
}

.lab-detail-meta-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.lab-detail-meta-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.lab-detail-meta-value {
  font-size: 0.92rem;
  color: var(--text);
}

.lab-attachment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lab-attachment-card[hidden] {
  display: none;
}

.lab-attachment-card svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}

.lab-attachment-card:hover {
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.lab-attachment-card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.lab-attachment-card-name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
}

.lab-instance-panel {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.lab-instance-panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.lab-instance-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--text-dim);
  text-align: center;
}

.lab-instance-empty svg {
  width: 26px;
  height: 26px;
  opacity: 0.6;
}

.lab-instance-empty p {
  font-size: 0.88rem;
}

.lab-instance-start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.lab-instance-start p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- Ranking ---------- */
.ranking-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  margin: 4px 0 40px;
  flex-wrap: wrap;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 210px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.podium-slot:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
}

.podium-rank-1 {
  order: 2;
  padding-top: 16px;
  padding-bottom: 30px;
  border-color: rgba(255, 176, 60, 0.5);
  background: linear-gradient(160deg, rgba(255, 176, 60, 0.14), var(--bg-soft) 75%);
  box-shadow: 0 24px 50px -28px rgba(255, 176, 60, 0.6);
}

.podium-rank-2 {
  order: 1;
  border-color: rgba(196, 204, 209, 0.4);
  background: linear-gradient(160deg, rgba(196, 204, 209, 0.1), var(--bg-soft) 75%);
}

.podium-rank-3 {
  order: 3;
  border-color: rgba(184, 115, 51, 0.4);
  background: linear-gradient(160deg, rgba(184, 115, 51, 0.12), var(--bg-soft) 75%);
}

.podium-crown {
  width: 22px;
  height: 22px;
  color: #ffcf5c;
}

.podium-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
}

.podium-rank-1 .podium-medal {
  color: #ffcf5c;
  background: rgba(255, 176, 60, 0.18);
}

.podium-rank-2 .podium-medal {
  color: #dfe5e8;
  background: rgba(196, 204, 209, 0.15);
}

.podium-rank-3 .podium-medal {
  color: #d99a5b;
  background: rgba(184, 115, 51, 0.18);
}

.podium-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
}

.podium-rank-1 .podium-avatar {
  width: 76px;
  height: 76px;
  font-size: 1.5rem;
}

.podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
}

.podium-nickname {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.podium-score {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}

/* Row-card list — each member is their own bordered card (like
   .lab-card/.solved-item elsewhere) instead of table rows, matching a
   reference leaderboard the user linked: rank number, avatar with a
   small medal badge for the top 3, name + a nickname/study/grade
   subtitle line, and a big pill-shaped score chip pinned to the right. */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-row-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ranking-row-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.ranking-card-rank {
  flex-shrink: 0;
  width: 28px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-dim);
  text-align: center;
}

.ranking-card-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}

.ranking-card-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.ranking-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Same rank colors as the podium's medal circles above, just small
   enough to sit in the avatar's corner. */
.ranking-card-medal {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-soft);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.6rem;
  color: #1a1206;
}

.ranking-card-medal-1 {
  background: #ffcf5c;
}

.ranking-card-medal-2 {
  background: #dfe5e8;
}

.ranking-card-medal-3 {
  background: #d99a5b;
}

.ranking-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ranking-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-card-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.ranking-card-dot {
  opacity: 0.5;
}

.ranking-card-score {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
}

/* Same palette as .profile-track-block (js/profile.js), just smaller —
   a pill instead of a full block, sized for the card's subtitle line. */
.ranking-study-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.ranking-study-badge.track-0day {
  border-color: rgba(92, 225, 255, 0.4);
  background: rgba(92, 225, 255, 0.1);
  color: #5ce1ff;
}

.ranking-study-badge.track-1day {
  border-color: rgba(255, 176, 60, 0.4);
  background: rgba(255, 176, 60, 0.12);
  color: #ffcf5c;
}

.ranking-study-badge.track-nday {
  border-color: rgba(185, 140, 255, 0.4);
  background: rgba(185, 140, 255, 0.12);
  color: #cbb2ff;
}

/* ---------- Notices ---------- */
.notice-date-col {
  width: 140px;
  white-space: nowrap;
}

.notice-views-col {
  width: 90px;
  white-space: nowrap;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.notice-row {
  cursor: pointer;
}

.notice-row-pinned td {
  background: rgba(57, 255, 157, 0.04);
}

.notice-pin-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 9px;
  margin-right: 10px;
  border-radius: 999px;
  border: 1px solid rgba(57, 255, 157, 0.4);
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* js/notice-detail.js toggles this badge via the `hidden` attribute —
   without this, .notice-pin-badge's own `display: inline-flex` above
   would beat the UA [hidden] rule at equal specificity (same recurring
   pattern as .lab-solved-badge/.profile-save-btn elsewhere in this
   file). */
.notice-pin-badge[hidden] {
  display: none;
}

.notice-title-cell {
  font-weight: 600;
}

.notice-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.notice-pagination[hidden] {
  display: none;
}

.notice-page-btn {
  padding: 8px 18px;
}

.notice-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.notice-page-status {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ---------- Notice detail (public) ---------- */
.notice-detail {
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.notice-detail-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.notice-detail-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.notice-detail-views {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.notice-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Notice content typography (rendered markdown) ----------
   Shared by the admin write-page's live preview and the public
   notice-detail page, so what an admin sees while writing is exactly
   what members see after publishing. */
.notice-content {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text);
}

.notice-content > *:first-child {
  margin-top: 0;
}

.notice-content h1,
.notice-content h2,
.notice-content h3,
.notice-content h4,
.notice-content h5,
.notice-content h6 {
  margin: 24px 0 12px;
  font-weight: 700;
  line-height: 1.4;
}

.notice-content h1 {
  font-size: 1.5rem;
}
.notice-content h2 {
  font-size: 1.3rem;
}
.notice-content h3 {
  font-size: 1.12rem;
}
.notice-content h4,
.notice-content h5,
.notice-content h6 {
  font-size: 1rem;
}

.notice-content p {
  margin: 0 0 16px;
}

.notice-content ul,
.notice-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.notice-content li {
  margin-bottom: 6px;
}

.notice-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notice-content strong {
  color: var(--text);
  font-weight: 700;
}

.notice-content code {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.notice-content pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  overflow-x: auto;
}

.notice-content pre code {
  padding: 0;
  background: none;
}

.notice-content blockquote {
  margin: 0 0 16px;
  padding: 4px 16px;
  border-left: 3px solid var(--accent-dim);
  color: var(--text-dim);
}

.notice-content blockquote p {
  margin-bottom: 0;
}

.notice-content hr {
  margin: 24px 0;
  border: none;
  border-top: 1px solid var(--line);
}

/* ---------- Notice write/edit (admin) ---------- */
.notice-pin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
}

.notice-pin-toggle input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* stretch (not start) so both columns take the same row height, then
   each column's own height:100% + the textarea/preview's flex:1 make
   the two boxes match exactly instead of each sizing to its own
   content. */
.notice-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.notice-editor-grid .form-field {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* The base .form-field's margin-bottom would otherwise make this
     column's stretched height differ from .notice-editor-preview-wrap's
     (which has no such margin) by that same amount. */
  margin-bottom: 0;
}

.notice-editor-textarea {
  flex: 1;
  min-height: 420px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Higher specificity than the generic `.form-field textarea` rule
   (which sets resize: vertical) — free resizing is exactly what would
   knock this out of sync with the preview box next to it. */
.notice-editor-grid textarea.notice-editor-textarea {
  resize: none;
}

.notice-editor-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.notice-editor-preview-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.notice-editor-preview {
  flex: 1;
  min-height: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  overflow-y: auto;
}

/* Pairs of related fields (category+difficulty, docker image+port) side
   by side on the write pages instead of stacking every field full-width. */
.admin-write-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 제목/카테고리/공동 작업자를 한 줄에 — 과제 작성 페이지에서만 쓰는
   3열 변형. 워게임/CTF 작성 페이지의 기본 2열 .admin-write-row는
   그대로 둔다. */
.admin-write-row-3 {
  grid-template-columns: 1.4fr 1fr 1.6fr;
}

.admin-write-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- CTF Calendar ---------- */
.calendar-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 24px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.calendar-nav-btn {
  padding: 8px;
  line-height: 0;
}

.calendar-nav-btn svg {
  width: 18px;
  height: 18px;
}

.calendar-month-label {
  /* Fixed (not min-) width so the label never resizes between e.g.
     "9월" and "12월" — a resize here reflows the whole centered header
     and visibly shifts the nav buttons too. */
  width: 160px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  /* Column gap AND horizontal padding must both match .calendar-week's
     below, or the day-of-week labels drift out of column alignment with
     the day grid under them (this was the actual bug — the two had
     different horizontal padding: 0 here vs 2px there). */
  column-gap: 10px;
  padding: 0 4px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  /* Matches .calendar-daynum's left alignment below (see its comment) —
     otherwise the day-of-week label would sit centered over a column
     while that column's actual day numbers sit at its left edge. */
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* No gap between weeks — a thin bottom border on each week (below)
   divides them instead, so the whole month reads as one continuous
   card (like CTFd's calendar) rather than a stack of separate
   week-cards floating with gaps between them. .calendar-wrap already
   supplies the one outer border/radius for the whole thing. */
.calendar-grid {
  display: flex;
  flex-direction: column;
}

/* One grid per week — day numbers sit in row 1, event bars stack in the
   rows below via explicit grid-row placement (see js/calendar.js). A
   bar that spans multiple day columns is a single grid item, so CSS
   Grid renders it as one unbroken shape with no gap where it crosses
   cell boundaries — that's what makes a multi-day event "connect"
   across the week instead of showing as separate chips per day. */
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: auto;
  gap: 4px 10px;
  /* Horizontal padding matches .calendar-weekdays above (see its
     comment). min-height reserves room for one event-bar row even on
     weeks with no events, so week-to-week height stays consistent
     instead of jumping between "just a number" and "number + bar" —
     that jump was what read as columns not lining up. Top/bottom
     padding (not a flex gap — .calendar-grid deliberately has none, so
     the border-bottom divider stays continuous) is the breathing room
     between one week and the next. */
  min-height: 70px;
  padding: 16px 4px 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-week:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

/* Left-aligned, not centered — a grid item stretches to fill its whole
   day cell, and a multi-day event bar always starts flush with that
   same cell's left edge (see js/calendar.js). Centering the number left
   it floating mid-cell with no shared reference point, so a bar
   starting under, say, the 4th read as if it started under the 3rd —
   the eye anchored to the number's center, not the cell boundary the
   bar actually used. Left-aligning both to the same edge removes the
   ambiguity. */
.calendar-daynum {
  grid-row: 1;
  padding: 2px 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: left;
}

.calendar-daynum-outside {
  opacity: 0.35;
}

.calendar-daynum-today {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  /* Left-aligned like every other .calendar-daynum, not centered — see
     its comment. Today's cell needs to share the same left-edge
     reference as the rest, or it'd be the one day where the ambiguity
     this was all fixing comes right back. */
  margin: 2px 0 0 2px;
  color: var(--bg);
  background: var(--accent);
  border-radius: 50%;
  font-weight: 800;
  box-shadow: 0 0 14px -2px var(--accent-glow);
}

.calendar-bar {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 4px 4px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.calendar-bar:hover {
  background: rgba(57, 255, 157, 0.25);
}

/* Rounded only on the edge where the event actually starts/ends —
   left/right plain (square) on whichever edge is a mid-week
   continuation, so the bar visually "keeps going" into the next/from
   the previous week's row instead of looking like its own event. */
.calendar-bar-start {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  padding-left: 8px;
}

.calendar-bar-end {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* ---------- Active recruit feed (bottom of calendar.html) ---------- */
.recruit-feed {
  margin-top: 40px;
}

.recruit-feed-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.recruit-feed-lead {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.recruit-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.recruit-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.recruit-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.recruit-card-event {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.recruit-card-content {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.recruit-card-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.recruit-card-author {
  font-size: 0.82rem;
  font-weight: 600;
}

.recruit-card-nickname {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 400;
}

.recruit-card-date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.recruit-card-stats {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.recruit-card-applicants {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

.recruit-card-applicants-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.recruit-card-applicant {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* ---------- CTF event detail + team recruiting ---------- */
.ctf-event-link-btn {
  display: flex;
  width: fit-content;
  margin: 4px auto 20px;
}

/* .btn-secondary's `display: inline-flex` otherwise beats the UA
   `[hidden]{display:none}` rule at equal specificity — same recurring
   fix as .profile-save-btn/.lab-solved-badge elsewhere in this file. */
.ctf-event-link-btn[hidden] {
  display: none;
}

.team-recruit-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.team-recruit-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.team-recruit-lead {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.team-recruit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.team-recruit-form textarea {
  min-height: 80px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  resize: vertical;
}

.team-recruit-form textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.team-recruit-form-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.team-recruit-target-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.team-recruit-target-field input {
  width: 100px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

.team-recruit-target-field input:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Inline edit — replaces one .team-recruit-item's normal display with
   the same textarea+target-size+footer shape as the create form above,
   toggled per-item by js/ctf-event-detail.js (editingRecruitId). */
.team-recruit-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.team-recruit-edit-content {
  min-height: 70px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  resize: vertical;
}

.team-recruit-edit-content:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.team-recruit-edit-actions {
  display: flex;
  gap: 8px;
}

.team-recruit-edit-cancel,
.team-recruit-edit-save {
  padding: 7px 14px;
  font-size: 0.78rem;
}

.team-recruit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-recruit-item {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.team-recruit-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.team-recruit-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.team-recruit-nickname {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 400;
}

.team-recruit-date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.team-recruit-content {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.team-recruit-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.team-recruit-applicants {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.82rem;
}

.team-recruit-applicants-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.team-recruit-applicant {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--text);
  font-weight: 600;
}

.team-recruit-actions {
  display: flex;
  gap: 8px;
}

.team-recruit-delete,
.team-recruit-edit-btn,
.team-recruit-apply {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.team-recruit-delete:hover {
  border-color: rgba(255, 90, 90, 0.6);
  color: #ff8080;
  background: rgba(255, 90, 90, 0.08);
}

.team-recruit-edit-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-glow);
}

.team-recruit-apply {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.team-recruit-apply:hover {
  background: var(--accent-glow);
}

.team-recruit-apply-active {
  background: var(--accent-glow);
}

/* ---------- Custom date/time picker (ctf-event-write.html) ---------- */
.dt-picker {
  position: relative;
}

.dt-picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.dt-picker-trigger:hover {
  box-shadow: 0 0 0 1px var(--accent-dim) inset;
}

.dt-picker-trigger:focus,
.dt-picker-trigger:focus-visible {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.dt-picker-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #fff;
}

.dt-picker-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-picker-value.dt-picker-value-set {
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-mono);
}

.dt-picker-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 280px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7);
}

.dt-picker-popup[hidden] {
  display: none;
}

.dt-picker-cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.dt-picker-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.dt-picker-nav-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-glow);
}

.dt-picker-nav-btn svg {
  width: 14px;
  height: 14px;
}

.dt-picker-month-label {
  min-width: 90px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.dt-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.dt-picker-weekdays span {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.dt-picker-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 12px;
}

.dt-picker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dt-picker-day:hover {
  background: rgba(255, 255, 255, 0.07);
}

.dt-picker-day-empty {
  cursor: default;
  pointer-events: none;
}

.dt-picker-day-today {
  color: var(--accent);
  font-weight: 700;
}

.dt-picker-day-selected {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.dt-picker-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  margin-bottom: 12px;
  border-top: 1px solid var(--line);
}

.dt-picker-time-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.dt-picker-hour,
.dt-picker-minute {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-align: center;
}

.dt-picker-hour:focus,
.dt-picker-minute:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.dt-picker-time-colon {
  color: var(--text-dim);
  font-weight: 700;
}

.dt-picker-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dt-picker-today-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.dt-picker-today-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.dt-picker-confirm-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .profile-page-inner {
    grid-template-columns: 1fr;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .study-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    width: 100%;
    height: calc(100svh - var(--nav-h));
    background: rgba(8, 9, 11, 0.97);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .hero-tagline {
    max-width: 26ch;
  }
}

/* ---------- 과제 게시판 (Write-up / 프로젝트) ---------- */

.assignment-category-badge {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.assignment-category-writeup {
  color: var(--accent);
  background: var(--accent-glow);
}

.assignment-category-project {
  color: #c792ff;
  background: rgba(199, 146, 255, 0.1);
}

.assignment-card-author {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: -6px;
}

.assignment-author-nickname {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 400;
}

.assignment-author-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 10px 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.assignment-author {
  font-weight: 600;
  font-size: 0.92rem;
}

.assignment-coauthors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.assignment-coauthors-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 2px;
}

.assignment-coauthor-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--text);
  font-weight: 600;
}

/* Inline images inside rendered markdown content (notices never had
   these — only assignment write-ups do). Scoped to .notice-content so
   both the write page's live preview and the public detail page pick
   it up automatically. */
.notice-content img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 12px 0;
}

/* GitHub 이슈 작성창 방식 — 탭(내용/미리보기) + 툴바가 한 줄, 그 아래
   박스 하나에 textarea 또는 렌더링된 미리보기 중 하나만 보인다. */
.assignment-editor-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.assignment-editor-tabs {
  display: flex;
  gap: 18px;
}

.assignment-editor-tab {
  padding: 10px 2px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.assignment-editor-tab:hover {
  color: var(--text);
}

.assignment-editor-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.assignment-editor-toolbar {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
}

.assignment-editor-toolbar[hidden] {
  display: none;
}

.assignment-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.assignment-toolbar-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* These are click-to-act utility buttons, not "go to X" links, so the
   inherited .btn-secondary hover lift reads as unwanted jitter here —
   turn it off and keep only the color/glow feedback. */
.assignment-toolbar-btn:hover {
  transform: none;
}

.assignment-editor-box {
  margin-top: 12px;
}

/* .form-field textarea's min-height:44px (class+type, 0-1-1) otherwise
   beats .notice-editor-textarea's min-height:420px (single class,
   0-1-0) — in the old 2-column layout this never showed because the
   preview column's own 420px forced a matching row height via flex
   stretch; there's no such neighbor here now that write/preview share
   one box, so it has to be won outright. */
.assignment-editor-box .notice-editor-textarea {
  min-height: 420px;
  /* A <textarea> isn't block-level — in the old 2-column layout it got
     full width for free by being a flex item with flex:1 inside a
     flex-column .form-field (see .notice-editor-grid .form-field
     above). No such flex parent here now, so its default `cols`-based
     intrinsic width (~20 characters) otherwise shows through. */
  width: 100%;
}

.assignment-preview-placeholder {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.assignment-coauthor-field {
  position: relative;
}

.assignment-coauthor-input-wrap {
  position: relative;
}

.assignment-coauthor-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  list-style: none;
}

.assignment-coauthor-suggestions[hidden] {
  display: none;
}

.assignment-coauthor-suggestion {
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.assignment-coauthor-suggestion:hover {
  background: var(--accent-glow);
}

.assignment-files-panel {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.assignment-files-title {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.assignment-files-lead {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.assignment-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  list-style: none;
}

.assignment-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.assignment-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
}

a.assignment-file-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.assignment-file-size {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.assignment-file-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.assignment-file-delete svg {
  width: 14px;
  height: 14px;
}

.assignment-file-delete:hover {
  color: #ff8080;
  background: rgba(255, 90, 90, 0.1);
}

.assignment-file-delete:disabled {
  opacity: 0.5;
  cursor: default;
}

.assignment-file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.assignment-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}

.assignment-delete-btn:hover {
  border-color: rgba(255, 90, 90, 0.6);
  color: #ff8080;
  background: rgba(255, 90, 90, 0.12);
}

/* Same recurring [hidden] vs display fix as .profile-save-btn/
   .ctf-event-link-btn elsewhere in this file — each of these sets its
   own `display` (flex/inline-flex), which otherwise beats the UA
   `[hidden]{display:none}` rule at equal specificity once JS toggles
   the `hidden` attribute. */
.assignment-coauthors[hidden],
.assignment-detail-actions[hidden],
.assignment-edit-btn[hidden] {
  display: none;
}
