/* ── RESET ── */
* { box-sizing: border-box; }

/* ── BODY ── */
body {
  margin: 0;
  font-family: 'DM Sans', Arial, sans-serif;
  background: #0a0f1c;
  color: white;
  scrollbar-width: thin;
  scrollbar-color: #334155 #0a0f1c;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: #0a0f1c;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: #334155;
  border: 2px solid #0a0f1c;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

#modal-progress,
#modal-obby,
#modal-completion-obby,
#modal-password-reset,
#modal-email-confirm,
.obby-options {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0f172a;
}

#modal-progress::-webkit-scrollbar-track,
#modal-obby::-webkit-scrollbar-track,
#modal-completion-obby::-webkit-scrollbar-track,
#modal-password-reset::-webkit-scrollbar-track,
#modal-email-confirm::-webkit-scrollbar-track,
.obby-options::-webkit-scrollbar-track {
  background: #0f172a;
}

#modal-progress::-webkit-scrollbar-thumb,
#modal-obby::-webkit-scrollbar-thumb,
#modal-completion-obby::-webkit-scrollbar-thumb,
#modal-password-reset::-webkit-scrollbar-thumb,
#modal-email-confirm::-webkit-scrollbar-thumb,
.obby-options::-webkit-scrollbar-thumb {
  background: #334155;
  border-color: #0f172a;
}

/* ── TOP BAR ── */
#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #0b1220;
  border-bottom: 1px solid #1f2937;
  position: sticky;
  top: 0;
  z-index: 50;
}

#topbar button {
  margin-right: 6px;
  margin-top: 0;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #94a3b8;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
}

#topbar button:hover {
  background: #1f2937;
  color: white;
  transform: none;
}

#nav-auth-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(192, 132, 252, 0.55);
  background: rgba(192, 132, 252, 0.16);
  color: #d8b4fe;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.nav-user {
  color: #ffffff !important;
  background: #9333ea !important;
  border-color: #c084fc !important;
}

.nav-admin {
  color: #d8b4fe;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── CONTAINER ── */
.container {
  max-width: 950px;
  margin: auto;
  padding: 30px;
}

.welcome-page {
  min-height: calc(100vh - 114px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 54px 0 18px;
}

.welcome-main {
  max-width: 780px;
  margin: auto;
  text-align: center;
}

.welcome-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.welcome-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.welcome-title-row h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

.welcome-main p {
  margin: 22px auto 0;
  max-width: 720px;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.65;
}

.welcome-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 42px auto 0;
  color: #94a3b8;
  font-size: 14px;
  text-decoration: none;
}

.welcome-contact:hover {
  color: #e2e8f0;
}

.discord-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.register-hint {
  color: #94a3b8;
  font-size: inherit;
  font-weight: 600;
}

.progress-page {
  padding: 24px 0 40px;
}

.progress-username {
  margin: 0 0 18px;
  font-size: 42px;
  line-height: 1.1;
}

.progress-ranking {
  margin: -8px 0 18px;
  color: #c084fc;
  font-size: 18px;
  font-weight: 900;
}

.progress-summary {
  color: #cbd5e1;
  margin-bottom: 10px;
}

.progress-summary p {
  margin: 5px 0;
}

.muted-text {
  color: #94a3b8;
}

.progress-track {
  display: block;
  width: 100%;
  height: 12px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #1f2937;
}

.progress-track.small {
  height: 9px;
  margin-top: 10px;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #c084fc;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.progress-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.progress-tier-card {
  margin: 0;
  padding: 16px;
  background: #0f172a;
  border: 1px solid #263451;
  color: white;
  text-align: left;
  border-radius: 8px;
  transform: none;
}

.progress-tier-card:hover,
.progress-tier-card.active {
  background: #182235;
  border-color: #c084fc;
  transform: none;
}

.progress-tier-title {
  display: block;
  margin-bottom: 8px;
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.progress-tier-card b {
  font-size: 22px;
}

.progress-obby-list {
  display: grid;
  gap: 7px;
}

.progress-obby-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 72px 150px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #0f172a;
  border-radius: 8px;
}

.progress-obby-name {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.completion-badge {
  justify-self: end;
  text-align: right;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.completion-badge.done {
  color: #4ade80;
}

.completion-badge.not-done {
  color: #f87171;
}

.progress-status {
  font-size: 13px;
}

.packs-page {
  padding: 24px 0 40px;
}

.packs-page h1 {
  margin: 0 0 18px;
  font-size: 36px;
}

.packs-list {
  display: grid;
  gap: 16px;
}

.pack-card {
  background: #121a2a;
  border: 1px solid #263451;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.pack-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 24px;
}

.pack-difficulty {
  font-weight: 900;
  font-size: 18px;
}

.pack-reward {
  color: #cbd5e1;
  margin: 12px 0 10px;
  font-weight: 800;
}

.pack-overall {
  margin: 0 0 30px;
  max-width: 360px;
}

.pack-overall .progress-track {
  height: 10px;
}

.pack-overall .pack-count {
  text-align: left;
  margin-left: 0;
}

.pack-count {
  margin: 9px 0 0;
  color: #e2e8f0;
  font-weight: 900;
  text-align: center;
}

.pack-fill {
  background: #3b82f6;
}

.pack-completed-label,
.pack-modal-completed {
  color: #4ade80;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
}

.pack-action {
  display: block;
  margin: 14px auto 0;
  min-width: 150px;
  background: #3b82f6;
}

.pack-action.view {
  background: transparent;
  color: #60a5fa;
  border: 1px solid #1d4ed8;
}

.progress-modal-subtitle {
  margin: -6px 0 16px;
  text-align: center;
  color: #cbd5e1;
  font-size: 18px;
  font-weight: 900;
}

.xp-burst {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 1600;
  color: #c084fc;
  font-size: 42px;
  font-weight: 1000;
  pointer-events: none;
  animation: xp-burst 1.2s ease-out forwards;
}

@keyframes xp-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.86);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -85%) scale(1.08);
  }
}

