:root {
  --ink: #0b0d0f;
  --ink-2: #12161d;
  --cream: #f6e7c9;
  --cream-dim: #cdbb9b;
  --gold: #ffcc45;
  --amber: #ef9d1d;
  --red: #df3b27;
  --red-deep: #8e1b12;
  --teal: #2fb4bb;
  --brown: #3a2a1c;

  --titleW: min(66vw, 30vh, 520px);
  --titleH: calc(var(--titleW) * 0.627);
  --btn: clamp(38px, 5.4vh, 52px);
  --tool: clamp(30px, 4.2vh, 40px);
  --deckH: 96px;
  --safeT: env(safe-area-inset-top, 0px);
  --safeB: env(safe-area-inset-bottom, 0px);
}

@media (min-aspect-ratio: 1/1) {
  :root { --titleW: min(54vw, 40vh, 600px); }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #07090c;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  color: var(--cream);
  font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: fixed;
  inset: 0;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  background:
    radial-gradient(ellipse at 22% 18%, rgba(239, 157, 29, .13), transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(47, 180, 187, .10), transparent 55%),
    #07090c;
}

#arena {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#arena canvas { display: block; }

#vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 44%, transparent 34%, rgba(4, 5, 8, .36) 74%, rgba(3, 4, 6, .72) 100%);
}

#grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: .12;
  mix-blend-mode: multiply;
  background-image: radial-gradient(rgba(0, 0, 0, .9) .55px, transparent .8px);
  background-size: 3px 3px;
}

#title {
  position: absolute;
  top: calc(var(--safeT) + 1.4vh);
  left: 50%;
  width: var(--titleW);
  height: auto;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  filter:
    drop-shadow(0 4px 0 rgba(0, 0, 0, .65))
    drop-shadow(0 12px 22px rgba(0, 0, 0, .55));
  animation: titleFloat 6.5s ease-in-out infinite;
}

@keyframes titleFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

/* ---------------- HUD ---------------- */

#hud {
  position: absolute;
  top: calc(var(--safeT) + var(--titleH) + 2.2vh);
  left: 0;
  right: 0;
  z-index: 14;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 1.4vw;
  padding: 0 max(7px, 2vw);
  pointer-events: none;
}

.corner {
  display: flex;
  align-items: center;
  gap: clamp(4px, .9vw, 9px);
  min-width: 0;
}

.corner.right { flex-direction: row-reverse; }

.portrait {
  position: relative;
  flex: none;
  width: clamp(36px, 9.6vh, 66px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #07090c;
  box-shadow:
    0 0 0 2px var(--ink),
    0 3px 0 rgba(0, 0, 0, .55),
    0 0 14px rgba(255, 204, 69, .1);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}

.portrait.r img {
  object-position: 50% 26%;
  transform: scaleX(-1);
}

.barblock {
  min-width: 0;
  flex: 1 1 auto;
}

.corner.right .barblock { text-align: right; }

.nameplate {
  margin: 0 0 2px;
  font-family: "Titan One", Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(9px, 1.65vh, 16px);
  letter-spacing: .055em;
  line-height: 1;
  color: var(--cream);
  text-shadow:
    1px 1px 0 #000,
    2px 2px 0 #000,
    0 0 10px rgba(0, 0, 0, .7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  position: relative;
  width: 100%;
  max-width: clamp(124px, 30vw, 330px);
  aspect-ratio: 527 / 98;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .62));
  margin-left: auto;
}

.corner.left .bar { margin-left: 0; }

.bar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

.bar-off {
  filter: grayscale(.45) sepia(.22) brightness(.34) contrast(1.15);
  opacity: .95;
}

.bar-on {
  filter: saturate(1.06) brightness(1.03);
  transition: clip-path .14s linear, filter .25s linear;
}

.bar.danger .bar-on {
  animation: barDanger .62s steps(2, end) infinite;
  filter: saturate(1.5) brightness(1.2) hue-rotate(-9deg);
}

@keyframes barDanger {
  0%, 100% { opacity: 1; }
  50% { opacity: .58; }
}

.super {
  position: relative;
  width: 64%;
  max-width: 210px;
  aspect-ratio: 630 / 107;
  margin-top: 3px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6));
  opacity: .92;
}

