/* KAISER KREW — Sporty Glass HUD & Menu Shell */
/* "Ride. Rhein. Roofs." — Kaiserswerth, Germany */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;900&family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:ital,wght@0,600;0,700;1,700&display=swap');

:root {
  --kk-font-logo: 'Big Shoulders Display', 'Impact', sans-serif;
  --kk-font-body: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --kk-font-hud: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  /* Colors */
  --kk-ink: #0E1116;
  --kk-panel: rgba(14, 18, 26, 0.84);
  --kk-panel-solid: #171C24;
  --kk-line: rgba(255, 255, 255, 0.14);
  --kk-text: #F3F0EA;
  --kk-text-dim: #A9B0BB;
  --kk-text-subtle: #6D7787;

  /* Crew & Theme Accents */
  --kk-accent: #00E5FF;
  --kk-accent-glow: rgba(0, 229, 255, 0.35);
  --kk-accent-secondary: #FF5722;

  /* Rule Colors */
  --kk-rule-people: #2EC5FF;
  --kk-rule-cars: #FFC233;
  --kk-rule-tram: #FF4057;

  /* Mayor & Alert */
  --kk-paper: #F1EBDD;
  --kk-paper-text: #1C1917;
  --kk-stamp: #C8102E;
  --kk-brass: #C9A24A;

  /* Landing Grades */
  --kk-grade-perfect: #FFD700;
  --kk-grade-clean: #00E5FF;
  --kk-grade-sketchy: #A9B0BB;
  --kk-grade-bail: #FF4057;

  /* Sizing & Targets */
  --kk-touch-target: 48px;
  --kk-panel-radius: 8px;
}

/* Base HUD Container */
.kk-hud-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--kk-font-hud);
  color: var(--kk-text);
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.kk-hud-root * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Glass Panels with Chamfered Corners */
.kk-glass {
  background: var(--kk-panel);
  border: 1px solid var(--kk-line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  clip-path: polygon(
    0 8px, 8px 0,
    calc(100% - 8px) 0, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 0 calc(100% - 8px)
  );
  pointer-events: auto;
}

/* Clickable Glass Items */
.kk-interactive {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.kk-interactive:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.kk-interactive:active {
  transform: translateY(1px);
}

/* ==========================================================================
   TOP LEFT: Player Card, Heat Stamps, Toasts
   ========================================================================== */
.kk-top-left {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}

.kk-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
}

.kk-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1C2331, #0E121A);
  border: 2px solid var(--kk-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kk-accent);
  font-family: var(--kk-font-logo);
  font-weight: 900;
  font-size: 20px;
  clip-path: polygon(0 4px, 4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px));
}

.kk-player-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.kk-player-name {
  font-family: var(--kk-font-logo);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
  text-transform: uppercase;
}

.kk-player-tag {
  font-size: 13px;
  color: var(--kk-text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Heat Stamps */
.kk-heat-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.kk-heat-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--kk-text-dim);
  text-transform: uppercase;
  margin-right: 4px;
}

.kk-heat-slots {
  display: flex;
  gap: 5px;
}

.kk-heat-stamp {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  clip-path: polygon(0 3px, 3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px));
}

.kk-heat-stamp svg {
  width: 13px;
  height: 13px;
}

.kk-heat-stamp.active-1 {
  background: #FFC233;
  color: #0E1116;
  border-color: #FFC233;
  box-shadow: 0 0 8px rgba(255, 194, 51, 0.4);
}
.kk-heat-stamp.active-2 {
  background: #FF9800;
  color: #0E1116;
  border-color: #FF9800;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
}
.kk-heat-stamp.active-3 {
  background: #FF5722;
  color: #fff;
  border-color: #FF5722;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
}
.kk-heat-stamp.active-4 {
  background: #E53935;
  color: #fff;
  border-color: #E53935;
  box-shadow: 0 0 12px rgba(229, 57, 53, 0.7);
}
.kk-heat-stamp.active-5 {
  background: #C8102E;
  color: #fff;
  border-color: #FF4057;
  box-shadow: 0 0 16px rgba(200, 16, 46, 0.9);
  animation: kk-pulse 1s infinite alternate;
}

