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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #8ed3cd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  position: fixed;
  inset: 0;
}

canvas {
  display: block;
}

.hud {
  position: fixed;
  z-index: 10;
  color: #ffffff;
}

#topbar {
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff !important;
  font-family: 'Fira Code', 'Orbitron', 'Geist', 'Inter', monospace, sans-serif;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 20px rgba(0, 210, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge:hover {
  border-color: var(--cx-accent, #00d2ff);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 210, 255, 0.4);
  transform: translateY(-2px);
  padding: 12px 26px;
}

.badge b {
  color: var(--cx-accent, #00d2ff);
}

.badge>svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Topbar Hover Expansion & CyberOS Font Styling */
#topbar .badge>span:not(#notifBadge) {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
  font-family: 'Fira Code', 'Orbitron', 'Geist', 'Inter', monospace, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin-left 0.3s ease;
  margin-left: 0;
}

#topbar .badge:hover>span:not(#notifBadge),
#topbar .badge:focus-visible>span:not(#notifBadge) {
  max-width: 280px;
  opacity: 1;
  margin-left: 8px;
}

.navDistText {
  font-family: 'Fira Code', 'Orbitron', 'Geist', 'Inter', monospace, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cx-accent, #00d2ff);
  margin-left: 6px;
  white-space: nowrap;
}

/* 🚉 Station Navigator — CipherX cxCard style fast travel modal */
#station .cxCard {
  width: 480px;
  max-width: calc(100vw - 32px);
}

.stationNavGrid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stationNavCard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stationNavCard:hover {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.12);
  border-color: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 16px var(--cx-accent-subtle, rgba(0, 210, 255, 0.15));
}

.stationNavCard:active {
  transform: translateY(1px);
}

.stationNavCard .snIcon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stationNavCard .snMeta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stationNavCard .snTitle {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.stationNavCard:hover .snTitle {
  color: var(--cx-accent, #00d2ff);
}

.stationNavCard .snDesc {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
}

.stationNavCard .snArrow {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, color 0.2s ease;
}

.stationNavCard:hover .snArrow {
  color: var(--cx-accent, #00d2ff);
  transform: translateX(3px);
}

/* 🚉 City error / empty overlay */
#cityError {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 24, .82);
  backdrop-filter: blur(4px);
  padding: 22px;
  transition: opacity .2s ease;
}

#cityError.hidden {
  opacity: 0;
  pointer-events: none;
}

#cityError .ceCard {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 251, 242, .98);
  border-radius: 20px;
  box-shadow: 0 18px 56px rgba(0, 0, 0, .4);
  padding: 24px 22px;
  text-align: center;
}

#cityError .ceCard h2 {
  font-size: 19px;
  color: #4a2f1e;
  margin-bottom: 9px;
}

#cityError .ceCard p {
  font-size: 13px;
  color: #8a6f4e;
  line-height: 1.5;
  margin-bottom: 18px;
}

#cityError .ceActions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

#cityError .ceActions button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 11px;
  border-radius: 12px;
  border: none;
  color: #fff;
  background: linear-gradient(150deg, #e8b34a, #d98f2e);
}

#cityError .ceActions button.alt {
  color: #8a6f4e;
  background: #fffdf8;
  border: 1.5px solid #e3d2b6;
}

#townLabel {
  background: rgba(217, 143, 46, .16) !important;
  color: #9a5e16 !important;
}

/* 📰 Town Gazette — public repo changes since this browser last marked the town read */

#prompt {
  position: fixed;
  z-index: 14;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 210, 255, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 20px rgba(0, 210, 255, 0.2);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: 'Fira Code', 'Orbitron', 'Geist', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

#prompt.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

#prompt .key {
  background: rgba(0, 210, 255, 0.18);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.5);
  border-radius: 6px;
  padding: 3px 9px;
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
  text-transform: uppercase;
}

#modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(30, 18, 8, .45);
  backdrop-filter: blur(4px);
  padding: 20px;
}

#modal.show {
  display: flex;
}

.card {
  background: #fffaf2;
  border-radius: 22px;
  width: 420px;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 70px rgba(40, 22, 8, .4);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.3);
}

@keyframes pop {
  from {
    transform: scale(.9) translateY(10px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.card .top {
  padding: 22px 24px;
  color: #fff;
}

.card .top .lang {
  font-size: 12px;
  font-weight: 700;
  opacity: .92;
  letter-spacing: .03em;
}

.card .top h2 {
  font-size: 21px;
  margin: 4px 0 2px;
  word-break: break-all;
}

.card .top .stars {
  font-size: 13px;
  font-weight: 600;
  opacity: .92;
}

.card .body {
  padding: 18px 24px 8px;
}

.card .body p {
  font-size: 14px;
  line-height: 1.55;
  color: #5a4636;
}

.card .body p.empty {
  color: #b39f8c;
  font-style: italic;
}

.btn {
  flex: 1;
  min-width: 130px;
  text-align: center;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.btn.live {
  background: #c2702f;
  color: #fff;
}

.btn.close {
  flex: 0 0 auto;
  min-width: 0;
  background: #f1e6d6;
  color: #6a523d;
}

.btn.chrono {
  background: linear-gradient(135deg, #4b3b8f, #6b4fb0);
  color: #fff;
}

.card .hero {
  width: 100%;
  aspect-ratio: 2 / 1;
  height: auto;
  max-height: 230px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #efe6d3, #e2d4bb);
}

.card .chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 14px 24px 2px;
}

.chip {
  font-size: 12px;
  font-weight: 700;
  color: #6a523d;
  background: #f4ead8;
  border-radius: 999px;
  padding: 5px 11px;
}

.card .since {
  width: 100%;
  font-size: 11px;
  color: #ab8a66;
  padding: 8px 24px 0;
  line-height: 1.5;
}

.chip b {
  color: #d2622f;
}

.card .cardAsk {
  padding: 12px 24px 0;
}

.cardAsk .caTitle {
  font-size: 12.5px;
  font-weight: 800;
  color: #8a6a3e;
  margin: 0 0 9px;
}

.cardAsk .caRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}

.cardAsk .caBtn {
  flex: 1 1 auto;
  min-width: 118px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #e6d3ad;
  background: #fbf3e2;
  color: #6a523d;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 10px;
  transition: background .14s ease, transform .12s ease;
}

.cardAsk .caBtn:hover {
  background: #f3e6cd;
  transform: translateY(-1px);
}

.cardAsk .caHint {
  font-size: 10.5px;
  font-weight: 700;
  color: #b39f8c;
  margin: 2px 0 6px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.cardAsk .caChips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cardAsk .caChip {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: #6a4f86;
  background: #f1ecf8;
  border: 1px solid #ddd0ec;
  border-radius: 999px;
  padding: 6px 11px;
  transition: background .14s ease, transform .12s ease;
}

.cardAsk .caChip:hover {
  background: #e7ddf7;
  transform: translateY(-1px);
}

/* ---- Contribution Library panel ---- */
#libModal {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 14, 6, .55);
  backdrop-filter: blur(5px);
  padding: 18px;
}

#libModal.show {
  display: flex;
}

#chronoModal {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 20, .6);
  backdrop-filter: blur(5px);
  padding: 18px;
}

#chronoModal.show {
  display: flex;
}

