@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --primary: #d4af37;
  --primary-dark: #8a6a1c;
  --primary-light: #f3d27a;
  --bg: #060504;
  --panel: rgba(16, 13, 8, 0.6);
  --panel-strong: rgba(18, 15, 10, 0.84);
  --text: #f6f0e1;
  --text-muted: #b5aa8f;
  --danger: #ff3b5c;
  --success: #2bd97c;
  --glow: rgba(212, 175, 55, 0.5);
  --primary-rgb: 212, 175, 55;
  --primary-dark-rgb: 138, 106, 28;
  --primary-light-rgb: 243, 210, 122;
  --radius: 20px;
  --font-display: 'Rajdhani', 'Manrope', sans-serif;
  --font-body: 'Manrope', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 12% 8%, rgba(var(--primary-rgb),0.22), transparent 55%),
    radial-gradient(1100px 750px at 96% 30%, rgba(var(--primary-light-rgb),0.14), transparent 55%),
    radial-gradient(1000px 650px at 88% 92%, rgba(var(--primary-dark-rgb),0.26), transparent 55%),
    radial-gradient(800px 500px at 50% 50%, rgba(var(--primary-dark-rgb),0.12), transparent 60%),
    var(--bg);
}

.brand-watermark {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  width: 220px;
  height: 220px;
  z-index: 0;
  pointer-events: none;
  background-image: var(--watermark-img, url('assets/kastt_logo.png'));
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: var(--watermark-opacity, 0.22);
  filter: saturate(1.2) drop-shadow(0 0 30px rgba(var(--primary-light-rgb),0.25));
}

.top-accent {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 12;
  background: linear-gradient(90deg, transparent, var(--primary-dark), var(--primary-light), #fff6d8, var(--primary-light), var(--primary-dark), transparent);
  box-shadow: 0 0 20px rgba(var(--primary-light-rgb),0.6);
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
}

#app {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}

#app.visible { opacity: 1; pointer-events: all; }
#app.hidden { display: none; }

.hud-corner {
  position: fixed;
  width: 54px;
  height: 54px;
  border: 2px solid var(--primary-light);
  opacity: .55;
  z-index: 11;
  pointer-events: none;
  filter: drop-shadow(0 0 8px var(--glow));
}
.hud-corner.tl { top: 22px; left: 22px; border-right: none; border-bottom: none; }
.hud-corner.tr { top: 22px; right: 22px; border-left: none; border-bottom: none; }
.hud-corner.bl { bottom: 22px; left: 22px; border-right: none; border-top: none; }
.hud-corner.br { bottom: 22px; right: 22px; border-left: none; border-top: none; }

.menu-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 44px 56px 30px;
  animation: fadeUp .55s cubic-bezier(.2,.9,.25,1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 30px;
}

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

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  filter: drop-shadow(0 0 14px var(--glow));
  position: relative;
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.logo-badge::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--primary-light);
  opacity: .4;
  animation: pulseRing 2.4s ease-in-out infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: .4; }
  50% { transform: scale(1.12); opacity: 0; }
}

.server-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.1;
}

.server-tag {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 3px;
}

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

.title-line {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 10px;
  display: flex;
  gap: 14px;
}

.title-thin {
  font-weight: 500;
  color: var(--text-muted);
}

.title-bold {
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary-light), #fff 50%, var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px var(--glow);
}

.title-underline {
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.stats {
  display: flex;
  gap: 14px;
}

.stat {
  position: relative;
  width: 64px;
  height: 56px;
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  padding: 1px;
  background: linear-gradient(160deg, var(--primary-light), transparent 60%, var(--primary-dark));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .6;
}

.stat-label {
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
  text-shadow: 0 0 12px var(--glow);
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 4px;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.clock-date {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.esc-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.03);
}

.key {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  color: var(--text);
  box-shadow: 0 0 12px rgba(0,0,0,.3);
}

.body-grid {
  flex: 1;
  display: flex;
  gap: 26px;
  min-height: 0;
}

.rail {
  width: 108px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0;
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

.rail-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 10px 18px;
  width: 100%;
}

.rail-avatar-wrap {
  position: relative;
  margin-bottom: 8px;
}

.rail-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  box-shadow: 0 0 18px var(--glow);
  position: relative;
  overflow: hidden;
}

.rail-avatar::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--primary-light);
  opacity: .4;
  animation: pulseRing 2.4s ease-in-out infinite;
}

.rail-avatar.has-photo {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15), 0 0 18px var(--glow);
}

.rail-avatar-dot {
  position: absolute;
  right: -2px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--success);
  border: 3px solid #0b0905;
  box-shadow: 0 0 10px var(--success);
  animation: pulseRing 1.8s ease-in-out infinite;
}

.rail-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-job {
  font-size: 9.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary-light);
  text-align: center;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
}

.rail-btn {
  width: 62px;
  height: 58px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all .2s ease;
}

.rail-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-btn span {
  font-size: 9px;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 600;
}

.rail-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.rail-btn.active {
  color: #fff;
  background: linear-gradient(165deg, var(--primary), var(--primary-dark));
  box-shadow: 0 0 20px var(--glow);
  border-color: rgba(255,255,255,0.15);
}

.rail-divider {
  width: 36px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 18px 0;
}

.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.rail-quick-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rail-quick-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  transition: all .2s ease;
}

.rail-quick-btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

.rail-quick-btn.primary {
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  box-shadow: 0 0 16px var(--glow);
}

.rail-quick-btn.primary svg { fill: currentColor; }

.rail-quick-btn.primary:hover { filter: brightness(1.12); transform: translateY(-2px); }

.rail-quick-btn.danger:hover {
  color: var(--danger);
  border-color: rgba(255,59,92,0.4);
  background: rgba(255,59,92,0.08);
}

.rail-socials {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.rail-social {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s ease;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
}

.rail-social:hover {
  color: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(var(--primary-rgb),0.25);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.active { display: flex; }

.hero-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 200px;
  flex-shrink: 0;
  margin-bottom: 16px;
  padding: 0 44px 0 34px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(100deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.05) 55%, transparent 80%),
    radial-gradient(640px 400px at 85% 50%, rgba(var(--primary-light-rgb),0.22), transparent 65%),
    linear-gradient(135deg, rgba(var(--primary-dark-rgb),0.32), var(--bg) 80%);
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .25;
  background-image:
    repeating-linear-gradient(135deg, rgba(var(--primary-light-rgb),0.14) 0 2px, transparent 2px 30px);
}

.hero-corner-glow {
  top: auto;
  right: -60px;
  bottom: -80px;
  width: 260px;
  height: 260px;
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: 560px;
  flex-shrink: 0;
}

.hero-text .eyebrow { display: block; margin-bottom: 8px; }

.hero-text h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: .3px;
  margin-bottom: 6px;
  color: var(--text);
}

.hero-text p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 360px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary-light), var(--primary) 55%, var(--primary-dark));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.4), 0 0 24px var(--glow);
  transition: transform .18s ease, filter .18s ease;
}