.kk-heat-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--kk-rule-cars);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 4px;
}

/* Toast Container */
.kk-toast-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  pointer-events: none;
}

.kk-toast-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: kk-toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.kk-toast-item.fading {
  animation: kk-toast-out 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.kk-toast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--kk-accent);
}

/* ==========================================================================
   TOP CENTRE: District, Vibe Meter, Teardown Alert
   ========================================================================== */
.kk-top-center {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 20;
}

.kk-district-vibe {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 18px;
}

.kk-district-name {
  font-family: var(--kk-font-logo);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
}

.kk-vibe-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kk-vibe-bar {
  width: 90px;
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  clip-path: polygon(0 2px, 2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px));
}

.kk-vibe-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2EC5FF, #FFC233, #FF5722);
  transition: width 0.35s ease;
}

.kk-vibe-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--kk-accent);
  text-transform: uppercase;
}

/* Teardown Alert Banner (Mayor Bollwerk) */
.kk-alert-banner {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background: var(--kk-paper);
  color: var(--kk-paper-text);
  border: 2px solid var(--kk-stamp);
  box-shadow: 0 6px 20px rgba(200, 16, 46, 0.45);
  font-family: var(--kk-font-body);
  clip-path: polygon(
    0 6px, 6px 0,
    calc(100% - 6px) 0, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 0 calc(100% - 6px)
  );
  animation: kk-alert-pulse 1.4s infinite alternate;
}

.kk-alert-banner.active {
  display: flex;
}

.kk-alert-stamp {
  background: var(--kk-stamp);
  color: #fff;
  font-family: var(--kk-font-logo);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  text-transform: uppercase;
  transform: rotate(-3deg);
  border: 1px dashed rgba(255, 255, 255, 0.4);
}

.kk-alert-timer {
  font-family: var(--kk-font-logo);
  font-size: 26px;
  font-weight: 900;
  color: var(--kk-stamp);
  letter-spacing: 0.05em;
  line-height: 1;
}

.kk-alert-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
  color: #2b2620;
}

/* ==========================================================================
   TOP RIGHT: Minimap & Quick Actions
   ========================================================================== */
.kk-top-right {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 20;
}

.kk-minimap-card {
  width: 180px;
  height: 180px;
  position: relative;
  overflow: hidden;
  padding: 6px;
  pointer-events: auto !important;
  touch-action: none;
}

.kk-minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #090C10;
  clip-path: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px));
}

.kk-minimap-compass {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--kk-text-dim);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kk-minimap-compass svg {
  width: 12px;
  height: 12px;
  color: var(--kk-accent);
}

.kk-minimap-coords {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--kk-text-subtle);
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 5px;
}

.kk-quick-actions {
  display: flex;
  gap: 6px;
}

.kk-btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kk-text);
  border: 1px solid var(--kk-line);
  background: var(--kk-panel);
}

.kk-btn-icon svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   SCORE POPUP (NEVER COVERS SCREEN CENTRE)
   Positioned at top: 22% - 26% leaving character & crosshair 100% unobstructed.
   ========================================================================== */
.kk-score-popup-container {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 30;
}

.kk-score-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: kk-score-pop 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.kk-score-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kk-score-total-inline {
  font-family: var(--kk-font-logo);
  font-size: 26px;
  font-weight: 900;
  color: #ffd23a;
  letter-spacing: 0.05em;
  text-shadow: 0 0 16px rgba(255, 210, 58, 0.7);
  margin-left: 6px;
}

.kk-score-grade-badge {
  font-family: var(--kk-font-logo);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  padding: 6px 18px;
  margin-bottom: 4px;
}

/* Grade Color Styling */
.kk-score-grade-perfect {
  color: var(--kk-grade-perfect);
  background: rgba(255, 215, 0, 0.12);
  border: 2px solid var(--kk-grade-perfect);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.45);
}