#zoneBoard {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 24, 0.55);
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  padding: 18px;
}

#zoneBoard.show {
  display: flex;
}

#zoneBoard .cxCard {
  width: 500px;
}

.zbBasis {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 210, 255, 0.06);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 12px 14px 6px;
}

.zbBasis code {
  background: rgba(0, 210, 255, 0.18);
  color: #00d2ff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}

.zbBar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 12px 14px 4px;
}

.zbBar>i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
}

.zbSecT {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cx-accent, #00d2ff);
  padding: 14px 14px 6px;
}

a.zbChall,
a.zbRepo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 10px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

a.zbChall:hover,
a.zbRepo:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.4);
  transform: translateX(3px);
}

a.zbChall .rk,
a.zbRepo .rk {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

a.zbChall .nm,
a.zbRepo .nm {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.zbChall .pts,
a.zbRepo .pts {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: #00d2ff;
}

a.zbChall .vs,
a.zbRepo .vs {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

a.zbChall .vs.solved,
a.zbRepo .vs.solved {
  background: rgba(22, 163, 74, 0.25);
  border: 1px solid rgba(22, 163, 74, 0.6);
  color: #4ade80;
}

a.zbChall .vs.unsolved,
a.zbRepo .vs.unsolved {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.zbActs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 14px 16px;
}

.zbBtn {
  flex: 1 1 auto;
  min-width: 130px;
  border: 1px solid rgba(0, 210, 255, 0.5);
  cursor: pointer;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(0, 210, 255, 0.2);
  transition: all 0.2s ease;
  font-family: 'Fira Code', 'Orbitron', 'Geist', 'Inter', monospace, sans-serif;
  letter-spacing: 0.3px;
}

.zbBtn:hover {
  background: rgba(0, 210, 255, 0.35);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
  transform: translateY(-1px);
}

.zbBtn.sub {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.zbBtn.sub:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.obsCard {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 14px;
  background: #f6f3ec;
  border: 1px solid #e6e0d4;
  margin-bottom: 11px;
}

.obsCard .badge {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  background: radial-gradient(circle at 50% 38%, #1a2347, #0a0e22);
  box-shadow: 0 0 0 2px var(--ac, #9fc0ff) inset, 0 2px 8px rgba(0, 0, 0, .18);
}

.obsCard .meta {
  flex: 1;
  min-width: 0;
}

.obsCard .star {
  font-weight: 800;
  font-size: 15px;
  color: #1c2a4a;
  letter-spacing: .02em;
}

.obsCard .epi {
  font-size: 12px;
  color: #6a6356;
  margin-left: 4px;
  font-weight: 600;
}

.obsCard .tags {
  font-size: 11.5px;
  color: #48506a;
  margin: 3px 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.obsCard .tags span {
  background: #e7ecf8;
  border-radius: 999px;
  padding: 2px 8px;
}

.obsCard .bs {
  font-size: 12.5px;
  color: #4a4438;
  line-height: 1.55;
}

.obsTrail {
  position: relative;
  overflow: hidden;
  padding: 15px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #172343 0%, #2d2d62 60%, #433270 100%);
  color: #eef5ff;
  border: 1px solid rgba(174, 205, 255, .36);
  box-shadow: 0 9px 24px rgba(20, 24, 62, .22);
}

.obsTrail::after {
  content: "✦";
  position: absolute;
  right: 13px;
  top: 7px;
  color: #ffe8a8;
  font-size: 24px;
  opacity: .72;
}

.obsTrail .otK {
  color: #a9cfff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.obsTrail .otT {
  margin-top: 3px;
  padding-right: 25px;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .01em;
}

.obsTrail .otD {
  margin-top: 6px;
  color: #cbd7ef;
  font-size: 12.5px;
  line-height: 1.5;
}

.obsTrail .otStops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.obsTrail .otStops span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(173, 205, 255, .12);
  border: 1px solid rgba(173, 205, 255, .2);
  color: #e7efff;
  font-size: 10.5px;
  font-weight: 700;
}

.obsTrail .otStops span.done {
  color: #ffe7a0;
  border-color: rgba(255, 224, 132, .46);
  background: rgba(255, 216, 112, .12);
}

.obsTrail button {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  color: #17213b;
  background: linear-gradient(135deg, #bce8ff, #f6e7a3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
  transition: transform .12s ease, filter .12s ease;
}

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

.obsTrail.empty {
  background: linear-gradient(135deg, #30384a, #4b4b58);
}

/* 🌌 Repository Constellation Trail — compact world HUD; leaves the right-side touch actions clear */
#starTrailHud {
  position: fixed;
  z-index: 12;
  left: 14px;
  bottom: 54px;
  width: min(330px, calc(100vw - 112px));
  padding: 12px 13px 11px;
  border-radius: 16px;
  color: #eef5ff;
  background: linear-gradient(145deg, rgba(13, 20, 48, .94), rgba(48, 34, 86, .94));
  border: 1px solid rgba(173, 211, 255, .42);
  box-shadow: 0 12px 34px rgba(6, 10, 30, .38);
  backdrop-filter: blur(9px);
  visibility: visible;
  transition: opacity .18s ease, transform .18s ease;
}

#starTrailHud.hidden {
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;
}

#starTrailHud .stClose {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #cbd7ef;
  background: rgba(255, 255, 255, .09);
  font-size: 13px;
}

#starTrailHud .stK {
  color: #a9cfff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#starTrailHud .stTheme {
  padding-right: 28px;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#starTrailHud .stSteps {
  display: flex;
  gap: 6px;
  margin: 8px 0 7px;
}

#starTrailHud .stSteps i {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: rgba(174, 196, 230, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}

#starTrailHud .stSteps i.done {
  background: #f0c96b;
  box-shadow: 0 0 9px rgba(255, 215, 112, .58);
}

#starTrailHud .stSteps i.now {
  background: #8fdfff;
  box-shadow: 0 0 10px rgba(123, 220, 255, .7);
}

#starTrailHud .stTarget {
  color: #d7e3f6;
  font-size: 11.5px;
  line-height: 1.45;
}

#starTrailHud .stTarget b {
  color: #fff;
}

#starTrailHud .stActions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

#starTrailHud .stActions button {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: #16213c;
  background: #bce8ff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
}

#starTrailHud.complete {
  background: linear-gradient(145deg, rgba(48, 34, 72, .95), rgba(91, 57, 69, .95));
  border-color: rgba(255, 218, 125, .58);
}

