@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800&family=Inter:wght@400;600;700&display=swap');

:root {
  --gold: #c8aa6e;
  --gold-bright: #f0e6d2;
  --blue: #0ac8b9;
  --red: #e84057;
  --bg-dark: #010a13;
  --panel: rgba(1, 10, 19, 0.82);
  --panel-border: rgba(200, 170, 110, 0.45);

  /* Sophisticated-minimal surface system (homepage cards) */
  --surface: #0f0f0f;
  --surface-2: #1a1a1a;
  --surface-3: #202020;
  --line: #222222;
  --line-2: #333333;
  --label: #9ca3af;
  --muted: #808080;
  --muted-2: #606060;
  --ink: #d7dade;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: 'Inter', sans-serif;
  color: var(--gold-bright);
  -webkit-user-select: none;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  cursor: crosshair;
  /* Aiming uses raw touch gestures on the canvas, so suppress the browser's
     own pan/zoom here only. Keeping this off the body lets scrollable overlays
     (e.g. the /admin customization screen) pan normally on touch devices. */
  touch-action: none;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  gap: 12px;
}

.hud-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 14px;
  display: flex;
  gap: 18px;
  backdrop-filter: blur(4px);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
}

.stat .label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  opacity: 0.85;
}

.stat span:last-child {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#hud-hearts {
  display: flex;
  gap: 6px;
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(232, 64, 87, 0.6));
}

#hud-hearts .lost { opacity: 0.18; filter: grayscale(1); }

.hud-bottom {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

#mp-status-pill {
  position: absolute;
  top: 76px;
  right: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--blue);
}

#mp-room-pill {
  position: absolute;
  top: 104px;
  right: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold-bright);
}

#mp-netstats {
  position: absolute;
  top: 132px;
  right: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #8fe3b0;
  font-variant-numeric: tabular-nums;
}

/* Opponent arsenal: enemy abilities + live cooldowns, top-right corner. */
#opp-abilities {
  position: absolute;
  top: 162px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
}

#opp-abilities.hidden { display: none; }

.opp-abilities-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--red, #e84057);
  opacity: 0.9;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}

.opp-abilities-row {
  display: flex;
  gap: 6px;
}

.opp-slot {
  position: relative;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(232, 64, 87, 0.7);
  border-radius: 7px;
  background: linear-gradient(160deg, #281a1c, #100406);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(232, 64, 87, 0.2);
}

.opp-slot.on-cd { border-color: rgba(232, 64, 87, 0.35); }

.opp-slot .opp-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  z-index: 1;
}

.opp-slot .cd-mask {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.opp-slot .cd-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4px #000;
  z-index: 3;
}

#ability-bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.ability-slot {
  position: relative;
  width: 54px;
  height: 54px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(160deg, #1e2328, #010a13);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(200, 170, 110, 0.25);
  transition: border-color 0.15s ease;
}

.ability-slot.on-cd { border-color: rgba(200, 170, 110, 0.35); }

.ability-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  z-index: 1;
}

.ability-key {
  position: absolute;
  bottom: 1px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  z-index: 3;
}

.ability-slot .cd-mask {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.ability-slot .cd-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4px #000;
  z-index: 3;
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 22px;
  background:
    radial-gradient(ellipse at center, rgba(1, 10, 19, 0.55) 0%, rgba(1, 10, 19, 0.92) 100%);
  text-align: center;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.overlay::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.overlay h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(42px, 8vw, 84px);
  font-weight: 800;
  letter-spacing: 6px;
  text-shadow: 0 0 30px rgba(200, 170, 110, 0.45);
}

.gold { color: var(--gold); }
.red { color: var(--red); text-shadow: 0 0 30px rgba(232, 64, 87, 0.5); }

.tagline {
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-top: -10px;
}

/* ---------- Homepage (sophisticated-minimal) ---------- */
#menu { gap: 18px; }

#menu .tagline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -6px;
}

.menu-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(680px, 94vw);
}

.mcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mcard:hover { border-color: var(--line-2); }

.mcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mcard-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
}

.mcard-badge {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* Controls list */
.ctrl-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  align-items: center;
}