.kk-score-grade-clean {
  color: var(--kk-grade-clean);
  background: rgba(0, 229, 255, 0.12);
  border: 2px solid var(--kk-grade-clean);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.kk-score-grade-sketchy {
  color: var(--kk-grade-sketchy);
  background: rgba(169, 176, 187, 0.12);
  border: 2px solid var(--kk-grade-sketchy);
}

/* BAIL: RED OUTLINE ONLY, NEVER RED FILL */
.kk-score-grade-bail {
  color: var(--kk-grade-bail);
  background: transparent !important;
  border: 2px solid var(--kk-grade-bail);
  box-shadow: 0 0 16px rgba(255, 64, 87, 0.4);
}

.kk-score-trick-name {
  font-family: var(--kk-font-hud);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.kk-score-breakdown {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  background: rgba(14, 18, 26, 0.85);
  padding: 4px 12px;
  border: 1px solid var(--kk-line);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--kk-text-dim);
}

.kk-score-breakdown b {
  color: #fff;
}

.kk-score-chain-tag {
  color: #FFC233;
  font-weight: 800;
}

.kk-score-total {
  font-family: var(--kk-font-logo);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
  margin-top: 2px;
  text-shadow: 0 0 14px var(--kk-accent-glow);
}

/* ==========================================================================
   RIGHT EDGE: Context Prompt
   ========================================================================== */
.kk-right-edge {
  position: absolute;
  top: 52%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.kk-prompt-badge {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(14, 18, 26, 0.9);
  border: 1px solid var(--kk-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px var(--kk-accent-glow);
}

.kk-prompt-badge.active {
  display: flex;
}

.kk-prompt-keycap {
  background: var(--kk-accent);
  color: var(--kk-ink);
  font-family: var(--kk-font-hud);
  font-size: 15px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.2;
}

.kk-prompt-text {
  font-family: var(--kk-font-hud);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}

/* ==========================================================================
   BOTTOM CENTRE: Run Score Total & Multiplier, Hotbar
   ========================================================================== */
.kk-bottom-center {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

/* Run Score Box */
.kk-run-score-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 18px;
  background: rgba(14, 18, 26, 0.85);
  border: 1px solid var(--kk-line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kk-run-score-wrap.kk-live {
  border-color: rgba(0, 229, 255, 0.7);
  background: rgba(14, 18, 26, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65), 0 0 16px rgba(0, 229, 255, 0.3);
}

.kk-run-score-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--kk-text-dim);
  text-transform: uppercase;
}

.kk-run-score-val {
  font-family: var(--kk-font-logo);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
  line-height: 1;
}

.kk-run-multiplier {
  font-family: var(--kk-font-logo);
  font-size: 20px;
  font-weight: 900;
  color: #FFC233;
  letter-spacing: 0.04em;
  line-height: 1;
}

.kk-run-multiplier.kk-hot {
  color: #ffd23a;
  font-size: 24px;
  text-shadow: 0 0 14px rgba(255, 210, 58, 0.8);
}

/* Hotbar */
.kk-hotbar {
  display: flex;
  gap: 6px;
  padding: 6px;
}

.kk-hotbar-slot {
  width: 54px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(22, 28, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--kk-text-dim);
  position: relative;
  transition: all 0.14s ease;
  clip-path: polygon(0 6px, 6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px));
}

.kk-hotbar-slot:hover {
  background: rgba(30, 38, 55, 0.85);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.kk-hotbar-slot.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--kk-accent);
  color: #fff;
  box-shadow: 0 0 14px var(--kk-accent-glow);
}

.kk-hotbar-slot.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 6px;
  right: 6px;
  height: 3px;
  background: var(--kk-accent);
}

.kk-slot-keycap {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--kk-text-subtle);
  line-height: 1;
}

.kk-hotbar-slot.active .kk-slot-keycap {
  color: var(--kk-accent);
}