.chronoPhilo {
  font-size: 12.5px;
  font-style: italic;
  color: #7a6a3a;
  padding: 9px 12px 4px;
}

.chronoCases {
  padding: 4px 8px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.chronoCase {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 3px 4px 3px 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid #e3d4ae;
  background: #fbf3e4;
  color: #5a4326;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.chronoCase.on {
  background: #3c3560;
  color: #fff;
  border-color: #3c3560;
}

.chronoQ {
  font-size: 13.5px;
  font-weight: 800;
  color: #43321f;
  padding: 6px 12px 2px;
}

.chronoTurn {
  display: flex;
  gap: 9px;
  padding: 7px 12px;
}

.chronoTurn .em {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1.3;
}

.chronoTurn .bd {
  flex: 1;
  min-width: 0;
}

.chronoTurn .nm {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.chronoTurn .tx {
  font-size: 13px;
  color: #3a2c1a;
  line-height: 1.5;
  margin-top: 1px;
}

.chronoTurn.verdict {
  background: #fbf6e6;
  border-radius: 12px;
  border: 1px solid #ecd9a3;
  margin: 7px 10px 2px;
}

.chronoSig {
  font-size: 13px;
  font-weight: 800;
  color: #7a5a12;
  margin-top: 5px;
}

.chronoVerdictVal {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 11px;
  border-radius: 8px;
  background: #2f9d6a;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.chronoTimeline {
  margin: 8px 12px 2px;
  padding: 9px 12px 9px;
  border-radius: 11px;
  background: #f6f1e0;
  border: 1px solid #ecdcb0;
}

.chronoTimeline .ctCap {
  font-size: 11px;
  font-weight: 800;
  color: #8a6a2e;
  letter-spacing: .02em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chronoTimeline .ctCap .ax {
  font-size: 10px;
  color: #a98c4e;
  font-weight: 700;
  white-space: nowrap;
}

.ctTrack {
  display: flex;
  gap: 6px;
}

.ctNode {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 7px 4px 6px;
  border-radius: 9px;
  background: #fff;
  border: 1.5px solid #e6d8b4;
}

.ctNode .ce {
  font-size: 16px;
  line-height: 1.1;
}

.ctNode .cd {
  font-size: 10.5px;
  font-weight: 800;
  color: #6a5630;
  margin-top: 2px;
}

.ctNode .cv {
  font-size: 10px;
  color: #7a6a48;
  margin-top: 1px;
  word-break: break-word;
  line-height: 1.25;
}

.ctNode.win {
  background: #eafaf0;
  border-color: #2f9d6a;
  box-shadow: 0 0 0 2px rgba(47, 157, 106, .18);
}

.ctNode.win .cd {
  color: #2f6d45;
}

.ctNode .wtag {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 800;
  color: #2f9d6a;
}

.chronoLive {
  margin: 9px 12px 4px;
  padding: 9px 12px;
  border-radius: 11px;
  background: #f3ead7;
  color: #8a6a3a;
  font-size: 12px;
  border: 1px dashed #d9c39a;
  line-height: 1.5;
}

.chronoRecapBtn {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 0;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid #e3d2a4;
  background: #f3ead7;
  color: #7a5f2e;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
}

.chronoRecapBtn:hover {
  background: #efe2c4;
}

.chronoRecap {
  margin: 6px 12px 2px;
  padding: 10px 12px;
  border-radius: 11px;
  background: #f6f1e0;
  border: 1px solid #ecdcb0;
}

.chronoRecap .rcSig {
  font-size: 12.5px;
  font-weight: 800;
  color: #9a6f1e;
  line-height: 1.45;
  margin-bottom: 6px;
}

.chronoRecap .rcVerdict {
  font-size: 12.5px;
  color: #5e4f33;
  line-height: 1.5;
}

.chronoRecap .rcVerdict b {
  color: #2f7d54;
  word-break: break-word;
}

.chronoRecap .rcConf {
  color: #9a8048;
  font-size: 11px;
  font-weight: 700;
}

.chronoConveneBtn {
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #2a2340;
  background: linear-gradient(135deg, #f0d678 0%, #e8c45a 100%);
  box-shadow: 0 2px 8px rgba(60, 53, 96, .28);
}

.chronoConveneBtn:disabled {
  opacity: .6;
  cursor: default;
}

/* Phase 39 — free-topic input row */
.chronoTopicWrap {
  padding: 2px 12px 8px;
}

.chronoTopicRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#chronoTopicInput {
  flex: 1;
  min-width: 150px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #d6ccec;
  background: #fff;
  color: #33271a;
  font-size: 15px;
}

#chronoTopicInput:focus {
  outline: none;
  border-color: #e8c45a;
}

.chronoTopicHint {
  font-size: 11.5px;
  color: #9a8aaa;
  padding: 6px 2px 0;
}

/* Phase 39 — live debate HUD overlay (watch the 3D chamber) */
#chronoLiveHud {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 24;
  width: min(560px, calc(100vw - 24px));
  background: linear-gradient(135deg, rgba(34, 28, 56, .96), rgba(20, 16, 40, .96));
  color: #f3eedf;
  border: 1px solid #4a3f6b;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
  padding: 13px 16px;
  display: none;
}

#chronoLiveHud.show {
  display: block;
}

.clhBadge {
  font-size: 12px;
  font-weight: 800;
  color: #ffe08a;
  white-space: nowrap;
}

.clhTopic {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clhRound {
  font-size: 11.5px;
  color: #bdb0d8;
  white-space: nowrap;
}

.clhClose {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #cfc4e6;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.clhFill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #e8c45a, #f0d678);
  transition: width .5s linear;
}

.clhVerdict {
  margin-top: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(232, 196, 90, .12);
  border: 1px solid rgba(232, 196, 90, .4);
  display: none;
}

.clhVerdict.show {
  display: block;
}

.clhUnverified {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #2a2340;
  background: #f0d678;
  border-radius: 99px;
  padding: 3px 9px;
  margin-bottom: 7px;
}

.clhVerdictTx {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
}

.clhSig {
  font-size: 12px;
  color: #e8c45a;
  margin-top: 6px;
  font-style: italic;
}

@media (hover:none) and (pointer:coarse) {
  #chronoLiveHud {
    bottom: auto;
    top: 54px;
  }

  .clhClose {
    min-width: 44px;
    min-height: 44px;
  }
}

#intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: linear-gradient(165deg, #7fcdc4 0%, #e8b87a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 24px;
}

#intro .inner {
  max-width: 440px;
}

#intro .langsel {
  display: inline-flex;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  padding: 3px;
}

#intro .langsel button {
  border: none;
  background: transparent;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  opacity: .72;
  transition: .15s;
}

#intro .langsel button.active {
  background: #fff;
  color: #c2702f;
  opacity: 1;
  box-shadow: 0 3px 10px rgba(60, 30, 10, .2);
}

#intro h1 {
  font-size: 27px;
  line-height: 1.3;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(60, 30, 10, .25);
}