.corner.left .super { margin-right: auto; }
.corner.right .super { display: none; }

.super img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}

.super-off { filter: brightness(.16) saturate(.12); }

.super-on {
  filter: saturate(1.25) brightness(1.15) drop-shadow(0 0 5px rgba(255, 204, 69, .7));
  transition: clip-path .16s linear;
}

.super.full .super-on { animation: superGlow .8s ease-in-out infinite; }

@keyframes superGlow {
  0%, 100% { filter: brightness(1.1) drop-shadow(0 0 3px rgba(255, 204, 69, .55)); }
  50% { filter: brightness(1.45) drop-shadow(0 0 10px rgba(255, 210, 74, .95)); }
}

.timerbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

.timerplate {
  position: relative;
  width: clamp(42px, 8.6vh, 78px);
  aspect-ratio: 1;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .65));
}

.timerplate > img {
  width: 100%;
  height: 100%;
  display: block;
}

#timerText {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 6%;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-weight: 900;
  font-size: calc(clamp(42px, 8.6vh, 78px) * .34);
  line-height: .8;
  letter-spacing: -.03em;
  color: #14100b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}


.pips {
  display: flex;
  gap: clamp(3px, .5vw, 6px);
  align-items: center;
  height: clamp(8px, 1.45vh, 14px);
}

.pip {
  width: clamp(8px, 1.45vh, 14px);
  height: auto;
  display: block;
  opacity: .34;
  filter: grayscale(1) brightness(.55);
  transition: opacity .25s, filter .25s, transform .25s;
}

.pip.won-player { opacity: 1; filter: none; }
.pip.won-rival { opacity: 1; filter: hue-rotate(145deg) saturate(1.35) brightness(1.1); }
.pip.current { opacity: .92; filter: sepia(.3) brightness(.9); transform: scale(1.12); }
.pip.won-player.current, .pip.won-rival.current { transform: scale(1.18); }

/* ---------------- in-world calls ---------------- */

#combo {
  position: absolute;
  left: 3.2vw;
  top: 32.5%;
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: clamp(4px, .8vw, 9px);
  opacity: 0;
  transform: translateY(8px) rotate(-4deg) scale(.86);
  transform-origin: left center;
  transition: opacity .12s, transform .16s cubic-bezier(.2, 1.7, .4, 1);
  pointer-events: none;
  filter: drop-shadow(0 9px 16px rgba(0, 0, 0, .55));
}

#combo.show {
  opacity: 1;
  transform: translateY(0) rotate(-4deg) scale(1);
}

#combo.pop { animation: comboPop .18s cubic-bezier(.2, 1.9, .4, 1); }

@keyframes comboPop {
  0% { transform: translateY(0) rotate(-4deg) scale(1.42); }
  100% { transform: translateY(0) rotate(-4deg) scale(1); }
}

#comboNum {
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-weight: 900;
  font-size: clamp(46px, 11.5vh, 106px);
  line-height: .72;
  color: var(--gold);
  -webkit-text-stroke: clamp(1px, .28vh, 2.4px) #0a0b0d;
  text-shadow:
    3px 4px 0 #0a0b0d,
    0 0 18px rgba(255, 204, 69, .22);
}

#comboLabel {
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(11px, 2.1vh, 21px);
  line-height: .92;
  color: var(--cream);
  letter-spacing: .02em;
  text-shadow: 2px 2px 0 #000, 0 0 12px rgba(0, 0, 0, .7);
}

#callout {
  position: absolute;
  left: 50%;
  top: 41%;
  z-index: 22;
  transform: translate(-50%, -50%) scale(.86) rotate(-2deg);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(32px, 7.6vh, 78px);
  line-height: .92;
  color: var(--cream);
  -webkit-text-stroke: clamp(1px, .22vh, 2px) #0a0b0d;
  text-shadow:
    0 4px 0 var(--red),
    0 8px 0 #0a0b0d,
    0 14px 26px rgba(0, 0, 0, .65);
  transition: opacity .14s, transform .18s cubic-bezier(.2, 1.7, .4, 1);
  white-space: nowrap;
}

#callout.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-2deg);
}