.kk-slot-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kk-slot-icon svg {
  width: 100%;
  height: 100%;
}

.kk-slot-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 48px;
}

/* ==========================================================================
   BOTTOM RIGHT: Speedometer & Gear Readout
   ========================================================================== */
.kk-bottom-right {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 20;
}

.kk-speedo-card {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 16px;
}

.kk-speedo-val {
  font-family: var(--kk-font-logo);
  font-size: 40px;
  font-weight: 900;
  font-style: italic;
  color: #fff;
  line-height: 0.9;
}

.kk-speedo-unit {
  font-family: var(--kk-font-hud);
  font-size: 14px;
  font-weight: 700;
  color: var(--kk-accent);
  letter-spacing: 0.06em;
}

/* ==========================================================================
   START / TITLE SCREEN OVERLAY
   ========================================================================== */
.kk-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 10, 15, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.kk-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kk-start-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 860px;
  width: 90%;
  text-align: center;
  gap: 20px;
}

.kk-start-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.kk-start-title {
  font-family: var(--kk-font-logo);
  font-size: clamp(52px, 8vw, 84px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 229, 255, 0.4);
  margin: 0;
}

.kk-start-tagline {
  font-family: var(--kk-font-hud);
  font-size: clamp(18px, 2.8vw, 24px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--kk-accent);
  text-transform: uppercase;
  margin-top: 4px;
}

.kk-start-loc {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--kk-text-dim);
  text-transform: uppercase;
  margin-top: 6px;
}

/* Crew Selection Grid */
.kk-crew-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.kk-selector-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--kk-text-dim);
  text-transform: uppercase;
  text-align: left;
}

.kk-crew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
}

.kk-crew-card {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--kk-line);
  background: rgba(18, 23, 33, 0.7);
  transition: all 0.15s ease;
}

.kk-crew-card:hover {
  background: rgba(28, 36, 52, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.kk-crew-card.active {
  border-color: var(--kk-accent);
  background: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 16px var(--kk-accent-glow);
}

.kk-crew-name {
  font-family: var(--kk-font-logo);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
  text-transform: uppercase;
}

.kk-crew-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--kk-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Spawn Point Grid */
.kk-spawn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  width: 100%;
}

.kk-spawn-card {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--kk-line);
  background: rgba(18, 23, 33, 0.7);
}

.kk-spawn-card.active {
  border-color: #FFC233;
  background: rgba(255, 194, 51, 0.1);
  box-shadow: 0 0 14px rgba(255, 194, 51, 0.3);
}

.kk-spawn-name {
  font-family: var(--kk-font-hud);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.kk-spawn-sub {
  font-size: 11px;
  color: var(--kk-text-dim);
}

/* Big Parallelogram Primary CTA */
.kk-cta-btn {
  background: var(--kk-accent);
  color: var(--kk-ink);
  font-family: var(--kk-font-logo);
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.08em;
  padding: 12px 42px;
  border: none;
  cursor: pointer;
  transform: skewX(-8deg);
  box-shadow: 0 0 24px var(--kk-accent-glow);
  transition: transform 0.12s ease, filter 0.12s ease;
  min-height: var(--kk-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kk-cta-btn span {
  transform: skewX(8deg);
}

.kk-cta-btn:hover {
  filter: brightness(1.12);
  transform: skewX(-8deg) scale(1.03);
}

.kk-cta-btn:active {
  transform: skewX(-8deg) scale(0.98);
}

/* ==========================================================================
   PAUSE OVERLAY
   ========================================================================== */
.kk-pause-card {
  width: 440px;
  max-width: 92%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kk-pause-title {
  font-family: var(--kk-font-logo);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-align: center;
  margin: 0;
  line-height: 1;
}

.kk-pause-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kk-menu-btn {
  padding: 12px 18px;
  font-family: var(--kk-font-hud);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(22, 28, 40, 0.8);
  border: 1px solid var(--kk-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--kk-touch-target);
}

.kk-menu-btn.primary {
  background: var(--kk-accent);
  color: var(--kk-ink);
  border-color: var(--kk-accent);
}

.kk-menu-btn.danger {
  color: var(--kk-grade-bail);
  border-color: rgba(255, 64, 87, 0.3);
}

/* Settings Sub-Panel */
.kk-settings-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  background: rgba(10, 14, 20, 0.9);
  padding: 16px;
  border: 1px solid var(--kk-line);
}

.kk-settings-panel.active {
  display: flex;
}

.kk-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--kk-text);
}

.kk-setting-row input[type="range"] {
  accent-color: var(--kk-accent);
  width: 140px;
}

.kk-setting-row input[type="checkbox"] {
  accent-color: var(--kk-accent);
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes kk-score-pop {
  0% {
    opacity: 0;
    transform: scale(0.65) translateY(24px);
  }
  15% {
    opacity: 1;
    transform: scale(1.08) translateY(-4px);
  }
  25% {
    transform: scale(1) translateY(0);
  }
  80% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.92) translateY(-14px);
  }
}