.btn-hero-primary svg {
  width: 16px; height: 16px;
  fill: #fff;
}

.btn-hero-primary .key {
  margin-left: 2px;
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.35);
}

.btn-hero-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-hero-primary:active { transform: translateY(0); }

.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
}

.btn-hero-ghost svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
}

.btn-hero-ghost:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255,59,92,0.08);
}

.bento {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-template-areas:
    "mp mp pl pl"
    "mp mp tk rl"
    "nw nw cg rl"
    "kb kb st qt";
  gap: 16px;
  overflow: hidden;
  min-height: 0;
}

.card-map { grid-area: mp; }
.card-player { grid-area: pl; }
.card-tasks { grid-area: tk; }
.card-rules { grid-area: rl; }
.card-news { grid-area: nw; }
.card-changelog { grid-area: cg; }
.card-keybinds { grid-area: kb; }
.card-settings { grid-area: st; }
.card-quit { grid-area: qt; }

.card-wide {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.card-wide .card-icon,
.card-wide .card-avatar {
  margin-bottom: 0;
  flex-shrink: 0;
}

.wide-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.wide-body .card-title { margin-top: 0; }

.card-wide .card-chips { margin-top: 8px; }

.card-tall {
  justify-content: flex-start;
}

.rules-mini {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  overflow: hidden;
}

.rule-mini-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rule-mini-row .num {
  width: 18px; height: 18px;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
  opacity: 0;
  transform: translateY(14px);
  animation: cardIn .5s cubic-bezier(.2,.9,.25,1) forwards;
  animation-delay: calc(var(--i, 0) * 55ms + 120ms);
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--primary-light), transparent 40%, transparent 60%, var(--primary-light));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.055);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}

.card:hover::before { opacity: .55; }
.card:hover::after { opacity: 1; }
.card:active { transform: translateY(-2px) scale(.99); }

.card-arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 15px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: all .25s ease;
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary-light);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,.4), 0 0 18px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
  z-index: 1;
}

.card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}

.icon-hue-1 { filter: none; }
.icon-hue-2 { filter: brightness(1.12) saturate(1.1); }
.icon-hue-3 { filter: hue-rotate(-10deg) saturate(1.2); }
.icon-hue-4 { filter: brightness(.88) saturate(1.25); }
.icon-hue-5 { filter: hue-rotate(8deg) brightness(1.05); }
.icon-hue-6 { filter: brightness(1.2) saturate(.9); }
.icon-hue-7 { filter: hue-rotate(-6deg) brightness(.95); }

.card-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin-bottom: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  box-shadow: 0 8px 20px rgba(0,0,0,.4), 0 0 0 3px rgba(255,255,255,0.08), 0 0 18px var(--glow);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: .3px;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.span-2 { grid-column: span 2; }
.span-row-2 { grid-row: span 2; }

.card-resume,
.card-map {
  justify-content: flex-end;
  padding: 30px;
  border-color: rgba(255,255,255,0.14);
}

.resume-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(0,0,0,.1), rgba(0,0,0,.72)),
    repeating-linear-gradient(135deg, rgba(var(--primary-rgb),0.16) 0 2px, transparent 2px 28px),
    radial-gradient(900px 500px at 100% 0%, rgba(var(--primary-light-rgb),0.25), transparent 60%),
    linear-gradient(135deg, var(--primary-dark), var(--bg) 72%);
  z-index: 0;
}

.hero-silhouette {
  position: absolute;
  right: -30px;
  bottom: -20px;
  width: 62%;
  height: 92%;
  z-index: 0;
  opacity: .9;
  filter: drop-shadow(0 0 22px var(--glow));
  pointer-events: none;
}

.corner-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  z-index: 0;
  animation: drift 6s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(-10px, 10px); }
}

.resume-content { position: relative; z-index: 1; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-light);
  font-weight: 700;
}

.resume-content h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  margin: 6px 0 4px;
  letter-spacing: 0px;
}

.resume-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 360px;
}

.map-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(160deg, rgba(0,0,0,.05), rgba(0,0,0,.75)),
    radial-gradient(700px 420px at 0% 100%, rgba(var(--primary-light-rgb),0.22), transparent 60%),
    linear-gradient(135deg, rgba(var(--primary-dark-rgb),0.36), var(--bg) 75%);
  overflow: hidden;
}

.map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .35;
}

.map-lines path {
  fill: none;
  stroke: var(--primary-light);
  stroke-width: 1;
}

.map-lines path.diag {
  stroke: rgba(255,255,255,0.5);
  stroke-width: .6;
  opacity: .5;
}

.map-pin {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 0 5px rgba(var(--primary-light-rgb),0.18), 0 0 14px var(--glow);
  animation: pulseRing 2.2s ease-in-out infinite;
}

.map-pin.p1 { top: 28%; left: 22%; }
.map-pin.p2 { top: 58%; left: 62%; animation-delay: .4s; }
.map-pin.p3 { top: 38%; left: 78%; animation-delay: .9s; background: var(--success); box-shadow: 0 0 0 5px rgba(43,217,124,0.18), 0 0 14px rgba(43,217,124,0.6); }

.live-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-muted);
}

.live-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseRing 1.6s ease-in-out infinite;
}

.resume-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 9px 16px;
  border-radius: 999px;
}

.card-quit.danger {
  border-color: rgba(255,59,92,0.25);
}

.card-quit.danger .card-icon {
  background: linear-gradient(145deg, #ff7a93, #b0123a);
  box-shadow: 0 8px 20px rgba(0,0,0,.4), 0 0 18px rgba(255,59,92,0.45), inset 0 1px 0 rgba(255,255,255,.25);
  filter: none;
}
.card-quit.danger .card-icon svg { stroke: #fff; }
.card-quit.danger::before { background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(255,59,92,0.45), transparent 60%); }
.card-quit.danger:hover {
  border-color: var(--danger);
  background: rgba(255,59,92,0.08);
}
.card-quit.danger:hover .card-arrow { color: var(--danger); }

.card-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.card-reset {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
}

.mini-tasks {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  overflow: hidden;
  margin-top: 12px;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.card-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 9px;
  border-radius: 7px;
}

.theme-dots {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}

.theme-dots .dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
}

.mini-task {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-task-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.mini-task-top strong { color: var(--text); font-weight: 600; }

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
  border-radius: 999px;
  box-shadow: 0 0 10px var(--glow);
  position: relative;
}

.credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 18px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .75;
}

.credit-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
}

.view-detail {
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.view-detail::before {
  content: attr(data-watermark);
  position: absolute;
  right: -10px;
  bottom: -40px;
  font-family: var(--font-display);
  font-size: 210px;
  font-weight: 700;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.025);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 4px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s ease;
}

.back-btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 2;
}

.back-btn:hover { border-color: var(--primary); color: var(--primary-light); }

.detail-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
}

.detail-head, .detail-body {
  position: relative;
  z-index: 1;
}