#callout.small { font-size: clamp(24px, 5.2vh, 54px); }

#count {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 23;
  transform: translate(-50%, -50%) scale(.7);
  opacity: 0;
  pointer-events: none;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-weight: 900;
  font-size: clamp(80px, 20vh, 180px);
  line-height: .72;
  color: var(--gold);
  -webkit-text-stroke: clamp(1px, .35vh, 3px) #0a0b0d;
  text-shadow: 0 5px 0 #0a0b0d, 0 0 32px rgba(255, 204, 69, .28);
  transition: opacity .1s, transform .16s cubic-bezier(.2, 1.9, .4, 1);
}

#count.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#riseHint {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 24;
  transform: translate(-50%, -50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  background: rgba(8, 10, 13, 0.9);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px #050607, 0 8px 18px rgba(0, 0, 0, 0.6);
  padding: 6px 12px 8px;
  transition: opacity 0.16s, transform 0.16s;
}

#riseHint.show {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

#riseHint > span {
  display: block;
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(10px, 1.6vh, 14px);
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 1px 1px 0 #000, 2px 2px 0 #000;
}

.risebars {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 5px;
}

.risebars i {
  width: clamp(13px, 2.4vh, 20px);
  height: clamp(4px, 0.7vh, 6px);
  background: #3a2a1c;
  border: 1px solid #000;
  transition: background 0.1s, box-shadow 0.1s;
}

.risebars i.on {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(255, 204, 69, 0.8);
}

#refCaption {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safeB) + var(--deckH) + 9px);
  z-index: 21;
  width: min(90vw, 660px);
  transform: translateX(-50%) translateY(9px);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(180deg, rgba(15, 18, 24, .97), rgba(9, 11, 15, .98));
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 2px #050607,
    0 10px 22px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: opacity .18s, transform .18s;
}

#refCaption.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#refCaption .who {
  flex: none;
  display: flex;
  align-items: center;
  padding: 6px clamp(6px, 1.2vw, 10px);
  background: var(--red);
  color: var(--cream);
  font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  font-style: normal;
  font-weight: 900;
  font-size: clamp(8px, 1.2vh, 11px);
  letter-spacing: .06em;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
  white-space: nowrap;
}

#refLine {
  flex: 1;
  padding: 6px 10px;
  font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: clamp(11px, 1.65vh, 15px);
  line-height: 1.12;
  letter-spacing: .015em;
  color: var(--cream);
}

/* ---------------- panels ---------------- */

.panel {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safeB) + var(--deckH) + 22px);
  transform: translateX(-50%) translateY(10px);
  z-index: 30;
  width: min(92vw, 620px);
  max-height: calc(100dvh - var(--deckH) - var(--titleH) - 68px);
  overflow: hidden auto;
  padding: clamp(10px, 1.7vh, 16px) clamp(12px, 2.4vw, 20px);
  background:
    linear-gradient(180deg, rgba(20, 24, 32, .97), rgba(9, 11, 15, .985));
  border: 3px solid var(--gold);
  border-radius: 9px;
  box-shadow:
    0 0 0 3px #050607,
    0 18px 40px rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s, transform .2s, visibility .18s;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) #0b0d13;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(246, 231, 201, .16);
  border-radius: 5px;
  pointer-events: none;
}

.panel.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.panel.small { width: min(86vw, 380px); text-align: center; }

.panel h2 {
  margin: 2px 0 3px;
  font-family: "Titan One", Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(19px, 3.7vh, 34px);
  line-height: .95;
  color: var(--cream);
  text-shadow: 0 3px 0 var(--red), 0 5px 0 #000;
  text-align: center;
}

.panel p {
  margin: 3px 0 0;
  font-size: clamp(11px, 1.6vh, 15px);
  font-weight: 500;
  color: var(--cream-dim);
  text-align: center;
}

.kicker {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(8px, 1.35vh, 12px);
  letter-spacing: .24em;
  color: var(--amber);
  text-align: center;
  text-indent: .24em;
}

.versus {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 2.2vw, 22px);
  margin: clamp(5px, 1vh, 8px) 0 clamp(7px, 1.2vh, 10px);
}

.fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 37%;
  min-width: 0;
}