@keyframes kk-toast-in {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes kk-toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-16px);
  }
}

@keyframes kk-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes kk-alert-pulse {
  from { box-shadow: 0 4px 16px rgba(200, 16, 46, 0.35); }
  to { box-shadow: 0 6px 26px rgba(200, 16, 46, 0.7); }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .kk-score-popup {
    animation: none !important;
    opacity: 1;
  }
  .kk-interactive:hover,
  .kk-interactive:active,
  .kk-cta-btn:hover,
  .kk-cta-btn:active {
    transform: none !important;
  }
}

/* High Contrast Mode */
.kk-high-contrast {
  --kk-panel: #000000;
  --kk-line: #FFFFFF;
  --kk-text: #FFFFFF;
  --kk-text-dim: #E0E0E0;
}
.kk-high-contrast .kk-glass {
  border-width: 2px;
}

/* ==========================================================================
   RESPONSIVE (<= 760px)
   ========================================================================== */
@media (max-width: 760px) {
  .kk-minimap-card {
    width: 104px;
    height: 104px;
  }
  .kk-district-name {
    font-size: 16px;
  }
  .kk-vibe-bar {
    width: 60px;
  }
  .kk-hotbar-slot {
    width: 44px;
    height: 44px;
  }
  .kk-slot-label {
    display: none;
  }
  .kk-run-score-val {
    font-size: 26px;
  }
  .kk-speedo-val {
    font-size: 30px;
  }
}

/* ==========================================================================
   SLICE ADDITIONS: hint line, air counter, street popup, score note
   ========================================================================== */
.kk-hint-line {
  font-family: var(--kk-font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--kk-text);
  background: rgba(14, 18, 26, 0.72);
  border: 1px solid var(--kk-line);
  padding: 6px 14px;
  border-radius: 4px;
  max-width: min(640px, 90vw);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.kk-hint-line.active { opacity: 1; transform: none; }
.kk-hint-line:empty { display: none; }

.kk-air-counter {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  font-family: var(--kk-font-hud);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 25;
}
.kk-air-counter.active { opacity: 1; }

.kk-street-popup {
  position: absolute;
  left: 16px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px 8px 14px;
  background: rgba(14, 18, 26, 0.84);
  border-left: 4px solid var(--kk-accent-secondary);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 20;
}
.kk-street-popup.active { opacity: 1; transform: none; }
.kk-street-name {
  font-family: var(--kk-font-logo);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
}
.kk-street-sub {
  font-family: var(--kk-font-hud);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--kk-text-dim);
  text-transform: uppercase;
}
.kk-street-sub:empty { display: none; }

.kk-score-note {
  font-family: var(--kk-font-hud);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--kk-text-dim);
  text-transform: uppercase;
  margin-top: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.kk-run-multiplier.kk-hot {
  animation: kk-pulse 0.5s ease-in-out infinite alternate;
}

