:root {
  --bg: #07111f;
  --panel: rgba(15, 29, 51, 0.84);
  --panel-solid: #0f1d33;
  --panel-soft: rgba(20, 38, 64, 0.92);
  --text: #eef6ff;
  --muted: #afbfd3;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #4aa8ff;
  --accent-strong: #7bc0ff;
  --gold: #d7ae55;
}

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

body {
  min-height: 100vh;
  color: var(--text);
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.96), rgba(7, 17, 31, 0.7) 48%, rgba(7, 17, 31, 0.42)),
    linear-gradient(0deg, rgba(7, 17, 31, 0.94), rgba(7, 17, 31, 0.24) 55%);
}

button,
input,
select,
a {
  font: inherit;
}

.splash-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 10%, rgba(74, 168, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #0d1b2e 58%, #111927 100%);
  background-position: center;
  background-size: cover;
  transition: background-image 240ms ease;
}

.app-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 29, 51, 0.72);
  backdrop-filter: blur(18px);
}

.back-link,
.version-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-weight: 800;
}

.back-link {
  padding: 0 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.version-pill {
  padding: 0 12px;
  color: var(--accent-strong);
  border: 1px solid rgba(74, 168, 255, 0.32);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 14px;
}

.hero {
  max-width: 980px;
  margin-bottom: 10px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 4px;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 0.98;
}

h2 {
  margin-top: 3px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.05;
}

p,
label,
small {
  color: var(--muted);
  line-height: 1.65;
}

.controls,
.champion-panel,
.error-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.controls {
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel-solid);
}

input[type="range"] {
  accent-color: var(--accent);
}

select:focus,
input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(74, 168, 255, 0.24);
}

.level-readout {
  min-width: 96px;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(74, 168, 255, 0.3);
  border-radius: 8px;
  background: rgba(74, 168, 255, 0.12);
}

.level-readout span {
  color: var(--accent-strong);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.champion-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px;
}

.champion-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.58);
}

.champion-card img {
  width: 70px;
  height: 70px;
  border: 2px solid rgba(215, 174, 85, 0.62);
  border-radius: 8px;
  background: var(--panel-solid);
}

.spell-strip {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.spell-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px 34px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.spell-card span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.spell-card img,
.spell-icon-placeholder {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 174, 85, 0.42);
  border-radius: 8px;
  background: var(--panel-solid);
}

.spell-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spell-card.loading {
  opacity: 0.72;
}

.spell-error {
  grid-column: 1 / -1;
  color: var(--muted);
}

.stat-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.58);
}

.move-speed-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.58);
}

.ms-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(88px, 1fr)) 90px 110px;
  align-items: end;
  gap: 8px;
}

.ms-grid label {
  gap: 5px;
  font-size: 0.72rem;
}

.ms-grid input {
  min-height: 30px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: var(--panel-solid);
}

.ms-result {
  display: grid;
  gap: 5px;
}

.ms-result span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ms-result strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(74, 168, 255, 0.3);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(74, 168, 255, 0.12);
}

.ms-result.featured strong {
  border-color: rgba(215, 174, 85, 0.5);
  color: var(--gold);
  background: rgba(215, 174, 85, 0.12);
}

.editor-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.editor-heading button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(74, 168, 255, 0.34);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(74, 168, 255, 0.1);
  font-weight: 900;
  cursor: pointer;
}

.editor-heading button:hover {
  background: rgba(74, 168, 255, 0.16);
}

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

.editor-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 82px 82px 92px;
  align-items: end;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.editor-row h3 {
  color: var(--text);
  font-size: 0.88rem;
}

.editor-row label {
  gap: 5px;
  font-size: 0.72rem;
}

.editor-row input {
  min-height: 30px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: var(--panel-solid);
}

.editor-row input:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.editor-result {
  display: grid;
  gap: 5px;
  min-height: 30px;
  align-content: end;
}

.editor-result span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-result strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(74, 168, 255, 0.3);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(74, 168, 255, 0.12);
  font-size: 1rem;
}

.error-state {
  padding: 24px;
}

.error-state button {
  min-height: 44px;
  margin-top: 16px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #06101d;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.hidden {
  display: none;
}

@media (max-width: 920px) {
  .champion-panel,
  .move-speed-card,
  .ms-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header,
  .editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .controls,
  .champion-card,
  .editor-grid,
  .editor-row {
    grid-template-columns: 1fr;
  }

  .level-readout {
    justify-items: start;
  }
}
