:root {
  --blue: #5bbeff;
  --blue-deep: #1c5c8a;
  --red: #ff8a4a;
  --red-deep: #8a3a1c;
  --gold: #e8b45a;
  --brass: #c49444;
  --arc: #5de1d0;
  --ink: #0a0f10;
  --panel: rgba(10, 18, 19, 0.86);
  --panel-2: rgba(18, 30, 30, 0.92);
  --line: rgba(196, 148, 68, 0.28);
  --text: #e9e3d3;
  --muted: #9aa79f;
  --hp: #58c46a;
  --mp: #4a9fe0;
  --xp: #d9b356;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --radius: 12px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05090a;
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app { position: fixed; inset: 0; }

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

#ui button, #ui select, #ui input, #ui .overlay, #ui .panel, #ui #minimap-wrap, #ui #shop {
  pointer-events: auto;
}
#ui .ability, #ui .item-slot, #ui .pill, #ui .icon-btn, #ui #minimap-wrap, #ui .item-row {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#ui #minimap-wrap canvas { touch-action: none; }

.hidden { display: none !important; }

button {
  font-family: inherit;
  color: var(--text);
  background: linear-gradient(180deg, rgba(38, 52, 50, 0.95), rgba(14, 22, 22, 0.95));
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.08s, filter 0.15s;
}
button:hover { border-color: rgba(232, 180, 90, 0.6); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.primary {
  background: linear-gradient(180deg, #d8a44d, #9a6a21);
  border-color: #f0cf8a;
  color: #1b1305;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.primary:hover { filter: brightness(1.08); border-color: #ffe6b0; }
.ghost { background: rgba(18, 28, 28, 0.7); }
.danger { color: #ff9a8a; border-color: rgba(255, 120, 100, 0.35); }
.big { padding: 12px 22px; font-size: 16px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; padding: 0;
}

/* ---------- top bar ---------- */
#topbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 430px;
  max-width: calc(100% - 24px);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 18px;
  background: linear-gradient(180deg, rgba(12, 20, 21, 0.9), rgba(8, 14, 15, 0.72));
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
#topbar .score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  min-width: 74px;
}
#topbar .score.blue { color: var(--blue); justify-content: flex-end; }
#topbar .score.red { color: var(--red); }
#topbar .team-mark {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: grid; place-items: center;
}
.match-clock { text-align: center; flex: 1; }
#clock {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #f2e8cf;
  text-shadow: 0 0 12px rgba(232, 180, 90, 0.35);
}
.objectives {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted);
}
.obj.blue { color: rgba(91, 190, 255, 0.9); }
.obj.red { color: rgba(255, 138, 74, 0.9); }
.obj.boss { color: var(--gold); }
#top-actions { display: flex; gap: 6px; margin-left: auto; }

/* ---------- announcements / kill feed ---------- */
#killfeed {
  position: absolute;
  top: 76px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  font-size: 12.5px;
}
.kill-line {
  background: rgba(8, 14, 15, 0.82);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  animation: slideIn 0.18s ease-out;
}
.kill-line .blue { color: var(--blue); }
.kill-line .red { color: var(--red); }
.kill-line .arrow { color: var(--gold); margin: 0 6px; font-size: 11px; }