#intro .sub {
  font-size: 15px;
  opacity: .95;
  margin-bottom: 22px;
  line-height: 1.5;
}

#intro .priv {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .74);
  max-width: 400px;
}

#intro .priv.hidden {
  display: none;
}

#intro .ctrls {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

#intro .ctrls div {
  background: rgba(255, 255, 255, .18);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
}

#intro .ctrls b {
  display: block;
  font-size: 16px;
  margin-bottom: 3px;
}

#startBtn {
  background: #fff;
  color: #c2702f;
  border: none;
  border-radius: 14px;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(60, 30, 10, .25);
}

#intro.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #5fb0a8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
}

/* ---- Roblox-style touch controls: floating left thumbstick + drag-to-look right half + round action button ---- */
#joy {
  position: fixed;
  z-index: 11;
  width: 134px;
  height: 134px;
  margin-left: -67px;
  margin-top: -67px;
  border-radius: 50%;
  display: none;
  pointer-events: none;
  touch-action: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06) 70%);
  border: 2px solid rgba(255, 255, 255, .4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}

#joy .nub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff, rgba(255, 255, 255, .82) 70%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
}

#actBtn {
  position: fixed;
  z-index: 12;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 30px;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #c2702f;
  box-shadow: 0 8px 22px rgba(60, 30, 10, .3);
  display: none;
  transition: transform .12s;
}

#actBtn:active {
  transform: scale(.92);
}

canvas {
  touch-action: none;
}

@media (hover: none) and (pointer: coarse) {
  #actBtn.avail {
    display: flex;
  }

  .hint {
    display: none;
  }
}

.hint {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(74, 47, 30, .6);
  font-weight: 600;
}

/* ---- LLM taxi chat ---- */
#taxiBtn {
  position: fixed;
  z-index: 13;
  right: 26px;
  bottom: 32px;
  width: 92px;
  height: 92px;
  border: 1.5px solid rgba(0, 210, 255, 0.45);
  border-radius: 50%;
  cursor: pointer;
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 28px rgba(0, 210, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#taxiBtn svg {
  width: 40px;
  height: 40px;
}

#taxiBtn:hover {
  transform: scale(1.08);
  border-color: var(--cx-accent, #00d2ff);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.75), 0 0 42px rgba(0, 210, 255, 0.55);
}

#taxiBtn:active {
  transform: scale(0.95);
}

#taxiBtn .pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(0, 210, 255, 0.6);
  animation: tpulse 2.2s ease-out infinite;
  pointer-events: none;
}

@keyframes tpulse {
  0% {
    transform: scale(1);
    opacity: .8;
  }

  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (hover: none) and (pointer: coarse) {
  #taxiBtn {
    right: calc(30px + env(safe-area-inset-right, 0px));
    bottom: calc(116px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- CTF Challenge Matrix Panel — CipherX cxCard shell ---- */
#ctfMatrix {
  position: fixed;
  z-index: 14;
  right: 14px;
  bottom: 88px;
  width: 490px;
  max-width: calc(100vw - 28px);
  max-height: 76vh;
  transform-origin: bottom right;
  transition: opacity .22s cubic-bezier(.16, 1, .3, 1), transform .22s cubic-bezier(.16, 1, .3, 1);
  display: flex;
}

#ctfMatrix.hidden {
  opacity: 0;
  transform: scale(.92) translateY(12px);
  pointer-events: none;
}

/* cxCard override: fit the panel, not fixed 520px */
#ctfMatrix .cxCard {
  width: 100%;
  max-height: 76vh;
  border-radius: 24px;
  animation: cxCardPop .28s cubic-bezier(.16, 1, .3, 1);
}

/* scrollable body */
#ctfMatrixBody {
  overflow-y: auto;
  padding: 6px 20px 18px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

#ctfMatrixBody::-webkit-scrollbar {
  width: 5px;
}

#ctfMatrixBody::-webkit-scrollbar-thumb {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), .28);
  border-radius: 99px;
}

.ctfMatrixEmpty {
  color: rgba(255, 255, 255, .38);
  font-size: 13px;
  text-align: center;
  padding: 32px 0;
  font-family: monospace, sans-serif;
  letter-spacing: .04em;
}

/* ── category group ── */
.ctfMatrixGroup {
  margin-bottom: 18px;
}

.ctfMatrixCatHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 4px 2px 4px 10px;
  border-left: 2px solid var(--cx-accent, #00d2ff);
}

.ctfMatrixCatLabel {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--cx-accent, #00d2ff);
  text-shadow: 0 0 10px var(--cx-accent-glow, rgba(0, 210, 255, .35));
}

.ctfMatrixCatCount {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .3);
  font-family: monospace, sans-serif;
}

/* ── 3-column grid of challenge boxes ── */
.ctfMatrixRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ── individual challenge box ── */
.ctfChallBox {
  position: relative;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 11px 11px 9px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: transform .15s cubic-bezier(.16, 1, .3, 1), box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
}

.ctfChallBox::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}

.ctfChallBox:hover {
  transform: translateY(-3px);
}

.ctfChallBox:hover::after {
  opacity: 1;
}

.ctfChallBox:active {
  transform: scale(.95);
}

/* unsolved = subtle dark glass */
.ctfChallUnsolved:hover {
  border-color: rgba(var(--cx-accent-rgb, 0, 210, 255), .3);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .35), 0 0 14px rgba(var(--cx-accent-rgb, 0, 210, 255), .1);
}

/* solved = tinted green success */
.ctfChallSolved {
  background: linear-gradient(145deg, rgba(47, 157, 106, .2), rgba(47, 157, 106, .08));
  border-color: rgba(110, 231, 183, .2);
  box-shadow: 0 0 18px rgba(47, 157, 106, .14), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.ctfChallSolved:hover {
  border-color: rgba(110, 231, 183, .45);
  box-shadow: 0 6px 22px rgba(47, 157, 106, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.ctfChallName {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
  line-height: 1.35;
  word-break: break-word;
  hyphens: auto;
}

.ctfChallSolved .ctfChallName {
  color: #6ee7b7;
}

.ctfChallPts {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .32);
  font-family: monospace, sans-serif;
}

.ctfChallSolved .ctfChallPts {
  color: rgba(110, 231, 183, .55);
}

.ctfChallBadge {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 10px;
  font-weight: 900;
  color: #6ee7b7;
  text-shadow: 0 0 10px rgba(110, 231, 183, .7);
}

@media (hover: none) and (pointer: coarse) {
  #ctfMatrix {
    right: 14px;
    bottom: calc(116px + env(safe-area-inset-bottom, 0px));
    max-height: 62vh;
    width: calc(100vw - 28px);
  }

  #ctfMatrix .cxCard {
    border-radius: 20px;
    max-height: 62vh;
  }

  .ctfMatrixRow {
    gap: 6px;
  }

  .ctfChallBox {
    padding: 10px 8px 8px;
    border-radius: 12px;
  }

  .ctfChallName {
    font-size: 11px;
  }
}