.mini {
  width: clamp(44px, 9.2vh, 74px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px var(--ink), 0 3px 0 rgba(0, 0, 0, .5);
  background: #07090c;
  margin-bottom: 4px;
}

.mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
}

.fighter.r .mini img {
  object-position: 50% 26%;
  transform: scaleX(-1);
}

.fighter b {
  font-family: "Titan One", Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(12px, 2.4vh, 22px);
  line-height: .95;
  color: var(--cream);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}

.fighter span {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(7px, 1.15vh, 10px);
  letter-spacing: .12em;
  color: var(--amber);
  text-align: center;
  line-height: 1.05;
  margin-top: 1px;
}

.statline {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  width: 72%;
}

.statline i {
  flex: 1;
  height: clamp(3px, .55vh, 5px);
  background: linear-gradient(180deg, var(--gold), var(--amber));
  border: 1px solid #000;
  transform: scaleY(var(--v));
  transform-origin: bottom;
  opacity: .85;
}

.fighter.r .statline i { background: linear-gradient(180deg, #55d3d7, var(--teal)); }

.vs {
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(19px, 4.2vh, 38px);
  line-height: 1;
  color: var(--red);
  text-shadow: 0 0 16px rgba(223, 59, 39, .35), 2px 3px 0 #000;
  transform: skewX(-6deg) translateY(clamp(20px, 4.2vh, 40px));
  flex: none;
}

.bigbtn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  margin: 1px auto 0;
  padding: clamp(6px, 1.1vh, 10px) 14px clamp(5px, .9vh, 8px);
  border: 3px solid #050607;
  border-radius: 7px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, var(--amber) 58%, #c8770a);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .35) inset,
    0 5px 0 #050607,
    0 10px 20px rgba(0, 0, 0, .5);
  transition: transform .08s, box-shadow .08s, filter .15s;
  touch-action: manipulation;
}

.bigbtn:hover { filter: brightness(1.06) saturate(1.08); }

.bigbtn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(255, 255, 255, .25) inset, 0 1px 0 #050607, 0 3px 8px rgba(0, 0, 0, .5);
}

.bigbtn span {
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(17px, 3.2vh, 30px);
  line-height: .92;
  letter-spacing: .03em;
  color: #1a0f07;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.bigbtn small {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(7px, 1.1vh, 10px);
  letter-spacing: .14em;
  color: #3c2009;
  text-indent: .14em;
}

.hint {
  margin-top: clamp(5px, .9vh, 8px);
  text-align: center;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: clamp(8px, 1.3vh, 11px);
  letter-spacing: .08em;
  color: var(--cream-dim);
}

.hint b { color: var(--gold); font-weight: 800; }
.touchhint { display: none; }
@media (pointer: coarse) {
  .keyhint { display: none; }
  .touchhint { display: block; }
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(5px, 1vw, 9px);
  margin: clamp(6px, 1.2vh, 10px) 0;
}

.stats .stat {
  flex: 1 1 30%;
  min-width: 80px;
  padding: 5px 6px;
  border: 1px solid rgba(255, 204, 69, .38);
  background: rgba(255, 204, 69, .055);
  text-align: center;
}

.stats .n {
  display: block;
  font-family: "Big Shoulders", "Arial Narrow", sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 3vh, 29px);
  line-height: .85;
  color: var(--gold);
}

.stats .l {
  display: block;
  margin-top: 2px;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(6.5px, 1vh, 9px);
  letter-spacing: .16em;
  color: var(--cream-dim);
}

#endCard { text-align: center; }

#endBelt {
  display: none;
  width: clamp(140px, 34vw, 250px);
  height: auto;
  margin: 0 auto 2px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6));
}

#endCard.win #endBelt { display: block; }
#endCard.win { border-color: var(--gold); }
#endCard.lose { border-color: var(--red); }
#endCard.lose h2 { text-shadow: 0 3px 0 #000, 0 5px 0 #000; color: var(--cream); }
#endCard.draw { border-color: var(--cream-dim); }

/* ---------------- belt in corner ---------------- */

