/* Block Kombat: the look of everything that is not the 3D picture, after the Figma file (page "Block Kombat · GUI (MK
   style)"): dark charcoal plates in gold bevel frames with cut corners, gold and blood-red, Kanit ExtraBold Italic capitals
   for every title, list and button, Cairo for the rest. Frames, plates, medallions and the logo are the Figma parts in
   ui/img/ (2x, drawn as 9-slice border images where they stretch); everything else is plain CSS. */
@font-face { font-family: Kanit; font-style: italic; font-weight: 800; font-display: swap; src: url(fonts/kanit-latin-800-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Kanit; font-style: italic; font-weight: 800; font-display: swap; src: url(fonts/kanit-latin-ext-800-italic.woff2) format('woff2'); unicode-range: U+0100-0130, U+0132-0151, U+0154-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Cairo; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/cairo-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cairo-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/cairo-latin-700-normal.woff2) format('woff2'); }

:root {
  --ink: #f3ead7; --mute: #b9ab90; --dim: #8a7a6a; --gold: #e9c26a; --gold2: #f5da8e; --bronze: #8a6326; --line: #3a2a14; --red: #c4262c; --blood: #8a0f16; --well: #0a0a0c; --green: #7ee05a;
  --metal: linear-gradient(180deg, #fff3c4 0%, #ecc86e 16%, #9c6b22 42%, #5e3d10 52%, #c39342 70%, #f5da8e 100%);
  --fire: linear-gradient(180deg, #fff6d0 0%, #ffb43a 45%, #c4262c 55%, #6a0a0e 100%);
  --k: italic 800 1em/1 Kanit, Cairo, system-ui, sans-serif;
  --ch: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; background: #070606; color: var(--ink); font: 600 15px/1.45 Cairo, system-ui, sans-serif; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: var(--gold2); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#veil { position: fixed; inset: 0; pointer-events: none; transition: background-color .3s, backdrop-filter .3s; }
#veil.blur { background: radial-gradient(ellipse at 50% 45%, rgba(40, 18, 14, .38), rgba(4, 3, 3, .82) 78%); -webkit-backdrop-filter: blur(8px) saturate(.8); backdrop-filter: blur(8px) saturate(.8); }
#veil.clear { background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(4, 3, 3, .7) 100%); }
#veil.off { background: transparent; }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; }

/* ---- type ---- */
.ttl { font: var(--k); font-size: 34px; text-transform: uppercase; letter-spacing: .03em; margin: 0; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 1px #1a0f03) drop-shadow(0 3px 4px rgba(0, 0, 0, .85)); }
.ttl.sm { font-size: 22px; }
.sub { margin: 6px 0 0; color: var(--mute); }
.note { margin: 0; color: var(--mute); font-size: 13px; line-height: 1.4; font-weight: 600; }
.note.warn { color: #ff9a8a; }
.lbl { color: #c9a25a; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.divider { width: min(480px, 70vw); height: auto; margin: 4px auto 0; }
kbd { font: 700 11px/1 Cairo, sans-serif; color: var(--gold2); border: 5px solid transparent; border-image: url(ui/img/btn.webp) 36 fill / 9px; padding: 2px 6px; margin-right: 6px; }

/* ---- plates (the gold-framed charcoal panel) and screens ---- */
.screen { position: fixed; inset: 0; display: grid; padding: 20px; overflow: auto; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.screen.center { place-items: start center; }
.screen.center > .card, .screen.center > .res { margin: auto; }
.screen.solid { background: #070606; }
.card, .plate, .acct { border: 14px solid transparent; border-image: url(ui/img/panel.webp) 72 fill / 36px stretch; }
.card { padding: 16px 20px; width: min(440px, 100%); }
.card.wide { width: min(700px, 100%); }
.card.menu { text-align: center; }
.card > .ttl { text-align: center; }
.plate { padding: 14px 18px; min-width: 0; }

/* ---- buttons ---- */
.btn { appearance: none; cursor: pointer; border: 6px solid transparent; border-image: url(ui/img/btn.webp) 36 fill / 18px stretch; background: none; padding: 8px 20px 9px; color: #e8dcc4; font: var(--k); font-size: 17px; text-transform: uppercase; letter-spacing: .04em; text-decoration: none; text-align: center; display: inline-block; text-shadow: 0 2px 3px rgba(0, 0, 0, .8); transition: filter .12s, transform .06s; }
.btn.hot { border-image-source: url(ui/img/btn-on.webp); color: #fff3c4; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(2px); }
.btn.big { padding: 11px 26px 12px; font-size: 21px; min-width: 170px; }
.btn.off, .btn:disabled { filter: grayscale(.8) brightness(.7); cursor: default; transform: none; }
.btn:focus-visible, .seg button:focus-visible { outline: 0; filter: brightness(1.22) drop-shadow(0 0 6px rgba(245, 218, 142, .8)); }
.vi:focus-visible, .cy-b:focus-visible, .key:focus-visible, .inp:focus-visible, .item:focus-visible, .mcard:focus-visible, a:focus-visible, .tb:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; }

/* ---- the vertical list: the lit entry sits on the red-and-gold bar ---- */
.vl { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0 0; }
.vi { appearance: none; border: 0; background: none; cursor: pointer; position: relative; isolation: isolate; padding: 7px 40px; font: var(--k); font-size: clamp(19px, 2.2vw, 24px); text-transform: uppercase; letter-spacing: .05em; color: #cfc6b6; text-shadow: 0 2px 4px #000; white-space: nowrap; }
.vi.on { font-size: clamp(23px, 2.7vw, 30px); color: #fff3c4; text-shadow: 0 0 1px #1a0f03, 0 2px 4px #000; }
.vi.on::before { content: ''; position: absolute; z-index: -1; inset: 0 -130px; background: url(ui/img/sel.webp) center / 100% 100% no-repeat; }
.vi:focus-visible { outline: 0; }   /* the lit bar already shows where the keyboard is */

/* ---- form parts ---- */
.field { display: grid; gap: 5px; margin-top: 12px; text-align: left; }
.inp, .cy { width: 100%; background: var(--well); border: 1px solid #5a3a10; clip-path: var(--ch); }
.inp { padding: 9px 12px; font: 700 16px/1.2 Cairo, sans-serif; color: #fff; text-align: center; -webkit-user-select: text; user-select: text; }
.inp:focus { outline: 0; border-color: var(--gold); background: #121014; }
.cy { display: flex; align-items: center; padding: 3px; min-height: 42px; }
.cy-v { flex: 1; text-align: center; font-weight: 700; font-size: 15px; color: #fff; }
.cy-b { appearance: none; border: 0; width: 34px; height: 34px; background: none; font: var(--k); font-size: 24px; color: var(--gold2); cursor: pointer; }
.cy-b:hover { color: #fff; }
.cy.one .cy-b { visibility: hidden; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; appearance: none; cursor: pointer; border: 5px solid transparent; border-image: url(ui/img/btn.webp) 36 fill / 14px stretch; background: none; padding: 6px 8px; font: var(--k); font-size: 14px; text-transform: uppercase; color: #e8dcc4; letter-spacing: .04em; }
.seg button.on { border-image-source: url(ui/img/btn-on.webp); color: #fff3c4; }
.range { width: 100%; accent-color: var(--gold); height: 26px; }

/* ---- the main menu ---- */
.mmenu { display: flex; flex-direction: column; align-items: center; padding: 18px 28px 14px; }
.mtop { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.logo { width: clamp(220px, 30vw, 400px); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.acct { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 8px; border-width: 10px; border-image-width: 28px; }
.ac-c { width: 34px; height: 34px; }
.ac-n { font: var(--k); font-size: 26px; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 2px; }
.ac-t { display: grid; line-height: 1.2; margin-left: 8px; }
.ac-w { color: #fff; font-weight: 700; font-size: 14px; }
.ac-s { color: #c9b48a; font-size: 11px; }
.ac-l { font-weight: 700; }
.mcards { display: flex; justify-content: center; align-items: center; gap: clamp(16px, 3.4vw, 54px); margin: clamp(10px, 2.4vh, 28px) 0 clamp(8px, 2vh, 22px); }
.mcard { appearance: none; border: 0; padding: 0; font: 600 13px/1.3 Cairo, sans-serif; cursor: pointer; position: relative; width: clamp(170px, 22vw, 300px); aspect-ratio: 300 / 186; background: #120d0b; text-align: left; transition: transform .18s, filter .18s; filter: brightness(.8) saturate(.85); }
.mcard::after { content: ''; position: absolute; inset: 0; border: 14px solid transparent; border-image: url(ui/img/card.webp) 60 / 30px stretch; pointer-events: none; z-index: 2; }
.mcard.on { filter: none; transform: scale(1.1); z-index: 1; }
.mcard.on::after { border-image-source: url(ui/img/card-on.webp); }
.mc-tower { transform: rotate(-5deg) translateY(10px); } .mc-shop { transform: rotate(5deg) translateY(10px); }
.mc-tower.on { transform: rotate(-5deg) translateY(10px) scale(1.1); } .mc-shop.on { transform: rotate(5deg) translateY(10px) scale(1.1); }
.mc-i { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: cover; clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); }
.mcard::before { content: ''; position: absolute; inset: 40% 4px 4px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .88)); z-index: 1; }
.mc-t, .mc-s { position: absolute; left: 9%; z-index: 1; }
.mc-t { bottom: 26%; font: var(--k); font-size: clamp(22px, 2.6vw, 38px); text-transform: uppercase; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 1px #1a0f03) drop-shadow(0 3px 4px #000); padding-right: 4px; }
.mc-s { bottom: 10%; font-size: clamp(11px, 1vw, 13px); color: #e8dcc4; }
.mlist { margin-top: 6px; }
.mfoot { margin-top: auto; text-align: center; padding-top: 8px; }
.mdesc { margin: 8px 0 0; min-height: 22px; font-size: 16px; color: #e8dcc4; }
.hints { width: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 22px; margin-top: 8px; color: #bfb39b; font-size: 12px; }
.hint { display: inline-flex; align-items: center; }
.hint.site { margin-right: auto; color: var(--gold2); font-weight: 700; text-decoration: none; }
.hint.site:hover { color: #fff; }

/* ---- choosing fighters ---- */
.sel { grid-template-columns: minmax(250px, 320px) 1fr minmax(250px, 320px); grid-template-rows: auto 1fr auto auto; grid-template-areas: 'head head head' 'pl . pr' 'vs vs vs' 'bot bot bot'; gap: 10px 20px; padding: 16px 26px 18px; }
.shead { grid-area: head; text-align: center; }
.stitle { font-size: clamp(30px, 3.6vw, 46px); }
.sel .pl { grid-area: pl; align-self: start; } .sel .pr { grid-area: pr; align-self: start; }
.plate .note { margin-top: 12px; }
.vs { grid-area: vs; display: flex; justify-content: center; align-items: center; gap: 18px; }
.vsn { flex: 1; font: var(--k); font-size: clamp(26px, 4.2vw, 56px); text-transform: uppercase; color: #fff; text-shadow: 0 0 2px #000, 0 4px 10px rgba(0, 0, 0, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px; }
.vsn.n0 { text-align: right; } .vsn.n1 { text-align: left; }
.vsm { position: relative; width: clamp(64px, 7vw, 92px); flex: none; }
.vsm img { width: 100%; }
.vsm b { position: absolute; inset: 0; display: grid; place-items: center; font: var(--k); font-size: clamp(20px, 2.4vw, 32px); background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sbot { grid-area: bot; display: flex; justify-content: center; align-items: end; gap: 20px; }
.sbot .field { width: min(300px, 40vw); margin: 0; }
.tower { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.tower li { display: flex; gap: 10px; align-items: baseline; padding: 7px 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); clip-path: var(--ch); color: #cfc6b6; }
.tower li b { font: var(--k); font-size: 13px; text-transform: uppercase; color: #c9a25a; min-width: 62px; }
.tower li.on { background: linear-gradient(180deg, #3a1416, #1a0a0b); border-color: var(--gold); color: #fff; }
.tower li.done { opacity: .5; text-decoration: line-through; }

/* ---- the market ---- */
.shop { grid-template-columns: minmax(200px, 260px) minmax(0, 580px) minmax(220px, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'head head head' 'left mid right'; gap: 12px 22px; padding: 16px 26px 18px; }
.shop .shead { grid-area: head; }
.shop > .acct { position: absolute; top: 16px; right: 26px; }
.sleft { grid-area: left; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; min-height: 0; }
.stabs { align-items: flex-start; margin: 20px 0 0 -26px; }
.stabs .vi { text-align: left; padding-left: 34px; }
.stabs .vi.on::before { inset: 0 -60px 0 0; background: linear-gradient(90deg, var(--gold2), transparent) top / 100% 2px no-repeat, linear-gradient(90deg, var(--gold2), transparent) bottom / 100% 2px no-repeat, linear-gradient(90deg, rgba(196, 38, 44, .95), rgba(138, 15, 22, .7) 60%, transparent); }
.smid { grid-area: mid; display: flex; flex-direction: column; min-height: 0; padding: 10px; }
.items { display: grid; gap: 7px; overflow: auto; padding: 4px; flex: 1; min-height: 60px; align-content: start; scrollbar-color: var(--bronze) transparent; }
.item { appearance: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px 10px 16px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); clip-path: var(--ch); text-align: left; color: var(--ink); font: inherit; width: 100%; }
.item.lit { background: linear-gradient(180deg, #3a1416, #1a0a0b); border-color: var(--gold); }
.it-t { display: grid; gap: 1px; min-width: 0; }
.it-n { font: var(--k); font-size: 18px; text-transform: uppercase; letter-spacing: .02em; color: #fff; }
.item.lit .it-n { color: #fff3c4; }
.it-d { color: #bfb39b; font-size: 13px; line-height: 1.3; }
.it-h { color: var(--gold2); font-size: 12px; font-weight: 700; }
.it-a { display: flex; align-items: center; gap: 10px; flex: none; }
.it-p { display: flex; align-items: center; gap: 6px; flex: none; font: var(--k); font-size: 18px; color: var(--gold2); }
.it-p .coin { width: 18px; height: 18px; }
.it-p.dim { color: var(--dim); }
.it-p.own { font-size: 13px; color: var(--mute); }
.it-p.own.on { color: var(--green); }
.item.pack { cursor: default; }
.item.pack .btn { font-size: 14px; }
.msg { margin: 8px 6px 2px; min-height: 18px; }
.sright { grid-area: right; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 12px; text-align: center; padding-bottom: 6px; }
.pick { display: grid; gap: 2px; max-width: 300px; }
.pk-n { font: var(--k); font-size: 26px; text-transform: uppercase; color: #fff; text-shadow: 0 2px 8px #000; }
.pk-d { color: #e8dcc4; text-shadow: 0 1px 4px #000; }

/* ---- result, pause, settings, move list ---- */
.res { width: min(560px, 100%); text-align: center; display: grid; justify-items: center; }
.big-t { margin: 0; font: var(--k); font-size: clamp(64px, 11vw, 128px); text-transform: uppercase; background: linear-gradient(180deg, #fff6d0, #ffcf5a 45%, #b5832f 55%, #6a4410); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 2px #1a0503) drop-shadow(0 8px 12px rgba(0, 0, 0, .85)); animation: slam .3s cubic-bezier(.2, 1.4, .4, 1); padding: 0 .08em; }
.big-t.lost { background-image: var(--fire); }
.rounds { margin: 6px 0 4px; font: var(--k); font-size: 20px; letter-spacing: .14em; color: #e8dcc4; text-transform: uppercase; }
.res .note { margin-top: 8px; }
.earn { margin-top: 12px; width: min(480px, 100%); display: grid; gap: 4px; text-align: left; }
.erow { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff; }
.erow .en { display: flex; align-items: center; gap: 8px; font: var(--k); font-size: 19px; color: var(--gold2); }
.erow.cut .en { color: #ff9a8a; }
.erow.wait span { color: var(--mute); }
.erow.tot { border-top: 1px solid var(--bronze); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.erow.tot .en { font-size: 22px; color: var(--gold2); }
.erow .coin { width: 22px; height: 22px; }
.login { margin-top: 10px; font-weight: 700; }
.pbody { display: grid; }
.card .vl { margin-top: 8px; }
.card .vi.on::before { inset: 0 -40px; }
.foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.set-body { max-height: min(60vh, 600px); overflow: auto; padding: 0 6px 4px 2px; margin-top: 6px; scrollbar-color: var(--bronze) transparent; }
.set-body .ttl.sm { margin-top: 22px; }
.keys2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 8px 0 12px; }
.keys .lbl { display: block; margin-bottom: 4px; }
.krow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; font-size: 14px; }
.key { appearance: none; cursor: pointer; background: var(--well); border: 1px solid #5a3a10; clip-path: var(--ch); min-width: 80px; padding: 5px 9px; font: 700 13px/1.1 Cairo, sans-serif; color: #fff; }
.key.on { border-color: var(--gold); color: var(--gold2); }
.moves { display: grid; gap: 4px; margin-top: 12px; max-height: 54vh; overflow: auto; padding-right: 6px; text-align: left; scrollbar-color: var(--bronze) transparent; }
.mv { display: grid; grid-template-columns: 1.1fr .9fr 1.6fr; gap: 10px; align-items: baseline; padding: 7px 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); clip-path: var(--ch); font-size: 13px; }
.mv b { font: var(--k); font-size: 14px; text-transform: uppercase; color: #fff; }
.mv .keys { font-weight: 700; color: var(--gold2); }
.card.wide > .note { margin-top: 10px; text-align: center; }

/* ---- the fight's display ---- */
#hud { position: fixed; inset: 0; pointer-events: none; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); }
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; align-items: start; }
.pc { display: flex; gap: 2px; align-items: flex-start; min-width: 0; }
.pc.p1 { flex-direction: row-reverse; }
.pc.hit .hb { animation: knock .28s; }
.port { position: relative; flex: none; width: clamp(46px, 5.6vw, 78px); aspect-ratio: 1; }
.port .hd { position: absolute; inset: 12%; width: 76%; height: 76%; image-rendering: pixelated; object-fit: cover; background: #2a1c16; }
.port .fb { display: grid; place-items: center; font: var(--k); font-size: 26px; color: var(--gold2); }
.port .pf { position: absolute; inset: 0; width: 100%; height: 100%; }
.pb { flex: 1; min-width: 0; display: grid; gap: 2px; padding-top: clamp(2px, .6vw, 8px); }
.hb { position: relative; width: 100%; max-width: 580px; aspect-ratio: 640 / 72; }
.p1 .hb { justify-self: end; }
.slot { position: absolute; top: 27.78%; height: 44.44%; left: 3.125%; width: 88.75%; background: #140707; overflow: hidden; }
.p1 .slot { left: 8.125%; }
.slot i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; }
.p1 .slot i { left: auto; right: 0; }
.slot .trail { background: linear-gradient(180deg, #ff5a4a, #8a0f16); }
.slot .fill { background: linear-gradient(180deg, #a6f07e 0%, #4fbe3a 22%, #2f9e2a 55%, #17621a 100%); box-shadow: inset 0 2px 0 rgba(216, 255, 184, .5); transition: width .1s linear; }
.slot .fill.low { background: linear-gradient(180deg, #ffe08a 0%, #f0b42c 30%, #c27a10 100%); }
.bf { position: absolute; inset: 0; width: 100%; height: 100%; }
.p1 .bf { transform: scaleX(-1); }
.nm { position: absolute; top: 27.78%; height: 44.44%; left: 6%; right: 18%; display: flex; align-items: center; font: var(--k); font-size: clamp(10px, 1.35vw, 18px); text-transform: uppercase; letter-spacing: .06em; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000; overflow: hidden; white-space: nowrap; }
.p1 .nm { left: 18%; right: 6%; justify-content: flex-end; }
.pips { display: flex; gap: 4px; padding: 0 5%; }
.p1 .pips { justify-content: flex-end; }
.pip { width: clamp(14px, 1.7vw, 24px); height: auto; }
.mid { display: grid; justify-items: center; gap: 2px; }
.medal { position: relative; width: clamp(64px, 8vw, 112px); aspect-ratio: 1; }
.medal .md { width: 100%; height: 100%; }
.clock { position: absolute; inset: 0; display: grid; place-items: center; font: var(--k); font-size: clamp(22px, 3vw, 42px); color: var(--gold2); text-shadow: 0 0 2px #1a0f03, 0 2px 4px #000; padding-right: 2px; }
.clock.low { color: #ff7a5a; animation: pulse .5s infinite alternate; }
.pausebtn { pointer-events: auto; appearance: none; cursor: pointer; background: none; border: 4px solid transparent; border-image: url(ui/img/btn.webp) 36 fill / 10px stretch; color: var(--gold2); padding: 2px 10px; font: 700 10px/1.3 Cairo, sans-serif; text-transform: uppercase; letter-spacing: .12em; }
.rage { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); width: min(34vw, 380px); display: grid; }
.rage.r0 { left: max(12px, env(safe-area-inset-left)); } .rage.r1 { right: max(12px, env(safe-area-inset-right)); }
.rl { font: var(--k); font-size: clamp(11px, 1.1vw, 14px); text-transform: uppercase; letter-spacing: .1em; color: #e8dcc4; text-shadow: 0 1px 3px #000; padding: 0 0 2px 13%; }
.r1 .rl { text-align: right; padding: 0 13% 2px 0; }
.rage.full .rl { color: #ffd27a; }
.rm { position: relative; width: 100%; aspect-ratio: 440 / 56; }
.rs { position: absolute; top: 35.7%; height: 28.6%; left: 11.82%; width: 83.6%; background: #0c0a0a; display: flex; overflow: hidden; }
.r1 .rs { left: 4.545%; justify-content: flex-end; }
.rf { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #a8dcff, #3a8ae0 50%, #1f5aa8); transition: width .15s; }
.rage.full .rf { background: linear-gradient(180deg, #ffe9a0, #ff9a1a 50%, #c4262c); animation: pulse .45s infinite alternate; }
.mf { position: absolute; inset: 0; width: 100%; height: 100%; }
.r1 .mf { transform: scaleX(-1); }
.combo, .cnote { position: absolute; top: 28%; font: var(--k); font-size: clamp(30px, 5vw, 56px); text-transform: uppercase; opacity: 0; color: #ffe08a; text-shadow: 0 0 2px #2a0a04, 0 3px 0 #8a4a10, 0 6px 10px rgba(0, 0, 0, .8); }
.cnote { top: 40%; font-size: clamp(18px, 2.6vw, 28px); color: #bfe4ff; text-shadow: 0 0 2px #071a2a, 0 3px 6px rgba(0, 0, 0, .8); letter-spacing: .08em; }
.c0 { left: 4vw; } .c1 { right: 4vw; }
.combo.go, .cnote.go { opacity: 1; animation: slam .22s cubic-bezier(.2, 1.4, .4, 1); }
.banner, .banner2 { position: absolute; left: 0; right: 0; top: 32%; text-align: center; font: var(--k); font-size: clamp(64px, 14vw, 170px); line-height: 1.05; text-transform: uppercase; opacity: 0; background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 3px #1a0503) drop-shadow(0 10px 14px rgba(0, 0, 0, .85)); }
.banner2 { top: calc(32% + clamp(64px, 14vw, 170px)); font-size: clamp(34px, 6.4vw, 76px); background: var(--metal); -webkit-background-clip: text; background-clip: text; }
.banner.go, .banner2.go { opacity: 1; animation: slam .26s cubic-bezier(.2, 1.5, .4, 1); }
.banner.ko { background: linear-gradient(180deg, #ffffff, #ffb0a0 45%, #c4262c 55%, #4a0408); -webkit-background-clip: text; background-clip: text; }
.train { position: absolute; left: 50%; bottom: max(70px, env(safe-area-inset-bottom)); transform: translateX(-50%); border: 10px solid transparent; border-image: url(ui/img/panel.webp) 72 fill / 26px stretch; padding: 4px 10px; display: flex; gap: 14px; font-size: 12px; white-space: nowrap; }
.train i { font-style: normal; color: var(--mute); } .train b { font: var(--k); font-size: 14px; text-transform: uppercase; color: var(--gold2); }
@keyframes slam { from { transform: scale(2.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes knock { 30% { transform: translateY(4px) rotate(-.6deg); } 60% { transform: translateY(-2px); } }
@keyframes pulse { to { filter: brightness(1.35); } }

/* ---- touch pad ---- */
#touch { position: fixed; inset: 0; pointer-events: none; }
.tpad { position: absolute; left: 0; bottom: 0; width: 46%; height: 62%; pointer-events: auto; touch-action: none; }
.stick { position: absolute; left: 86px; top: calc(100% - 96px); width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; background: radial-gradient(circle, rgba(20, 12, 8, .35), rgba(20, 12, 8, .6)); border: 2px solid rgba(233, 194, 106, .7); display: grid; place-items: center; }
.stick.on { border-color: var(--gold2); }
.knob { width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3c4, #c39342 55%, #5e3d10); box-shadow: 0 4px 10px rgba(0, 0, 0, .6); }
.tbtns { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(54px, calc(env(safe-area-inset-bottom) + 40px)); width: 176px; height: 176px; pointer-events: none; }
.tb { position: absolute; width: 64px; height: 64px; border-radius: 50%; pointer-events: auto; touch-action: none; border: 3px solid #c39342; background: radial-gradient(circle at 50% 35%, #2b2d33, #0e0f12); color: var(--gold2); font: var(--k); font-size: 22px; box-shadow: 0 4px 10px rgba(0, 0, 0, .6), inset 0 0 0 2px #2a1a06; }
.tb.on { background: radial-gradient(circle at 50% 35%, #d8343a, #3a0508); color: #fff3c4; transform: scale(.94); }
.tb-light { left: 0; top: 56px; } .tb-heavy { left: 56px; top: 0; } .tb-kick { left: 112px; top: 56px; } .tb-block { left: 56px; top: 112px; }

/* ---- smaller screens ---- */
@media (max-width: 1100px) { .shop { grid-template-columns: minmax(170px, 210px) minmax(0, 1fr) minmax(190px, 260px); gap: 10px 14px; } }
@media (max-width: 899px) {
  .mmenu { padding: 12px 14px; }
  .mcards { gap: 10px; } .mcard { width: 28vw; } .mc-s { display: none; }
  .mtop { gap: 8px; } .acct { padding: 2px 8px 2px 4px; } .ac-n { font-size: 20px; } .ac-c { width: 26px; height: 26px; }
  .hints .hint:not(.site) { display: none; }
  .keys2 { grid-template-columns: 1fr; }
  .mv { grid-template-columns: 1fr 1fr; } .mv .note { grid-column: 1 / -1; }
  .rage { width: 38vw; } .train { gap: 8px; font-size: 10px; bottom: auto; top: 96px; }
}
/* phones held upright: the 3D fighters on top, the plates under them */
@media (max-width: 899px) and (orientation: portrait) {
  .sel { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: 'head' 'vs' 'pl' 'pr' 'bot'; padding: 12px; gap: 8px; }
  .sel .vs { margin-top: 34vh; }
  .sbot { flex-wrap: wrap; } .sbot .field { order: -1; width: 100%; }
  .shop { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: 'head' 'left' 'mid' 'right'; padding: 12px; }
  .shop .smid { margin-top: 30vh; }
  .shop > .acct { top: 10px; right: 12px; }
  .sleft { flex-direction: row; align-items: center; overflow-x: auto; }
  .stabs { flex-direction: row; margin: 0; gap: 0; } .stabs .vi { padding: 6px 12px; font-size: 16px; } .stabs .vi.on { font-size: 18px; } .stabs .vi.on::before { inset: 0; background: linear-gradient(180deg, rgba(196, 38, 44, .95), rgba(138, 15, 22, .8)); }
  .sleft > .btn { display: none; }
  .sright { flex-direction: row; justify-content: center; padding: 0; } .pick { display: none; }
}
/* short screens (phones on their side): the desktop layout, packed tighter */
@media (max-height: 560px) {
  .mmenu { padding: 6px 16px; } .logo { width: 170px; } .mcards { margin: 4px 0 2px; } .mcard { width: min(20vw, 190px); } .mcard.on, .mc-tower.on, .mc-shop.on { transform: none; } .mc-tower { transform: rotate(-4deg); } .mc-shop { transform: rotate(4deg); }
  .vl { margin-top: 4px; gap: 0; } .vi { padding: 2px 30px; font-size: 15px; } .vi.on { font-size: 18px; } .mdesc { font-size: 12px; margin-top: 2px; min-height: 0; } .mfoot { padding-top: 2px; } .mfoot .divider { display: none; } .hints { margin-top: 2px; }
  .sel { grid-template-columns: minmax(200px, 250px) 1fr minmax(200px, 250px); gap: 6px 12px; padding: 8px 14px; }
  .stitle { font-size: 24px; } .shead .divider { display: none; }
  .sel .plate { max-height: calc(100vh - 150px); overflow: auto; padding: 6px 10px; } .sel .field { margin-top: 4px; } .sel .note { display: none; } .sel .ttl.sm { font-size: 17px; }
  .cy { min-height: 34px; } .cy-b { height: 28px; } .inp { padding: 6px 10px; font-size: 14px; } .lbl { font-size: 10px; }
  .vsn { font-size: 26px; } .vsm { width: 52px; } .btn.big { padding: 7px 18px 8px; font-size: 17px; min-width: 120px; } .sbot .field { width: 220px; }
  .shop { grid-template-columns: minmax(130px, 170px) minmax(0, 1fr) minmax(170px, 220px); gap: 6px 12px; padding: 8px 14px; }
  .stabs { margin: 6px 0 0 -14px; } .stabs .vi { padding: 3px 14px; } .item { padding: 6px 10px 6px 12px; } .it-n { font-size: 15px; } .it-d { font-size: 12px; } .msg { display: none; }
  .pk-n { font-size: 20px; } .pk-d { font-size: 12px; }
  .card { padding: 8px 14px; } .set-body { max-height: calc(100vh - 150px); } .moves { max-height: calc(100vh - 170px); }
  .big-t { font-size: 60px; } .earn { margin-top: 4px; gap: 0; } .rounds { font-size: 15px; }
  .rage { width: 30vw; } .train { top: 76px; }
}
@media (max-width: 520px) { .mcards { display: none; } .logo { width: 170px; } .nm { font-size: 9px; } .port { width: 34px; } .medal { width: 56px; } .clock { font-size: 20px; } .pips { padding: 0 2%; } .pip { width: 12px; } }
@media (prefers-reduced-motion: reduce) { .combo.go, .cnote.go, .banner.go, .banner2.go, .pc.hit .hb, .rage.full .rf, .clock.low, .big-t { animation: none; } .btn, #veil, .slot .fill, .rf, .mcard { transition: none; } }
