:root {
  --bg: #070d15;
  --panel: rgba(12, 20, 34, 0.78);
  --panel-solid: #101a2a;
  --panel-soft: rgba(18, 30, 48, 0.88);
  --text: #eef6ff;
  --muted: #aab9c9;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(215, 174, 85, 0.34);
  --accent: #3fb7df;
  --accent-strong: #8ee7ff;
  --gold: #d7ae55;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

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

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

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 13, 21, 0.98), rgba(7, 13, 21, 0.78) 45%, rgba(7, 13, 21, 0.5)),
    linear-gradient(0deg, rgba(7, 13, 21, 0.96), rgba(7, 13, 21, 0.32) 58%);
}

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

.splash-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, #070d15 0%, #101b2a 58%, #161a20 100%);
  background-position: center;
  background-size: cover;
  filter: saturate(1.06) contrast(1.04);
  transition: background-image 260ms ease, opacity 260ms ease;
}

.app-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px auto 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 25, 0.72);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px);
}

.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.075);
  transition: background 160ms ease, transform 160ms ease;
}

.version-pill {
  padding: 0 12px;
  color: var(--accent-strong);
  border: 1px solid rgba(63, 183, 223, 0.34);
  background: rgba(63, 183, 223, 0.08);
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

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

.hero {
  max-width: 920px;
  margin-bottom: 18px;
  padding: 18px 0 8px;
}

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

h1 {
  max-width: 780px;
  margin-top: 6px;
  font-size: clamp(2.35rem, 5vw, 4.65rem);
  line-height: 0.95;
  text-wrap: balance;
}

.hero p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 14px;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

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: var(--shadow);
  backdrop-filter: blur(22px);
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
}

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

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

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(5, 11, 19, 0.76);
}

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

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

.level-readout {
  min-width: 110px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(63, 183, 223, 0.32);
  border-radius: 8px;
  background: rgba(63, 183, 223, 0.12);
}

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

.champion-panel {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  align-items: start;
  gap: 14px;
  padding: 14px;
}

.champion-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(215, 174, 85, 0.1), rgba(63, 183, 223, 0.04)),
    rgba(7, 13, 21, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.champion-card img {
  width: 82px;
  height: 82px;
  border: 2px solid rgba(215, 174, 85, 0.62);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

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

.spell-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 30, 48, 0.74);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

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

.spell-card img,
.spell-icon-placeholder {
  width: 38px;
  height: 38px;
  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.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spell-card:hover {
  border-color: rgba(215, 174, 85, 0.38);
  background: rgba(24, 39, 60, 0.86);
  transform: translateY(-1px);
}

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

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

.stat-editor {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 13, 21, 0.62);
}

.move-speed-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: end;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(63, 183, 223, 0.09), transparent 52%),
    rgba(7, 13, 21, 0.62);
}

.ms-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr)) minmax(92px, 0.8fr) minmax(116px, 0.9fr);
  align-items: end;
  gap: 10px;
}

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

.ms-grid input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(5, 11, 19, 0.76);
}

.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: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(63, 183, 223, 0.3);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(63, 183, 223, 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(63, 183, 223, 0.34);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(63, 183, 223, 0.1);
  font-weight: 900;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.editor-heading button:hover {
  background: rgba(63, 183, 223, 0.16);
  transform: translateY(-1px);
}

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

.editor-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 82px 82px 92px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 30, 48, 0.78);
  transition: border-color 160ms ease, background 160ms ease;
}

.editor-row:hover {
  border-color: rgba(63, 183, 223, 0.28);
  background: rgba(22, 36, 56, 0.9);
}

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

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

.editor-row input {
  min-height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(5, 11, 19, 0.76);
}

.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: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(63, 183, 223, 0.3);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(63, 183, 223, 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;
  }

  .app-shell {
    padding-top: 14px;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
  }
}