.ctrl-keys { display: flex; gap: 4px; flex-wrap: wrap; }

.ctrl-list kbd {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 7px;
  line-height: 1;
}

.ctrl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.ctrl-tip {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  padding-top: 11px;
  line-height: 1.4;
}

/* Arena setup blocks */
.setup-block { display: flex; flex-direction: column; gap: 9px; }

.setup-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.seg-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.seg-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 11px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.seg-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-3); }

.seg-btn.active {
  color: var(--gold-bright);
  border-color: rgba(200, 170, 110, 0.55);
  background: rgba(200, 170, 110, 0.1);
}

.big-btn {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 14px 56px;
  color: var(--bg-dark);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 0 24px rgba(200, 170, 110, 0.35);
}

.big-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 36px rgba(200, 170, 110, 0.6);
}

.results {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 18px 30px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  font-size: 15px;
}

.stat-row span:first-child { color: var(--gold); }
.stat-row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-row.best {
  border-top: 1px solid var(--panel-border);
  padding-top: 10px;
  margin-top: 4px;
}
.stat-row.best span { color: var(--blue); }

.hint { font-size: 13px; opacity: 0.6; }
.hint b { color: var(--blue); }

.legal-note {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(240, 230, 210, 0.56);
  max-width: min(760px, 92vw);
  text-align: center;
}

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

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mode-btn:hover { border-color: var(--line-2); background: var(--surface-3); }

.mode-btn .mode-name {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.mode-btn .mode-desc {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted-2);
}

.mode-btn.active {
  border-color: rgba(200, 170, 110, 0.55);
  background: rgba(200, 170, 110, 0.09);
}

.mode-btn.active .mode-name { color: var(--gold-bright); }

/* Smite Training gets its own full-width, accented tile. */
.mode-btn.mode-smite {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(120, 200, 255, 0.10), rgba(108, 229, 177, 0.08));
  border-color: rgba(120, 200, 255, 0.30);
}
.mode-btn.mode-smite:hover { border-color: rgba(120, 200, 255, 0.55); }
.mode-btn.mode-smite.active {
  border-color: rgba(120, 200, 255, 0.7);
  background: linear-gradient(135deg, rgba(120, 200, 255, 0.18), rgba(108, 229, 177, 0.12));
}
.mode-btn.mode-smite.active .mode-name { color: #9fdcff; }

/* On-screen SMITE button (Smite Training touch/click cast) */
#smite-btn {
  position: fixed;
  right: 28px;
  bottom: 96px;
  z-index: 40;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 3px solid rgba(120, 200, 255, 0.75);
  background: radial-gradient(circle at 50% 38%, rgba(120, 200, 255, 0.45), rgba(10, 40, 70, 0.92));
  color: #eaf6ff;
  font-family: inherit;
  font-weight: 900;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(90, 200, 255, 0.45), inset 0 0 18px rgba(120, 200, 255, 0.35);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  user-select: none;
}
#smite-btn:hover { box-shadow: 0 0 32px rgba(90, 200, 255, 0.65), inset 0 0 22px rgba(120, 200, 255, 0.5); }
#smite-btn:active { transform: scale(0.92); }
.smite-btn-label { font-size: 20px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }

@media (max-width: 640px) {
  #smite-btn { right: 18px; bottom: 78px; width: 92px; height: 92px; }
  .smite-btn-label { font-size: 17px; }
}

/* Multiplayer card */
.field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  padding: 11px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field::placeholder { color: var(--muted-2); }

.field:focus {
  outline: none;
  border-color: rgba(200, 170, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(200, 170, 110, 0.08);
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select.field option { background: var(--surface-2); color: var(--ink); }

.field.code { text-transform: uppercase; letter-spacing: 0.15em; }
.field.code::placeholder { letter-spacing: normal; }

.party-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.party-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }

.join-group { display: flex; gap: 8px; }
.join-group .field.code { flex: 1; min-width: 0; }

.ghost-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 14px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ghost-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: var(--surface-3);
}

