html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #080a14;
  color: #eef4ff;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

canvas#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

.nk-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.nk-top-left {
  position: fixed;
  top: 16px;
  left: 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-shadow: 0 0 14px rgba(46, 240, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.8);
}

.nk-pos {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: #ffffff;
}

.nk-pos-suf {
  font-size: 22px;
  font-weight: 700;
  color: #2ef0ff;
  margin-left: 2px;
}

.nk-lap {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffb8dd;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 16, 32, 0.65);
  border: 1px solid rgba(255, 46, 136, 0.45);
}

.nk-top-right {
  position: fixed;
  top: 16px;
  right: 20px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.nk-timer {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 46, 136, 0.55), 0 2px 6px rgba(0, 0, 0, 0.8);
}

.nk-best {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #9ddcff;
  background: rgba(11, 16, 32, 0.6);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(46, 240, 255, 0.3);
}

.nk-controls-row {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.nk-btn-mini {
  background: rgba(12, 18, 36, 0.72);
  color: #e8f6ff;
  border: 1px solid rgba(46, 240, 255, 0.45);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.nk-btn-mini:hover {
  background: rgba(46, 240, 255, 0.22);
  transform: translateY(-1px);
}

.nk-minimap-wrap {
  position: fixed;
  top: 108px;
  right: 20px;
  width: 136px;
  height: 136px;
  border-radius: 14px;
  background: radial-gradient(circle at center, rgba(14, 20, 42, 0.78), rgba(7, 10, 22, 0.86));
  border: 1px solid rgba(46, 240, 255, 0.35);
  box-shadow: 0 0 18px rgba(10, 16, 36, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nk-minimap {
  width: 128px;
  height: 128px;
}

.nk-bottom-left {
  position: fixed;
  bottom: 18px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nk-meter-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9beeff;
  text-shadow: 0 0 8px rgba(46, 240, 255, 0.6);
}

.nk-flow-svg {
  width: 210px;
  height: 62px;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(46, 240, 255, 0.55));
}

.nk-bottom-right {
  position: fixed;
  bottom: 18px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nk-spark-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nk-spark-wrap.ready {
  animation: nkPulse 0.75s ease-in-out infinite;
}

.nk-spark-svg {
  width: 108px;
  height: 108px;
  filter: drop-shadow(0 0 10px rgba(46, 240, 255, 0.6));
}

.nk-spark-center {
  position: absolute;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #e6fbff;
  line-height: 1.15;
  text-shadow: 0 0 10px rgba(255, 46, 136, 0.75);
}

@keyframes nkPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px #2ef0ff); }
  50% { transform: scale(1.09); filter: drop-shadow(0 0 22px #ff2e88); }
}

.nk-title-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.nk-title-main {
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 900;
  letter-spacing: 10px;
  color: #ffffff;
  text-shadow:
    0 0 12px #2ef0ff,
    0 0 28px #ff2e88,
    0 0 54px rgba(255, 46, 136, 0.7);
  margin: 0;
}

.nk-title-sub {
  margin-top: 6px;
  font-size: clamp(13px, 2vw, 18px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #c8e8ff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.nk-turtle-quote {
  margin-top: 18px;
  max-width: 520px;
  text-align: center;
  font-size: 15px;
  font-style: italic;
  color: #ffe2b3;
  background: rgba(8, 12, 26, 0.62);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 174, 72, 0.45);
  text-shadow: 0 0 10px rgba(255, 160, 60, 0.5);
}

.nk-countdown {
  margin-top: 18px;
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #2ef0ff;
  text-shadow: 0 0 20px #2ef0ff, 0 0 42px #ff2e88;
  transition: transform 0.22s ease, opacity 0.25s ease;
}

.nk-popup-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.nk-popup {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  animation: nkPopFloat 0.95s ease-out forwards;
}

.nk-popup.flow {
  color: #2ef0ff;
  text-shadow: 0 0 14px #2ef0ff, 0 2px 8px rgba(0, 0, 0, 0.85);
}

.nk-popup.miss {
  color: #ff3b93;
  text-shadow: 0 0 16px #ff2e88, 0 2px 8px rgba(0, 0, 0, 0.9);
}

.nk-popup.rush {
  font-size: 36px;
  color: #fff27a;
  text-shadow: 0 0 18px #ff2e88, 0 0 32px #2ef0ff;
}

.nk-popup.banner {
  top: 24%;
  font-size: 32px;
  color: #ffd3ea;
  text-shadow: 0 0 18px #ff2e88, 0 0 28px rgba(46, 240, 255, 0.7);
}

@keyframes nkPopFloat {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(0.96); }
}

.nk-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(circle at center, transparent 45%, rgba(255, 46, 136, 0.45) 100%);
}

.nk-labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.nk-rival-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.15s linear;
}

.nk-rival-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid currentColor;
  text-shadow: 0 0 8px currentColor;
}

.nk-rival-taunt {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  font-style: italic;
  color: #ffffff;
  background: rgba(10, 14, 30, 0.82);
  padding: 3px 9px;
  border-radius: 8px;
  text-shadow: 0 0 10px currentColor;
}

.nk-draft-pill {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #2ef0ff;
  background: rgba(8, 16, 32, 0.72);
  border: 1px solid rgba(46, 240, 255, 0.65);
  border-radius: 999px;
  padding: 4px 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 0 10px #2ef0ff;
}

.nk-finale-caption {
  position: fixed;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.nk-finale-caption h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow: 0 0 18px #2ef0ff, 0 0 36px #ff2e88;
}

.nk-finale-caption p {
  margin: 8px 0 0;
  font-size: 16px;
  color: #ffd5ec;
  letter-spacing: 1.5px;
}

.nk-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 18, 0.68);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  z-index: 25;
}

.nk-modal.open {
  display: flex;
}

.nk-card {
  width: min(440px, 90vw);
  padding: 26px 28px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 20, 40, 0.94), rgba(10, 12, 26, 0.96));
  border: 1px solid rgba(46, 240, 255, 0.45);
  box-shadow: 0 0 36px rgba(255, 46, 136, 0.28), 0 16px 40px rgba(0, 0, 0, 0.65);
  text-align: center;
}

.nk-card h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 14px #2ef0ff;
}

.nk-card-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: #ffb8dd;
}

.nk-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}

.nk-stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(46, 240, 255, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
}

.nk-stat-k {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8cc9e8;
}

.nk-stat-v {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.nk-badge {
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(46, 240, 255, 0.18), rgba(255, 46, 136, 0.22));
  border: 1px solid rgba(255, 210, 90, 0.6);
  color: #ffe89e;
  font-size: 13px;
  font-weight: 700;
}

.nk-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.nk-btn {
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid #2ef0ff;
  background: linear-gradient(135deg, rgba(46, 240, 255, 0.24), rgba(255, 46, 136, 0.28));
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.nk-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(46, 240, 255, 0.55);
}

.nk-btn.secondary {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.nk-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #9bb4d4;
}

.nk-controls-hint {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.7px;
  color: rgba(208, 232, 255, 0.7);
  background: rgba(8, 12, 24, 0.55);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
