/* Dota Mobile — layout, HUD and menus. HUD positions are set in JS from MLBB's 1136x640 design canvas
   (var(--s) = design scale); sizes below that say calc(var(--s) * N) are design px.
   Look: dark stone/iron panels with bevelled gold frames (9-slice images from art/ui/make_ui.py), painted icons
   (art/ui/slice_icons.py), Cinzel for display text. Cheap on phones: frames and rings are pre-baked images,
   shadows are small, no backdrop-filter, animations only touch transform / opacity. */
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url("fonts/cinzel-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 500; font-display: swap; src: url("fonts/firasanscondensed-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 700; font-display: swap; src: url("fonts/firasanscondensed-700-latin.woff2") format("woff2"); }

:root {
  --bg: #0b0e12; --panel: rgba(16, 14, 12, 0.94); --line: rgba(232, 200, 140, 0.22); --gold: #e8c272; --gold-l: #fbe7b0; --gold-d: #a07a36;
  --text: #efe6d6; --dim: #a39a88; --good: #5ad87a; --bad: #ec5a44; --blue: #4aa8f0; --mana: #3d8ff0;
  --stone: linear-gradient(180deg, rgba(36, 30, 24, 0.96), rgba(16, 13, 10, 0.97));
  --grain: url("img/ui/grain.webp");
  --frame: url("img/ui/frame-panel.png") 32 / 12px stretch;
  --frame-btn: url("img/ui/frame-btn.png") 16 / 7px stretch;
  --frame-dark: url("img/ui/frame-dark.png") 16 / 6px stretch;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  font-family: "Fira Sans Condensed", "Arial Narrow", system-ui, sans-serif; }