.party-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.party-foot-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-foot b { color: var(--ink); font-weight: 600; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.link-btn:hover { color: var(--red); }

/* Menu CTA: keep gold PLAY hero, refine CUSTOMIZE to match cards */
#menu .big-btn.secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  box-shadow: none;
}

#menu .big-btn.secondary:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: none;
}

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

.big-btn.secondary {
  background: linear-gradient(180deg, #2a3540, #121a22);
  color: var(--gold-bright);
  border: 1px solid var(--panel-border);
  box-shadow: 0 0 16px rgba(10, 200, 185, 0.15);
}

.big-btn.secondary:hover {
  box-shadow: 0 0 24px rgba(10, 200, 185, 0.35);
}

/* ---------- Customization screen ---------- */
.overlay.scroll {
  justify-content: flex-start;
  overflow-y: auto;
  gap: 16px;
  padding: 36px 24px 48px;
  touch-action: pan-y;
}

.small-title {
  font-size: clamp(28px, 4.5vw, 44px) !important;
  letter-spacing: 4px !important;
}

.ms-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 22px;
  width: min(640px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
}

/* Collapsible tuning panels on the customize screen */
.cust-drop {
  padding: 0;
  gap: 0;
}

.cust-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
  user-select: none;
}

.cust-summary::-webkit-details-marker { display: none; }

.cust-summary-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cust-summary-label::before {
  content: '\25B8';
  display: inline-block;
  font-size: 11px;
  color: var(--gold);
  transition: transform 0.15s ease;
}

.cust-drop[open] .cust-summary-label::before {
  transform: rotate(90deg);
}

.cust-summary:hover { color: var(--gold-bright); }

.cust-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 22px 16px;
}

.ms-note {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(240, 230, 210, 0.55);
  margin: 0;
}

#champ-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.champ-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--panel-border);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.champ-swatch:hover { transform: scale(1.12); }

.champ-swatch.active {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(200, 170, 110, 0.7);
}

/* Champion hitbox picker: three Small / Medium / Large bands */
.hitbox-options {
  display: flex;
  gap: 10px;
}

.hitbox-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  background: #0d1620;
  color: var(--gold);
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.hitbox-opt:hover { border-color: var(--gold); }

.hitbox-opt.active {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(200, 170, 110, 0.5);
  background: rgba(200, 170, 110, 0.12);
}

.hitbox-opt-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hitbox-opt-size {
  font-size: 16px;
  font-weight: 700;
}

.hitbox-opt-ex {
  font-size: 10px;
  opacity: 0.7;
  text-align: center;
}

/* Loadout board: slot chips + active-slot detail */
.loadout-board {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 22px 18px;
  width: min(900px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
  text-align: left;
}

.loadout-tabs {
  display: flex;
  gap: 8px;
}

.loadout-tab {
  flex: 1;
  padding: 9px 12px;
  background: #0d1620;
  color: var(--gold);
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.loadout-tab:hover { border-color: var(--gold); }

.loadout-tab.active {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(200, 170, 110, 0.5);
  background: rgba(200, 170, 110, 0.12);
}

#mode-tuning {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.mode-tune-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: #0d1620;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.mode-tune-title {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--gold-bright);
}

#slot-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slot-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #0d1620;
  color: var(--gold-bright);
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.slot-chip:hover { border-color: var(--gold); }

.slot-chip.active {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(200, 170, 110, 0.5);
  background: rgba(200, 170, 110, 0.12);
}

.chip-name { font-size: 13px; font-weight: 600; }

.key-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gold);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(200, 170, 110, 0.08);
}

.slot-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

#slot-detail {
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-name { font-size: 16px; font-weight: 700; }

.source-tag {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--blue);
  border: 1px solid rgba(10, 200, 185, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
}

.detail-desc {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(240, 230, 210, 0.65);
  margin: 0;
}