#drivebar {
  position: fixed;
  z-index: 13;
  left: 0;
  right: 0;
  margin-inline: auto;
  top: 76px;
  width: fit-content;
  max-width: min(560px, calc(100vw - 20px));
  background: rgba(10, 14, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 999px;
  color: #ffffff;
  font-family: 'Fira Code', 'Orbitron', 'Geist', 'Inter', monospace, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 22px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 20px rgba(0, 210, 255, 0.2);
  animation: cxCardPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#drivebar .cancel {
  position: relative;
  overflow: hidden;
  background: rgba(255, 68, 68, 0.18);
  border: 1px solid rgba(255, 68, 68, 0.5);
  color: #ff6b6b;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: all 0.2s ease;
}

#drivebar .cancel:hover {
  background: rgba(255, 68, 68, 0.32);
  box-shadow: 0 0 12px rgba(255, 68, 68, 0.5);
}

#drivebar .cancel .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(231, 76, 60, .9);
}

#drivebar .cancel.holding .fill {
  width: 100%;
  transition: width 1s linear;
}

#drivebar .cancel .lbl {
  position: relative;
  z-index: 1;
}

/* ---- mobile tap-target a11y (Phase 36) — placed last so it overrides base rules ---- */
@media (hover: none) and (pointer: coarse) {

  #langBtn,
  #dayBtn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  #stationBtn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  #intro .langsel button {
    min-height: 44px;
    padding: 10px 22px;
  }

  .chronoRecapBtn {
    min-height: 44px;
  }

  .obsTrail button,
  #starTrailHud .stActions button {
    min-height: 44px;
  }

  #starTrailHud {
    left: 12px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    width: min(280px, calc(100vw - 112px));
  }
}

/* ---- 🗺️ world map / minimap v1 ---- */
#mapLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 4px 4px;
  justify-content: center;
  width: 100%;
}

#mapLegend .mz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1;
  transition: all 0.2s ease;
}

#mapLegend .mz:hover {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.12);
  border-color: var(--cx-accent, #00d2ff);
  color: #fff;
  transform: translateY(-1px);
}

#mapLegend .mz:active {
  transform: translateY(1px);
}

#mapLegend .mz .mzc {
  font-size: 10.5px;
  color: var(--cx-accent, #00d2ff);
  font-weight: 800;
  font-family: monospace, sans-serif;
}

#mapLegend .mz i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

#mapBody::-webkit-scrollbar {
  width: 5px;
}

#mapBody::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  margin: 8px 0;
}

#mapBody::-webkit-scrollbar-thumb {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.35);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#mapBody::-webkit-scrollbar-thumb:hover {
  background: var(--cx-accent, #00d2ff);
}

.mapZoomBtn:hover {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.25) !important;
  border-color: var(--cx-accent, #00d2ff) !important;
  color: #00d2ff !important;
  box-shadow: 0 0 12px var(--cx-accent-subtle, rgba(0, 210, 255, 0.3));
}

.mapZoomBtn:active {
  transform: scale(0.92);
}

/* ---- 🔑 CipherX CyberOS Auth & Team Modals ---- */
#authModal,
#teamModal,
#playerListModal,
#playerProfileModal,
#logoutModal,
#obsModal,
#profileSettingsModal,
#notifModal,
#station,
#mapWrap {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

#authModal.hidden,
#teamModal.hidden,
#playerListModal.hidden,
#playerProfileModal.hidden,
#logoutModal.hidden,
#obsModal.hidden,
#profileSettingsModal.hidden,
#notifModal.hidden,
#station.hidden,
#mapWrap.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  display: none !important;
}

/* ---- 👤 Profile Settings Modal Content ---- */
.psHero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.psAvatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(var(--cx-accent-rgb, 0, 210, 255), 0.2), rgba(var(--cx-accent-rgb, 0, 210, 255), 0.06));
  border: 2px solid rgba(var(--cx-accent-rgb, 0, 210, 255), 0.4);
  color: var(--cx-accent, #00d2ff);
  font-size: 28px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--cx-accent-subtle, rgba(0, 210, 255, 0.2));
}

.psHeroInfo {
  flex: 1;
  min-width: 0;
}

.psUsername {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}

.psEmail {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
}

.psStatPill {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.1);
  border: 1px solid rgba(var(--cx-accent-rgb, 0, 210, 255), 0.3);
  color: var(--cx-accent, #00d2ff);
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  padding: 8px 14px;
  text-align: center;
  flex: 0 0 auto;
}

.psStatPill small {
  display: block;
  font-size: 9px;
  letter-spacing: .05em;
  opacity: .7;
  text-transform: uppercase;
  font-weight: 700;
}

.psStatsRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 24px 10px;
}

.psStatCard {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 8px;
  text-align: center;
}

