﻿:root {
  --bg-1: #060a1f;
  --bg-2: #101d3e;
  --bg-3: #0e3b31;
  --panel: rgba(10, 16, 36, 0.82);
  --panel-border: rgba(50, 220, 255, 0.34);
  --text-main: #ecf4ff;
  --text-soft: #abc0e4;
  --neon-cyan: #3ce7ff;
  --neon-lime: #7bffad;
  --neon-rose: #ff85c7;
  --neon-amber: #ffd88c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 14% 18%, rgba(44, 143, 255, 0.3), transparent 40%),
    radial-gradient(circle at 84% 75%, rgba(104, 255, 170, 0.22), transparent 36%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
  color: var(--text-main);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(60, 231, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 231, 255, 0.08) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 90%);
}

.runner-shell {
  width: min(96vw, 1240px);
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 30px rgba(50, 220, 255, 0.2), inset 0 0 40px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

h1 {
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}

h1 span {
  color: var(--neon-cyan);
  text-shadow: 0 0 14px rgba(60, 231, 255, 0.7);
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-links a,
.mini-link {
  border: 1px solid rgba(60, 231, 255, 0.44);
  border-radius: 8px;
  padding: 5px 10px;
  background: rgba(8, 16, 38, 0.7);
  color: #deeeff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 10px;
  flex: 1;
}

.hud-item {
  background: rgba(7, 11, 28, 0.8);
  border: 1px solid rgba(123, 255, 173, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
}

.hud-item label {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.hud-item strong {
  font-size: 18px;
}

.arena-wrap {
  display: grid;
  grid-template-columns: 1fr 248px;
  gap: 14px;
  align-items: start;
}

canvas {
  width: min(90vw, 960px);
  height: min(64vw, 540px);
  max-width: 960px;
  max-height: 540px;
  background:
    radial-gradient(circle at 16% 24%, rgba(60, 231, 255, 0.16), transparent 50%),
    linear-gradient(155deg, #0b132e, #091124 62%);
  border-radius: 16px;
  border: 1px solid rgba(123, 255, 173, 0.3);
  box-shadow: 0 0 26px rgba(60, 231, 255, 0.22), inset 0 0 34px rgba(0, 0, 0, 0.45);
}

.legend {
  background: rgba(7, 12, 30, 0.82);
  border: 1px solid rgba(255, 216, 140, 0.36);
  border-radius: 12px;
  padding: 12px;
}

.legend h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--neon-amber);
}

.legend p {
  margin: 8px 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.player-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(123, 255, 173, 0.25);
}

.mode-toggle-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-btn {
  flex: 1 1 0;
}

.mode-btn.is-active {
  border: 1px solid rgba(123, 255, 173, 0.45);
  box-shadow: 0 0 18px rgba(123, 255, 173, 0.26);
}

#level-controls.is-hidden {
  display: none;
}

.player-panel label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #d7e7ff;
}

.player-panel .hint {
  font-size: 12px;
  color: #93aad0;
}

.inline-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(60, 231, 255, 0.42);
  background: rgba(5, 10, 25, 0.8);
  color: #eaf4ff;
  padding: 6px 8px;
}

.mini-btn {
  margin-top: 0;
  margin-right: 0;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

kbd {
  border: 1px solid rgba(60, 231, 255, 0.42);
  border-radius: 6px;
  padding: 3px 6px;
  background: rgba(60, 231, 255, 0.11);
  margin-right: 4px;
  font-size: 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 5, 14, 0.72);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.panel {
  width: min(92vw, 580px);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(123, 255, 173, 0.4);
  background: rgba(9, 15, 34, 0.96);
  box-shadow: 0 0 34px rgba(60, 231, 255, 0.24);
  text-align: left;
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.panel p {
  color: #cbdbf5;
  line-height: 1.5;
}

button {
  margin-top: 14px;
  margin-right: 10px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(120deg, var(--neon-lime), #39ffd6);
  color: #042018;
  box-shadow: 0 0 16px rgba(123, 255, 173, 0.34);
}

button.secondary {
  background: transparent;
  color: #ffd8ea;
  border: 1px solid rgba(255, 133, 199, 0.45);
  box-shadow: none;
}

.hidden {
  display: none;
}

@media (max-width: 1000px) {
  .arena-wrap {
    grid-template-columns: 1fr;
  }

  .legend {
    width: min(90vw, 960px);
  }

  .hud {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}

@media (max-width: 680px) {
  .runner-shell {
    padding: 12px;
  }

  canvas {
    width: 92vw;
    height: 56vw;
  }
}