/* Ability grids */
.ability-section {
  width: min(1560px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.ability-tile {
  position: relative;
  background: var(--panel);
  color: var(--gold-bright);
  border: 1.5px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.ability-tile:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.ability-tile.assigned { border-color: rgba(10, 200, 185, 0.55); }

.ability-tile.in-slot {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(200, 170, 110, 0.45);
}

.tile-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.pill-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.ability-icon-img {
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(255, 130, 60, 0.28));
}

.tile-name { font-size: 13px; font-weight: 600; }

.tile-source {
  font-size: 10px;
  color: rgba(240, 230, 210, 0.5);
}

.tile-keys {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 3px;
}

.tile-key {
  font-size: 9px;
  font-weight: 700;
  color: var(--bg-dark);
  background: var(--gold);
  border-radius: 3px;
  padding: 1px 4px;
}

/* Champion catalog (searchable, one row per champion) */
#champ-search {
  width: 100%;
  background: #0d1620;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--gold-bright);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
}

#champ-search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(200, 170, 110, 0.3);
}

#champ-search::placeholder { color: rgba(240, 230, 210, 0.35); }

.catalog-note { text-align: left; }

#champ-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(470px, 100%), 1fr));
  gap: 10px;
  text-align: left;
  /* Scroll the catalog internally so SAVE & PLAY stays within reach
     instead of sitting below ~170 champion rows of page scroll. */
  max-height: min(48vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 170, 110, 0.4) rgba(13, 22, 32, 0.6);
}

#champ-catalog::-webkit-scrollbar { width: 10px; }

#champ-catalog::-webkit-scrollbar-track {
  background: rgba(13, 22, 32, 0.6);
  border-radius: 999px;
}

#champ-catalog::-webkit-scrollbar-thumb {
  background: rgba(200, 170, 110, 0.4);
  border-radius: 999px;
}

#champ-catalog::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 170, 110, 0.6);
}

.champ-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.champ-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.champ-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.champ-name {
  font-size: 13px;
  font-weight: 700;
}

.spell-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spell-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #0d1620;
  border: 1px solid rgba(200, 170, 110, 0.18);
  border-radius: 999px;
  color: rgba(240, 230, 210, 0.32);
  font-family: inherit;
  font-size: 11px;
  cursor: default;
}

.pill-letter {
  font-size: 9px;
  font-weight: 700;
  color: rgba(200, 170, 110, 0.45);
  border: 1px solid rgba(200, 170, 110, 0.25);
  border-radius: 3px;
  padding: 0 3px;
}

.spell-pill.impl {
  color: var(--gold-bright);
  border-color: rgba(10, 200, 185, 0.5);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.spell-pill.impl:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(200, 170, 110, 0.35);
}

.spell-pill.impl .pill-letter {
  color: var(--blue);
  border-color: rgba(10, 200, 185, 0.5);
}

.spell-pill.in-slot {
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(200, 170, 110, 0.5);
}

.pill-key {
  font-size: 9px;
  font-weight: 700;
  color: var(--bg-dark);
  background: var(--gold);
  border-radius: 3px;
  padding: 0 4px;
}

.catalog-section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 2px 4px;
  border-bottom: 1px solid rgba(200, 170, 110, 0.22);
}

.catalog-section-header:not(:first-child) {
  margin-top: 8px;
}

.catalog-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.catalog-section-note {
  font-size: 11px;
  color: rgba(240, 230, 210, 0.45);
}

.catalog-empty {
  grid-column: 1 / -1;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 18px;
  font-size: 13px;
  color: rgba(240, 230, 210, 0.55);
}

.param-row {
  display: grid;
  grid-template-columns: 82px 1fr 52px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.param-row label { color: var(--gold); }

.param-value {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(200, 170, 110, 0.25);
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 6px rgba(200, 170, 110, 0.6);
}

input[type='range']::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 6px rgba(200, 170, 110, 0.6);
}

@media (max-width: 600px) {
  .ability-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  .chip-name { display: none; } /* chips collapse to key + icon */
  .hud-panel { padding: 6px 10px; gap: 10px; }
  .stat { min-width: 42px; }
  .stat span:last-child { font-size: 15px; }
  .hud-bottom { left: 50%; transform: translateX(-50%); bottom: 12px; }
  .ability-slot { width: 46px; height: 46px; }
  .ability-icon { width: 24px; height: 24px; font-size: 20px; }
  .mode-grid,
  .card-arena .mode-grid { grid-template-columns: 1fr; }
}