#modal-progress-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#modal-progress {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 34px 34px 28px;
  width: 92%;
  max-width: 760px;
  max-height: 84vh;
  overflow-y: auto;
  position: relative;
}

#modal-progress h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 44px 16px;
  font-size: 26px;
  text-align: center;
}

.progress-modal-count {
  margin: 10px 0 4px;
  color: #e2e8f0;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.progress-section-title {
  text-align: center;
}

#progress-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-size: 15px;
}

#modal-role-choice-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#modal-role-choice {
  width: min(420px, 92vw);
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 30px;
  position: relative;
  text-align: center;
}

#modal-role-choice h2 {
  margin: 0 0 18px;
}

.role-choice-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.role-choice-actions button {
  min-width: 150px;
  margin-top: 0;
}

.role-admin {
  background: #6d28d9;
}

.role-progress {
  background: #3b82f6;
}

.role-or {
  color: #94a3b8;
  font-weight: 900;
  text-align: center;
}

#role-choice-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #64748b;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
  margin: 0;
}

/* ── CARDS ── */
.card {
  background: #121a2a;
  padding: 30px;
  margin-top: 30px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* ── INPUTS ── */
input {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: #0b1220;
  color: white;
  border: 1px solid #263451;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: #c084fc; }
input::placeholder { color: #4b5563; }

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: calc(50% + 6px);
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 1px solid #263451;
  color: #94a3b8;
  border-radius: 8px;
  font-size: 15px;
}

.password-toggle:hover {
  transform: translateY(-50%);
  background: #111827;
}

.obby-picker {
  margin-top: 12px;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  padding-left: 42px;
}

#completionObbySearch {
  cursor: pointer;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-34%);
  color: #64748b;
  font-size: 18px;
  pointer-events: none;
}

.obby-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
}

.obby-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  background: #0f172a;
  border: 1px solid #263451;
  border-radius: 8px;
  color: white;
  text-align: left;
}

.obby-option:hover,
.obby-option.selected {
  background: #182235;
  border-color: #c084fc;
  transform: none;
}

.picker-empty {
  margin: 0;
  padding: 10px 12px;
  color: #64748b;
}

#message-popups {
  position: fixed;
  right: 18px;
  top: 86px;
  display: grid;
  gap: 10px;
  z-index: 1200;
  width: min(360px, calc(100vw - 36px));
}