#announce {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.announce-line {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 26px;
  letter-spacing: 4px;
  color: #f4e7c7;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 0 26px rgba(232, 180, 90, 0.4);
  padding: 8px 26px;
  background: linear-gradient(90deg, transparent, rgba(20, 16, 8, 0.72), transparent);
  animation: announceIn 0.3s ease-out, fadeOut 0.6s ease-in 2.4s forwards;
}
.announce-line.blue { color: #a8dcff; text-shadow: 0 0 26px rgba(91, 190, 255, 0.4); }
.announce-line.red { color: #ffb894; text-shadow: 0 0 26px rgba(255, 138, 74, 0.4); }
.announce-line.small {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  color: #f0e2c4;
  padding: 4px 16px;
  background: rgba(10, 18, 19, 0.8);
  border: 1px solid rgba(196, 148, 68, 0.25);
  border-radius: 999px;
  animation: fadeOut 0.4s ease-in 0.8s forwards;
}
.kick-row {
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 6px 8px 2px;
}
.kick-row.blue { color: var(--blue); }
.kick-row.red { color: var(--red); }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }
@keyframes announceIn { from { opacity: 0; transform: scale(0.92); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- minimap ---------- */
#minimap-wrap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(208px, 23vw);
  height: min(208px, 23vw);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0a1212;
}
#minimap { display: block; width: 100%; height: 100%; cursor: crosshair; }
#minimap-tip {
  position: absolute;
  left: 6px; bottom: 4px;
  font-size: 10px;
  color: rgba(233, 227, 211, 0.5);
  pointer-events: none;
}

/* ---------- hero panel ---------- */
#hero-panel {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: linear-gradient(180deg, rgba(12, 20, 21, 0.86), rgba(8, 14, 15, 0.72));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.portrait {
  position: relative;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(232, 180, 90, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(93, 225, 208, 0.18), rgba(4, 10, 10, 0.9));
  overflow: hidden;
  flex: none;
}
.portrait canvas { width: 100%; height: 100%; display: block; }
#hero-level {
  position: absolute;
  left: 50%; bottom: -2px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #101a1a;
  border: 1px solid var(--line);
  color: var(--gold);
}
#xp-ring {
  position: absolute; inset: -2px;
  border-radius: 50%;
  background: conic-gradient(var(--xp) var(--xp, 0%), transparent 0);
  mask: radial-gradient(circle, transparent 66%, #000 67%);
  -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%);
  opacity: 0.85;
  pointer-events: none;
}
.vitals { display: flex; flex-direction: column; gap: 4px; min-width: 230px; }
.bar {
  position: relative;
  height: 14px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar > div {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(1);
}
.bar.hp > div { background: linear-gradient(180deg, #7ee087, #2f8c42); }
.bar.mp { height: 10px; }
.bar.mp > div { background: linear-gradient(180deg, #6bc0ff, #245f9a); }
.bar.xp { height: 5px; background: rgba(0, 0, 0, 0.4); }
.bar.xp > div { background: linear-gradient(90deg, #8f6b24, #e8c26a); }
.bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #08100c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  letter-spacing: 0.3px;
}
.bar.mp span { color: #cfeaff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7); }
.chips { display: flex; gap: 6px; margin-top: 1px; }
.chip {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  white-space: nowrap;
}
.chip.gold { color: #f2cf82; border-color: rgba(232, 180, 90, 0.28); }
.chip.spell { color: var(--arc); }

/* ---------- controls ---------- */
#controls {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.ability-row { display: flex; gap: 6px; align-items: flex-end; }
.ability {
  position: relative;
  width: 58px; height: 58px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid rgba(196, 148, 68, 0.32);
  background: #0b1414;
  overflow: visible;
}
.ability canvas { width: 100%; height: 100%; border-radius: 7px; display: block; }
.ability .key {
  position: absolute;
  top: -6px; left: -6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  background: #0b1414;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 4px;
  color: var(--gold);
}
.ability .cd {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: rgba(3, 6, 8, 0.72);
  color: #fff;
  font-style: normal;
  font-size: 15px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}
.ability.cooling .cd { display: flex; }
.ability .rank {
  position: absolute;
  right: 2px; bottom: 2px;
  font-size: 9px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  padding: 0 3px;
}
.ability.ready { border-color: rgba(232, 180, 90, 0.75); box-shadow: 0 0 12px rgba(232, 180, 90, 0.18); }
.ability.locked { filter: grayscale(0.8) brightness(0.55); }
.ability.aiming { border-color: #ffe6a8; box-shadow: 0 0 18px rgba(255, 224, 150, 0.55); }
.ability.flash { animation: slotFlash 0.26s ease-out; }
@keyframes slotFlash {
  0% { box-shadow: 0 0 0 rgba(255, 120, 100, 0); }
  35% { box-shadow: 0 0 18px rgba(255, 120, 100, 0.85); border-color: #ff8a70; }
  100% { box-shadow: 0 0 0 rgba(255, 120, 100, 0); }
}
.icon-btn.muted { opacity: 0.45; }
.ability.ult { width: 64px; height: 64px; }
.ability.summoner { width: 44px; height: 44px; }
.ability.summoner .key { font-size: 9px; }
.ability.passive { width: 40px; height: 40px; border-radius: 50%; opacity: 0.9; }
.ability.passive .key { display: none; }
.summoners { display: flex; flex-direction: column; gap: 6px; margin-left: 4px; }
.item-row { display: flex; gap: 4px; }
.item-slot {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 7px;
  border: 1px solid rgba(196, 148, 68, 0.25);
  background: rgba(10, 18, 18, 0.85);
  padding: 0;
  overflow: hidden;
}
.item-slot canvas { width: 100%; height: 100%; display: block; }
.item-slot .n { position: absolute; right: 2px; bottom: 1px; font-size: 9px; color: #fff; text-shadow: 0 1px 2px #000; }
.item-slot.empty { opacity: 0.35; }
.action-row { display: flex; gap: 8px; }
.pill {
  font-size: 11.5px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(12, 20, 21, 0.85);
}
.pill i { font-style: normal; color: var(--gold); font-size: 10px; margin-left: 4px; }

/* ---------- death & cursor ---------- */
#death-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(40, 5, 5, 0.2), rgba(5, 2, 2, 0.72));
  pointer-events: none;
}
.death-card { text-align: center; }
.death-card h2 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 34px;
  letter-spacing: 8px;
  color: #e6c9b4;
  margin: 0 0 6px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.9);
}
.death-card p { margin: 4px; color: #d8c8b8; font-size: 15px; font-variant-numeric: tabular-nums; }
.death-card .hint { color: rgba(233, 227, 211, 0.55); font-size: 12px; }

#cursor-tip {
  position: absolute;
  top: 0; left: 0;
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 5px;
  background: rgba(6, 10, 11, 0.9);
  border: 1px solid var(--line);
  color: var(--text);
  pointer-events: none;
  display: block;
  white-space: nowrap;
  z-index: 20;
}
#cursor-tip p { margin: 2px 0; }
#cursor-tip .tip-stats { color: var(--muted); font-size: 10.5px; }

/* ---------- overlays / panels ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 8, 0.66);
  backdrop-filter: blur(5px);
  z-index: 30;
}
.panel {
  background: linear-gradient(180deg, rgba(15, 25, 25, 0.97), rgba(7, 12, 13, 0.98));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}
.panel header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(196, 148, 68, 0.16);
}
.panel h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: #f2e4c4;
  font-weight: 700;
}
.close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  padding: 0;
  font-size: 13px;
  background: rgba(30, 20, 20, 0.6);
}

/* shop */
.shop-panel { width: min(960px, 94vw); height: min(620px, 88vh); display: flex; flex-direction: column; }
.shop-gold { font-size: 15px; color: var(--gold); font-weight: 700; }
.shop-body { flex: 1; display: grid; grid-template-columns: 150px 1fr 260px; min-height: 0; }
#shop-tabs {
  border-right: 1px solid rgba(196, 148, 68, 0.14);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}
#shop-tabs button {
  padding: 9px 10px;
  text-align: left;
  font-size: 12.5px;
  border-color: transparent;
  background: transparent;
}
#shop-tabs button.active {
  background: rgba(232, 180, 90, 0.12);
  border-color: rgba(232, 180, 90, 0.35);
  color: #f6e3b7;
}
#shop-items {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  align-content: start;
  overflow-y: auto;
}
.shop-cell {
  position: relative;
  border: 1px solid rgba(196, 148, 68, 0.18);
  border-radius: 8px;
  background: rgba(8, 14, 14, 0.7);
  padding: 6px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s, background 0.12s;
}
.shop-cell:hover { border-color: rgba(232, 180, 90, 0.6); background: rgba(28, 36, 32, 0.8); }
.shop-cell.selected { border-color: var(--gold); background: rgba(60, 45, 18, 0.5); }
.shop-cell canvas { width: 44px; height: 44px; display: block; margin: 0 auto; }
.shop-cell .name { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-cell .cost { font-size: 10.5px; color: var(--gold); }
.shop-cell.cant { opacity: 0.45; }
#shop-detail {
  border-left: 1px solid rgba(196, 148, 68, 0.14);
  padding: 14px;
  overflow-y: auto;
  font-size: 12.5px;
}
.detail-empty { color: var(--muted); font-size: 12px; margin-top: 30px; text-align: center; }
.detail-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.detail-head canvas { width: 54px; height: 54px; }
.detail-head h4 { margin: 0; font-size: 15px; color: #f2e4c4; }
.detail-price { color: var(--gold); font-size: 13px; }
.detail-stats { color: #cfe3d2; font-size: 12px; line-height: 1.7; margin: 8px 0; }
.detail-stats .stat { color: #8fe0b0; }
.detail-build { color: var(--muted); font-size: 11.5px; margin: 8px 0; }
#shop-detail .buy { width: 100%; margin-top: 10px; padding: 9px; }
.shop-panel footer {
  border-top: 1px solid rgba(196, 148, 68, 0.16);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
#shop-inventory { display: flex; gap: 6px; }
.inv-slot {
  position: relative;
  width: 40px; height: 40px;
  border: 1px solid rgba(196, 148, 68, 0.22);
  border-radius: 7px;
  background: rgba(8, 14, 14, 0.7);
  padding: 0;
  overflow: hidden;
}
.inv-slot canvas { width: 100%; height: 100%; }
.panel .hint { color: var(--muted); font-size: 11.5px; margin: 0 0 0 auto; }

/* scoreboard */
.board-panel { width: min(820px, 94vw); max-height: 86vh; display: flex; flex-direction: column; }
#board-body { padding: 12px 16px 18px; overflow-y: auto; }
.team-block { margin-bottom: 14px; }
.team-block h4 { margin: 6px 0; font-size: 13px; letter-spacing: 2px; }
.team-block.blue h4 { color: var(--blue); }
.team-block.red h4 { color: var(--red); }
.board-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(6, 0.7fr);
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.board-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.board-row.head { color: var(--muted); font-size: 10.5px; letter-spacing: 1px; }
.board-row .who { display: flex; align-items: center; gap: 6px; }
.board-row .dot { width: 8px; height: 8px; border-radius: 50%; }
.board-row.dead { opacity: 0.45; }

/* pause / results */
.pause-panel { width: min(420px, 92vw); padding: 22px; text-align: center; }
.pause-panel h2 { margin-bottom: 6px; }
.pause-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pause-actions button { padding: 10px; font-size: 14px; }
#settings-panel { margin-top: 16px; text-align: left; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
#settings-panel label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#settings-panel input[type="range"] { width: 170px; accent-color: var(--gold); }
#settings-panel select { background: #0c1515; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
#settings-panel .check { justify-content: flex-start; }
.results-panel { width: min(720px, 94vw); padding: 24px; text-align: center; }
#results-title { font-size: 40px; letter-spacing: 12px; margin: 6px 0; }
#results-title.win { color: #f5d68e; text-shadow: 0 0 30px rgba(232, 180, 90, 0.45); }
#results-title.lose { color: #e08a7a; text-shadow: 0 0 30px rgba(255, 90, 70, 0.3); }
#results-sub { color: var(--muted); font-size: 13px; }
#results-table { margin: 18px 0 6px; text-align: left; }

/* menu */
#menu {
  background:
    linear-gradient(180deg, rgba(4, 9, 10, 0.72), rgba(3, 6, 7, 0.9) 62%, rgba(3, 6, 7, 0.97)),
    radial-gradient(circle at 50% 10%, rgba(30, 62, 60, 0.35), transparent 60%),
    url('../assets/art/splash.jpg') center 32% / cover no-repeat;
}
.menu-shell {
  width: min(1180px, 95vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.title-block { text-align: center; }
.title-block h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: 16px;
  color: #f4e3bc;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.8), 0 0 60px rgba(93, 225, 208, 0.18);
  font-weight: 800;
}
.subtitle { margin: 4px 0 0; font-size: 12px; letter-spacing: 6px; color: rgba(196, 225, 220, 0.55); }
.menu-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr 0.85fr;
  gap: 16px;
  min-height: 0;
  flex: 1;
}
.menu-grid section {
  background: linear-gradient(180deg, rgba(12, 22, 22, 0.92), rgba(6, 11, 12, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  overflow-y: auto;
  max-height: 66vh;
}
.menu-grid h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 600;
}
#hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hero-card {
  position: relative;
  border: 1px solid rgba(196, 148, 68, 0.2);
  border-radius: 9px;
  background: rgba(8, 14, 14, 0.6);
  padding: 5px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s, transform 0.12s;
}
.hero-card:hover { transform: translateY(-2px); border-color: rgba(232, 180, 90, 0.55); }
.hero-card.active { border-color: var(--gold); box-shadow: 0 0 18px rgba(232, 180, 90, 0.22); background: rgba(58, 44, 16, 0.45); }
.hero-card canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 6px; }
.hero-card .hero-card-art { width: 100%; aspect-ratio: 1; display: block; border-radius: 6px; object-fit: cover; filter: saturate(0.92); }
.hero-card .hname { font-size: 10.5px; color: var(--text); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .hrole { font-size: 9px; color: var(--muted); }
#hero-detail-body { display: flex; flex-direction: column; gap: 10px; }
.detail-hero { display: flex; gap: 12px; align-items: center; }
.detail-hero canvas { width: 86px; height: 86px; border-radius: 50%; border: 2px solid rgba(232, 180, 90, 0.4); }
.detail-hero .detail-hero-art { width: 86px; height: 86px; border-radius: 50%; border: 2px solid rgba(232, 180, 90, 0.4); object-fit: cover; flex: none; }
.detail-hero h2 { margin: 0; font-size: 20px; letter-spacing: 2px; color: #f4e3bc; }
.detail-hero p { margin: 2px 0; font-size: 11.5px; color: var(--muted); }
.ability-list { display: flex; flex-direction: column; gap: 7px; }
.ability-entry { display: grid; grid-template-columns: 34px 1fr; gap: 8px; font-size: 11.5px; }
.ability-entry canvas { width: 34px; height: 34px; }
.ability-entry b { color: #f0dfb8; font-weight: 600; }
.ability-entry p { margin: 2px 0 0; color: var(--muted); line-height: 1.45; }
.match-setup { display: flex; flex-direction: column; gap: 12px; }
.match-setup label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.match-setup select {
  background: #0c1515;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 13px;
}
.summoner-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.summoner-picks button { padding: 7px 6px; font-size: 11.5px; }
.summoner-picks button.active { border-color: var(--gold); color: #f6e3b7; background: rgba(232, 180, 90, 0.12); }
.menu-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.match-setup .hint { color: rgba(233, 227, 211, 0.45); font-size: 11px; line-height: 1.5; margin: 0; }
.menu-footer { display: flex; justify-content: space-between; font-size: 10.5px; color: rgba(233, 227, 211, 0.3); letter-spacing: 1px; }

/* loading */
.loader { text-align: center; }
.spinner {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(232, 180, 90, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- mobile ---------- */
#joy {
  position: absolute;
  width: 124px;
  height: 124px;
  display: none;
  pointer-events: none;
  z-index: 12;
}
#joy.active { display: block; }
#joy .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(232, 180, 90, 0.45);
  background: radial-gradient(circle, rgba(20, 40, 38, 0.45), rgba(8, 16, 16, 0.18) 70%, transparent);
  box-shadow: inset 0 0 18px rgba(93, 225, 208, 0.12);
}
#joy .knob {
  position: absolute;
  left: 36px;
  top: 36px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(244, 227, 188, 0.85), rgba(160, 120, 50, 0.6));
  border: 1px solid rgba(255, 232, 170, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}
@media (pointer: coarse) {
  #game { cursor: default; }
  #topbar { top: max(6px, env(safe-area-inset-top)); min-width: 0; padding: 4px 12px; gap: 10px; }
  #topbar .score { font-size: 17px; min-width: 52px; }
  #clock { font-size: 16px; }
  .objectives { font-size: 9px; gap: 6px; }
  #hero-panel {
    left: 8px;
    bottom: auto;
    top: calc(max(6px, env(safe-area-inset-top)) + 70px);
    padding: 5px 7px;
    gap: 6px;
    border-radius: 10px;
  }
  .portrait { width: 42px; height: 42px; }
  .vitals { min-width: 118px; gap: 3px; }
  .bar { height: 11px; }
  .bar.mp { height: 10px; }
  .bar span { font-size: 9px; }
  .chips { display: none; }
  #controls {
    left: auto; right: 8px; bottom: max(6px, env(safe-area-inset-bottom));
    transform: none; align-items: flex-end; gap: 4px;
  }
  .ability-row { gap: 4px; }
  .ability { width: 46px; height: 46px; border-radius: 9px; }
  .ability.ult { width: 52px; height: 52px; }
  .ability.summoner { width: 34px; height: 34px; }
  .ability.passive { display: none; }
  .summoners { gap: 4px; margin-left: 2px; }
  .item-slot { width: 27px; height: 27px; }
  .action-row { gap: 4px; }
  .action-row .pill { padding: 3px 8px; font-size: 10px; }
  #minimap-wrap {
    width: 108px; height: 108px;
    right: 8px;
    bottom: auto;
    top: calc(max(6px, env(safe-area-inset-top)) + 70px);
  }
  #killfeed { top: calc(max(6px, env(safe-area-inset-top)) + 188px); right: 8px; font-size: 10.5px; }
  .kill-line { padding: 2px 7px; }
  .menu-grid { grid-template-columns: 1fr; max-height: 74vh; overflow-y: auto; padding-bottom: 78px; }
  .menu-grid section { max-height: none; }
  #hero-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-card { padding: 3px; }
  .hero-card .hrole { display: none; }
  #btn-start {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 4px);
    z-index: 60;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65);
  }
  .title-block h1 { letter-spacing: 10px; }
  .shop-panel { height: 92vh; }
  .shop-body { grid-template-columns: 92px 1fr; }
  #shop-detail { display: none; }
  .shop-panel footer { flex-wrap: wrap; }
  .panel .hint { margin-left: 0; }
  .board-row { grid-template-columns: 1.6fr repeat(4, 0.7fr); }
  .board-row .hide-m { display: none; }
}
@media (max-height: 520px) {
  #topbar { top: 4px; }
  .ability { width: 44px; height: 44px; }
  .ability.ult { width: 48px; height: 48px; }
  #hero-panel .chips { display: none; }
  #minimap-wrap { width: 110px; height: 110px; bottom: 150px; }
}