#belt {
  position: absolute;
  right: clamp(2px, 1.2vw, 16px);
  bottom: calc(var(--safeB) + var(--deckH) + 2px);
  width: clamp(74px, 19vw, 205px);
  height: auto;
  z-index: 6;
  pointer-events: none;
  opacity: .82;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .65));
  transition: opacity .3s, transform .3s;
}

body.fighting #belt { opacity: .48; }

/* ---------------- deck ---------------- */

#deck {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safeB) + 9px);
  transform: translateX(-50%);
  z-index: 34;
  width: min(96vw, 800px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.1vw, 12px);
  pointer-events: none;
}

.cluster {
  display: flex;
  align-items: center;
  gap: clamp(4px, .8vw, 8px);
  pointer-events: none;
}

.cluster > * { pointer-events: auto; }

.ctl {
  position: relative;
  width: var(--btn);
  height: var(--btn);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 3px solid #060708;
  border-radius: 11px;
  cursor: pointer;
  touch-action: none;
  color: #140f0a;
  background:
    linear-gradient(180deg, #f8ecd3 0%, #e3cea4 56%, #b89a65 100%);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .6) inset,
    0 4px 0 #060708,
    0 8px 14px rgba(0, 0, 0, .45);
  transition: transform .06s, box-shadow .06s, filter .12s;
}

.ctl span {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 900;
  font-size: calc(var(--btn) * .31);
  line-height: .9;
  letter-spacing: .02em;
}

.ctl small {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: calc(var(--btn) * .19);
  line-height: .85;
  opacity: .62;
  margin-top: 1px;
}

.ctl:active, .ctl.down {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .45) inset,
    0 1px 0 #060708,
    0 3px 7px rgba(0, 0, 0, .45);
  filter: brightness(1.08);
}

.ctl.move {
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd77c 0%, var(--amber) 55%, #b66b06 100%);
}

.ctl.move .arrow {
  font-size: calc(var(--btn) * .48);
  line-height: .8;
  transform: translateY(-1px);
}

.ctl.move small { position: absolute; bottom: 3px; right: 6px; font-size: 8px; }

.depthpad {
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}

.ctl.depth {
  width: calc(var(--btn) * .72);
  height: calc(var(--btn) * .72);
  border-radius: 9px;
  border-width: 2px;
}

.ctl.depth .arrow { font-size: calc(var(--btn) * .34); }

.ctl.depth small {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 7px;
}

