/* KTF — KEEP THE FLOW: Dark Aggressive Tactical Action UI. Exclusively Black, Deep Red & White. */
:root {
  color-scheme: dark;
  --acid: #ff1e38;
  --acid-glow: rgba(255, 30, 56, 0.55);
  --acid-dark: #8b0015;
  --ink: #040407;
  --panel-bg: #09090e;
  --muted: #8a8d9a;
  --paper: #ffffff;
  --border-subtle: #2b1216;
}

.hidden { display: none !important; }

html, body {
  background: radial-gradient(ellipse at 50% 30%, #1a080c 0%, #0c090d 50%, #040407 100%);
  color: var(--paper);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#game-wrapper {
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  max-width: calc(100dvh * 9 / 16);
  max-height: 100dvh;
  container-type: size;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 30, 56, 0.2), 0 25px 100px #000000;
  background: #000000;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.ui-overlay {
  background: rgba(4, 4, 7, 0.94);
  backdrop-filter: blur(10px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.ui-overlay:not(.hidden) {
  animation: overlay-in 0.22s ease-out;
}

/* ================== KTF EXACT ARTWORK MAIN MENU ================== */
.ktf-exact-menu {
  padding: 0 !important;
  background: #040407 !important;
  overflow: hidden !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.ktf-menu-art-backdrop {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.ktf-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Tactical Mode Switcher Pill */
.ktf-mode-pill {
  position: absolute;
  top: 57.6%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 4, 7, 0.88);
  border: 1px solid rgba(255, 30, 56, 0.45);
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 15;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 15px rgba(255, 30, 56, 0.25);
}

.ktf-mode-pill .mode-option {
  background: none;
  border: none;
  color: #a4a7b5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  transition: all 0.15s;
}

.ktf-mode-pill .mode-option:hover {
  color: #ffffff;
}

.ktf-mode-pill .mode-option.selected {
  color: #ffffff;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(255, 30, 56, 0.65);
}

.ktf-mode-pill .mode-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

/* Interactive Hitbox Buttons Mapped Directly to Artwork */
.ktf-zone-btn {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 6px;
  z-index: 10;
  transition: all 0.16s ease;
}

.ktf-zone-btn:hover {
  background: rgba(255, 30, 56, 0.15);
  border-color: rgba(255, 40, 60, 0.6);
  box-shadow: 0 0 20px rgba(255, 30, 56, 0.5);
}

.ktf-zone-btn:active {
  background: rgba(255, 30, 56, 0.35);
  transform: scale(0.985);
}

/* Hitboxes measured on the 1080x1920 crop of assets/_src/menu_portrait_v2.jpg */
.zone-play {
  left: 31.2%;
  top: 61.2%;
  width: 38%;
  height: 3.8%;
}

.zone-loadout {
  left: 31.2%;
  top: 65.4%;
  width: 38%;
  height: 2.5%;
}

.zone-upgrades {
  left: 31.2%;
  top: 68.1%;
  width: 38%;
  height: 2.5%;
}

.zone-settings {
  left: 31.2%;
  top: 70.8%;
  width: 38%;
  height: 2.5%;
}

.zone-exit {
  left: 31.2%;
  top: 73.5%;
  width: 38%;
  height: 2.5%;
}

/* ================== MODALS & HUD ================== */
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--acid);
  margin-bottom: 8px;
}

.game-title, .modal-header {
  font-family: Impact, sans-serif;
  letter-spacing: 1px;
  font-size: 34px;
  color: #ffffff;
  margin: 0 0 6px;
}

.modal-sub {
  line-height: 1.5;
  color: #9ea0b0;
  font-size: 12px;
  margin-bottom: 16px;
}

.btn-primary {
  background: var(--acid);
  border: 1px solid #ff445c;
  border-radius: 6px;
  color: #ffffff;
  box-shadow: 0 4px 0 var(--acid-dark);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 12px 20px;
  min-height: 46px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

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

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--acid-dark);
}

.btn-secondary {
  background: #101119;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0.6px;
  padding: 10px 16px;
  min-height: 42px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: var(--acid);
  background: #17111a;
  box-shadow: 0 0 10px rgba(255, 30, 56, 0.25);
}

.menu-buttons {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
}