/* ==========================================================================
   MINIMAL PASS (owner: "ultra minimalist, intuitive and self-explanatory")
   One visual language: dark rounded surfaces, round buttons, one orange accent.
   Only what a rider needs: who, the map, sound and pause, speed, the run when one is live, one hint.
   ========================================================================== */
:root {
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --kk-edge: 16px;
  --kk-surface: rgba(14, 18, 26, 0.72);
}
.kk-hud-root { --kk-accent: #FF6A2A; --kk-accent-glow: rgba(255, 106, 42, 0.35); }

.kk-glass {
  clip-path: none;
  border-radius: 12px;
  box-shadow: none;
  background: var(--kk-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.kk-glass:not(.kk-interactive) { pointer-events: none; }
/* owner 2026-10-11: the pause / challenge menus' buttons sat inside a non-interactive glass card and inherited
   pointer-events none - none of them could be clicked. Interactive controls always take clicks. */
.kk-interactive { pointer-events: auto; }

/* rider chip (top left): avatar + name. Tap it to switch rider. */
.kk-top-left { top: calc(12px + var(--sat)); left: calc(var(--kk-edge) + var(--sal)); }
.kk-player-card { gap: 8px; padding: 5px 16px 5px 5px; border-radius: 999px; }
.kk-avatar { width: 34px; height: 34px; border-radius: 50%; clip-path: none; font-size: 17px; }
.kk-player-info { margin-left: 0; }
.kk-player-name { font-family: var(--kk-font-logo); font-size: 22px; font-weight: 900; letter-spacing: 0.05em; line-height: 1; }
.kk-player-tag { display: none; }

/* top right: sound and pause above a round map; no compass, no coordinates */
.kk-top-right { top: calc(12px + var(--sat)); right: calc(var(--kk-edge) + var(--sar)); flex-direction: column-reverse; gap: 8px; }
.kk-minimap-card { width: 124px; height: 124px; padding: 0; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.85); background: #0a0d12; }
.kk-minimap-canvas { clip-path: none; border-radius: 50%; }
.kk-minimap-compass, .kk-minimap-coords { display: none; }
.kk-quick-actions { gap: 8px; }
.kk-btn-icon { width: 44px; height: 44px; border-radius: 50%; padding: 0; color: #fff; }
.kk-btn-icon svg { width: 20px; height: 20px; }
.kk-btn-icon:focus-visible, .kk-player-card:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* the run: only while there is one; the word is smaller than the number */
.kk-run-score-wrap { display: none; order: -1; padding: 4px 18px; border-radius: 999px; gap: 8px; }
.kk-run-score-wrap.kk-live { display: flex; }
.kk-run-score-val { font-size: 30px; }
.kk-run-multiplier { font-size: 18px; }

/* one hint line, calm */
.kk-bottom-center { bottom: calc(16px + var(--sab)); gap: 8px; }
.kk-hint-line { font-size: 15px; font-weight: 500; padding: 6px 14px; border: 0; border-radius: 10px; background: var(--kk-surface); text-shadow: none; max-width: min(520px, 90vw); }

/* speed: a small pill, bottom right */
.kk-bottom-right { right: calc(var(--kk-edge) + var(--sar)); bottom: calc(16px + var(--sab)); }
.kk-speedo-card { padding: 4px 14px; border-radius: 999px; gap: 5px; }
.kk-speedo-val { font-size: 28px; }
.kk-speedo-unit { font-size: 12px; color: var(--kk-text-dim); }

/* build bar */
.kk-hotbar { padding: 5px; border-radius: 14px; gap: 5px; }
.kk-hotbar-slot { clip-path: none; border-radius: 10px; }
.kk-slot-label { font-size: 11px; }

/* parts the S1 game does not use */
.kk-right-edge { display: none; }

/* ---- phone: landscape, thumbs own the lower corners, so the HUD lives on the top edge ---- */
body.kk-touch .kk-minimap-card { width: 92px; height: 92px; border-width: 2px; }
body.kk-touch .kk-top-right { top: calc(8px + var(--sat)); right: calc(12px + var(--sar)); gap: 6px; }
body.kk-touch .kk-top-left { top: calc(8px + var(--sat)); left: calc(12px + var(--sal)); }
body.kk-touch .kk-bottom-center { bottom: auto; top: calc(8px + var(--sat)); }
body.kk-touch .kk-hint-line { max-width: calc(100vw - 360px); min-width: 0; }
body.kk-touch .kk-bottom-right { right: auto; left: calc(12px + var(--sal)); bottom: calc(12px + var(--sab)); }
body.kk-touch .kk-speedo-card { padding: 2px 12px; }
body.kk-touch .kk-speedo-val { font-size: 24px; }
body.kk-touch .kk-street-popup { display: none; }
body.kk-touch .kk-slot-keycap { display: none; }
body.kk-touch[data-mode="build"] .kk-bottom-center { top: auto; bottom: calc(12px + var(--sab)); }
body.kk-touch[data-mode="build"] .kk-hint-line { max-width: calc(100vw - 480px); }
body.kk-touch[data-mode="build"] .kk-minimap-card { display: none; }
body.kk-touch[data-mode="build"] .kk-bottom-right { display: none; }
body.kk-touch .kk-hotbar-slot { width: 56px; height: 56px; }
body.kk-touch .kk-toast-container { max-width: 240px; }

/* ---------------------------------------------------------------- gear + polish round (2026-10-06) */
/* speed pill: glows with the cruise tier (player.cruiseInfo), flares on a boost; a thin line fills to the next tier */
.kk-speedo-card { position: relative; overflow: hidden; transition: box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease; }
.kk-speedo-card[data-tier="1"] { border-color: rgba(255, 170, 90, 0.55); box-shadow: 0 0 12px rgba(255, 150, 70, 0.32); }
.kk-speedo-card[data-tier="2"] { border-color: rgba(255, 140, 55, 0.8); box-shadow: 0 0 18px rgba(255, 125, 45, 0.5), inset 0 0 10px rgba(255, 120, 40, 0.14); }
.kk-speedo-card[data-tier="3"] { border-color: rgba(255, 95, 70, 0.95); box-shadow: 0 0 26px rgba(255, 85, 60, 0.68), inset 0 0 14px rgba(255, 90, 60, 0.2); animation: kkSpeedHot 1.15s ease-in-out infinite; }
.kk-speedo-card.boost { border-color: #fff1c2; box-shadow: 0 0 0 1px #fff1c2, 0 0 34px rgba(255, 205, 100, 0.95), inset 0 0 16px rgba(255, 220, 140, 0.35); animation: none; }
@keyframes kkSpeedHot { 0%, 100% { box-shadow: 0 0 22px rgba(255, 85, 60, 0.55), inset 0 0 12px rgba(255, 90, 60, 0.16); } 50% { box-shadow: 0 0 32px rgba(255, 85, 60, 0.85), inset 0 0 16px rgba(255, 90, 60, 0.26); } }
.kk-speedo-tier { font: 800 10px/1 var(--kk-font-hud, 'Barlow Condensed', sans-serif); letter-spacing: 0.16em; color: #ffb35c; margin-left: 2px; align-self: center; }
.kk-speedo-tier:empty { display: none; }
.kk-speedo-card[data-tier="3"] .kk-speedo-tier, .kk-speedo-card.boost .kk-speedo-tier { color: #ffe0a8; }
.kk-speedo-prog { position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, #ff6a2a, #ffc233); transform-origin: left center; transform: scaleX(0); transition: transform 0.25s linear; opacity: 0.85; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .kk-speedo-card[data-tier="3"] { animation: none; } }
body.kk-reduce-motion .kk-speedo-card[data-tier="3"] { animation: none; }

/* captions for key sounds and voice lines in the open town (the Markt slice has its own) */
.kk-captions { position: absolute; left: 50%; bottom: calc(132px + var(--sab, 0px)); transform: translate(-50%, var(--kk-cap-lift, 0px)); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 21; max-width: min(560px, calc(100vw - 32px)); }
.kk-captions div, .kk-caption-item { padding: 4px 11px; border-radius: 8px; background: rgba(10, 12, 18, 0.84); color: #f3f0ea; font: 600 15px/1.3 var(--kk-font-body, 'Barlow', sans-serif); text-align: center; animation: kkCapIn 0.18s ease-out, kkCapOut 0.4s ease-in 1.9s forwards; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }
@keyframes kkCapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes kkCapOut { to { opacity: 0; } }
body.kk-touch .kk-captions { bottom: auto; top: calc(100px + var(--sat, 0px)); }

/* Directional caption side markers & arrows (XAG 120 accessibility) */
.kk-caption-item.kk-caption-left, .kk-caption-item.kk-caption-side-left { border-left: 3.5px solid #00e5ff; box-shadow: -4px 4px 16px rgba(0, 229, 255, 0.3); }
.kk-caption-item.kk-caption-right, .kk-caption-item.kk-caption-side-right { border-right: 3.5px solid #00e5ff; box-shadow: 4px 4px 16px rgba(0, 229, 255, 0.3); }
.kk-caption-item.kk-caption-front, .kk-caption-item.kk-caption-ahead { border-top: 3.5px solid #ffd15c; box-shadow: 0 -2px 14px rgba(255, 209, 92, 0.25); }
.kk-caption-item.kk-caption-back, .kk-caption-item.kk-caption-behind { border-bottom: 3.5px solid #ff6a2a; box-shadow: 0 4px 14px rgba(255, 106, 42, 0.25); }
.kk-caption-marker { display: inline-flex; align-items: center; justify-content: center; font-family: var(--kk-font-hud, 'Barlow Condensed', sans-serif); font-size: 14px; font-weight: 800; line-height: 1; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.kk-caption-marker.left, .kk-caption-marker.right { color: #00e5ff; background: rgba(0, 229, 255, 0.18); }
.kk-caption-marker.front, .kk-caption-marker.ahead { color: #ffd15c; background: rgba(255, 209, 92, 0.18); }
.kk-caption-marker.back, .kk-caption-marker.behind { color: #ff6a2a; background: rgba(255, 106, 42, 0.18); }
.kk-caption-text { display: inline; }
body.kk-captions-off .kk-captions { display: none !important; }
body.kk-caption-dir-off .kk-caption-marker { display: none !important; }
body.kk-caption-dir-off .kk-caption-item { border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }
.kk-setting-row.kk-dimmed { opacity: 0.45; pointer-events: none; }

/* the place name sits above the desktop control strip (onboarding.js sets --kk-strip-h), never under it */
body:not(.kk-touch) .kk-street-popup { bottom: calc(var(--kk-strip-h, 0px) + 26px); transition: opacity 0.3s ease, transform 0.3s ease, bottom 0.25s ease; }

/* the first-run coach's arrow, when its place is off screen (onboarding.js .kkg-edge): a small yellow badge at the
   screen edge that points the way, with the distance under it (LOOP 1 check 2026-10-08) */
.kkg-edge { position: fixed; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 23; display: none; pointer-events: none; }
.kkg-edge.on { display: block; }
#kk-guide:not(.on) .kkg-edge { display: none; }
.kkg-edge svg { width: 44px; height: 44px; border-radius: 50%; background: #ffc233; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); fill: none; stroke: #14100c; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; padding: 9px; box-sizing: border-box; }
.kkg-edge b { position: absolute; left: 50%; top: 48px; transform: translateX(-50%); white-space: nowrap; font: 800 13px/1 var(--kk-font-hud, sans-serif); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
@media (prefers-reduced-motion: no-preference) { .kkg-edge.on svg { animation: kkgEdgePulse 1.1s ease-in-out infinite; } }
@keyframes kkgEdgePulse { 50% { box-shadow: 0 0 0 6px rgba(255, 194, 51, 0.35), 0 4px 14px rgba(0, 0, 0, 0.45); } }