.ctl.block { background: linear-gradient(180deg, #8ee6e8 0%, var(--teal) 56%, #167b80 100%); }

.ctl.jab {
  background: linear-gradient(180deg, #ff8763 0%, var(--red) 56%, #931f12 100%);
  color: var(--cream);
}

.ctl.jab small, .ctl.hook small, .ctl.super small { color: #201308; }

.ctl.hook { background: linear-gradient(180deg, #fff3c4 0%, var(--cream) 58%, #bea478 100%); }

.ctl.super {
  background: linear-gradient(180deg, #ffe98a 0%, var(--gold) 58%, #bd8006 100%);
  opacity: .5;
  transition: opacity .2s, transform .06s, box-shadow .06s, filter .2s;
}

.ctl.super.ready {
  opacity: 1;
  animation: superBtn 1s ease-in-out infinite;
}

@keyframes superBtn {
  0%, 100% { box-shadow: 0 2px 0 rgba(255, 255, 255, .6) inset, 0 4px 0 #060708, 0 0 0 rgba(255, 204, 69, 0); }
  50% { box-shadow: 0 2px 0 rgba(255, 255, 255, .6) inset, 0 4px 0 #060708, 0 0 18px rgba(255, 204, 69, .75); }
}

.cluster.tools { gap: clamp(3px, .7vw, 7px); }

.tool {
  width: var(--tool);
  height: var(--tool);
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .7));
  transition: transform .06s, filter .06s, opacity .2s;
}

.tool img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.tool:active, .tool.down {
  transform: translateY(3px) scale(.97);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .7)) brightness(1.15);
}

.tool.disabled { opacity: .4; pointer-events: none; }

.chip {
  height: calc(var(--tool) * .78);
  min-width: 44px;
  padding: 0 6px;
  border: 2px solid #060708;
  border-radius: 6px;
  background: linear-gradient(180deg, #2c333c, #14181e);
  color: var(--cream-dim);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(7px, 1.1vh, 9px);
  letter-spacing: .08em;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 2px 0 #060708;
}

.chip.on { color: var(--gold); border-color: var(--amber); }

/* ---------------- boot ---------------- */

#boot {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(58, 42, 28, .5), transparent 62%),
    #07090c;
  transition: opacity .5s, visibility .5s;
}

#boot.done { opacity: 0; visibility: hidden; }

.boot-title {
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(22px, 5.2vh, 46px);
  color: var(--cream);
  text-shadow: 0 3px 0 var(--red), 0 6px 0 #000;
  letter-spacing: .04em;
  text-align: center;
  padding: 0 12px;
}

.boot-sub {
  margin-top: 6px;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(9px, 1.5vh, 13px);
  letter-spacing: .3em;
  color: var(--amber);
  text-indent: .3em;
}

/* ---------------- responsive ---------------- */

@media (max-width: 680px) {
  #belt {
    left: 1vw;
    right: auto;
    bottom: calc(var(--safeB) + var(--deckH) + 6px);
    width: clamp(80px, 22vw, 120px);
  }
  .nameplate { font-size: clamp(9px, 1.32vh, 13px); letter-spacing: .02em; }
  #deck { flex-wrap: wrap; gap: 6px; }
  .cluster.left { order: 1; }
  .cluster.right { order: 1; }
  .cluster.tools { order: 2; width: 100%; justify-content: center; position: relative; }
  .cluster.tools .chip { position: absolute; right: 0; bottom: 0; height: calc(var(--tool) * .9); }
}

@media (max-height: 620px) {
  :root { --titleW: min(46vw, 30vh, 380px); }
  #title { top: calc(var(--safeT) + .6vh); }
  #hud { top: calc(var(--safeT) + var(--titleH) + 1vh); }
  .panel { padding: 8px 12px; }
  .versus { margin: 3px 0 5px; }
  .mini { width: clamp(30px, 7.5vh, 46px); margin-bottom: 2px; }
  .fighter span { display: none; }
  .statline { display: none; }
  .panel h2 { font-size: clamp(16px, 4.6vh, 26px); }
  .bigbtn { padding: 5px 10px; }
  .bigbtn span { font-size: clamp(15px, 5vh, 24px); }
  .hint { margin-top: 4px; font-size: 8px; }
  #combo { top: 30%; }
  #comboNum { font-size: clamp(40px, 13vh, 76px); }
  #callout { top: 44%; font-size: clamp(28px, 8.5vh, 54px); }
  #count { top: 46%; font-size: clamp(70px, 21vh, 130px); }
  #riseHint { top: 58%; }
  #refCaption .who { display: none; }
  #riseHint {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 24;
  transform: translate(-50%, -50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  background: rgba(8, 10, 13, 0.9);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px #050607, 0 8px 18px rgba(0, 0, 0, 0.6);
  padding: 6px 12px 8px;
  transition: opacity 0.16s, transform 0.16s;
}

#riseHint.show {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

#riseHint > span {
  display: block;
  font-family: "Titan One", Impact, sans-serif;
  font-size: clamp(10px, 1.6vh, 14px);
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 1px 1px 0 #000, 2px 2px 0 #000;
}

.risebars {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 5px;
}

.risebars i {
  width: clamp(13px, 2.4vh, 20px);
  height: clamp(4px, 0.7vh, 6px);
  background: #3a2a1c;
  border: 1px solid #000;
  transition: background 0.1s, box-shadow 0.1s;
}

.risebars i.on {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(255, 204, 69, 0.8);
}

#refCaption { width: min(94vw, 660px); }
  #endBelt { display: none !important; }
}

@media (max-height: 460px) {
  .versus { margin: 1px 0 3px; }
  .mini { width: 30px; }
  .fighter b { font-size: 12px; }
  .panel { bottom: calc(var(--safeB) + var(--deckH) + 5px); }
}

@media (prefers-reduced-motion: reduce) {
  #title { animation: none; }
  .bar.danger .bar-on, .ctl.super.ready, .super.full .super-on { animation: none; }
  .panel, #refCaption, #callout, #combo, #count { transition-duration: .01s; }
}