.message-popup {
  position: relative;
  background: #111827;
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-left: 4px solid #c084fc;
  border-radius: 12px;
  padding: 18px 42px 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  animation: message-pop-in 0.18s ease-out;
}

.message-popup.closing {
  animation: message-pop-out 0.18s ease-in forwards;
}

.message-popup h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.message-popup p {
  margin: 6px 0;
  color: #e2e8f0;
  font-size: 14px;
}

.message-text {
  margin-top: 10px !important;
  line-height: 1.45;
}

.message-status {
  font-weight: 900;
}

.status-accepted {
  color: #4ade80 !important;
}

.status-rejected {
  color: #f87171 !important;
}

.status-pending {
  color: #60a5fa !important;
}

.message-popup button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 1px solid #263451;
  color: #94a3b8;
}

.message-sender {
  margin-top: 14px !important;
  color: #c084fc !important;
  font-weight: 800;
  font-size: 13px !important;
}

.ban-message {
  border-left-color: #f87171;
}

.developer-granted-message {
  border-left-color: #a855f7;
}

.developer-granted-message h3,
.developer-granted-message .message-text {
  color: #c084fc;
}

.developer-removed-message {
  border-left-color: #ef4444;
}

.developer-removed-message h3,
.developer-removed-message .message-text {
  color: #f87171;
}

@keyframes message-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes message-pop-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

#page-submit label {
  display: block;
  margin-top: 24px;
  font-size: 18px;
  font-weight: 700;
}

.submit-heading {
  margin-top: 30px;
}

.submit-heading h1 {
  margin: 0;
  font-size: 28px;
}

.submit-heading p {
  margin: 8px 0 0;
  color: #f87171;
  font-size: 14px;
  font-weight: 700;
}

.submit-or {
  margin: 26px 0 -4px;
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  color: #c084fc;
}

.submit-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.inline-error {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  min-height: 38px;
  color: #f87171;
  font-size: 14px;
  font-weight: 700;
}

.inline-ok {
  color: #4ade80;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  margin-top: 0;
  background: transparent;
  border: 1px solid #263451;
  color: #94a3b8;
}

.auth-tabs button.active {
  background: #c084fc;
  border-color: #c084fc;
  color: white;
}

/* ── BUTTONS ── */
.login-action-row,
.reset-confirm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-register-note {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.post-register-note.hidden {
  display: none;
}

.forgot-link,
.resend-link {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  color: #94a3b8;
  transform: none;
}

.forgot-link:hover {
  color: #cbd5e1;
  transform: none;
  opacity: 1;
}

.resend-link {
  margin-top: 0;
  color: #60a5fa;
}

.resend-link:hover {
  color: #93c5fd;
  transform: none;
  opacity: 1;
}

.reset-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: #cbd5e1;
}

.reset-support {
  margin-top: 14px;
  padding: 14px;
  background: #0f172a;
  border: 1px solid #263451;
  border-radius: 8px;
  text-align: center;
}

.reset-support p {
  margin: 0 0 10px;
  color: #cbd5e1;
}

.reset-resend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: #94a3b8;
  font-size: 14px;
}

button {
  margin-top: 14px;
  padding: 10px 18px;
  background: #c084fc;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  transition: 0.15s;
}

button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ── PAGE SYSTEM ── */
.page.hidden { display: none; }

/* ── DIFFICULTY BAR ── */
.difficultyBarContainer,
#difficultyBarContainer {
  height: 10px;
  width: 100%;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.difficultyBar,
#difficultyBar {
  height: 100%;
  width: 0%;
  background: #c084fc;
  border-radius: 8px;
  transition: width 0.25s, background 0.25s, box-shadow 0.25s;
}

.difficultyPreview,
#difficultyPreview {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  min-height: 20px;
}

/* ── LEADERBOARD LIST ── */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.sort-controls span {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

.sort-controls button {
  margin: 0;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid #263451;
  color: #94a3b8;
  font-size: 12px;
}

.sort-controls button.active {
  background: #c084fc;
  border-color: #c084fc;
  color: white;
}

#list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

#list li {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: #0f172a;
  margin-top: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

#list li:hover { background: #182235; }

#list li.empty-list-row,
#obby-list li.empty-list-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  color: #64748b;
  cursor: default;
}