.detail-body {
  flex: 1;
  width: 100%;
  max-width: 880px;
  overflow-y: auto;
  padding-right: 8px;
  animation: fadeUp .4s ease both;
}

.detail-body.wide {
  max-width: 100%;
}

.detail-body::-webkit-scrollbar { width: 6px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 10px; }
.detail-body::-webkit-scrollbar-track { background: transparent; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 18px;
}

.info-item .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-item .value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--primary-light);
}

.list-item {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.list-item h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.list-item .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.list-item p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.rule-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.rule-row .num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 0 14px var(--glow);
}

.change-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  padding: 4px 11px;
  border-radius: 999px;
  margin-right: 8px;
  box-shadow: 0 0 12px var(--glow);
}

.change-item { padding-left: 4px; font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.change-item::before { content: '\2192  '; color: var(--primary-light); }

.key-table { width: 100%; border-collapse: collapse; }
.key-table tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
.key-table td { padding: 14px 6px; font-size: 13px; }
.key-table td:last-child { text-align: right; }
.key-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}

.settings-section { margin-bottom: 26px; }
.settings-section h4 {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 700;
}

.swatches { display: flex; gap: 12px; flex-wrap: wrap; }

.swatch {
  width: 46px; height: 46px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.12);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.swatch:hover { transform: translateY(-3px); }
.swatch.selected { border-color: #fff; box-shadow: 0 0 16px var(--glow); }

.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.color-row span { font-size: 13px; color: var(--text-muted); }

input[type="color"] {
  width: 44px; height: 32px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.btn:hover { border-color: var(--primary); color: var(--primary-light); }

.btn.primary {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
  box-shadow: 0 0 20px var(--glow);
}

.btn.primary:hover { filter: brightness(1.12); color: #fff; }

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .span-2 { grid-column: span 2; }
  .title-line { font-size: 24px; letter-spacing: 6px; }
}

.map-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,0.05);
  cursor: grab;
  user-select: none;
}

.map-viewer.dragging { cursor: grabbing; }

.map-viewer-inner {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.map-viewer-inner img {
  display: block;
  max-width: none;
  pointer-events: none;
}

.map-player-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 0 5px rgba(var(--primary-light-rgb),0.25), 0 0 16px var(--glow);
  border: 2px solid #fff;
  z-index: 2;
  pointer-events: none;
}

.map-hint {
  position: absolute;
  left: 20px; top: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--text-muted);
  background: rgba(10,8,5,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  z-index: 2;
  pointer-events: none;
}

.map-controls {
  position: absolute;
  right: 18px; bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.map-ctrl-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(14,12,8,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all .2s ease;
}

.map-ctrl-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.map-ctrl-btn:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(var(--primary-rgb),0.12); }

.map-external-btn {
  position: absolute;
  right: 18px; top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: rgba(14,12,8,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  z-index: 2;
  transition: all .2s ease;
}

.map-external-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.map-external-btn:hover { border-color: var(--primary); color: var(--primary-light); }

.player-detail {
  display: flex;
  gap: 24px;
  align-items: stretch;
  min-height: calc(100% - 4px);
}

.pd-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
  justify-content: center;
  min-width: 0;
}

.pd-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px 28px;
  backdrop-filter: blur(18px) saturate(140%);
}

.pd-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.07), 0 0 26px var(--glow);
  position: relative;
  overflow: hidden;
}

.pd-profile-text { min-width: 0; }

.pd-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: #fff;
}

.pd-job {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.pd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pd-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 999px;
}

.pd-chip.online { color: var(--success); background: rgba(43,217,124,0.08); border-color: rgba(43,217,124,0.25); }
.pd-chip.online .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulseRing 1.8s ease-in-out infinite; }

.pd-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pd-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px 18px;
  transition: all .2s ease;
}

.pd-stat:hover { border-color: rgba(var(--primary-light-rgb),0.35); transform: translateY(-2px); }

.pd-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 0 14px var(--glow);
}

.pd-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.pd-stat-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-side {
  width: 300px;
  flex-shrink: 0;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background:
    linear-gradient(175deg, rgba(0,0,0,.05), rgba(0,0,0,.55)),
    linear-gradient(145deg, rgba(var(--primary-dark-rgb),0.36), var(--bg) 80%);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 60px rgba(var(--primary-rgb),0.12);
}

.pd-side-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(var(--primary-light-rgb),0.08) 0 1px, transparent 1px 22px);
  pointer-events: none;
}

.pd-side-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--success);
  background: rgba(43,217,124,0.1);
  border: 1px solid rgba(43,217,124,0.3);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.pd-side-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

.pd-side-avatar {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 5px rgba(255,255,255,0.08), 0 0 32px var(--glow);
  margin-bottom: 16px;
  overflow: hidden;
}

.pd-side-name {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: #fff;
}

.pd-side-tag {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary-light);
  letter-spacing: 1px;
  margin-top: 4px;
}

.pd-side-divider {
  position: relative;
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 22px 0 18px;
}

.pd-side-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.pd-side-row span { color: var(--text-muted); }
.pd-side-row b { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: 11.5px; }

@media (max-width: 1100px) {
  .player-detail { flex-direction: column; }
  .pd-side { width: 100%; }
  .pd-stats-grid { grid-template-columns: repeat(2, 1fr); }
}


.player-money {
  display: flex;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.money-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(43,217,124,0.07);
  border: 1px solid rgba(43,217,124,0.22);
  min-width: 120px;
}

.money-block.bank {
  background: rgba(59,157,255,0.07);
  border-color: rgba(59,157,255,0.22);
}

.money-block span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.money-block b {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: #6ff0a8;
}

.money-block.bank b { color: #8cc6ff; }

.card-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 0 12px rgba(var(--primary-rgb),0.45);
}

.card-snippet {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 520px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.changelog-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}

.cl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.cl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 8px var(--glow);
  flex-shrink: 0;
}

.bento .card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.008) 45%),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 32px rgba(0,0,0,.28);
}

.bento .card:hover {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 45%),
    var(--panel);
}

.bento .card-player {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding-right: 54px;
}

.bento .card-player .card-avatar {
  width: 60px;
  height: 60px;
  font-size: 24px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.bento .card-player .wide-body { flex: 1; min-width: 0; }

.kb-pair {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-right: 12px;
}

#keybinds-preview {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
}

.bento .card-news {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding-right: 54px;
}

.bento .card-news .card-icon { margin-bottom: 0; flex-shrink: 0; }

.bento .card > * { flex-shrink: 0; }

.bento .card-changelog .card-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  margin: 0;
}

.bento .card-changelog .card-arrow { top: auto; bottom: 18px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 2px;
}

.hero-meta:empty { display: none; }

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
}

.meta-pill b { color: var(--text); font-weight: 700; }