.settings-box, .pause-box {
  width: 100%;
  max-width: 340px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
  text-align: left;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0e0f17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.setting-item span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.setting-item-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: #0e0f17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.vol-percent {
  color: #00ffcc;
  font-weight: 800;
  font-family: monospace;
}

.slider-track-wrap {
  width: 100%;
  display: flex;
  align-items: center;
}

.ktf-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #1d1f2d;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ktf-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00ffcc;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.7);
  transition: transform 0.1s ease, background 0.1s ease;
}

.ktf-slider::-webkit-slider-thumb:hover,
.ktf-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
  background: #ffffff;
  box-shadow: 0 0 14px rgba(0, 255, 204, 1.0);
}

.ktf-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00ffcc;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.7);
  border: none;
}

.pause-audio-controls {
  width: 100%;
  max-width: 340px;
  margin: 10px auto 14px auto;
  text-align: left;
}

.stats-box {
  width: 100%;
  max-width: 340px;
  border: 1px solid rgba(255, 30, 56, 0.25);
  background: #0e0f17;
  border-radius: 8px;
  margin: 16px auto;
  padding: 14px 18px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9ea0b0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { color: #ffffff; font-weight: 800; }

.levelup-cards { max-width: 370px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.levelup-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  text-align: left;
  gap: 4px 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #141520 0%, #0b0c13 100%);
  cursor: pointer;
  transition: all 0.15s;
}

.levelup-card:hover {
  border-color: var(--acid);
  transform: translateX(4px);
  box-shadow: 0 0 15px rgba(255, 30, 56, 0.35);
}

.card-evolution {
  border-color: #ff3350 !important;
  background: linear-gradient(135deg, #2b0b12 0%, #13070b 100%) !important;
}

.gold-badge {
  display: inline-block;
  border: 1px solid rgba(255, 30, 56, 0.4);
  border-radius: 5px;
  color: #ff4d64;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  background: rgba(255, 30, 56, 0.08);
  margin-bottom: 14px;
}

.hud-pause-btn {
  position: absolute;
  width: 36px;
  height: 36px;
  right: 3%;
  top: 2%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(14, 15, 22, 0.85);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
}

.hud-sprint-btn {
  position: absolute;
  width: 66px;
  height: 66px;
  bottom: 3%;
  right: 4%;
  border-radius: 50%;
  border: 2px solid var(--acid);
  color: var(--acid);
  background: rgba(18, 7, 10, 0.92);
  box-shadow: 0 0 22px rgba(255, 30, 56, 0.35);
  cursor: pointer;
  z-index: 10;
}

.hud-dash-icon { font-size: 30px; line-height: 0.8; }
.hud-dash-icon small { display: block; font-size: 8px; margin-top: 4px; letter-spacing: 1px; }
.hud-dash-overlay { background: rgba(0, 0, 0, 0.7); position: absolute; inset: 0; border-radius: 50%; }

.result-record { font-size: 10px; letter-spacing: 2px; color: var(--acid); margin-top: 8px; }
.result-score { font: 74px/1.1 Impact, sans-serif; color: var(--acid); margin: 6px 0; text-shadow: 0 0 20px rgba(255, 30, 56, 0.5); }
.result-combo { color: #ffffff; font-size: 11px; letter-spacing: 1px; }

#toast {
  position: absolute;
  bottom: 25px;
  left: 5%;
  width: 90%;
  z-index: 100;
  border: 1px solid var(--acid);
  border-radius: 6px;
  padding: 12px;
  background: #140508;
  color: #ffffff;
  text-align: center;
  font-size: 12px;
}

.control-strip {
  display: flex;
  gap: 8px;
  color: #8c8d9a;
  font-size: 8px;
  letter-spacing: 0.5px;
}

kbd {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 4px;
  border-radius: 3px;
}

.desktop-note {
  position: fixed;
  left: 6%;
  top: 15%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #727482;
  font: 26px/1.1 Impact, sans-serif;
  letter-spacing: 1px;
}

.tiny-cross { font: 52px Arial, sans-serif; color: rgba(255, 30, 56, 0.45); }
.desktop-note small { font: 8px 'Segoe UI', sans-serif; letter-spacing: 1.5px; color: #8e909e; }
.desktop-footer { position: fixed; right: 6%; bottom: 12%; color: #727482; font: 20px/1.15 Impact, sans-serif; }
.desktop-footer span { display: block; margin-top: 16px; font: 8px 'Segoe UI', sans-serif; letter-spacing: 1px; }

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-breathe { 50% { transform: translateY(-4px); } }

@media (max-width: 900px) {
  .desktop-note, .desktop-footer { display: none; }
}

@media (max-height: 700px) {
  .ktf-glitch-title { font-size: 46px; }
  .ktf-subtitles { font-size: 8px; margin-top: 4px; }
  .ktf-hero-stage { min-height: 110px; max-height: 200px; }
  .ktf-play-btn { font-size: 18px; min-height: 44px; padding: 10px 16px; }
  .ktf-sub-btn { font-size: 10px; padding: 7px 10px; }
  .disteyo-logo { height: 32px; }
}

/* ================== RESULT SCREEN CHOREOGRAPHY ================== */
.result-screen { position: absolute; overflow: hidden; }
.result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 340px;
  margin: 4px auto 0;
}
.result-main { flex: 1; text-align: center; }
.result-rank {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 66px/1 Impact, sans-serif;
  color: var(--paper);
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: scale(2.4) rotate(-14deg);
  transition: none;
}
.result-rank.stamp { animation: rank-stamp 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.result-rank[data-rank="S"] { color: #ffd166; border-color: #ffd166; box-shadow: 0 0 28px rgba(255, 209, 102, 0.55); }
.result-rank[data-rank="A"] { color: var(--acid); border-color: var(--acid); box-shadow: 0 0 22px var(--acid-glow); }
.result-rank[data-rank="B"] { color: #ffffff; border-color: #ffffff; }
.result-rank[data-rank="C"] { color: #b9bccb; border-color: #6d7086; }
.result-rank[data-rank="D"] { color: #6d7086; border-color: #3a3c4d; }
.result-screen .result-score { transform: scale(0.7); opacity: 0; }
.result-screen.reveal .result-score { animation: score-in 0.35s ease-out forwards; }
.result-screen .end-title { opacity: 0; transform: translateY(14px); }
.result-screen.reveal .end-title { animation: title-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.result-screen .stats-box, .result-screen .menu-buttons { opacity: 0; transform: translateY(12px); }
.result-screen.reveal .stats-box { animation: title-in 0.4s 0.55s ease-out forwards; }
.result-screen.reveal .menu-buttons { animation: title-in 0.4s 0.75s ease-out forwards; }
.result-screen.new-best .result-record { color: #ffd166; animation: best-pulse 0.9s ease-in-out infinite; }
.result-screen.new-best .result-score { color: #ffd166; text-shadow: 0 0 26px rgba(255, 209, 102, 0.6); }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: var(--w);
  height: calc(var(--w) * 0.6);
  border-radius: 1px;
  animation: confetti-fall var(--d) var(--delay) cubic-bezier(0.3, 0.6, 0.6, 1) forwards;
  opacity: 0;
}
.result-screen > :not(.confetti) { position: relative; z-index: 1; }

@keyframes rank-stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-14deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(-6deg); } }
@keyframes score-in { to { transform: scale(1); opacity: 1; } }
@keyframes title-in { to { transform: translateY(0); opacity: 1; } }
@keyframes best-pulse { 50% { opacity: 0.45; } }
@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0.8; transform: translateY(110vh) rotate(var(--r)); }
}

/* ================== LEVEL-UP CARDS ================== */
#modal-levelup {
  background: rgba(4, 4, 7, 0.72);
  backdrop-filter: blur(6px) saturate(0.7);
}
.levelup-card {
  grid-template-columns: 44px 1fr;
  grid-template-areas: "icon title" "icon desc";
  opacity: 0;
  transform: translateX(-24px);
  animation: card-in 0.32s cubic-bezier(0.2, 1.2, 0.4, 1) forwards;
}
.levelup-card:nth-child(2) { animation-delay: 0.07s; }
.levelup-card:nth-child(3) { animation-delay: 0.14s; }
.levelup-card .card-icon { grid-area: icon; font-size: 30px; line-height: 1; text-align: center; }
.levelup-card .card-title { grid-area: title; font-size: 15px; font-weight: 800; color: #ffffff; }
.levelup-card .card-desc { grid-area: desc; font-size: 11.5px; color: #9ea0b0; line-height: 1.35; }
.levelup-card .card-tag {
  position: absolute; top: 8px; right: 10px;
  font-size: 8px; letter-spacing: 1.2px; font-weight: 800;
  color: var(--acid); border: 1px solid rgba(255, 30, 56, 0.5); border-radius: 3px; padding: 2px 5px;
}
.levelup-card.card-evolution .card-tag { color: #ffd166; border-color: #ffd166; }
.levelup-card.card-evolution .card-title { color: #ffd166; }
.levelup-card.card-evolution { box-shadow: 0 0 22px rgba(255, 209, 102, 0.25); animation: card-in 0.32s cubic-bezier(0.2, 1.2, 0.4, 1) forwards, evo-glow 1.4s 0.4s ease-in-out infinite; }
.levelup-card:active { transform: scale(0.97); }
@keyframes card-in { to { opacity: 1; transform: translateX(0); } }
@keyframes evo-glow { 50% { box-shadow: 0 0 34px rgba(255, 209, 102, 0.5); } }

/* ================== BOSS CHEST (pick one) ================== */
.chest-box { max-width: 370px; }
.chest-box .chest-title { margin-bottom: 6px; }
.chest-box .modal-sub { margin-bottom: 12px; }
.chest-gold {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 auto 8px; padding: 4px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #ffd166;
  background: rgba(255, 209, 102, 0.12); border: 1px solid rgba(255, 209, 102, 0.5);
}
.chest-list { margin-bottom: 4px; }
.chest-card { width: 100%; }

/* ================== AUGMENT ROUNDS ================== */
#modal-augment {
  background: rgba(4, 4, 7, 0.78);
  backdrop-filter: blur(7px) saturate(0.6);
}
#modal-augment[data-tier="gold"] { background: radial-gradient(ellipse at 50% 30%, rgba(255, 209, 102, 0.14), rgba(4, 4, 7, 0.86) 60%); }
#modal-augment[data-tier="prismatic"] { background: radial-gradient(ellipse at 50% 30%, rgba(255, 106, 213, 0.18), rgba(95, 245, 255, 0.08) 35%, rgba(4, 4, 7, 0.88) 65%); }
.aug-tier-title { letter-spacing: 3px; }
#modal-augment[data-tier="prismatic"] .aug-tier-title {
  background: linear-gradient(90deg, #ff6ad5, #ffd166, #5ff5ff, #ff6ad5);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
  animation: prism-shift 2.6s linear infinite;
}
@keyframes prism-shift { to { background-position: 300% 0; } }

.augment-card { grid-template-columns: 54px 1fr; }
.augment-card .card-icon { width: 52px; height: 52px; }
.augment-card.tier-prismatic .card-icon .icon-img { border-radius: 8px; filter: drop-shadow(0 0 8px rgba(255, 106, 213, 0.55)); }
.aug-code {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  font-size: 15px; font-weight: 900; letter-spacing: 1px;
  border: 2px solid currentColor; background: rgba(255, 255, 255, 0.04);
}
.augment-card.tier-silver { border-color: rgba(201, 209, 224, 0.55); }
.augment-card.tier-silver .aug-code, .augment-card.tier-silver .card-tag { color: #c9d1e0; border-color: #c9d1e0; }
.augment-card.tier-gold { border-color: rgba(255, 209, 102, 0.75); box-shadow: 0 0 18px rgba(255, 209, 102, 0.18); }
.augment-card.tier-gold .aug-code, .augment-card.tier-gold .card-tag, .augment-card.tier-gold .card-title { color: #ffd166; border-color: #ffd166; }
.augment-card.tier-prismatic {
  border-color: transparent;
  background:
    linear-gradient(135deg, #1a0b18 0%, #0a0f18 100%) padding-box,
    linear-gradient(120deg, #ff6ad5, #ffd166, #5ff5ff, #ff6ad5) border-box;
  background-size: 100% 100%, 300% 100%;
  box-shadow: 0 0 26px rgba(255, 106, 213, 0.32);
  animation: card-in 0.32s cubic-bezier(0.2, 1.2, 0.4, 1) forwards, prism-border 3s linear infinite;
}
@keyframes prism-border { to { background-position: 0 0, 300% 0; } }
.augment-card.tier-prismatic .aug-code, .augment-card.tier-prismatic .card-tag { color: #ff9be4; border-color: #ff9be4; }
.augment-card.tier-prismatic .card-title { color: #ffffff; text-shadow: 0 0 10px rgba(255, 106, 213, 0.6); }
.aug-reroll-btn { margin-top: 14px; min-width: 200px; }
.aug-reroll-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.aug-row { flex-wrap: wrap; }
.aug-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 70%; }
.aug-chip {
  font-size: 9px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap;
}
.aug-chip.tier-silver { color: #c9d1e0; }
.aug-chip.tier-gold { color: #ffd166; }
.aug-chip.tier-prismatic { color: #ff9be4; }
.aug-chip.aug-none { color: #5a5c68; border-style: dashed; }

/* ================== MENU PERSONAL BEST PILL ================== */
.ktf-best-pill {
  position: absolute;
  top: 3.2%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #ffffff;
  background: rgba(10, 4, 7, 0.82);
  border: 1px solid rgba(255, 30, 56, 0.45);
  border-radius: 12px;
  padding: 5px 12px;
  z-index: 15;
  pointer-events: none;
}
.ktf-best-pill b { color: #ffd166; }

/* PNG icons (assets/icons) replace the old emoji everywhere. */
.icon-img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.levelup-card .card-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.levelup-card.card-evolution .card-icon .icon-img { filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.7)); }
.u-icon { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; }
.ci-icon { display: inline-flex; width: 26px; height: 26px; flex: 0 0 26px; }
.u-btn { display: inline-flex; align-items: center; gap: 5px; }
.icon-coin { width: 15px; height: 15px; object-fit: contain; display: inline-block; vertical-align: middle; }

/* Nickname caption — sits where the artwork used to say PLAYER 01. */
.ktf-nick {
  position: absolute;
  top: 18.3%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  justify-content: center;
  width: 60%;
}
.ktf-nick-btn {
  background: none;
  border: 0;
  padding: 2px 8px;
  color: #d3d3da;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ktf-nick-btn .nick-edit {
  margin-left: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.15s;
}
.ktf-nick-btn:hover { color: #ffffff; background: rgba(255, 30, 56, 0.18); }
.ktf-nick-btn:hover .nick-edit { color: var(--acid); }
.ktf-nick-input {
  width: 180px;
  max-width: 100%;
  background: rgba(10, 4, 7, 0.9);
  border: 1px solid var(--acid);
  border-radius: 6px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-align: center;
  padding: 3px 8px;
  outline: none;
  box-shadow: 0 0 14px rgba(255, 30, 56, 0.45);
}

/* Pulse the PLAY zone so the eye lands on it. */
.zone-play { animation: play-pulse 2.2s ease-in-out infinite; }
@keyframes play-pulse { 50% { box-shadow: 0 0 22px rgba(255, 30, 56, 0.45); border-color: rgba(255, 40, 60, 0.55); } }

/* Pause / chest / heroes / upgrades entrance */
.pause-box, .chest-box, .settings-box { animation: title-in 0.3s cubic-bezier(0.2, 1.3, 0.4, 1); }

/* Dash button: ready pulse */
.hud-sprint-btn.ready { animation: dash-ready 1.1s ease-in-out infinite; }
@keyframes dash-ready { 50% { box-shadow: 0 0 34px rgba(255, 30, 56, 0.75); transform: scale(1.04); } }

.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }

/* Result titles follow the KTF palette, not the legacy neon gradient. */
.result-screen .end-title {
  background: none;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
  font-size: 44px;
  text-shadow: 0 0 24px rgba(255, 30, 56, 0.45);
}
.result-screen .game-subtitle { color: #9ea0b0; font-size: 11px; letter-spacing: 3px; margin-bottom: 18px; }
.result-screen .result-combo { color: #9ea0b0; font-size: 10px; letter-spacing: 1px; max-width: 220px; margin: 0 auto; line-height: 1.5; }