#list li.empty-list-row:hover,
#obby-list li.empty-list-row:hover {
  background: #0f172a;
}

#obby-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

#obby-list li {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: #0f172a;
  margin-top: 6px;
  border-radius: 8px;
  cursor: pointer;
}

#obby-list li:hover { background: #182235; }

.obby-rank,
.obby-score {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 800;
}

.obby-name {
  font-size: 15px;
  font-weight: 600;
}

.account-message {
  margin-top: 10px;
  padding: 10px 12px;
  background: #0f172a;
  border-left: 3px solid #f87171;
  border-radius: 6px;
  color: #e2e8f0;
}

.lb-rank {
  font-weight: 700;
  color: #c084fc;
  font-size: 14px;
  min-width: 42px;
}

.lb-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.lb-level {
  font-size: 13px;
  color: #64748b;
}

/* ── HIDDEN ── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════
   PROFILE MODAL
═══════════════════════════════════════ */

/* Overlay */
#modal-profile-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#modal-obby-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#modal-completion-obby-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#modal-password-reset-bg,
#modal-email-confirm-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

#modal-obby {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px 36px 28px;
  width: 90%;
  max-width: 620px;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}

#modal-completion-obby {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 620px;
  max-height: 82vh;
  overflow: hidden;
  position: relative;
}

#modal-password-reset,
#modal-email-confirm {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 30px;
  width: 90%;
  max-width: 460px;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}

#modal-password-reset h2,
#modal-email-confirm h2 {
  margin: 0 40px 8px 0;
}

#obby-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-size: 18px;
}

#completion-obby-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-size: 15px;
}

#password-reset-close-btn,
#email-confirm-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-size: 15px;
}

#modal-completion-obby h2 {
  margin: 0 0 14px;
  padding-right: 40px;
}

.modal-search {
  margin-bottom: 12px;
}

#obby-title {
  margin: 0 0 14px;
  padding-right: 40px;
}

#obby-details p {
  margin: 7px 0;
  color: #e2e8f0;
}

.obby-meta-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 56px;
  flex-wrap: wrap;
}

.verified-by-link {
  color: #60a5fa;
  font-weight: 800;
  text-decoration: none;
}

.verified-by-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.victor-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  width: 100%;
  gap: 12px;
  padding: 7px 0 9px;
  margin: 0;
  align-items: start;
  background: transparent;
  color: #e2e8f0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.victor-row:hover {
  background: transparent;
  color: white;
  transform: none;
}

.victor-row span:first-child {
  transform: translateY(-2px);
}

/* Modal box */
#modal-profile {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px 36px 28px;
  width: 90%;
  max-width: 540px;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}

/* Close button */
#prof-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid #1f2937;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s;
}

#prof-close-btn:hover {
  background: #1f2937;
  color: white;
  transform: none;
}

/* Player name */
#profile-username {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.3px;
  padding-right: 40px; /* don't overlap X button */
}

/* XP / Level / Rank block */
#profile-count {
  margin-bottom: 6px;
}

#profile-count p {
  margin: 5px 0;
  font-size: 15px;
  color: #e2e8f0;
}

#profile-count b { color: white; }

/* Section titles */
.prof-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: white;
}

/* ── Stats rows ── */
.prof-row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.prof-tier-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.bold-white { color: white; }

.prof-count {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  color: #cbd5e1;
  min-width: 90px;
  text-align: right;
}

.prof-pct {
  font-size: 13px;
  color: #64748b;
  min-width: 52px;
  text-align: right;
}

/* ── Completion rows ── */
.prof-comp-row {
  display: flex;
  align-items: center;
  padding: 9px 0;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.prof-comp-rank {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  min-width: 46px;
}

.prof-comp-name {
  flex: 1;
  font-size: 14px;
  color: #e2e8f0;
}

.prof-comp-score {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .container { padding: 14px; }
  #modal-profile { padding: 24px 18px; }
  #profile-username { font-size: 21px; }
}