.psStatVal {
  font-size: 20px;
  font-weight: 900;
  color: var(--cx-accent, #00d2ff);
  line-height: 1.1;
}

.psStatLbl {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: 3px;
}

.psSection {
  padding: 4px 24px 14px;
}

.psSectionHead {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 10px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.psFieldRow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.psFieldLabel {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.psFieldInput {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.psFieldInput:focus {
  border-color: var(--cx-accent, #00d2ff);
  box-shadow: 0 0 16px var(--cx-accent-subtle, rgba(0, 210, 255, 0.2));
}

.psFieldInput::placeholder {
  color: rgba(255, 255, 255, 0.22);
}

.psSaveBtn {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--cx-accent, #00d2ff);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.32), rgba(0, 210, 255, 0.12));
  color: #fff;
  font-family: monospace, sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .12em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 210, 255, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 4px;
}

.psSaveBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 16px 40px rgba(0, 210, 255, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.psSaveBtn:active {
  transform: translateY(1px);
}

.psSaveBtn:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
}

.psMsg {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
  line-height: 1.4;
}

.psMsg.ok {
  background: rgba(47, 157, 106, 0.18);
  border: 1px solid rgba(47, 157, 106, 0.4);
  color: #6ee7b7;
}

.psMsg.err {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.psLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.psSpinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(var(--cx-accent-rgb, 0, 210, 255), 0.18);
  border-top-color: var(--cx-accent, #00d2ff);
  animation: psSpin 0.7s linear infinite;
}

@keyframes psSpin {
  to {
    transform: rotate(360deg);
  }
}

.psError {
  padding: 24px;
  text-align: center;
  color: #fca5a5;
  font-size: 13px;
}

/* CipherX 3D Cyber Canvas & Backdrop Layer */
#cxAuthBgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.cxAuthOverlayBackdrop {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 50% 50%, rgba(10, 14, 26, 0.02), rgba(4, 6, 12, 0.03));
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
}

/* CipherX 3D Floating Glass Card (60% opacity) */
.cxCard {
  position: relative;
  z-index: 10;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 92vh;
  border-radius: 32px;
  background: rgba(10, 14, 24, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 30px 100px -20px rgba(0, 0, 0, 0.75),
    0 0 60px -15px var(--cx-accent-glow, rgba(0, 210, 255, 0.25)),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  animation: cxCardPop 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cxCardPop {
  0% {
    opacity: 0;
    transform: perspective(1200px) translateY(24px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: perspective(1200px) translateY(0) scale(1);
  }
}

/* Specular Light Spotlight overlay reacting to cursor */
.cxGlassSpecular {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 32px;
  z-index: 12;
  background: radial-gradient(700px circle at var(--cx-mouse-x, 50%) var(--cx-mouse-y, 30%), rgba(255, 255, 255, 0.08), transparent 60%);
}

/* Close Button */
.cxClose {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cxClose:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: rotate(90deg) scale(1.08);
  border-color: var(--cx-accent, #00d2ff);
  box-shadow: 0 0 15px var(--cx-accent-subtle, rgba(0, 210, 255, 0.2));
}

/* Header & Brand Area */
.cxCardHead {
  padding: 32px 36px 14px;
  position: relative;
  z-index: 15;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cxBrandArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cxEmblem {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cx-accent, #00d2ff);
  box-shadow: 0 0 24px var(--cx-accent-subtle, rgba(0, 210, 255, 0.15)), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: cxEmblemGlow 3.5s ease-in-out infinite alternate;
}

@keyframes cxEmblemGlow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 16px var(--cx-accent-subtle);
  }

  100% {
    transform: scale(1.04);
    box-shadow: 0 0 32px var(--cx-accent-glow);
  }
}

.cxTitleWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cxTitle {
  font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
  line-height: 1.1;
}

.cxTitleAccent {
  color: var(--cx-accent, #00d2ff);
  text-shadow: 0 0 20px var(--cx-accent-glow, rgba(0, 210, 255, 0.4));
}

.cxSubTitle {
  font-family: monospace, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 5px;
}

.cxSecurityBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cxPulseDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cx-accent, #00d2ff);
  box-shadow: 0 0 8px var(--cx-accent, #00d2ff);
  animation: cxPulse 2s ease-in-out infinite;
}

@keyframes cxPulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

.cxSecurityText {
  font-family: monospace, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
}

/* Segmented Control Liquid Tab Switcher */
.cxTabsWrap {
  margin-top: 22px;
  width: 100%;
}

.cxTabs {
  position: relative;
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.cxTabPill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 12px;
  background: var(--cx-accent, #00d2ff);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px var(--cx-accent-glow, rgba(0, 210, 255, 0.45)), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), width 0.38s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.cxTab {
  flex: 1;
  position: relative;
  z-index: 5;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: monospace, sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 11px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.cxTab.active {
  color: #040712;
  text-shadow: none;
  font-weight: 900;
}

/* Error banner */
.cxError {
  margin: 14px 36px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fca5a5;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
  text-align: center;
  backdrop-filter: blur(10px);
}

/* Form & Floating Glass Inputs */
.cxForm {
  padding: 20px 36px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(85vh - 220px);
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.cxForm.hidden,
#psUserProfileView.hidden,
#psTeamSettingsView.hidden {
  display: none !important;
}

/* CyberOS Futuristic Accent Glass Scrollbar */
.cxForm,
#notifModalBody,
.cxNotifCard,
#notifModalBody * {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.4) rgba(0, 0, 0, 0.2);
}

.cxForm::-webkit-scrollbar,
#notifModalBody::-webkit-scrollbar,
.cxNotifCard::-webkit-scrollbar,
#notifModalBody *::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.cxForm::-webkit-scrollbar-track,
#notifModalBody::-webkit-scrollbar-track,
.cxNotifCard::-webkit-scrollbar-track,
#notifModalBody *::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  margin: 4px 0;
}

.cxForm::-webkit-scrollbar-thumb,
#notifModalBody::-webkit-scrollbar-thumb,
.cxNotifCard::-webkit-scrollbar-thumb,
#notifModalBody *::-webkit-scrollbar-thumb {
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.35);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cxForm::-webkit-scrollbar-thumb:hover,
#notifModalBody::-webkit-scrollbar-thumb:hover,
.cxNotifCard::-webkit-scrollbar-thumb:hover,
#notifModalBody *::-webkit-scrollbar-thumb:hover {
  background: var(--cx-accent, #00d2ff);
  box-shadow: 0 0 10px var(--cx-accent-glow, rgba(0, 210, 255, 0.5));
}

.cxInputGroup {
  position: relative;
  margin-bottom: 2px;
  text-align: left;
  flex-shrink: 0;
}

.cxInput {
  width: 100%;
  height: 50px;
  padding: 20px 48px 6px 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.cxPassToggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  z-index: 10;
  transition: color 0.2s ease, background 0.2s ease;
}

.cxPassToggle:hover {
  color: var(--cx-accent, #00d2ff);
  background: rgba(255, 255, 255, 0.08);
}

.cxEyeIcon {
  pointer-events: none;
}

.cxSelect {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(255,255,255,0.6)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.cxLabel {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.42);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left top;
}

.cxInput:focus~.cxLabel,
.cxInput:not(:placeholder-shown)~.cxLabel,
.cxInputGroup.has-value .cxLabel,
.cxInputGroup.is-focused .cxLabel {
  transform: translateY(-10px) scale(0.76);
  color: var(--cx-accent, #00d2ff);
  font-weight: 700;
}

.cxInput:focus,
.cxInputGroup.is-focused .cxInput {
  background: rgba(0, 0, 0, 0.45);
  border-color: var(--cx-accent, #00d2ff);
  box-shadow: 0 0 24px var(--cx-accent-subtle, rgba(0, 210, 255, 0.2)), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.cxInputFocusGlow {
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  pointer-events: none;
  border: 1px solid var(--cx-accent, #00d2ff);
  opacity: 0;
  transition: opacity 0.25s ease;
  box-shadow: 0 0 20px var(--cx-accent-glow, rgba(0, 210, 255, 0.3));
}

.cxInput:focus~.cxInputFocusGlow,
.cxInputGroup.is-focused .cxInputFocusGlow {
  opacity: 0.6;
}

/* Premium Floating Submit Button */
.cxSubmitBtn {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  margin-bottom: 2px;
  flex-shrink: 0;
  border-radius: 16px;
  border: 1px solid var(--cx-accent, #00d2ff);
  background: linear-gradient(135deg, rgba(var(--cx-accent-rgb, 0, 210, 255), 0.35) 0%, rgba(var(--cx-accent-rgb, 0, 210, 255), 0.14) 100%);
  color: #ffffff;
  font-family: monospace, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline: none;
  box-shadow: 0 12px 32px var(--cx-accent-subtle, rgba(0, 210, 255, 0.2)), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cxSubmitBtn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 18px 45px var(--cx-accent-glow, rgba(0, 210, 255, 0.4)), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  filter: brightness(1.15);
}

.cxSubmitBtn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 6px 16px var(--cx-accent-subtle, rgba(0, 210, 255, 0.2));
}

.cxBtnText {
  position: relative;
  z-index: 5;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.cxBtnShimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: transform 0.65s ease;
  pointer-events: none;
  z-index: 2;
}

.cxSubmitBtn:hover .cxBtnShimmer {
  transform: translateX(200%);
}

/* Footer Status Bar */

/* Team Info View */
.teamMemberList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teamMemberRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.teamMemberRow.clickable {
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  text-align: left;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.teamMemberRow.clickable:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--cx-accent, #00d2ff);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--cx-accent-subtle, rgba(0, 210, 255, 0.15));
}

.teamMemberRow.clickable:active {
  transform: translateY(0);
}

.tmLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tmAvatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--cx-accent, #00d2ff);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.tmNameWrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tmName {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmCaptain {
  font-size: 10px;
  font-weight: 800;
  color: var(--cx-accent, #00d2ff);
  letter-spacing: .02em;
}

.tmFlag {
  font-size: 13px;
  line-height: 1;
}

.tmRight {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.tmScore {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cx-accent, #00d2ff);
}

.tmArrow {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  transition: all .2s;
}

.teamMemberRow.clickable:hover .tmArrow {
  transform: translateX(4px);
  color: var(--cx-accent, #00d2ff);
}

/* ---- 👤 Player Profile Content ---- */
.ppHero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.ppAvatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cx-accent, #00d2ff);
  font-size: 26px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px var(--cx-accent-subtle, rgba(0, 210, 255, 0.15));
}

.ppHeroInfo {
  flex: 1;
  min-width: 0;
}

.ppName {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.ppFlag {
  font-size: 20px;
  flex: 0 0 auto;
}

.ppAffil {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.ppWebsite {
  font-size: 11.5px;
  color: var(--cx-accent, #00d2ff);
  text-decoration: none;
  margin-top: 3px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ppWebsite:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px var(--cx-accent, #00d2ff);
}

.ppRankBadge {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
  border-radius: 12px;
  padding: 8px 14px;
  border: 1px solid var(--cx-accent, #00d2ff);
  color: var(--cx-accent, #00d2ff);
  letter-spacing: -.01em;
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.1);
  box-shadow: inset 0 0 10px rgba(var(--cx-accent-rgb, 0, 210, 255), 0.2);
}

/* --- Stats Row --- */
.ppStats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 18px 10px;
  flex: 0 0 auto;
}

.ppStatCard {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 8px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.ppStatVal {
  font-size: 18px;
  font-weight: 900;
  color: var(--cx-accent, #00d2ff);
  line-height: 1.1;
}

.ppStatLbl {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: 3px;
}

/* --- Sections --- */
.ppSection {
  padding: 6px 18px 14px;
  flex: 0 0 auto;
}

.ppSectionHead {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.ppSectionCt {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: auto;
}

/* --- Category breakdown --- */
.ppCatList {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ppCatRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}

.ppCatDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.ppCatName {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.ppCatCount {
  font-size: 11px;
  font-weight: 800;
  color: var(--cx-accent, #00d2ff);
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.15);
  border-radius: 999px;
  padding: 1px 9px;
  min-width: 28px;
  text-align: center;
}

/* --- Awards --- */
.ppAwardList {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ppAwardRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(var(--cx-accent-rgb, 0, 210, 255), 0.08);
  border-radius: 10px;
  border: 1px solid rgba(var(--cx-accent-rgb, 0, 210, 255), 0.2);
}

.ppAwardName {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.ppAwardPts {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--cx-accent, #00d2ff);
}

/* --- Solves list --- */
.ppSolveList {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ppSolveRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background .12s, border-color .12s;
}

.ppSolveRow:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.ppSolveCat {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .02em;
  flex: 0 0 auto;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ppSolveName {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppSolvePts {
  font-size: 12px;
  font-weight: 800;
  color: var(--cx-accent, #00d2ff);
  flex: 0 0 auto;
}

.ppSolveDate {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
}

.ppMoreSolves {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 6px 0 2px;
  font-weight: 700;
}

.ppEmpty {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.3);
  padding: 10px 4px;
  text-align: center;
  font-style: italic;
}

/* --- Loading / Error states --- */
.ppLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 14px;
}

.ppSpinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #eadcc4;
  border-top-color: #d2622f;
  animation: ppSpin .8s linear infinite;
}

@keyframes ppSpin {
  to {
    transform: rotate(360deg);
  }
}

.ppLoadingText {
  font-size: 13px;
  color: #a88a66;
  font-weight: 600;
}

.ppError {
  padding: 28px 22px;
  font-size: 13px;
  color: #c81e1e;
  text-align: center;
  background: #fde8e8;
  margin: 16px;
  border-radius: 12px;
  border: 1px solid #f8b4b4;
}

/* ═══════════════════════════════════════════════════════════
   CTF CHALLENGE MODAL
   ═══════════════════════════════════════════════════════════ */

/* Overlay backdrop */
#challengeModal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(4, 6, 12, 0.70);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
}

#challengeModal.show {
  opacity: 1;
  pointer-events: all;
}

/* 3D Floating Glass Card */
.chCard {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  border-radius: 32px;
  background: rgba(10, 14, 24, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 30px 100px -20px rgba(0, 0, 0, 0.8),
    0 0 60px -15px color-mix(in srgb, var(--ch-accent, #00d2ff) 35%, transparent),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  animation: cxCardPop 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Header ── */
.chHeader {
  --ch-accent: #9ca3af;
  position: relative;
  z-index: 15;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ch-accent) 18%, rgba(10, 14, 24, 0.6)) 0%, rgba(10, 14, 24, 0.6) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--ch-accent) 35%, rgba(255, 255, 255, 0.1));
  padding: 28px 32px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.chClose {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.chClose:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: rotate(90deg) scale(1.08);
  border-color: var(--ch-accent, #00d2ff);
  box-shadow: 0 0 16px color-mix(in srgb, var(--ch-accent, #00d2ff) 40%, transparent);
}

.chCatBadge {
  margin-top: 2px;
  flex-shrink: 0;
  background: var(--ch-accent);
  color: #040712;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border-radius: 10px;
  box-shadow: 0 0 16px color-mix(in srgb, var(--ch-accent) 45%, transparent);
}

.chHeaderBody {
  flex: 1;
  min-width: 0;
  padding-right: 40px;
}

.chTitle {
  color: #ffffff;
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  word-break: break-word;
  letter-spacing: -0.02em;
}

.chHeaderMeta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chPtsBadge {
  background: var(--ch-accent);
  color: #040712;
  font-size: 12.5px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 14px color-mix(in srgb, var(--ch-accent) 40%, transparent);
}

.chSolvedBadge {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

/* ── Chips row ── */
.chChipsRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.chChip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
}

.chChipTag {
  color: #94a3b8;
  font-style: italic;
}

/* ── Scrollable body ── */
.chBody {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.chBody::-webkit-scrollbar {
  width: 4px;
}

.chBody::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 2px;
}

/* ── Sections ── */
.chSection {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chSection:last-child {
  border-bottom: none;
}

.chSectionHead {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ── Description ── */
.chDesc {
  color: #cbd5e1;
  font-size: 14.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.chDesc strong {
  color: #f1f5f9;
  font-weight: 700;
}

.chDesc code {
  background: rgba(255, 255, 255, 0.1);
  color: #86efac;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
}

.chEmpty {
  color: #4b5563;
  font-style: italic;
}

/* ── Connection Details ── */
.chConnBox {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chConnLink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.28);
  border-radius: 12px;
  padding: 12px 16px;
  color: #38bdf8;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.1);
  word-break: break-all;
}

.chConnLink:hover {
  background: rgba(0, 210, 255, 0.18);
  border-color: rgba(0, 210, 255, 0.55);
  color: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.25);
}

.chConnIcon {
  font-size: 15px;
  flex-shrink: 0;
}

.chConnText {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.chConnExt {
  font-size: 14px;
  opacity: 0.8;
  flex-shrink: 0;
}

.chConnCodeBlock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
}

.chConnCode {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13.5px;
  color: #4ade80;
  font-weight: 600;
  word-break: break-all;
  white-space: pre-wrap;
  flex: 1;
  min-width: 0;
  user-select: text;
  -webkit-user-select: text;
}

.chConnCopyBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  outline: none;
}

.chConnCopyBtn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.chConnCopyBtn.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

/* ── Solved banner ── */
.chSolvedBanner {
  margin: 0 22px 4px;
  background: linear-gradient(135deg, #052e16 0%, #14532d 100%);
  border: 1px solid #16a34a;
  border-radius: 12px;
  color: #86efac;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 18px;
  text-align: center;
}

/* ── Files ── */
.chFiles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chFile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 11px 14px;
  color: #93c5fd;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.chFile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(147, 197, 253, 0.4);
}

.chFile span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chFileDl {
  color: #64748b;
  margin-left: auto;
  font-size: 16px;
}

/* ── Hints ── */
.chHints {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chHint {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
}

.chHint--open {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.06);
}

.chHintMeta {
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chHintCost {
  background: rgba(251, 191, 36, 0.15);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
}

.chHintContent {
  color: #e2e8f0;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chHintReveal {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.chHintReveal:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.22);
}

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

/* ── Flag submission ── */
.chFlagForm {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chFlagInput {
  flex: 1;
  min-width: 200px;
  height: 50px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 14px;
  font-family: 'Fira Code', monospace;
  padding: 0 18px;
  border-radius: 16px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-user-select: text;
  user-select: text;
  box-sizing: border-box;
}

.chFlagInput::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.chFlagInput:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--ch-accent, #00d2ff);
  box-shadow: 0 0 24px color-mix(in srgb, var(--ch-accent, #00d2ff) 30%, transparent), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.chFlagBtn {
  height: 50px;
  padding: 0 26px;
  border-radius: 16px;
  border: 1px solid var(--ch-accent, #00d2ff);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ch-accent, #00d2ff) 40%, transparent) 0%, color-mix(in srgb, var(--ch-accent, #00d2ff) 18%, transparent) 100%);
  color: #ffffff;
  font-family: monospace, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline: none;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ch-accent, #00d2ff) 25%, transparent), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.chFlagBtn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--ch-accent, #00d2ff) 45%, transparent), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  filter: brightness(1.15);
}

.chFlagBtn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

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

/* Flag submission status */
.chFlagStatus {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 8px;
  min-height: 0;
  transition: all 0.2s;
}

.chFlagStatus:empty {
  display: none;
}

.chFlag--ok {
  background: rgba(22, 163, 74, 0.15);
  color: #86efac;
  border: 1px solid rgba(22, 163, 74, 0.4);
}

.chFlag--err {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.chFlag--warn {
  background: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

/* ── Mobile ── */
@media (max-width: 520px) {
  .chCard {
    max-height: 95vh;
    border-radius: 16px;
  }

  .chTitle {
    font-size: 18px;
  }

  .chFlagForm {
    flex-direction: column;
  }

  .chFlagBtn {
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────
   🏆  CTFd Scoreboard Panel  (reuses #libModal/.libcard shell)
───────────────────────────────────────────────────────────── */
/* Override libhead bg for the scoreboard — inline style in HTML handles it */

/* ── Podium banner ── */
.sbPodium {
  display: flex;
  gap: 10px;
  padding: 16px 12px 10px;
  justify-content: center;
  align-items: flex-end;
}

.sbPodCard {
  flex: 1;
  max-width: 110px;
  border-radius: 16px;
  padding: 14px 8px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sbPodCard:hover {
  transform: translateY(-4px) scale(1.02);
  filter: brightness(1.1);
}

.sbPod1 {
  background: linear-gradient(160deg, rgba(255, 215, 0, 0.15), rgba(0, 0, 0, 0.6));
  border: 1px solid rgba(255, 215, 0, 0.4);
  order: 2;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.sbPod2 {
  background: linear-gradient(160deg, rgba(192, 192, 192, 0.12), rgba(0, 0, 0, 0.6));
  border: 1px solid rgba(192, 192, 192, 0.3);
  order: 1;
}

.sbPod3 {
  background: linear-gradient(160deg, rgba(205, 127, 50, 0.12), rgba(0, 0, 0, 0.6));
  border: 1px solid rgba(205, 127, 50, 0.3);
  order: 3;
}

.sbMedal {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.sbTeamName {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}

.sbTeamScore {
  font-size: 11px;
  font-weight: 800;
  color: var(--cx-accent, #00d2ff);
  letter-spacing: 0.05em;
}

/* ── Section divider ── */
.sbDivider {
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  padding: 8px 12px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 6px 8px 10px;
}

/* ── Full standings rows ── */
.sbRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 4px 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sbRow:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.25);
  transform: translateX(2px);
}

.sbRow.sbTop {
  background: rgba(0, 210, 255, 0.05);
}

.sbRank {
  width: 32px;
  flex-shrink: 0;
  text-align: center;
}

.sbRankMedal {
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.sbRankNum {
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.5);
}

.sbRankName {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbRankScore {
  font-size: 12px;
  font-weight: 800;
  color: var(--cx-accent, #00d2ff);
  flex-shrink: 0;
}

/* ── Timestamp ── */
.sbTimestamp {
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  padding: 14px 0 8px;
  letter-spacing: 0.05em;
  font-family: monospace, sans-serif;
}

/* ── Footer refresh button ── */
#libModal #libFoot .cxSubmitBtn {
  max-width: 200px;
  margin: 0;
  height: 42px;
  font-size: 12px;
}