.meta-pill svg {
  width: 13px; height: 13px;
  fill: none; stroke: var(--primary-light); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.meta-pill.online { color: var(--success); background: rgba(43,217,124,0.08); border-color: rgba(43,217,124,0.25); }
.meta-pill.online b { color: #b8f5d3; }
.meta-pill.online .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulseRing 1.8s ease-in-out infinite; }

.tick { animation: statTick .5s ease; }

@keyframes statTick {
  0% { color: #fff; text-shadow: 0 0 12px var(--primary-light); }
  100% { text-shadow: none; }
}

.bento .card.in {
  opacity: 1;
  animation: none;
  transform: perspective(900px) rotateX(0deg) rotateY(0deg) translateY(0);
  transition: transform .35s cubic-bezier(.2,.9,.25,1), border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.bento .card.in:hover {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px);
  transition: transform .12s ease-out, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.bento .card.in:active {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-2px) scale(.99);
}

#app .menu-wrap {
  transition: transform .45s cubic-bezier(.2,.9,.25,1), filter .45s ease, opacity .45s ease;
}

#app:not(.visible) .menu-wrap {
  transform: scale(.975);
  filter: blur(6px);
  opacity: 0;
}

#app.visible .menu-wrap {
  transform: scale(1);
  filter: blur(0);
  opacity: 1;
}

.dv-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.dv-stat {
  padding: 20px 24px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(var(--primary-rgb),0.14), rgba(255,255,255,0.02) 60%), var(--panel);
  border: 1px solid rgba(255,255,255,0.09);
}

.dv-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.dv-stat span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dv-empty {
  padding: 60px;
  text-align: center;
  color: var(--text-muted);
  border-radius: 20px;
  border: 1px dashed rgba(255,255,255,0.12);
}

.task-grid, .rule-grid, .news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.task-card, .rule-card, .news-card, .key-tile, .tl-item {
  opacity: 0;
  animation: fadeUp .45s cubic-bezier(.2,.9,.25,1) forwards;
  animation-delay: var(--d, 0ms);
}

.task-card {
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .2s ease, transform .2s ease;
}

.task-card:hover { border-color: rgba(var(--primary-light-rgb),0.35); transform: translateY(-2px); }

.task-card.complete { border-color: rgba(43,217,124,0.35); background: linear-gradient(160deg, rgba(43,217,124,0.08), transparent 60%), var(--panel); }

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

.task-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 1px;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #ffd27a;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,176,32,0.1);
  border: 1px solid rgba(255,176,32,0.28);
}

.task-reward svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.task-label { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #fff; }

.task-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.task-meta b { color: var(--primary-light); }
.task-card.complete .task-meta b { color: var(--success); }
.task-card.complete .progress-fill { background: linear-gradient(90deg, #22d98a, #7af3bf); }

.dv-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(var(--primary-rgb),0.2), rgba(var(--primary-dark-rgb),0.06) 60%), var(--panel);
  border: 1px solid rgba(var(--primary-light-rgb),0.22);
}

.dv-banner-icon {
  width: 50px; height: 50px;
  border-radius: 15px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 0 20px var(--glow);
}

.dv-banner-icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dv-banner b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; }
.dv-banner span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--text-muted); }

.rule-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color .2s ease, transform .2s ease;
}

.rule-card:hover { border-color: rgba(var(--primary-light-rgb),0.35); transform: translateY(-2px); }

.rule-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: .9;
  background: linear-gradient(180deg, var(--primary-light), var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
  min-width: 42px;
}

.rule-card p { font-size: 15px; line-height: 1.6; color: var(--text); margin-top: 2px; }

.news-feature {
  position: relative;
  overflow: hidden;
  padding: 34px 36px;
  margin-bottom: 16px;
  border-radius: 22px;
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(var(--primary-light-rgb),0.22), transparent 60%),
    linear-gradient(135deg, rgba(var(--primary-dark-rgb),0.5), var(--bg) 85%);
  border: 1px solid rgba(var(--primary-light-rgb),0.25);
  animation: fadeUp .45s ease both;
}

.news-feature-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(var(--primary-light-rgb),0.07) 0 1px, transparent 1px 24px);
  pointer-events: none;
}

.news-feature > *:not(.news-feature-lines) { position: relative; }
.news-feature .card-badge { margin-left: 0; }
.news-feature h3 { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: #fff; margin-top: 6px; }
.news-feature p { font-size: 15.5px; line-height: 1.7; color: #e4dac2; margin-top: 10px; max-width: 860px; }

.news-date { font-family: var(--font-mono); font-size: 12px; color: var(--primary-light); margin-top: 12px; letter-spacing: .5px; }

.news-card {
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
}

.news-card .news-date { margin-top: 0; }
.news-card h4 { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #fff; margin-top: 6px; }
.news-card p { font-size: 13.5px; line-height: 1.6; color: var(--text-muted); margin-top: 6px; }

.timeline { position: relative; padding-left: 34px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 10px; bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary-light), rgba(var(--primary-rgb),0.1));
  border-radius: 2px;
}

.tl-item { position: relative; margin-bottom: 16px; }

.tl-node {
  position: absolute;
  left: -31px; top: 22px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary-light);
}

.tl-item.latest .tl-node { background: var(--primary-light); box-shadow: 0 0 0 5px rgba(var(--primary-light-rgb),0.2), 0 0 14px var(--glow); }

.tl-card {
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
}

.tl-item.latest .tl-card { border-color: rgba(var(--primary-light-rgb),0.3); background: linear-gradient(160deg, rgba(var(--primary-rgb),0.12), transparent 55%), var(--panel); }

.tl-head { display: flex; align-items: center; gap: 10px; }
.tl-head .card-badge { margin-left: 0; }
.tl-date { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.tl-changes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin-top: 14px; }
.tl-change { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }

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

.key-tile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color .2s ease, transform .2s ease;
}

.key-tile:hover { border-color: rgba(var(--primary-light-rgb),0.35); transform: translateY(-2px); }
.key-tile:hover .keycap { transform: translateY(2px); box-shadow: 0 2px 0 rgba(var(--primary-dark-rgb),0.9), 0 0 18px var(--glow); }

.keycap {
  min-width: 54px;
  height: 54px;
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 0 rgba(var(--primary-dark-rgb),0.9), 0 8px 18px rgba(0,0,0,.4);
  transition: transform .15s ease, box-shadow .15s ease;
  flex-shrink: 0;
}

.keycap.wide { min-width: 80px; }

.key-action { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: #fff; }

.hero-banner { height: 224px; }
.hero-text { max-width: 680px; }
.hero-text #hero-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-meta { margin: 10px 0 14px; }

.settings-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: start;
}

.settings-col { display: flex; flex-direction: column; gap: 18px; }

.set-section {
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01) 50%), var(--panel);
  border: 1px solid rgba(255,255,255,0.09);
  animation: fadeUp .4s ease both;
}

.set-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.set-head h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}

.set-head span { font-size: 12px; color: var(--text-muted); }
.set-head span.live { color: #ff5c7a; font-weight: 700; }

.sub-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.game-set-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.game-set {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all .2s ease;
  opacity: 0;
  animation: fadeUp .4s ease forwards;
  animation-delay: var(--d, 0ms);
}

.game-set:hover {
  border-color: rgba(var(--primary-light-rgb),0.4);
  background: rgba(var(--primary-rgb),0.1);
  transform: translateY(-2px);
}

.gs-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 0 14px var(--glow);
}