#stage { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; --s: 1; --st: 0px; --sr: 0px; --sb: 0px; --sl: 0px; }
#stage.rotated { width: 100vh; width: 100dvh; height: 100vw; transform-origin: 0 0; transform: translateX(100vw) rotate(90deg); }
#game, #overlay { position: absolute; left: 0; top: 0; display: block; }
#overlay { pointer-events: none; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
.passive, .passive * { pointer-events: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
.display { font-family: "Cinzel", Georgia, serif; font-weight: 700; letter-spacing: 0.04em; }
.dim { color: var(--dim); }
.center { text-align: center; }
/* gold metal text (Cinzel headings) */
.gild { background: linear-gradient(180deg, #fff4cc 0%, #f0cf80 40%, #b88a3c 62%, #f4dc9c 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* a framed stone panel: grain over a dark gradient inside the bevelled gold 9-slice */
.framed { background: var(--grain), var(--stone); background-clip: padding-box; border: 12px solid transparent; border-image: var(--frame); }

/* ---------------------------------------------------------------- boot */
#boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at 50% 42%, #3a1c12, #0c0806 62%, #050404); z-index: 100; }
#boot .bbar { width: 40%; max-width: 420px; height: 10px; padding: 2px; background: #0a0806; border: 1px solid #6a5028; box-shadow: 0 0 0 1px #000, inset 0 1px 3px #000; }
#boot .bbar i { display: block; height: 100%; width: 10%; background: linear-gradient(180deg, #ffe7a0, #d89a30 55%, #9a5a14); transition: width 0.3s; box-shadow: 0 0 8px rgba(255, 190, 80, 0.6); }
#boot .msg { color: var(--dim); font-size: 14px; margin: 0; letter-spacing: 0.08em; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: 0.92; }
.logo .l1 { font-family: "Cinzel", serif; font-weight: 700; font-size: 72px; letter-spacing: 0.1em; margin-right: -0.1em;
  background: linear-gradient(180deg, #fff6d8 0%, #f2cf84 38%, #a8712c 58%, #f8e2a8 78%, #c8944a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2a0c06) drop-shadow(0 0 18px rgba(220, 70, 40, 0.55)); }
.logo .l2 { font-family: "Cinzel", serif; font-weight: 700; font-size: 22px; letter-spacing: 0.62em; color: #e9c77e; margin-right: -0.62em; text-shadow: 0 2px 0 #000, 0 0 10px rgba(232, 160, 60, 0.5); }
.logo .l2::before, .logo .l2::after { content: ""; display: inline-block; width: 2.2em; height: 1px; vertical-align: middle; margin: 0 0.6em; background: linear-gradient(90deg, transparent, #e9c77e); }
.logo .l2::after { background: linear-gradient(90deg, #e9c77e, transparent); margin-left: 0; }

/* ---------------------------------------------------------------- screens */
.screen { position: absolute; inset: 0; display: none; z-index: 20; }
.screen.show { display: block; }
.screen button { position: relative; background: linear-gradient(180deg, #3e3124 0%, #251c14 55%, #1a130d 100%); background-clip: padding-box; border: 7px solid transparent; border-image: var(--frame-btn);
  color: #f4e8cf; padding: 0.42rem 1.15rem; font-family: "Cinzel", Georgia, serif; font-weight: 700; letter-spacing: 0.06em; text-shadow: 0 1px 2px #000; transition: transform 0.08s, filter 0.15s; }
.screen button:hover { filter: brightness(1.15); }
.screen button:active { transform: scale(0.97); }
.screen button.big { background: linear-gradient(180deg, #d4553a 0%, #9a2a18 50%, #6a160c 100%); background-clip: padding-box; font-size: 1.12rem; padding: 0.6rem 2.2rem; color: #fff1d6;
  box-shadow: 0 0 22px rgba(220, 70, 40, 0.35); text-shadow: 0 1px 0 #4a0c04, 0 0 8px rgba(255, 160, 100, 0.5); }
.screen button.big::before { content: ""; position: absolute; left: 6%; right: 6%; top: 0; height: 45%; background: linear-gradient(180deg, rgba(255, 230, 200, 0.28), rgba(255, 230, 200, 0)); pointer-events: none; }
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 52rem); max-height: 90%; overflow: auto; padding: 1rem 1.4rem;
  background: var(--grain), var(--stone); background-clip: padding-box; border: 12px solid transparent; border-image: var(--frame); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.panel h2 { margin: 0 0 0.8rem; color: var(--gold); font-size: 1.6rem; text-shadow: 0 2px 0 #000; }
.panel h2::after { content: ""; display: block; height: 1px; margin-top: 0.45rem; background: linear-gradient(90deg, var(--gold-d), rgba(160, 122, 54, 0)); }
.panel h3 { color: var(--gold); font-family: "Cinzel", serif; font-size: 1rem; letter-spacing: 0.06em; margin: 1rem 0 0.3rem; }
.panel ul { padding-left: 1.2rem; line-height: 1.45; }
.panel li::marker { color: var(--gold-d); }
.scroll::-webkit-scrollbar { width: 6px; } .scroll::-webkit-scrollbar-thumb { background: #6a5028; border-radius: 3px; }

/* shared painted backdrop for the menus (title painting, dimmed) */
.screen.title, .select, .difficulty, .loading, .howto, .table, .settingsS:not(.overlay) { background: #0a0806 url("img/ui/title-bg.webp") center / cover no-repeat; }
.screen.title::before, .select::before, .difficulty::before, .loading::before, .howto::before, .table::before, .settingsS:not(.overlay)::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.screen.title::before { background: radial-gradient(ellipse at 62% 42%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.62) 100%), linear-gradient(90deg, rgba(6, 5, 4, 0.92) 0%, rgba(6, 5, 4, 0.7) 32%, rgba(6, 5, 4, 0.05) 62%), linear-gradient(0deg, rgba(6, 5, 4, 0.7), rgba(6, 5, 4, 0) 30%); }
.select::before, .difficulty::before, .howto::before, .table::before, .settingsS:not(.overlay)::before { background: radial-gradient(ellipse at 50% 40%, rgba(12, 9, 7, 0.72), rgba(6, 5, 4, 0.94) 75%); }
.loading::before { background: rgba(5, 4, 3, 0.82); }
.screen.title::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.9;
  background-image: radial-gradient(circle, rgba(255, 200, 100, 1) 0 2.4px, rgba(255, 130, 40, 0.35) 3.2px, rgba(255, 120, 30, 0) 6px), radial-gradient(circle, rgba(255, 160, 70, 1) 0 2px, rgba(255, 110, 30, 0.3) 2.8px, rgba(255, 100, 20, 0) 5px), radial-gradient(circle, rgba(255, 225, 150, 0.95) 0 1.4px, rgba(255, 180, 80, 0) 3px);
  background-size: 410px 620px, 330px 470px, 260px 380px; background-position: 40px 100px, 190px 40px, 90px 200px;
  -webkit-mask: linear-gradient(0deg, #000 0%, #000 55%, transparent 100%); mask: linear-gradient(0deg, #000 0%, #000 55%, transparent 100%);
  animation: embers 18s linear infinite, flick 3.1s ease-in-out infinite alternate; }
@keyframes embers { to { background-position: 40px -520px, 190px -430px, 90px -180px; } }
@keyframes flick { from { opacity: 0.55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .screen.title::after { animation: none; } }
.screen.title > *, .select > *, .difficulty > *, .loading > *, .howto > *, .table > * { z-index: 1; }

.title .logo { position: absolute; left: 7%; top: 12%; align-items: flex-start; }
.title .logo .l1 { font-size: 5.4rem; }
.title .logo .l2 { font-size: 1.45rem; margin-left: 0.2em; }
.title .logo .l2::before { display: none; }
.title .sub { position: absolute; left: 7%; top: calc(12% + 8.1rem); max-width: 25rem; color: #e2d4ba; margin: 0; line-height: 1.4; text-shadow: 0 1px 3px #000; padding-left: 0.9rem; border-left: 2px solid var(--gold-d); }
.title .menu { position: absolute; left: 7%; bottom: 13%; display: flex; flex-direction: column; gap: 0.6rem; align-items: stretch; min-width: 15rem; }
.title .menu button { text-align: center; }
.title .foot { position: absolute; right: 1.5rem; bottom: 1rem; font-size: 0.75rem; margin: 0; max-width: 20rem; text-align: right; text-shadow: 0 1px 2px #000; }

.sel-top { position: absolute; left: 0; right: 0; top: 0; height: 3.4rem; display: flex; align-items: center; gap: 1rem; padding: 0 max(1.2rem, var(--sl)); font-size: 1.45rem; color: var(--gold);
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.96), rgba(18, 14, 10, 0.88)); border-bottom: 1px solid #000; box-shadow: 0 1px 0 rgba(232, 194, 114, 0.35), 0 4px 14px rgba(0, 0, 0, 0.5); }
.sel-top .display { text-shadow: 0 2px 0 #000; }
.sel-top .back { font-size: 1.4rem; padding: 0 0.85rem; line-height: 1.3; }
.sel-foot { position: absolute; right: max(1.5rem, var(--sr)); bottom: max(1rem, var(--sb)); }
.sel-body { position: absolute; left: 0; right: 0; top: 3.9rem; bottom: 4.8rem; display: flex; gap: 1.2rem; padding: 0 max(1.2rem, var(--sl)); }
.roster { display: grid; grid-template-columns: repeat(2, 8.5rem); grid-auto-rows: 9.5rem; gap: 0.6rem; align-content: start; }
.screen .roster .card { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0.3rem; position: relative; overflow: hidden; border-width: 6px; border-image: var(--frame-dark); background: #0c0a08; background-clip: padding-box; font-family: "Fira Sans Condensed", sans-serif; letter-spacing: 0; }
.roster .card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.roster .card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; background: linear-gradient(0deg, rgba(6, 5, 4, 0.95), rgba(6, 5, 4, 0)); }
.roster .card .nm, .roster .card .rl { position: relative; z-index: 1; text-shadow: 0 1px 3px #000; }
.roster .card .nm { font-weight: 700; font-family: "Cinzel", serif; font-size: 0.92rem; color: #f8ecd2; }
.roster .card .rl { font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; }
.screen .roster .card.on { border-image: var(--frame-btn); box-shadow: 0 0 18px rgba(240, 190, 90, 0.55); }
.roster .card.on img { filter: brightness(1.12) saturate(1.1); }
.info { flex: 1; overflow: auto; padding: 0.7rem 1.1rem; background: var(--grain), var(--stone); background-clip: padding-box; border: 12px solid transparent; border-image: var(--frame); }
.info .hname { font-size: 2.1rem; text-shadow: 0 2px 0 #000; background: linear-gradient(180deg, #fff4cc, #e8c272 55%, #b88a3c); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.info .role { color: var(--gold); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.82rem; }
.info .tag { margin: 0.2rem 0 0.6rem; color: #ddd0b8; font-style: italic; }
.info .bars { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1.2rem; margin-bottom: 0.7rem; }
.info .bar { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.info .bar span { width: 5.5rem; }
.info .bar i { flex: 1; height: 8px; background: #0c0a08; border: 1px solid #4a3a20; position: relative; overflow: hidden; box-shadow: inset 0 1px 2px #000; }
.info .bar i::after { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: linear-gradient(180deg, #ffe7a0, #d89a30 55%, #9a5a14); }
.info .bar i::before { content: ""; position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, 0.6) calc(10% - 1px) 10%); }
.info .sk { display: flex; gap: 0.75rem; margin: 0.5rem 0; align-items: flex-start; }
.info .sk img { width: 3rem; height: 3rem; flex: none; border: 2px solid #8a6a30; box-shadow: 0 0 0 1px #000, 0 2px 4px rgba(0, 0, 0, 0.6); background: #000; }
.info .sk b { color: #f6e6c4; }
.info .sk p { margin: 0.15rem 0 0; font-size: 0.85rem; color: #d4c8b0; }
.info .acts { margin-top: 0.7rem; font-size: 0.85rem; }
.info .acts img { width: 1.6rem; height: 1.6rem; vertical-align: middle; border: 1px solid #8a6a30; }
.diffs { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; gap: 1rem; width: min(92%, 54rem); }
.screen .diffs .diff { flex: 1; display: flex; flex-direction: column; gap: 0.55rem; padding: 1.1rem 1.2rem; text-align: left; min-height: 10rem; border-width: 12px; border-image: var(--frame); background: var(--grain), var(--stone); background-clip: padding-box; }
.diffs .diff .sk { display: flex; gap: 0.25rem; height: 1.6rem; }
.diffs .diff .sk img { height: 100%; filter: drop-shadow(0 1px 1px #000); }
.diffs .diff b { font-size: 1.55rem; color: var(--gold); }
.diffs .diff span { font-family: "Fira Sans Condensed", sans-serif; font-weight: 500; font-size: 0.92rem; color: #d8ccb8; letter-spacing: 0; line-height: 1.35; }
.screen .diffs .diff.on { background: radial-gradient(ellipse at 50% 0%, rgba(240, 180, 80, 0.28), rgba(240, 180, 80, 0) 70%), var(--grain), var(--stone); background-clip: padding-box; box-shadow: 0 0 22px rgba(240, 190, 90, 0.45); }
.difficulty > p { position: absolute; left: 0; right: 0; bottom: 6rem; text-shadow: 0 1px 2px #000; }
.pt .diffs { flex-direction: column; top: 50%; }
.pt .diffs .diff { min-height: 0; }
.pt .sel-body { flex-direction: column; }
.pt .roster { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 7rem; }

.loading .row { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: 1.2%; }
.loading .row:first-child { top: 7%; }
.loading .row:nth-child(3) { bottom: 17%; }
.loading .vs { position: absolute; left: 0; right: 0; top: 47%; text-align: center; font-size: 3rem; transform: translateY(-50%); color: var(--gold); text-shadow: 0 3px 0 #000, 0 0 24px rgba(240, 160, 60, 0.6); }
.loading .vs::before, .loading .vs::after { content: ""; display: inline-block; width: 22%; height: 2px; vertical-align: middle; margin: 0 1.2rem; background: linear-gradient(90deg, rgba(90, 216, 122, 0), rgba(90, 216, 122, 0.9)); }
.loading .vs::after { background: linear-gradient(90deg, rgba(236, 90, 68, 0.9), rgba(236, 90, 68, 0)); }
.lcard { width: 15%; max-width: 9rem; aspect-ratio: 0.75; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 0.35rem;
  border: 6px solid transparent; border-image: var(--frame-dark); background: #000; background-clip: padding-box; }
.lcard.good { box-shadow: 0 0 0 1px rgba(90, 216, 122, 0.7), 0 0 14px rgba(90, 216, 122, 0.25); } .lcard.bad { box-shadow: 0 0 0 1px rgba(236, 90, 68, 0.7), 0 0 14px rgba(236, 90, 68, 0.25); }
.lcard.me { border-image: var(--frame-btn); box-shadow: 0 0 0 1px #fff2c0, 0 0 18px rgba(240, 210, 120, 0.7); }
.lcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lcard::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: linear-gradient(0deg, rgba(4, 3, 2, 0.95), rgba(4, 3, 2, 0)); }
.lcard span { position: relative; z-index: 1; text-shadow: 0 1px 3px #000; font-size: 0.85rem; }
.lcard .nm { font-weight: 700; font-family: "Cinzel", serif; font-size: 0.8rem; color: #f6ead0; }
.lcard .pl { color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.lcard .pc { color: var(--gold); font-weight: 700; }
.loading .ltip { position: absolute; left: 10%; right: 10%; bottom: 7%; text-align: center; color: #d4c6aa; margin: 0; font-style: italic; text-shadow: 0 1px 2px #000; }
.loading .lbar { position: absolute; left: 28%; right: 28%; bottom: 3.2%; height: 9px; padding: 2px; background: #0a0806; border: 1px solid #6a5028; box-shadow: 0 0 0 1px #000; }
.loading .lbar i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #ffe7a0, #d89a30 55%, #9a5a14); transition: width 0.3s; }

.results { background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.85)); }
.results .rays { position: absolute; left: 50%; top: 40%; width: 70vmax; height: 70vmax; transform: translate(-50%, -50%); pointer-events: none; opacity: 0.55;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 140, 0.16) 0deg 6deg, rgba(255, 220, 140, 0) 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 0%, transparent 60%); mask: radial-gradient(circle, #000 0%, transparent 60%); animation: rays 40s linear infinite; }
.results.lose .rays { background: repeating-conic-gradient(from 0deg, rgba(200, 50, 30, 0.18) 0deg 6deg, rgba(200, 50, 30, 0) 6deg 18deg); }
@keyframes rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
.results .crest { position: absolute; left: 50%; top: 18%; width: 9rem; height: 9rem; transform: translateX(-50%); object-fit: contain; filter: drop-shadow(0 4px 6px #000); animation: pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1); }
.results .vd { position: absolute; left: 0; right: 0; top: calc(36% + 0.4rem); z-index: 1; text-align: center; font-size: 5rem; line-height: 1.15; animation: pop 0.8s cubic-bezier(0.2, 1.6, 0.4, 1); }
.results.win .vd { background: linear-gradient(180deg, #fffbe6 10%, #f6d27e 45%, #b47a28 62%, #ffe9a8 85%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #3a2208) drop-shadow(0 0 24px rgba(240, 190, 80, 0.7)); }
.results.lose .vd { background: linear-gradient(180deg, #ffe0d6 10%, #e8806a 45%, #8a2214 65%, #f0a090 88%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #2a0604) drop-shadow(0 0 24px rgba(200, 40, 30, 0.7)); }
.results .plate { position: absolute; left: 0; right: 0; top: calc(36% - 0.5rem); height: 8.2rem; pointer-events: none; animation: platein 0.7s ease-out;
  background: linear-gradient(90deg, rgba(8, 6, 4, 0), rgba(8, 6, 4, 0.82) 22%, rgba(8, 6, 4, 0.82) 78%, rgba(8, 6, 4, 0)); }
.results .plate::before, .results .plate::after { content: ""; position: absolute; left: 8%; right: 8%; height: 2px; background: linear-gradient(90deg, rgba(232, 194, 114, 0), #e8c272 30%, #e8c272 70%, rgba(232, 194, 114, 0)); }
.results .plate::before { top: 0; } .results .plate::after { bottom: 0; }
.results.lose .plate::before, .results.lose .plate::after { background: linear-gradient(90deg, rgba(200, 80, 60, 0), #c85a44 30%, #c85a44 70%, rgba(200, 80, 60, 0)); }
@keyframes platein { from { transform: scaleY(0); opacity: 0; } }
.results .rsum { position: absolute; left: 50%; top: calc(36% + 8.2rem); transform: translateX(-50%); display: flex; gap: 0.5rem; animation: chipin 0.9s ease-out; }
.results .chip { min-width: 6.2rem; padding: 0.35rem 0.8rem; text-align: center; background: rgba(14, 11, 8, 0.82); border: 1px solid #6a5028; box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(232, 194, 114, 0.25); }
.results .chip span { display: block; font-family: "Cinzel", serif; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-d); }
.results .chip b { font-size: 1.15rem; color: #f8ecd2; }
@keyframes chipin { 0%, 55% { opacity: 0; transform: translate(-50%, 10px); } }
.results .tap { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; text-shadow: 0 1px 2px #000; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.results .crest { animation-name: popc; } @keyframes popc { from { transform: translateX(-50%) scale(2); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.table .panel, .scoreboard .panel { width: min(96%, 70rem); }
.scoreboard { background: rgba(0, 0, 0, 0.6); z-index: 30; }
.th { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; font-size: 1.6rem; color: var(--gold); text-shadow: 0 2px 0 #000; }
.th .dim { font-size: 0.9rem; text-shadow: none; }
table { width: 100%; border-collapse: collapse; margin-bottom: 0.8rem; font-size: 0.85rem; }
th { text-align: left; color: var(--gold); font-family: "Cinzel", serif; font-size: 0.72rem; letter-spacing: 0.08em; font-weight: 700; border-bottom: 1px solid var(--gold-d); padding: 0.3rem 0.4rem; background: linear-gradient(0deg, rgba(232, 194, 114, 0.08), transparent); }
td { padding: 0.25rem 0.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.025); }
tr.me td { background: linear-gradient(90deg, rgba(90, 216, 122, 0.18), rgba(90, 216, 122, 0.04)) !important; }
td.hc { display: flex; align-items: center; gap: 0.5rem; }
td.hc img { width: 2rem; height: 2rem; border: 1px solid #8a6a30; box-shadow: 0 0 0 1px #000; }
td.its img { width: 1.6rem; height: 1.6rem; margin-right: 2px; border: 1px solid #5a4424; vertical-align: middle; }
.mvp { font-style: normal; background: linear-gradient(180deg, #ffe7a0, #c8902c); color: #2a1404; padding: 0 0.35rem; font-size: 0.7rem; font-weight: 700; box-shadow: 0 0 6px rgba(255, 200, 80, 0.6); }
.btns { display: flex; gap: 0.8rem; justify-content: flex-end; }
.pausemenu, .settingsS.overlay { background: rgba(0, 0, 0, 0.62); }
.pausemenu, .settingsS { z-index: 40; }
.pausemenu .panel { width: min(80%, 22rem); display: flex; flex-direction: column; gap: 0.6rem; text-align: center; }
.pausemenu .panel h2::after { background: linear-gradient(90deg, rgba(160, 122, 54, 0), var(--gold-d), rgba(160, 122, 54, 0)); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.6rem 0; padding-bottom: 0.6rem; border-bottom: 1px solid rgba(232, 194, 114, 0.1); }
.opt > span { font-family: "Cinzel", serif; letter-spacing: 0.04em; color: #ecdcbc; }
.seg { display: flex; }
.screen .seg button { padding: 0.32rem 0.85rem; font-size: 0.85rem; border-width: 5px; border-image: url("img/ui/frame-dark.png") 16 / 5px stretch; background: linear-gradient(180deg, #2a221a, #15110c); background-clip: padding-box; color: var(--dim); }
.screen .seg button.on { border-image: url("img/ui/frame-btn.png") 16 / 5px stretch; background: linear-gradient(180deg, #8a6024, #4a3010); background-clip: padding-box; color: #fff0d0; }
.opt input[type=range] { width: 50%; accent-color: #d8a040; }

/* ---------------------------------------------------------------- shop */
.shop { background: var(--grain), linear-gradient(180deg, #17120e, #0b0907); z-index: 25; }
.shop-top { position: absolute; left: 0; right: 0; top: 0; height: 3rem; display: flex; align-items: center; gap: 1rem; padding: 0 max(1rem, var(--sr)) 0 max(1rem, var(--sl));
  background: linear-gradient(180deg, #241c14, #120e0a); border-bottom: 1px solid #000; box-shadow: 0 1px 0 rgba(232, 194, 114, 0.4), 0 4px 10px rgba(0, 0, 0, 0.5); z-index: 2; }
.shop-top .title { font-size: 1.35rem; color: var(--gold); flex: 1; text-shadow: 0 2px 0 #000; }
.shop-top .gold { font-size: 1.25rem; color: #ffe08a; font-weight: 700; display: flex; align-items: center; padding: 0.1rem 0.8rem 0.1rem 0.3rem; background: rgba(0, 0, 0, 0.45); border: 1px solid #5a4424; text-shadow: 0 1px 2px #000; }
.screen .shop-top .close { background: none; border: none; font-size: 1.5rem; padding: 0.1rem 0.7rem; font-family: inherit; color: #e8d8b8; }
.coin { display: inline-block; width: 1.05em; height: 1.05em; margin-right: 0.3em; vertical-align: -0.18em; background: url("img/ui/coin.webp") center / contain no-repeat; }
.shop-body { position: absolute; left: 0; right: 0; top: 3rem; bottom: 4.4rem; display: flex; }
.shop .tabs { width: 8.4rem; display: flex; flex-direction: column; gap: 3px; padding: 0.5rem 0 0.4rem max(0.4rem, var(--sl)); }
.screen.shop .tab { text-align: left; padding: 0.62rem 0.7rem; border: none; border-left: 3px solid transparent; background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)); font-size: 0.86rem; color: #cbbd9e; }
.screen.shop .tab.on { background: linear-gradient(90deg, rgba(232, 160, 60, 0.35), rgba(232, 160, 60, 0.04)); border-left-color: #f0c060; color: #ffe6a8; }
.shop .list { flex: 1.2; display: flex; gap: 0.6rem; overflow-y: auto; padding: 0.5rem; }
.shop .col { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.shop .colh { color: var(--gold); font-family: "Cinzel", serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; padding: 0.1rem 0.2rem 0.25rem; border-bottom: 1px solid rgba(232, 194, 114, 0.25); margin-bottom: 0.1rem; }
.screen.shop .item { display: grid; grid-template-columns: 2.7rem 1fr; grid-template-rows: auto auto; column-gap: 0.5rem; align-items: center; text-align: left; padding: 0.22rem; border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); font-family: "Fira Sans Condensed", sans-serif; letter-spacing: 0; }
.shop .item img { grid-row: span 2; width: 2.7rem; height: 2.7rem; border: 2px solid var(--tier, #6a5a44); box-shadow: 0 0 0 1px #000; }
.shop .item.t1 { --tier: #8a7a62; } .shop .item.t2 { --tier: #4a8ad0; } .shop .item.t3 { --tier: #e8962e; }
.shop .item .nm { font-size: 0.8rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #f0e4cc; }
.shop .item .pr { font-size: 0.76rem; color: #ffd870; font-weight: 700; }
.shop .item.poor .pr { color: #b07060; }
.shop .item.poor img { filter: saturate(0.55) brightness(0.8); }
.shop .item.owned .pr { color: var(--good); }
.screen.shop .item.sel { border-color: #f0c060; background: linear-gradient(90deg, rgba(240, 192, 96, 0.24), rgba(240, 192, 96, 0.05)); box-shadow: 0 0 10px rgba(240, 192, 96, 0.25); }
.shop .item.act::after { content: "ACTIVE"; position: absolute; right: 3px; top: 2px; font-size: 0.5rem; letter-spacing: 0.1em; color: #ffd870; opacity: 0.85; }
.shop .detail { flex: 1; overflow-y: auto; padding: 0.6rem max(1rem, var(--sr)) 0.6rem 0.9rem; border-left: 1px solid rgba(232, 194, 114, 0.2); font-size: 0.85rem; background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15)); }
.shop .dh { display: flex; gap: 0.8rem; align-items: center; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(232, 194, 114, 0.18); }
.shop .dh img { width: 4rem; height: 4rem; border: 2px solid #c8963c; box-shadow: 0 0 0 1px #000, 0 0 14px rgba(240, 180, 80, 0.3); }
.shop .dh .nm { font-size: 1.25rem; font-weight: 700; font-family: "Cinzel", serif; color: #fbeccc; }
.shop .dh .pr { color: #ffd870; font-weight: 700; }
.shop .stats { margin: 0.5rem 0; padding-left: 1.1rem; color: #b8e6a0; }
.shop .trig { color: #d8ccb8; margin: 0.4rem 0; }
.shop .trig.act { color: #f2dfa8; padding: 0.4rem 0.55rem; background: rgba(232, 160, 60, 0.08); border-left: 2px solid #c8963c; }
.shop .tree { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
.shop .tree .lbl { color: var(--gold); font-family: "Cinzel", serif; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; width: 100%; }
.screen.shop .mini { padding: 0.1rem; display: flex; flex-direction: column; align-items: center; font-size: 0.65rem; color: #ffd870; background: rgba(0, 0, 0, 0.4); border: 1px solid #5a4424; font-family: "Fira Sans Condensed", sans-serif; }
.shop .mini img { width: 2.2rem; height: 2.2rem; }
.shop .tree.from .mini + .mini::before { content: "+"; position: absolute; left: -0.42rem; top: 0.55rem; color: var(--gold); font-size: 0.8rem; }
.shop .act-row { display: flex; gap: 0.6rem; margin-top: 0.7rem; }
.screen.shop .buy, .screen.shop .sell { flex: 1; font-size: 1.05rem; padding: 0.55rem; }
.screen.shop .buy { background: linear-gradient(180deg, #5cb84a 0%, #2c7a24 50%, #1a4e14 100%); background-clip: padding-box; box-shadow: 0 0 16px rgba(90, 200, 70, 0.3); }
.screen.shop .buy.off { filter: grayscale(0.85) brightness(0.65); box-shadow: none; }
.screen.shop .sell { background: linear-gradient(180deg, #a8442a, #6a2010 55%, #4a140a); background-clip: padding-box; }
.shop .buy span, .shop .sell span { color: #ffe080; margin-left: 0.3rem; }
.shop .why { color: #ec8a78; margin: 0.4rem 0; }
.shop-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 4.4rem; display: flex; align-items: center; gap: 0.8rem; padding: 0 max(1rem, var(--sl));
  background: linear-gradient(0deg, #1e1812, #110d0a); border-top: 1px solid #000; box-shadow: 0 -1px 0 rgba(232, 194, 114, 0.35); }
.shop-bottom .lbl { color: var(--gold); font-family: "Cinzel", serif; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.shop .inv { display: flex; gap: 0.4rem; }
.screen.shop .inv .slot { position: relative; width: 2.9rem; height: 2.9rem; padding: 0; border: 2px solid #4a3a24; background: radial-gradient(circle, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7)); box-shadow: 0 0 0 1px #000, inset 0 2px 6px #000; }
.shop .inv .slot img { width: 100%; height: 100%; display: block; }
.shop .inv .slot img:not([src]) { display: none; }
.screen.shop .inv .slot.sel { border-color: #f0c060; }
.screen.shop .inv.act .slot { border-color: #6a5420; border-radius: 50%; overflow: hidden; }
.shop .inv .slot .chg { position: absolute; right: 2px; bottom: 1px; font-weight: 700; font-size: 0.8rem; color: #fff4dc; text-shadow: 0 0 3px #000, 0 1px 0 #000; }
.pt .shop-body { flex-wrap: wrap; }
.pt .shop .tabs { width: 100%; flex-direction: row; overflow-x: auto; padding: 0.3rem; }
.pt .screen.shop .tab { padding: 0.5rem; border-left: none; border-bottom: 3px solid transparent; }
.pt .screen.shop .tab.on { border-bottom-color: #f0c060; }
.pt .shop .list { flex: 1 1 100%; height: 50%; }
.pt .shop .detail { flex: 1 1 100%; height: 40%; border-left: none; border-top: 1px solid rgba(232, 194, 114, 0.2); }

/* ---------------------------------------------------------------- HUD (positions from JS) */
#ui > .hud, #ui > .controls { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.hud > *, .controls > * { position: absolute; pointer-events: auto; }
.hud .passive { pointer-events: none; }
/* top-centre score plaque: kills | timer | kills */
.score { display: flex; align-items: center; justify-content: space-between; padding: 0 calc(var(--s) * 16px) calc(var(--s) * 3px); font-weight: 700;
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.94), rgba(30, 24, 18, 0.92)); background-clip: padding-box; border: calc(var(--s) * 6px) solid transparent; border-top: none;
  border-image: url("img/ui/frame-btn.png") 0 16 16 16 / 0 calc(var(--s) * 7px) calc(var(--s) * 7px) calc(var(--s) * 7px) stretch; }
.score .k1, .score .k2 { font-family: "Cinzel", serif; font-size: calc(var(--s) * 26px); line-height: 1; text-shadow: 0 2px 0 #000; min-width: 1.4em; }
.score .k1 { color: #7af094; text-align: left; } .score .k2 { color: #ff7a62; text-align: right; }
.score .time { font-size: calc(var(--s) * 15px); color: #f0e2c4; letter-spacing: 0.06em; padding: calc(var(--s) * 1px) calc(var(--s) * 8px); background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(232, 194, 114, 0.3); }
.heads { display: flex; gap: calc(var(--s) * 4px); align-items: flex-start; pointer-events: none !important; }
.heads.allies { justify-content: flex-end; }
.heads .head { width: calc(var(--s) * 34px); height: calc(var(--s) * 34px); border-radius: 50%; overflow: hidden; position: relative; background: #000;
  border: calc(var(--s) * 2.5px) solid var(--good); box-shadow: 0 0 0 1px #000, 0 calc(var(--s) * 2px) calc(var(--s) * 3px) rgba(0, 0, 0, 0.6); }
.heads.enemies .head { border-color: var(--bad); }
.heads .head.me { border-color: #f6e08a; box-shadow: 0 0 0 1px #000, 0 0 calc(var(--s) * 6px) rgba(246, 224, 138, 0.8); }
.heads .head img { width: 100%; height: 100%; object-fit: cover; display: block; }
.heads .head::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 calc(var(--s) * -6px) calc(var(--s) * 6px) rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 240, 200, 0.25); }
.heads .head.dead img { filter: grayscale(1) brightness(0.35); }
.heads .head .rt { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: calc(var(--s) * 15px); text-shadow: 0 0 3px #000, 0 0 3px #000; }
.kda { display: flex; align-items: center; justify-content: space-around; font-size: calc(var(--s) * 17px); font-weight: 700; text-shadow: 0 1px 2px #000; pointer-events: none !important;
  background: linear-gradient(90deg, rgba(10, 8, 6, 0), rgba(10, 8, 6, 0.75) 18%, rgba(10, 8, 6, 0.75) 82%, rgba(10, 8, 6, 0)); }
.kda .ic { display: inline-block; width: calc(var(--s) * 18px); height: calc(var(--s) * 18px); margin-right: calc(var(--s) * 3px); vertical-align: calc(var(--s) * -3px); background: center / contain no-repeat; filter: drop-shadow(0 1px 1px #000); }
.kda .k { color: #8af0a0; } .kda .d { color: #ff8a74; } .kda .a { color: #8ac8ff; }
/* shop button: framed square, painted coin pouch, gold count */
.shopbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 38%, #5a4018, #1e150a 70%); background-clip: padding-box;
  border: calc(var(--s) * 7px) solid transparent; border-image: url("img/ui/frame-btn.png") 16 / calc(var(--s) * 8px) stretch; box-shadow: 0 0 calc(var(--s) * 10px) rgba(0, 0, 0, 0.6); }
.shopbtn:active { transform: scale(0.94); }
.shopbtn .bag { width: 74%; height: 62%; background: center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.7)); }
.shopbtn .gold { font-weight: 700; color: #ffe08a; font-size: calc(var(--s) * 17px); line-height: 1; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.quick { display: none; flex-direction: column; align-items: center; }
.quick.show { display: flex; animation: qin 0.3s; }
.quick img { width: calc(var(--s) * 56px); height: calc(var(--s) * 56px); border: calc(var(--s) * 2.5px) solid #d8a848; box-shadow: 0 0 0 1px #000, 0 0 calc(var(--s) * 10px) rgba(255, 200, 80, 0.55); }
.quick:active img { transform: scale(0.93); }
.quick .price { font-size: calc(var(--s) * 14px); color: #ffe08a; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 3px #000; margin-top: calc(var(--s) * 1px); padding: 0 calc(var(--s) * 6px); background: rgba(0, 0, 0, 0.55); }
@keyframes qin { from { transform: scale(0.6); opacity: 0; } }
.qtip { padding: calc(var(--s) * 6px) calc(var(--s) * 10px); font-size: calc(var(--s) * 12px); opacity: 0; pointer-events: none !important; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(26, 20, 14, 0.95), rgba(12, 10, 8, 0.95)); border: 1px solid #6a5028; box-shadow: 0 0 0 1px #000, 0 4px 10px rgba(0, 0, 0, 0.5); }
.qtip b { color: var(--gold); font-family: "Cinzel", serif; }
.qtip.show { animation: fade10 5s forwards; }
@keyframes fade10 { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--s) * 3px); pointer-events: none !important; }
.slots .slot { background: radial-gradient(circle, rgba(20, 16, 12, 0.55), rgba(0, 0, 0, 0.75)); border: 1px solid #4a3a24; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), inset 0 1px 3px #000; overflow: hidden; }
.slots .slot img { width: 100%; height: 100%; display: block; }
.slots .slot img:not([src]) { display: none; }
.slots .slot.full { border-color: #8a6a34; }
.slots .slot.activeitem { border-color: #ffd050; box-shadow: 0 0 0 1px #000, 0 0 calc(var(--s) * 5px) rgba(255, 208, 80, 0.6); }
.roundbtn { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: calc(var(--s) * 20px);
  background: url("img/ui/ring-extra.webp") center / 100% 100% no-repeat, radial-gradient(circle at 50% 35%, #3a3024, #0e0b08 70%); }
.roundbtn:active { transform: scale(0.92); }
.roundbtn.pause span { display: block; width: 30%; height: 34%; border-left: calc(var(--s) * 5px) solid #ecc878; border-right: calc(var(--s) * 5px) solid #ecc878; filter: drop-shadow(0 1px 1px #000); }
.roundbtn.ping span { display: block; width: 62%; height: 62%; background: center / contain no-repeat; }
.roundbtn.on { background: url("img/ui/ring-extra.webp") center / 100% 100% no-repeat, radial-gradient(circle, #f0c050, #8a5a10 70%); box-shadow: 0 0 calc(var(--s) * 12px) rgba(255, 200, 80, 0.8); }
.minimap { background: #000; overflow: visible; box-shadow: 0 0 calc(var(--s) * 10px) rgba(0, 0, 0, 0.7); }
.minimap canvas { display: block; }
.minimap::after { content: ""; position: absolute; inset: calc(var(--s) * -5px); pointer-events: none; border: calc(var(--s) * 9px) solid transparent; border-image: url("img/ui/frame-panel.png") 32 / calc(var(--s) * 9px) stretch; }
.feed { display: flex; flex-direction: column; align-items: flex-end; gap: calc(var(--s) * 3px); pointer-events: none !important; }
.feedrow { display: flex; align-items: center; gap: calc(var(--s) * 5px); padding: calc(var(--s) * 2px) calc(var(--s) * 4px) calc(var(--s) * 2px) calc(var(--s) * 8px); font-size: calc(var(--s) * 13px); animation: fin 0.3s, ffade 7s linear forwards; align-self: flex-end;
  background: linear-gradient(270deg, rgba(14, 11, 8, 0.92), rgba(14, 11, 8, 0.7) 80%, rgba(14, 11, 8, 0.15)); border-right: calc(var(--s) * 3px) solid var(--good); border-top: 1px solid rgba(160, 124, 60, 0.45); border-bottom: 1px solid rgba(0, 0, 0, 0.6); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.feedrow.bad { border-right-color: var(--bad); }
.feedrow.mine { box-shadow: 0 0 0 1px rgba(255, 214, 120, 0.85), 0 0 calc(var(--s) * 10px) rgba(255, 190, 70, 0.55); }
.feedrow.died { box-shadow: 0 0 0 1px rgba(255, 90, 70, 0.8); }
.feedrow img { width: calc(var(--s) * 28px); height: calc(var(--s) * 28px); border-radius: 50%; border: calc(var(--s) * 2px) solid; box-shadow: 0 0 0 1px #000; }
.feedrow img.x { width: calc(var(--s) * 22px); height: calc(var(--s) * 22px); border: none; border-radius: 0; box-shadow: none; filter: drop-shadow(0 1px 1px #000); }
.feedrow.good img:first-child, .feedrow.bad img:last-child { border-color: var(--good); }
.feedrow.good img:last-child, .feedrow.bad img:first-child { border-color: var(--bad); }
.feedrow span.x { color: #e8dcc8; }
.feedrow .by { color: var(--dim); font-family: "Cinzel", serif; }
@keyframes ffade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fin { from { transform: translateX(20px); opacity: 0; } }
.banner { display: flex; align-items: center; justify-content: center; gap: calc(var(--s) * 10px); opacity: 0; pointer-events: none !important; transition: opacity 0.4s; }
.banner.show { opacity: 1; animation: bin 0.4s; }
.banner img { width: calc(var(--s) * 66px); height: calc(var(--s) * 66px); border-radius: 50%; border: calc(var(--s) * 3px) solid; box-shadow: 0 0 0 calc(var(--s) * 2px) #1a140c, 0 0 0 calc(var(--s) * 3px) #c8963c, 0 calc(var(--s) * 3px) calc(var(--s) * 8px) rgba(0, 0, 0, 0.7); position: relative; z-index: 1; }
.banner.good img:first-child { border-color: var(--good); } .banner.good img:last-child { border-color: var(--bad); }
.banner.bad img:first-child { border-color: var(--bad); } .banner.bad img:last-child { border-color: var(--good); }
.banner .w { font-family: "Cinzel", serif; font-weight: 700; font-size: calc(var(--s) * 32px); padding: calc(var(--s) * 6px) calc(var(--s) * 34px); white-space: nowrap; margin: 0 calc(var(--s) * -22px);
  background: linear-gradient(180deg, rgba(232, 194, 114, 0.9) 0, rgba(232, 194, 114, 0.9) calc(var(--s) * 2px), rgba(16, 12, 8, 0.92) calc(var(--s) * 2px), rgba(36, 26, 16, 0.92) 50%, rgba(16, 12, 8, 0.92) calc(100% - calc(var(--s) * 2px)), rgba(232, 194, 114, 0.9) calc(100% - calc(var(--s) * 2px)));
  clip-path: polygon(0 50%, 6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%); }
.banner.good .w { color: #c6ffcc; text-shadow: 0 2px 0 #000, 0 0 12px rgba(90, 216, 122, 0.8); }
.banner.bad .w { color: #ffc4b4; text-shadow: 0 2px 0 #000, 0 0 12px rgba(236, 90, 68, 0.8); }
@keyframes bin { from { transform: scale(1.4); } }
.tip { text-align: center; color: #9ff4ff; font-size: calc(var(--s) * 20px); font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 8px rgba(0, 0, 0, 0.8); opacity: 0; pointer-events: none !important; }
.tip.show { animation: tipr 2s forwards; }
@keyframes tipr { 0% { opacity: 1; transform: translateY(calc(var(--s) * 30px)); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(calc(var(--s) * -50px)); } }
.channel { display: none; flex-direction: column; align-items: center; gap: 3px; pointer-events: none !important; }
.channel.show { display: flex; }
.channel .nm { font-size: calc(var(--s) * 14px); font-family: "Cinzel", serif; color: #f0e0bc; text-shadow: 0 1px 2px #000; }
.channel .bar { width: 100%; height: calc(var(--s) * 12px); padding: 1px; background: rgba(0, 0, 0, 0.8); border: 1px solid #a07a36; box-shadow: 0 0 0 1px #000; }
.channel .bar i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #c8ecff, #3a9ae8 50%, #1a5aa8); box-shadow: 0 0 6px rgba(120, 190, 255, 0.7); }
.death { display: none; align-items: center; justify-content: center; gap: calc(var(--s) * 10px); font-size: calc(var(--s) * 20px); pointer-events: none !important; z-index: 6;
  background: linear-gradient(90deg, rgba(40, 6, 4, 0), rgba(40, 8, 6, 0.85) 20%, rgba(40, 8, 6, 0.85) 80%, rgba(40, 6, 4, 0)); border-top: 1px solid rgba(236, 90, 68, 0.6); border-bottom: 1px solid rgba(236, 90, 68, 0.6); }
.death.show { display: flex; }
.death .hg { width: calc(var(--s) * 34px); height: calc(var(--s) * 34px); background: center / contain no-repeat; filter: drop-shadow(0 1px 2px #000); }
.death .txt { font-family: "Cinzel", serif; color: #f2d8c4; text-shadow: 0 2px 0 #000; letter-spacing: 0.04em; }
.death b { font-size: 1.5em; color: #ffd870; margin: 0 0.12em; }
.dim.show { opacity: 1; }
.hud .dim { left: 0 !important; top: 0 !important; right: 0; bottom: 0; width: auto !important; height: auto !important; background: radial-gradient(circle, rgba(20, 18, 24, 0.45), rgba(0, 0, 0, 0.75)); opacity: 0; transition: opacity 2s; color: inherit; }
.vignette { left: 0; top: 0; right: 0; bottom: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(220, 0, 0, 0.9)); }
.vignette.l1 { animation: vig1 2s ease-in-out infinite; }
.vignette.l2 { animation: vig2 1.6s ease-in-out infinite; }
@keyframes vig1 { 0%, 100% { opacity: 0.05; } 50% { opacity: 0.3; } }
@keyframes vig2 { 0%, 100% { opacity: 0.05; } 50% { opacity: 0.5; } }
.fps { font-size: 11px; color: #9f9; text-align: right; text-shadow: 0 0 2px #000; pointer-events: none !important; }

/* controls */
.joy-zone { background: transparent; }
.joy { pointer-events: none !important; opacity: 0.55; transition: opacity 0.1s; background: url("img/ui/joy-base.webp") center / 100% 100% no-repeat; border-radius: 50%; }
.joy.held { opacity: 1; }
.joy-knob { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: url("img/ui/joy-knob.webp") center / 100% 100% no-repeat; }
.joy-dir { position: absolute; left: 50%; top: 50%; border-radius: 50%; border-top: calc(var(--s) * 7px) solid rgba(140, 230, 255, 0.9); opacity: 0; filter: drop-shadow(0 0 calc(var(--s) * 4px) rgba(120, 220, 255, 0.9)); }
.btn { border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; touch-action: none; position: absolute; }
/* the right cluster is drawn up to 1.5x MLBB's size (controls.js clusterScale sets --bk): its inner text and pips scale with it */
.btn.skill, .btn.atk { --bs: calc(var(--s) * var(--bk, 1)); }
.btn.held, .btn.pressed { transform: scale(0.88); }
.btn::after { content: ""; position: absolute; pointer-events: none; background: center / 100% 100% no-repeat; z-index: 2; }
.btn.atk { background: radial-gradient(circle at 50% 38%, #4a3c2c, #1a140e 62%, #0a0806); box-shadow: 0 0 calc(var(--bs, var(--s)) * 14px) rgba(0, 0, 0, 0.65); }
.btn.atk::after { inset: -5%; background-image: url("img/ui/ring-atk.webp"); }
.btn.atk .atk-glyph { width: 58%; height: 58%; background: center / contain no-repeat; filter: drop-shadow(0 calc(var(--bs, var(--s)) * 2px) calc(var(--bs, var(--s)) * 2px) rgba(0, 0, 0, 0.8)); }
.btn.atk.held .atk-glyph { filter: drop-shadow(0 0 calc(var(--bs, var(--s)) * 6px) rgba(255, 220, 140, 0.9)); }
.btn.atk.disabled { filter: grayscale(1) brightness(0.6); }
.btn.skill { background: #0a0806; box-shadow: 0 0 calc(var(--bs, var(--s)) * 10px) rgba(0, 0, 0, 0.65); }
.btn.skill::after { inset: -9%; background-image: url("img/ui/ring-skill.webp"); }
.btn img { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; }
.btn .cd { position: absolute; inset: 0; border-radius: 50%; z-index: 1; display: none; pointer-events: none;
  background: conic-gradient(rgba(6, 6, 10, 0.8) calc(var(--f, 0) * 360deg), rgba(255, 226, 150, 0.95) calc(var(--f, 0) * 360deg) calc(var(--f, 0) * 360deg + 2.5deg), rgba(0, 0, 0, 0.08) 0); }
.btn .cdn { position: absolute; z-index: 3; font-weight: 700; color: #fff4dc; font-size: calc(var(--bs, var(--s)) * 30px); text-shadow: 0 0 calc(var(--bs, var(--s)) * 4px) #000, 0 calc(var(--bs, var(--s)) * 2px) 0 #000; pointer-events: none; }
.btn .lvl { position: absolute; left: -14%; right: -14%; bottom: -21%; display: flex; justify-content: center; gap: calc(var(--bs, var(--s)) * 3px); pointer-events: none; z-index: 3; }
.btn .lvl i { width: calc(var(--bs, var(--s)) * 8px); height: calc(var(--bs, var(--s)) * 8px); transform: rotate(45deg); background: #1a140c; border: 1px solid #6a5028; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7); }
.btn .lvl i.on { background: linear-gradient(135deg, #fff2c0, #e8b448 50%, #8a5a14); border-color: #2a1a06; box-shadow: 0 0 calc(var(--bs, var(--s)) * 4px) rgba(255, 200, 80, 0.75); }
.btn .mana { position: absolute; z-index: 3; bottom: 4%; left: 50%; transform: translateX(-50%); font-size: calc(var(--bs, var(--s)) * 12px); font-weight: 700; line-height: 1; color: #bfe0ff; padding: calc(var(--bs, var(--s)) * 1px) calc(var(--bs, var(--s)) * 5px);
  background: rgba(8, 20, 48, 0.82); border: 1px solid rgba(90, 160, 240, 0.7); border-radius: calc(var(--s) * 6px); pointer-events: none; text-shadow: 0 1px 1px #000; }
.btn .mana:empty { display: none; }
.btn .mpx { position: absolute; inset: 0; z-index: 1; border-radius: 50%; background: radial-gradient(circle, rgba(20, 50, 160, 0.35), rgba(20, 40, 140, 0.7)); display: none; pointer-events: none; }
.btn.nomana .mpx { display: block; }
.btn.unlearned .cd { background: rgba(6, 6, 10, 0.5) !important; }
.btn.unlearned img { filter: grayscale(0.6); }
.btn.nomana .mana { color: #ff9a8a; border-color: rgba(240, 90, 70, 0.8); }
.btn.silenced img { filter: grayscale(1) sepia(1) hue-rotate(230deg); }
.btn.extra { background: #0a0806; box-shadow: 0 0 calc(var(--s) * 8px) rgba(0, 0, 0, 0.6); }
.btn.extra::after { inset: -8%; background-image: url("img/ui/ring-extra.webp"); }
.btn.extra .lbl { position: absolute; bottom: calc(var(--s) * -21px); font-size: calc(var(--s) * 13px); white-space: nowrap; color: #f0e2c4; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none; letter-spacing: 0.04em; }
.btn.extra.active::after { filter: hue-rotate(-10deg) saturate(1.4) brightness(1.15); }
.btn.extra.empty img { filter: grayscale(1) brightness(0.4); }
.btn.extra.busy { box-shadow: 0 0 calc(var(--s) * 14px) #58a8ff; }
.controls.dead .btn.extra, .controls.dead .btn.atk { filter: grayscale(1) brightness(0.55); }
/* active-item buttons: charges badge, hotkey hint (mouse screens only), empty slot = "+", running Salve/Clarity */
.btn.extra img:not([src]) { display: none; }
.btn.extra.empty { background: radial-gradient(circle, rgba(30, 24, 16, 0.75), rgba(8, 6, 4, 0.85)); }
.btn.extra.empty::before { content: "+"; position: absolute; color: rgba(240, 210, 150, 0.55); font-weight: 700; font-size: calc(var(--s) * 34px); line-height: 1; pointer-events: none; }
.btn.extra.empty .lbl { color: rgba(240, 226, 196, 0.6); }
.btn.extra .chg { position: absolute; z-index: 4; right: -6%; bottom: -2%; min-width: calc(var(--s) * 22px); height: calc(var(--s) * 22px); border-radius: calc(var(--s) * 11px); padding: 0 calc(var(--s) * 4px); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: calc(var(--s) * 14px); line-height: 1; color: #1e1206; pointer-events: none;
  background: radial-gradient(circle at 40% 32%, #fff6cc, #f0c050 50%, #a8680f); border: 1px solid #2a1606; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.btn.extra .chg:empty { display: none; }
.btn.extra .hk { display: none; position: absolute; z-index: 4; left: -4%; top: -4%; font-size: calc(var(--s) * 11px); font-weight: 700; color: #f0e2c4; background: rgba(10, 8, 6, 0.85); border: 1px solid #6a5028; border-radius: calc(var(--s) * 4px); padding: 0 calc(var(--s) * 3px); pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .btn.extra .hk { display: block; } }
.btn.extra.running img { filter: brightness(0.55) saturate(0.6); }
.btn.extra.running { box-shadow: 0 0 calc(var(--s) * 12px) rgba(110, 230, 140, 0.8); }
.btn.extra.tp::after { filter: hue-rotate(185deg) saturate(1.2); }
.plus { display: none; border-radius: 50%; color: #3a2008; font-weight: 700; font-size: calc(var(--s) * (32px + 8px * (var(--bk, 1) - 1) / 0.5)); line-height: 1; align-items: center; justify-content: center; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
  background: radial-gradient(circle at 40% 32%, #fff6cc, #f0c050 40%, #b0741c 75%, #6a400c); border: calc(var(--s) * 2px) solid #3a2206; box-shadow: 0 0 0 1px #f8e0a0, 0 0 calc(var(--s) * 12px) rgba(255, 200, 60, 0.85); animation: pulse 1.2s ease-in-out infinite; }
.plus.show { display: flex; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.tab-lock { display: flex; align-items: center; justify-content: center; font-size: calc(var(--s) * (13px + 3px * (var(--bk, 1) - 1) / 0.5)); color: #e2d2b0; font-family: "Cinzel", serif; letter-spacing: 0.06em; text-shadow: 0 1px 1px #000;
  background: linear-gradient(180deg, rgba(36, 28, 20, 0.85), rgba(14, 11, 8, 0.85)); background-clip: padding-box; border: calc(var(--s) * 5px) solid transparent; border-image: url("img/ui/frame-dark.png") 16 / calc(var(--s) * 6px) stretch; }
.tab-lock:active { filter: brightness(1.3); }
.tab-lock.tabv span { writing-mode: vertical-rl; }
.cancel { display: none; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: calc(var(--s) * 15px); font-family: "Cinzel", serif; color: #ffd6cc; pointer-events: none !important;
  background: radial-gradient(circle, rgba(60, 10, 8, 0.55), rgba(30, 6, 4, 0.75)); border: calc(var(--s) * 3px) solid rgba(255, 120, 100, 0.75); box-shadow: 0 0 0 1px #000, inset 0 0 calc(var(--s) * 14px) rgba(200, 40, 30, 0.6); text-shadow: 0 1px 2px #000; }
.cancel.show { display: flex; }
.cancel.hot { background: radial-gradient(circle, rgba(230, 60, 40, 0.8), rgba(130, 20, 10, 0.85)); transform: scale(1.1); box-shadow: 0 0 calc(var(--s) * 18px) rgba(255, 80, 60, 0.8); }
.aim-ring { display: none; position: absolute; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none !important;
  border: calc(var(--s) * 3px) solid rgba(130, 200, 255, 0.9); background: radial-gradient(circle, rgba(40, 90, 160, 0.06) 40%, rgba(60, 130, 220, 0.3)); box-shadow: 0 0 calc(var(--s) * 10px) rgba(100, 180, 255, 0.5); }
.aim-ring.red { border-color: rgba(255, 100, 80, 0.95); background: radial-gradient(circle, rgba(160, 30, 20, 0.06) 40%, rgba(200, 40, 30, 0.32)); box-shadow: 0 0 calc(var(--s) * 10px) rgba(255, 80, 60, 0.5); }
.aim-knob { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffffff, #9ccfff 45%, #3a7ac8); box-shadow: 0 0 calc(var(--s) * 10px) rgba(120, 190, 255, 0.95); border: 1px solid rgba(255, 255, 255, 0.7); }
.aim-ring.red .aim-knob { background: radial-gradient(circle at 40% 35%, #fff, #ffaa9a 45%, #c8402e); box-shadow: 0 0 calc(var(--s) * 10px) rgba(255, 100, 80, 0.95); }
.table .btns, .scoreboard .btns { position: sticky; bottom: -1rem; padding: 0.6rem 0; background: linear-gradient(transparent, rgba(16, 13, 10, 0.98) 30%); }
.sq table, .table table { font-size: 0.78rem; }
.sq .btn.extra .lbl { bottom: auto; top: calc(var(--s) * -21px); }

/* M3 hero select: sixteen heroes, role tabs, scrolling roster */
.rostercol { display: flex; flex-direction: column; gap: 0.4rem; min-height: 0; flex: 0 0 auto; width: 24.6rem; max-width: 52vw; }
.rtabs { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.rtab { padding: 0.2rem 0.55rem; font-size: 0.78rem; border-radius: 4px; min-height: 0; }
.rtab.on { outline: 2px solid var(--gold); color: var(--gold); }
.rostercol .roster { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 6.6rem; overflow-y: auto; min-height: 0; flex: 1 1 auto; padding: 2px; }
.rostercol .roster .card .nm { font-size: 0.8rem; line-height: 1.05; text-align: center; }
.pt .rostercol { width: auto; max-width: none; flex: 0 0 auto; max-height: 48%; }
.pt .rostercol .roster { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 5.6rem; }
/* roster cards with the bronze skin: Cinzel names shrink and wrap inside the 4-column grid, compact role tabs */
.rostercol .roster .card .nm { font-size: 0.6rem; letter-spacing: -0.03em; line-height: 1.05; }
.rostercol .roster .card .rl { font-size: 0.56rem; letter-spacing: 0.06em; }
.rostercol { container-type: inline-size; }
@container (max-width: 340px) {
  .rostercol .roster .card .nm { font-family: "Fira Sans Condensed", sans-serif; font-size: 0.62rem; letter-spacing: 0; }
  .rostercol .roster .card { padding: 0.15rem 0.05rem; }
}
.pt .rostercol .roster .card .rl { font-size: 0.5rem; }
.screen .rtabs .rtab { padding: 0.1rem 0.45rem; font-size: 0.66rem; min-height: 0; line-height: 1.2; border-width: 5px; }
.screen.shop .tabs .tab { font-size: 0.78rem; letter-spacing: 0.02em; padding-left: 0.55rem; padding-right: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