.gs-icon svg, .clip-btn svg {
  width: 19px; height: 19px;
  fill: none; stroke: #fff; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

.gs-text b { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #fff; }
.gs-text small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.clip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.clip-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all .2s ease;
}

.clip-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.clip-btn.rec { color: #ffd0d9; background: rgba(255,59,92,0.1); border-color: rgba(255,59,92,0.35); }
.clip-btn.rec:hover { background: rgba(255,59,92,0.18); color: #fff; }
.clip-btn.editor { margin-left: auto; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); border-color: transparent; color: #fff; box-shadow: 0 0 16px var(--glow); }
.clip-btn.editor:hover { filter: brightness(1.12); color: #fff; }

.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 10px #ff3b5c; animation: pulseRing 1.4s ease-in-out infinite; }

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pref-row:last-child { border-bottom: none; padding-bottom: 0; }
.pref-row b { display: block; font-size: 14px; font-weight: 700; color: #fff; }
.pref-row small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toggle {
  position: relative;
  width: 50px; height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all .25s ease;
  flex-shrink: 0;
}

.toggle span {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s cubic-bezier(.2,.9,.25,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.toggle.on { background: linear-gradient(145deg, var(--primary), var(--primary-dark)); border-color: transparent; box-shadow: 0 0 14px var(--glow); }
.toggle.on span { transform: translateX(22px); }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 220px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb),0.25), 0 0 12px var(--glow);
  cursor: pointer;
}

.settings-layout .color-row { padding: 11px 0; }
.settings-layout .swatches { margin-bottom: 4px; }
.settings-layout .settings-actions { margin-top: 18px; }

.quit-wrap {
  max-width: 900px;
  margin: 40px auto 0;
  text-align: center;
  animation: fadeUp .4s ease both;
}

.quit-title h3 { font-family: var(--font-display); font-size: 38px; font-weight: 700; color: #fff; }
.quit-title p { font-size: 15px; color: var(--text-muted); margin-top: 8px; }

.quit-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 34px 0 26px;
}

.quit-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 26px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01) 50%), var(--panel);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  cursor: pointer;
  transition: all .22s ease;
}

.quit-opt:hover { transform: translateY(-4px); border-color: rgba(var(--primary-light-rgb),0.45); box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 0 30px rgba(var(--primary-rgb),0.18); }
.quit-opt.danger:hover { border-color: rgba(255,59,92,0.5); box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 0 30px rgba(255,59,92,0.2); }

.qo-icon {
  width: 62px; height: 62px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 0 22px var(--glow);
  margin-bottom: 6px;
}

.quit-opt.danger .qo-icon { background: linear-gradient(145deg, #ff6b85, #a3123a); box-shadow: 0 0 22px rgba(255,59,92,0.5); }
.qo-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quit-opt b { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #fff; }
.quit-opt small { font-size: 13px; color: var(--text-muted); }

.map-top-actions {
  position: absolute;
  right: 18px; top: 18px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

.map-top-actions .map-external-btn { position: static; }
.map-external-btn.primary { background: linear-gradient(145deg, var(--primary), var(--primary-dark)); border-color: transparent; color: #fff; box-shadow: 0 0 18px var(--glow); }
.map-external-btn.primary:hover { color: #fff; filter: brightness(1.12); }

#toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(14,12,8,0.92);
  border: 1px solid rgba(var(--primary-light-rgb),0.35);
  box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 20px rgba(var(--primary-rgb),0.25);
  backdrop-filter: blur(10px);
  animation: toastIn .3s cubic-bezier(.2,.9,.25,1) both;
}

.toast.ok { border-color: rgba(43,217,124,0.45); }
.toast.out { animation: toastOut .35s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

.map-me {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
  transform: scale(var(--inv, 1));
  transform-origin: 0 0;
}

.map-me-pulse {
  position: absolute;
  left: -26px; top: -26px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(var(--primary-light-rgb),0.25);
  animation: mePulse 2s ease-out infinite;
}

@keyframes mePulse {
  0% { transform: scale(.35); opacity: .9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.map-me-arrow {
  position: absolute;
  left: -18px; top: -18px;
  width: 36px; height: 36px;
  transform: rotate(var(--hd, 0deg));
  transition: transform .4s ease;
}

.map-me-arrow::before {
  content: '';
  position: absolute;
  left: 50%; top: -6px;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--primary-light);
  filter: drop-shadow(0 0 6px var(--glow));
}

.map-me-dot {
  position: absolute;
  left: -9px; top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb),0.35), 0 0 18px var(--glow);
}

.map-loc {
  position: absolute;
  left: 20px; bottom: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(10,8,5,0.78);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.map-loc:empty { display: none; }
.map-loc .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary-light); box-shadow: 0 0 10px var(--glow); }
.map-loc b { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #fff; }
.map-loc span { font-size: 12px; color: var(--text-muted); }

.map-debug {
  position: absolute;
  left: 50%; top: 20px;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ffd27a;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10,8,5,0.85);
  border: 1px solid rgba(255,176,32,0.35);
  pointer-events: none;
}

.meta-pill.restart b { font-family: var(--font-mono); }
.meta-pill.restart.warn { color: #ffb4c2; background: rgba(255,59,92,0.12); border-color: rgba(255,59,92,0.4); animation: warnPulse 1.6s ease-in-out infinite; }
.meta-pill.restart.warn svg { stroke: #ff6b85; }

@keyframes warnPulse { 50% { box-shadow: 0 0 16px rgba(255,59,92,0.35); } }

.hero-vehicle {
  position: relative;
  z-index: 2;
  width: 440px;
  flex-shrink: 0;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(8,6,4,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(14px);
  animation: fadeUp .4s ease both;
}

.hero-vehicle:empty { display: none; }
.hero-banner.has-vehicle .brand-watermark { opacity: 0.08; right: 2%; }

.hv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hv-name small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--primary-light); }
.hv-name b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; line-height: 1.1; }

.hv-plate {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #1b1b2a;
  background: linear-gradient(180deg, #ffffff, #dfe3ee);
  border: 2px solid #2b3a8f;
  border-radius: 7px;
  padding: 4px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  white-space: nowrap;
}

.hv-body { display: flex; align-items: center; gap: 20px; margin-top: 14px; }

.hv-speed { display: flex; flex-direction: column; align-items: center; min-width: 86px; }
.hv-speed b { font-family: var(--font-display); font-size: 46px; font-weight: 700; line-height: 1; color: #fff; text-shadow: 0 0 18px var(--glow); }
.hv-speed span { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; color: var(--text-muted); margin-top: 4px; }

.hv-bars { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.hv-bar-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.hv-bar-top b { color: #fff; font-family: var(--font-mono); }

.hv-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.hv-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.hv-fill.good { background: linear-gradient(90deg, var(--primary-dark), var(--primary-light)); box-shadow: 0 0 10px var(--glow); }
.hv-fill.mid { background: linear-gradient(90deg, #a3660b, #ffd27a); }
.hv-fill.low { background: linear-gradient(90deg, #a3123a, #ff6b85); }

.pd-playtime {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.pd-playtime:empty { display: none; }
.pt-head { display: flex; justify-content: space-between; align-items: baseline; }
.pt-head span { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.pt-head b { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; }
.pt-next { font-size: 12px; color: var(--text-muted); margin: 6px 0 8px; }
.pt-next b { color: var(--primary-light); }
.pt-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.pt-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.pt-badge.got { color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); border-color: transparent; box-shadow: 0 0 10px var(--glow); }

.card-badge.live { background: linear-gradient(135deg, #ff3b5c, #ff8a3d); box-shadow: 0 0 12px rgba(255,59,92,0.5); }

body.kb-nav .nav-focus {
  outline: 2px solid var(--primary-light) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(var(--primary-rgb),0.2), 0 0 28px var(--glow) !important;
  z-index: 5;
}

body.kb-nav .bento .card.in.nav-focus { transform: perspective(900px) translateY(-5px); }

body.perf *, body.perf *::before, body.perf *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.perf .bento .card.in:hover,
body.perf .bento .card.in:active { transform: translateY(-3px); }

body.perf #bg-canvas { opacity: 1; }
body.perf .noise-overlay { display: none; }
body.perf .map-me-pulse, body.perf .meta-pill.online .dot, body.perf .rail-avatar::after { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .bento .card.in:hover { transform: translateY(-3px); }
  .map-me-pulse { animation: none; }
}


.card-icon svg, .gs-icon svg, .pd-stat-icon svg, .qo-icon svg, .dv-banner-icon svg, .lr-icon svg { stroke: #1a1307; }
.btn-hero-primary, .btn.primary, .rail-btn.active, .rail-quick-btn.primary, .map-external-btn.primary, .clip-btn.editor, .toggle.on, .pt-badge.got { color: #1a1307; }
.btn-hero-primary svg, .rail-btn.active svg, .rail-quick-btn.primary svg, .map-external-btn.primary svg, .clip-btn.editor svg { stroke: #1a1307; }
.rail-quick-btn.primary svg, .btn-hero-primary svg { fill: #1a1307; }
.btn-hero-primary .key { color: #1a1307; border-color: rgba(26,19,7,0.4); background: rgba(26,19,7,0.12); }
.card-badge { color: #1a1307; }
.card-badge.live { color: #fff; }
.rail-avatar, .card-avatar, .pd-avatar, .pd-side-avatar { color: #1a1307; }


#bg-canvas, .noise-overlay, .vignette, .top-accent {
  transition: opacity .35s ease, visibility .35s ease;
}

body:not(.menu-open) #bg-canvas,
body:not(.menu-open) .noise-overlay,
body:not(.menu-open) .vignette,
body:not(.menu-open) .top-accent {
  opacity: 0 !important;
  visibility: hidden;
}

.map-labels { position: absolute; inset: 0; pointer-events: none; }
.map-label { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); transform-origin: center; white-space: nowrap; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.75); opacity: 0.92; }
.map-label.tier-2 { font-size: 10px; font-weight: 600; opacity: 0; transition: opacity 0.2s ease; color: rgba(255,255,255,0.9); }
.map-labels.show-minor .map-label.tier-2 { opacity: 0.9; }
.map-code { font-style: normal; margin-left: 8px; padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--primary-light, #fff); background: rgba(var(--primary-rgb), 0.16); border: 1px solid rgba(var(--primary-rgb), 0.35); }

.map-bg.has-map { background-size: 230% auto; background-position: 44% 72%; background-repeat: no-repeat; }
.map-bg.has-map::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%); }
.map-bg.has-map .map-lines, .map-bg.has-map .map-pin { display: none; }

.map-viewer-inner img.recoloring { opacity: 0; }
.map-viewer-inner img { transition: opacity 0.35s ease; }
.map-viewer { background: var(--bg, #050407); }
.map-blips, .map-postals { position: absolute; inset: 0; pointer-events: none; }
.map-blips.hidden { display: none; }
.map-blip { cursor: pointer; position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; transform: scale(var(--inv, 1)); border-radius: 50%; background: rgba(8, 7, 10, 0.82); border: 2px solid var(--bc); box-shadow: 0 1px 3px rgba(0,0,0,0.6); display: grid; place-items: center; pointer-events: auto; cursor: default; z-index: 2; }
.map-blip svg { width: 16px; height: 16px; fill: none; stroke: var(--bc); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-blip:hover { z-index: 4; background: rgba(var(--primary-rgb), 0.22); }
.map-blip.waypoint { width: 32px; height: 32px; margin: -16px 0 0 -16px; background: rgba(var(--primary-rgb), 0.3); border-color: var(--primary-light); z-index: 3; }
.map-blip.waypoint svg { stroke: var(--primary-light); }
.map-postal { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); font-size: 9px; font-weight: 700; letter-spacing: 0.04em; color: rgba(var(--primary-light-rgb), 0.85); text-shadow: 0 1px 2px rgba(0,0,0,0.95); opacity: 0; transition: opacity 0.2s ease; white-space: nowrap; }
.map-postals.show .map-postal { opacity: 1; }
.map-blip-toggle { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); background: rgba(8, 7, 10, 0.75); border: 1px solid rgba(255,255,255,0.1); cursor: pointer; backdrop-filter: blur(6px); }
.map-blip-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.map-blip-toggle.active { color: var(--primary-light); border-color: rgba(var(--primary-rgb), 0.5); background: rgba(var(--primary-rgb), 0.14); }
.map-tip { position: absolute; z-index: 7; transform: translate(-50%, -100%); padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--text); background: rgba(8, 7, 10, 0.92); border: 1px solid rgba(var(--primary-rgb), 0.4); pointer-events: none; opacity: 0; transition: opacity 0.12s ease; white-space: nowrap; }
.map-tip.show { opacity: 1; }
.map-label { color: rgba(var(--primary-light-rgb), 0.95); }
.map-label.tier-2 { color: rgba(255, 255, 255, 0.75); }

.rail-social svg { width: 18px; height: 18px; }
.rail-social svg.si-fill { fill: currentColor; }
.rail-social svg.si-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.rules-toolbar { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 12px; }
.rules-tabs { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; transition: opacity .2s ease; }
.rules-tabs.dim { opacity: .45; }
.rules-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all .18s ease; }
.rules-tab span { font-size: 10px; font-weight: 800; color: rgba(var(--primary-rgb), 0.8); }
.rules-tab:hover { color: var(--text); border-color: rgba(var(--primary-rgb), 0.4); }
.rules-tab.active { color: var(--text); background: rgba(var(--primary-rgb), 0.16); border-color: rgba(var(--primary-rgb), 0.55); box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.15); }
.rules-search { flex: 0 0 220px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }
.rules-search:focus-within { border-color: rgba(var(--primary-rgb), 0.6); }
.rules-search svg { width: 15px; height: 15px; fill: none; stroke: var(--text-muted); stroke-width: 2; flex: none; }
.rules-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 13px; }
.rules-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-size: 13px; color: var(--text-muted); }
.rules-head b { color: var(--text); font-size: 16px; }
.rules-head-num { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; color: var(--primary-light); background: rgba(var(--primary-rgb), 0.15); }
.rules-head-count { margin-left: auto; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.rule-grid-rich { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; }
.rule-card.rich { display: flex; gap: 14px; align-items: flex-start; }
.rule-card.rich .rule-body { flex: 1; min-width: 0; }
.rule-card.rich h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--text); }
.rule-card.rich p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
.rule-sec { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(var(--primary-rgb), 0.85); }
.rule-points { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rule-points li { position: relative; padding-left: 14px; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.rule-points li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.rule-card.important { border-color: rgba(255, 59, 92, 0.45); background: linear-gradient(135deg, rgba(255, 59, 92, 0.08), transparent 60%); }
.rule-card.important h4 { color: #ff6b84; }
.rules-empty { padding: 40px; text-align: center; color: var(--text-muted); grid-column: 1 / -1; }

.map-blip.area { background: color-mix(in srgb, var(--bc) 22%, transparent); border-style: dashed; }
.map-blip.custom { border-radius: 7px; }
.map-blip:hover { transform: scale(calc(var(--inv, 1) * 1.25)); }
.map-label { text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 4px rgba(0,0,0,0.95), 0 0 10px rgba(0,0,0,0.8); }
.map-label.tier-2 { color: rgba(255, 255, 255, 0.92); }
.map-legend { position: absolute; right: 16px; top: 64px; bottom: 150px; z-index: 6; width: 196px; overflow-y: auto; padding: 8px; border-radius: 14px; background: rgba(8, 7, 10, 0.78); border: 1px solid rgba(255,255,255,0.08); backdrop-filter: blur(8px); }
.map-legend:empty { display: none; }
.map-legend::-webkit-scrollbar { width: 4px; }
.map-legend::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.5); border-radius: 4px; }
.ml-head { display: flex; justify-content: space-between; padding: 4px 6px 8px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.ml-head span { color: var(--primary-light); }
.ml-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.ml-row:hover { background: rgba(255,255,255,0.05); }
.ml-row.off { opacity: .35; }
.ml-ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(8,7,10,0.9); border: 1.2px solid var(--bc); }
.ml-ic svg { width: 11px; height: 11px; fill: none; stroke: var(--bc); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ml-name { flex: 1; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-n { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.map-pop { position: absolute; z-index: 8; width: 240px; transform: translate(-50%, calc(-100% - 14px)); padding: 12px; border-radius: 14px; background: rgba(10, 9, 12, 0.95); border: 1px solid rgba(var(--primary-rgb), 0.45); box-shadow: 0 14px 40px rgba(0,0,0,0.6); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.map-pop.show { opacity: 1; pointer-events: auto; }
.mp-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mp-top .ml-ic { width: 30px; height: 30px; }
.mp-top .ml-ic svg { width: 15px; height: 15px; }
.mp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-t b { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-t span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.mp-x { border: 0; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; }
.mp-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 12px; color: var(--text-muted); }
.mp-row svg { width: 13px; height: 13px; fill: none; stroke: var(--primary-light); stroke-width: 2; flex: none; }
.mp-wp { width: 100%; margin-top: 10px; padding: 8px; border-radius: 9px; border: 1px solid rgba(var(--primary-rgb), 0.5); background: rgba(var(--primary-rgb), 0.18); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.mp-wp:hover { background: rgba(var(--primary-rgb), 0.3); }
.mp-wp.done { border-color: rgba(43,217,124,0.6); background: rgba(43,217,124,0.15); }
#map-style-btn.on { border-color: rgba(var(--primary-rgb), 0.6); color: var(--primary-light); }
.map-viewer.style-default .map-label { color: #fff; }

.rule-card.rich { cursor: pointer; }
.rule-card.rich::after { content: 'Click to expand'; position: absolute; right: 14px; bottom: 10px; font-size: 10px; letter-spacing: .06em; color: rgba(var(--primary-light-rgb), 0.7); opacity: 0; transition: opacity .2s ease; }
.rule-card.rich { position: relative; }
.rule-card.rich:hover::after { opacity: 1; }
.rule-reader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 40px; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease; }
.rule-reader.show { opacity: 1; }
.rr-card { position: relative; width: min(880px, 92vw); max-height: 82vh; overflow-y: auto; padding: 34px 40px 26px; border-radius: 22px; background: linear-gradient(160deg, rgba(var(--primary-rgb), 0.12), rgba(10, 9, 12, 0.97) 40%); border: 1px solid rgba(var(--primary-rgb), 0.45); box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 40px rgba(var(--primary-rgb), 0.12); transform: translateY(10px) scale(.98); transition: transform .25s ease; }
.rule-reader.show .rr-card { transform: none; }
.rr-card.important { border-color: rgba(255, 59, 92, 0.6); background: linear-gradient(160deg, rgba(255, 59, 92, 0.14), rgba(10, 9, 12, 0.97) 40%); }
.rr-card.important h2 { color: #ff6b84; }
.rr-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.rr-num { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; background: linear-gradient(180deg, var(--primary-light), var(--primary-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rr-num small { margin-left: 6px; font-size: 14px; -webkit-text-fill-color: var(--text-muted); }
.rr-sec { padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-light); background: rgba(var(--primary-rgb), 0.14); border: 1px solid rgba(var(--primary-rgb), 0.35); }
.rr-close { margin-left: auto; width: 38px; height: 38px; border-radius: 11px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: var(--text); font-size: 22px; cursor: pointer; }
.rr-close:hover { border-color: var(--primary); }
.rr-card h2 { margin: 0 0 14px; font-size: 28px; line-height: 1.25; color: var(--text); }
.rr-card p { margin: 0; font-size: 18px; line-height: 1.7; color: var(--text); opacity: .92; }
.rr-points { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rr-points li { position: relative; padding-left: 22px; font-size: 16.5px; line-height: 1.6; color: var(--text); opacity: .88; }
.rr-points li::before { content: ''; position: absolute; left: 4px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6); }
.rr-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.08); }
.rr-nav span { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }
.rr-nav button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid rgba(var(--primary-rgb), 0.4); background: rgba(var(--primary-rgb), 0.12); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.rr-nav button:hover { background: rgba(var(--primary-rgb), 0.25); }
.rr-nav svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

body:not(.menu-open) .rule-reader { display: none; }

.bg-logo { position: fixed; z-index: 1; pointer-events: none; right: -6vw; top: 50%; width: 78vh; height: 78vh; transform: translateY(-46%) rotate(-8deg); background: center / contain no-repeat; opacity: var(--bg-logo-opacity, 0.16); filter: saturate(0.9) brightness(1.35) blur(0.6px); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 45%, transparent 72%); mask-image: radial-gradient(circle at 50% 50%, #000 45%, transparent 72%); transition: opacity .35s ease; }
body:not(.menu-open) .bg-logo { opacity: 0; visibility: hidden; }
body.perf .bg-logo { filter: none; }

.map-viewer { contain: strict; }
.map-viewer-inner { backface-visibility: hidden; }
.map-legend, .map-blip-toggle, .map-pop, .map-loc, .map-hint, .map-external-btn, .map-ctrl-btn { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.map-legend { background: rgba(8, 7, 10, 0.92); }
.map-blip-toggle { background: rgba(8, 7, 10, 0.9); }
.map-viewer.dragging .map-blip, .map-viewer.dragging .map-label { transition: none; }
body.map-open .noise-overlay { visibility: hidden; }

.map-label, .map-label.tier-2, .map-postal { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.45); }
.map-label { opacity: 0.95; }

.map-tiles { position: absolute; left: 0; top: 0; pointer-events: none; display: none; }
.map-tiles.on { display: block; }
.map-tile { position: absolute; opacity: 0; }
.map-tile.ready { opacity: 1; }
.map-blip { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.map-blip.has-img { background: color-mix(in srgb, var(--bc) 30%, rgba(8,7,10,0.9)); }
.map-blip .bi { width: 20px; height: 20px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.8)); }
.ml-ic.has-img { background: color-mix(in srgb, var(--bc) 30%, rgba(8,7,10,0.9)); }
.ml-ic .bi { width: 14px; height: 14px; object-fit: contain; }
.mp-top .ml-ic .bi { width: 20px; height: 20px; }
.map-legend { width: 220px; }

.map-areas { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.map-area { position: absolute; border-radius: 50%; background: var(--bc); pointer-events: none; }

.map-me { z-index: 1; will-change: transform; contain: layout style; }
.map-me-pulse { will-change: transform, opacity; }
.map-viewer.dragging .map-me-pulse { animation-play-state: paused; }
.map-me-arrow::before { filter: none; }
.map-blips { z-index: 2; }
.map-me.covered { display: none; }

.card-map { contain: paint; }
.card-map .map-bg { will-change: transform; }

.map-tile { image-rendering: auto; transform: translateZ(0); }

.map-overlay { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; will-change: transform; --sc: 1; }
.map-overlay .map-blips, .map-overlay .map-labels, .map-overlay .map-postals { position: absolute; left: 0; top: 0; width: 0; height: 0; inset: auto; }
.map-overlay .map-blip, .map-overlay .map-label, .map-overlay .map-postal, .map-overlay .map-me { left: calc(var(--px) * var(--sc) * 1px); top: calc(var(--py) * var(--sc) * 1px); }
.map-overlay .map-blip { transform: none; }
.map-overlay .map-blip:hover { transform: scale(1.2); }
.map-overlay .map-label, .map-overlay .map-postal { transform: translate(-50%, -50%); }
.map-overlay .map-me { transform: none; }
.map-overlay .map-blip .bi { image-rendering: auto; }
.map-area.outline { background: transparent; border: 3px solid var(--bc); }

.rail-avatar.has-photo, #card-avatar.has-photo, #pd-avatar.has-photo, #pd-side-avatar.has-photo { background-size: 118% auto; background-position: center 18%; background-repeat: no-repeat; background-color: rgba(var(--primary-rgb), 0.22); }
.rail-avatar.has-photo span, #pd-avatar.has-photo span, #pd-side-avatar.has-photo span { display: none; }

.key-tile .key-action small { display: block; margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-light); opacity: .8; }
.key-tile.custom .keycap { border-color: rgba(var(--primary-rgb), 0.7); box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.3); }

.map-blip .hd { display: none; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--hd, 0deg)); pointer-events: none; }
.map-blip.has-hd .hd { display: block; }
.map-blip .hd::before { content: ''; position: absolute; left: -5px; top: -24px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--bc); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.7)); }
.map-blip { transition: none; }
.map-viewer.zooming .map-blip { transition: none; }

.map-viewer.zooming .map-blip { transition: none !important; }

.map-blip-toggle { left: calc(50% - 70px); }
.map-codes-toggle { position: absolute; top: 16px; left: calc(50% + 40px); transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); background: rgba(8, 7, 10, 0.9); border: 1px solid rgba(255,255,255,0.1); cursor: pointer; }
.map-codes-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-codes-toggle.active { color: var(--primary-light); border-color: rgba(var(--primary-rgb), 0.5); background: rgba(var(--primary-rgb), 0.14); }
.map-postals.zone .map-postal { padding: 2px 6px; border-radius: 5px; font-size: 10px; letter-spacing: .08em; background: rgba(8,7,10,0.72); border: 1px solid rgba(var(--primary-rgb), 0.45); color: var(--primary-light); text-shadow: none; }


.map-fx { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; }
.map-blip.lights { animation: kpm-lights 0.6s steps(1) infinite; }
@keyframes kpm-lights { 0% { box-shadow: 0 0 0 3px #ff2a3d, 0 0 0 5px rgba(42,110,255,0.35), 0 0 14px 4px rgba(255,42,61,0.8); } 50% { box-shadow: 0 0 0 3px #2a6eff, 0 0 0 5px rgba(255,42,61,0.35), 0 0 14px 4px rgba(42,110,255,0.8); } }
.map-blip.unit.lights { animation: kpm-lights 0.6s steps(1) infinite; }
.map-blip.unit { background: var(--bc); border: 2px solid #ffffff; box-shadow: 0 1px 4px rgba(0,0,0,0.65); }
.map-blip.unit svg { stroke: #ffffff; }
.map-blip.unit .ucs { font-family: var(--font-body); font-weight: 800; font-size: 9px; line-height: 1; color: #ffffff; letter-spacing: 0.2px; text-shadow: 0 0 2px rgba(0,0,0,0.85), 0 1px 1px rgba(0,0,0,0.85); white-space: nowrap; }
.map-blip.unit .ucs.long { font-size: 7.5px; }
.map-blip.unit .hd::before { border-bottom-color: #ffffff; }

body.map-open *, body.map-open *::before, body.map-open *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.map-open .noise-overlay { display: none; }
.map-overlay.map-under { z-index: 1; }
.map-blip:not(.unit):not(.pl):not(.waypoint):not(.area) { width: var(--gblip, 22px); height: var(--gblip, 22px); margin: calc(var(--gblip, 22px) / -2) 0 0 calc(var(--gblip, 22px) / -2); border-width: 1.5px; }
.map-blip:not(.unit):not(.pl):not(.waypoint):not(.area) svg { width: calc(var(--gblip, 22px) * 0.55); height: calc(var(--gblip, 22px) * 0.55); }
.map-blip:not(.unit):not(.pl):not(.waypoint):not(.area) .bi { width: calc(var(--gblip, 22px) * 0.7); height: calc(var(--gblip, 22px) * 0.7); }
