:root {
  --ink: #07070d;
  --night: #0d0e18;
  --stone: #191a26;
  --stone-2: #232435;
  --stone-3: #2f3046;
  --line: #3a3b55;
  --gold: #d9b45a;
  --gold-2: #f3dc94;
  --gold-d: #7a5a22;
  --ember: #ff8a3a;
  --blood: #c8443c;
  --bone: #ece2c8;
  --mist: #9aa0c0;
  --teal: #7fe0b8;
  --ui: "Alegreya Sans SC", "Pixelify Sans", system-ui, sans-serif;
  --px: "Pixelify Sans", "Alegreya Sans SC", monospace;
  --num: "Press Start 2P", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--ui);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  cursor: url("../assets/arrow.cur"), auto;
}

button {
  font: inherit;
  color: inherit;
}

button,
a,
.btn,
.icon-btn,
.rank-side,
.logo3d,
.hcard,
.stake,
input,
textarea,
label,
[role="button"] {
  cursor: url("../assets/arrow.cur"), pointer;
}

canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  font: 10px var(--num);
  color: var(--bone);
  background: linear-gradient(#34354d, #20212f);
  border: 1px solid #55577a;
  border-bottom-width: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------- scene */

.bg-plate {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  background: #0c0a12 center / cover no-repeat;
}

body.is-loading .bg-plate,
body.is-loading #scene,
body.is-loading #scene-shade {
  visibility: hidden;
  opacity: 0;
}

body.is-loading {
  background: var(--ink);
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
  background: transparent;
}

#scene-shade {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(28, 22, 10, 0.5) 0%, rgba(28, 22, 10, 0.18) 36%, rgba(28, 22, 10, 0) 62%);
  transition: opacity 0.4s;
}

body.in-fight #scene,
body.in-fight #scene-shade,
body.in-fight #topbar {
  display: none;
}

body.panel-open #scene-shade {
  background: rgba(18, 14, 8, 0.55);
}

#app {
  position: fixed;
  inset: 0;
  z-index: 2;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
  animation: screen-in 0.35s ease-out;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------- top bar */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  pointer-events: none;
}

#topbar > * {
  pointer-events: auto;
}

.top-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
}

.top-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

#fee-bar {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(8, 8, 14, 0.82);
  border: 1px solid #3a3b58;
  border-radius: 999px;
  pointer-events: none;
}

#fee-time {
  font: 12px var(--num);
  color: var(--gold-2);
}

.fee-label {
  font: 8px var(--num);
  color: #c8c0a8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#fee-bank {
  font: 11px var(--num);
  color: var(--bone);
}

.vol {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 4px;
  background: rgba(14, 14, 22, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.vol button:not(.icon-btn) {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #1c1d2c;
  color: var(--bone);
  font: 14px var(--num);
  line-height: 1;
}

#vol-pct {
  min-width: 34px;
  font: 8px var(--num);
  color: var(--gold-2);
  text-align: center;
}

.px-note {
  display: block;
  margin-top: 8px;
  font-family: "Press Start 2P", var(--num);
  font-size: 8px;
  letter-spacing: 0;
  color: #cbb892;
  font-weight: 400;
  line-height: 1.55;
  text-transform: none;
}

.btn-primary .px-note,
.btn-primary small {
  color: #f4e4c0;
  background: #1a1208;
  padding: 6px 8px;
  border-radius: 4px;
  text-shadow: none;
}

.lang {
  display: flex;
  padding: 3px;
  background: rgba(14, 14, 22, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.lang button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font: 10px var(--num);
  color: var(--mist);
  transition: 0.2s;
}

.lang button.on {
  background: linear-gradient(var(--gold-2), var(--gold));
  color: #1a1206;
  box-shadow: 0 0 14px rgba(217, 180, 90, 0.45);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(14, 14, 22, 0.8) center/18px no-repeat;
  backdrop-filter: blur(6px);
}

.icon-btn.on {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ece2c8'%3E%3Cpath d='M2 6h3l4-3v10L5 10H2z'/%3E%3Crect x='11' y='5' width='1' height='6'/%3E%3Crect x='13' y='3' width='1' height='10'/%3E%3C/svg%3E");
}

.icon-btn.off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%239aa0c0'%3E%3Cpath d='M2 6h3l4-3v10L5 10H2z'/%3E%3Cpath d='M11 6l4 4M15 6l-4 4' stroke='%239aa0c0' stroke-width='1.4'/%3E%3C/svg%3E");
}

/* coin */
.coin-wrap {
  position: relative;
}

.coin {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: transform 0.25s;
  animation: coin-bob 4s ease-in-out infinite;
}

.coin img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  object-position: 50% 45%;
  padding: 2px;
  box-sizing: border-box;
  background: #120a08;
  display: block;
  box-shadow: 0 0 0 2px #1a0a08, 0 0 0 4px var(--gold), 0 6px 24px rgba(255, 60, 40, 0.35);
}

.coin-ring {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(243, 220, 148, 0.5);
  animation: spin 14s linear infinite;
  pointer-events: none;
}

.coin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.55) 48%, transparent 60%);
  background-size: 260% 100%;
  animation: shine 3.6s ease-in-out infinite;
  pointer-events: none;
}

.coin:hover {
  transform: scale(1.08) rotate(-6deg);
}

@keyframes coin-bob {
  50% {
    transform: translateY(-3px);
  }
}

@keyframes shine {
  0%,
  60% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ca-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 8px 7px 12px;
  max-width: 320px;
  background: rgba(14, 14, 22, 0.85);
  border: 1px solid var(--gold-d);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, transform 0.12s;
}

.ca-chip:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.ca-chip .ca-label {
  font: 9px var(--num);
  color: var(--gold);
}

.ca-chip code {
  flex: 1;
  font: 13px var(--px);
  color: var(--bone);
  background: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-chip .ca-copy {
  padding: 4px 9px;
  font: 700 11px var(--ui);
  letter-spacing: 0.04em;
  color: #1d1205;
  background: linear-gradient(#ffe7a0, #d9b45a);
  border-radius: 999px;
}

.ca-chip .ca-price {
  font: 10px var(--num);
  color: #7dffb3;
  white-space: nowrap;
}

.coin-pop {
  position: absolute;
  top: 66px;
  left: 0;
  width: 270px;
  padding: 14px;
  background: linear-gradient(#1c1d2b, #12131c);
  border: 1px solid var(--gold-d);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: 0.2s;
}

.coin-pop.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

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

.cp-head img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.cp-head b {
  display: block;
  font: 12px var(--num);
  color: var(--gold-2);
}

.cp-head span {
  font-size: 13px;
  color: var(--mist);
}

.coin-pop code {
  display: block;
  margin: 12px 0;
  padding: 8px 10px;
  font: 11px/1.4 var(--px);
  color: var(--bone);
  background: #0a0a12;
  border: 1px solid var(--line);
  border-radius: 6px;
  word-break: break-all;
}

.cp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 12px;
}
.cp-stats div {
  background: #0a0a12;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 7px;
}
.cp-stats span {
  display: block;
  font: 8px var(--num);
  color: #9a9178;
}
.cp-stats b {
  display: block;
  margin-top: 2px;
  font: 10px var(--num);
  color: var(--bone);
}

.cp-row {
  display: flex;
  gap: 8px;
}

.cp-row .btn {
  flex: 1;
}

/* ------------------------------------------------------------- buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font: 700 17px var(--ui);
  letter-spacing: 0.06em;
  color: var(--bone);
  text-decoration: none;
  background: linear-gradient(180deg, #2c2d42 0%, #1b1c2a 100%);
  border: 1px solid #4a4b68;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -3px 0 rgba(0, 0, 0, 0.35), 0 4px 0 #0b0b12, 0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.2s, border-color 0.2s;
}

.btn:hover:not(:disabled) {
  border-color: var(--gold);
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 0 #0b0b12, 0 4px 10px rgba(0, 0, 0, 0.45);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-primary {
  color: #1d1205;
  background: linear-gradient(180deg, #ffe7a0 0%, #e2b453 45%, #b07d2c 100%);
  border-color: #ffefb8;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(90, 50, 10, 0.45), 0 4px 0 #4a2f0c, 0 12px 30px rgba(217, 160, 60, 0.3);
}

.btn-primary:hover:not(:disabled) {
  border-color: #fff;
}

.btn-lg {
  padding: 16px 30px;
  font-size: 21px;
}

.btn-glow {
  animation: roomglow 1.8s ease-in-out infinite;
}

@keyframes roomglow {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(90, 50, 10, 0.45), 0 4px 0 #4a2f0c, 0 0 16px rgba(255, 196, 80, 0.35);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -3px 0 rgba(90, 50, 10, 0.45), 0 4px 0 #4a2f0c, 0 0 28px rgba(255, 214, 110, 0.85);
  }
}

.btn-train {
  display: grid;
  justify-items: start;
  gap: 2px;
  text-align: left;
}

.btn-train b {
  font-size: 18px;
  letter-spacing: 0.06em;
}

.btn-train small {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--mist);
}

.connect-panel {
  width: min(460px, 92vw);
  display: grid;
  justify-items: start;
  gap: 8px;
}

.btn-sm {
  padding: 8px 10px;
  font-size: 13px;
}

.btn-back {
  border: 0;
  background: none;
  color: var(--mist);
  font: 700 15px var(--ui);
  letter-spacing: 0.06em;
  padding: 6px 0;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--gold-2);
}

.soon {
  font: normal 8px var(--num);
  color: var(--ember);
  padding: 4px 6px;
  border: 1px solid rgba(255, 138, 58, 0.5);
  border-radius: 4px;
  text-transform: uppercase;
}

.nav-row {
  display: flex;
  gap: 12px;
}

/* ------------------------------------------------------------- logo */

.logo3d {
  position: relative;
  display: grid;
  place-items: center;
  width: min(340px, 100%);
  margin: 0 auto;
  transform-style: preserve-3d;
  perspective: 900px;
  transition: transform 0.15s ease-out;
  cursor: url("../assets/arrow.cur"), pointer;
  outline: none;
}

.logo3d:focus-visible {
  filter: drop-shadow(0 0 12px rgba(243, 220, 148, 0.55));
}

.logo3d.is-poke {
  animation: logo-poke 0.38s ease-out;
}

@keyframes logo-poke {
  0% {
    transform: scale(1) rotateY(0) rotateX(0);
  }
  35% {
    transform: scale(0.92) rotateY(8deg) rotateX(-6deg);
  }
  70% {
    transform: scale(1.06) rotateY(-4deg) rotateX(3deg);
  }
  100% {
    transform: scale(1) rotateY(0) rotateX(0);
  }
}

.logo3d img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
  pointer-events: none;
}

.logo3d .logo-shadow {
  position: absolute;
  inset: 0;
  transform: translateZ(-22px) translate(10px, 12px);
  filter: brightness(0) opacity(0.45);
}

.logo3d .logo-face {
  position: relative;
  transform: translateZ(16px);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.logo3d.small {
  width: min(260px, 70vw);
}

/* ------------------------------------------------------------- load */

.load-box {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.load-box p {
  margin: 0;
  color: var(--mist);
  font-size: 15px;
  letter-spacing: 0.1em;
}

.load-bar {
  width: 260px;
  height: 8px;
  background: #12121c;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.load-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-d), var(--gold-2));
  transition: width 0.2s;
}

/* ------------------------------------------------------------- menu */

#screen-menu {
  justify-content: flex-start;
}

.elo-board {
  width: 100%;
  max-height: min(220px, 30vh);
  overflow: auto;
  padding: 8px 8px 6px;
  border: 2px solid #3a2a10;
  background: rgba(6, 6, 12, 0.88);
  box-shadow: 0 0 0 2px #000, 4px 4px 0 rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
}

.elo-board h3 {
  margin: 0 0 6px;
  font: 9px var(--num);
  color: #ffe08a;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.elo-board ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.elo-board li {
  display: grid;
  grid-template-columns: 14px 16px minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  padding: 3px 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.elo-board li.me {
  background: rgba(226, 179, 64, 0.12);
}

.elo-board .n {
  font: 7px var(--num);
  color: #c8c0a8;
  text-shadow: 1px 1px 0 #000;
}

.elo-board .rank-mark {
  width: 16px;
  height: 16px;
}

.elo-board .who {
  font: 7px var(--num);
  color: #f2ead4;
  text-shadow: 1px 1px 0 #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elo-board b {
  font: 8px var(--num);
  color: #ffe08a;
  text-shadow: 1px 1px 0 #000;
  justify-self: end;
}

.elo-board .elo-empty {
  display: block;
  grid-template-columns: 1fr;
  font: 7px var(--num);
  color: #c8c0a8;
  text-shadow: 1px 1px 0 #000;
  padding: 6px 2px 4px;
  border: 0;
  text-align: center;
}

body.in-fight .elo-board,
body.panel-open .elo-board {
  display: none !important;
}

.rank-side {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 148px;
  padding: 10px 10px;
  border: 2px solid #3a2a10;
  background: rgba(6, 6, 12, 0.82);
  box-shadow: 0 0 0 2px #000, 4px 4px 0 rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.top-acct {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 148px;
}

.rank-side b {
  font: 10px var(--num);
  color: #ffe08a;
  text-shadow: 2px 2px 0 #000;
  text-align: center;
}

.rank-side small {
  font: 8px var(--num);
  color: #c8c0a8;
  text-shadow: 1px 1px 0 #000;
  text-align: center;
  max-width: 150px;
  overflow-wrap: anywhere;
}

#btn-guest-pvp {
  margin-top: 4px;
  font: 8px var(--num);
  padding: 8px 10px;
}

.menu-live {
  width: 100%;
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.menu-live .sub {
  margin: 0;
  font: 7px var(--num);
  color: #c8c0a8;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}

.menu-live .room-row {
  width: 100%;
  padding: 6px;
  gap: 6px;
  grid-template-columns: 1fr auto;
}

.chat-dock {
  position: fixed;
  z-index: 6;
  right: clamp(14px, 2.5vw, 32px);
  bottom: clamp(132px, 22vh, 196px);
  top: auto;
  width: min(288px, 30vw);
  min-height: 200px;
  max-height: min(320px, 38vh);
  margin: 0;
}

.side-chat {
  width: min(280px, 30vw);
  min-height: 200px;
  max-height: min(360px, 48vh);
  margin: 0 clamp(16px, 3vw, 40px) 0 auto;
  display: flex;
  flex-direction: column;
  background: rgba(8, 8, 14, 0.82);
  border: 1px solid #3a3b58;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.side-chat.hidden {
  display: none;
}

.side-chat header {
  padding: 10px 12px;
  font: 11px var(--px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
  border-bottom: 1px solid #2e2f48;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  font: 13px/1.35 var(--ui);
  color: var(--mist);
}

.chat-line {
  margin-bottom: 6px;
  word-break: break-word;
}

.chat-line b {
  color: var(--bone);
  margin-right: 6px;
  font-size: 12px;
}

.chat-form {
  display: flex;
  border-top: 1px solid #2e2f48;
  padding: 8px;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: 13px var(--ui);
  color: var(--bone);
  background: #12121c;
  border: 1px solid #3a3b58;
  border-radius: 6px;
}

.fight-chat {
  position: fixed;
  z-index: 6;
  right: clamp(14px, 2.5vw, 32px);
  bottom: clamp(132px, 22vh, 196px);
  top: auto;
  width: min(260px, 30vw);
  max-height: min(240px, 34vh);
  margin: 0;
  pointer-events: auto;
}

#room-chat.chat-dock {
  position: fixed;
  bottom: clamp(132px, 22vh, 196px);
  top: auto;
  right: clamp(14px, 2.5vw, 32px);
}

.menu-left {
  margin-left: clamp(12px, 3vw, 48px);
  max-width: 400px;
  perspective: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.acct {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.rank-mark {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 0;
  font: 0 / 0 var(--num);
  color: transparent;
  background: center / contain no-repeat;
  background-image: url("../assets/rank_bronze.png");
  box-shadow: 0 2px 0 #000, 0 0 10px rgba(196, 132, 74, 0.35);
  image-rendering: auto;
}

.rank-mark[data-rank="bronze"] {
  background-image: url("../assets/rank_bronze.png");
  box-shadow: 0 2px 0 #000, 0 0 10px rgba(196, 132, 74, 0.4);
}
.rank-mark[data-rank="silver"] {
  background-image: url("../assets/rank_silver.png");
  box-shadow: 0 2px 0 #000, 0 0 10px rgba(200, 210, 230, 0.35);
}
.rank-mark[data-rank="gold"] {
  background-image: url("../assets/rank_gold.png");
  box-shadow: 0 2px 0 #000, 0 0 12px rgba(226, 179, 64, 0.45);
}
.rank-mark[data-rank="platinum"] {
  background-image: url("../assets/rank_platinum.png");
  box-shadow: 0 2px 0 #000, 0 0 12px rgba(143, 212, 255, 0.4);
}

.acct b {
  display: block;
  font: 13px var(--num);
  letter-spacing: 0.08em;
}

.acct small {
  display: block;
  margin-top: 2px;
  font: 12px var(--ui);
  color: var(--mist);
}

.wallet-picks {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.play-modes {
  display: grid;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
}

.play-mode {
  display: grid;
  gap: 6px;
  width: 100%;
}

.play-mode .btn {
  width: 100%;
}

.play-mode .sub {
  margin: 0;
  color: #d8c9a0;
  line-height: 1.45;
}

.stake-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
  font: 13px var(--ui);
  color: var(--mist);
}

.stake-custom input {
  width: 120px;
  padding: 8px 10px;
  font: 16px var(--num);
  color: var(--bone);
  background: #12121c;
  border: 1px solid #3a3b58;
  border-radius: 8px;
}

.admin-panel {
  max-width: min(960px, 94vw);
  max-height: 86vh;
  overflow: auto;
}

.admin-login {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}

.admin-login input {
  flex: 1;
  padding: 8px 10px;
  font: 12px var(--ui);
  color: var(--bone);
  background: #12121c;
  border: 1px solid #3a3b58;
}

.admin-table {
  overflow: auto;
  margin: 12px 0;
  font: 13px var(--ui);
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #2a2b40;
  word-break: break-all;
}

.admin-block {
  font: 13px var(--ui);
  color: var(--mist);
  margin-bottom: 10px;
}

[hidden] {
  display: none !important;
}

.rewards-panel {
  max-width: 620px;
}

.reward-pot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #5b5136;
  background: rgba(20, 19, 25, 0.84);
}

.reward-pot b {
  color: var(--gold);
  font: 20px var(--num);
}

.reward-pot span {
  color: var(--bone);
  font: 18px var(--num);
}

.reward-split {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.reward-split li {
  display: grid;
  grid-template-columns: 54px 72px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #2a2b40;
  color: var(--mist);
  font: 13px var(--ui);
}

.reward-split li b,
.reward-split li span {
  color: var(--gold);
}

.tagline {
  margin: 8px 0 28px;
  max-width: 340px;
  text-align: center;
  font: 9px/1.7 var(--num);
  color: #efe6c8;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 #000, 0 0 8px #000;
}

.menu-nav {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.menu-nav .nav-row .btn {
  flex: 1;
}

.menu-nav .btn-lg {
  justify-content: flex-start;
}

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

.panel {
  position: relative;
  width: min(880px, 92vw);
  max-height: 88vh;
  overflow: auto;
  padding: 26px 34px 32px;
  background: linear-gradient(180deg, rgba(28, 29, 43, 0.96), rgba(16, 17, 26, 0.97));
  border: 1px solid #3c3d58;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel::before,
.hs-detail::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(217, 180, 90, 0.16);
  border-radius: 10px;
  pointer-events: none;
}

h2 {
  margin: 4px 0 6px;
  font: 800 32px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.sub,
.scr-head p {
  margin: 0 0 20px;
  color: var(--mist);
  font-size: 16px;
}

/* how */
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
  margin-top: 16px;
}

.keys {
  display: grid;
  gap: 10px;
}

.keys > div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(10, 10, 18, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kc {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 96px;
  color: var(--mist);
}

.keys b {
  font-size: 16px;
}

.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.rules li {
  position: relative;
  padding-left: 22px;
  font-size: 17px;
  line-height: 1.4;
  color: #d6d0c0;
}

.rules li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}

.rules.works li {
  font-size: 15px;
  line-height: 1.55;
}

.rules.works u {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.play-live {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.play-live .room-row {
  padding: 8px 10px;
  grid-template-columns: 1fr auto;
}

#btn-spec-leave {
  position: absolute;
  left: 50%;
  bottom: max(calc(var(--k) * 10px), 18px);
  transform: translateX(-50%);
  z-index: 8;
  min-width: 140px;
}

.fight-feed {
  position: absolute;
  left: max(calc(var(--k) * 8px), 14px);
  top: max(calc(var(--k) * 48px), 72px);
  bottom: 120px;
  width: min(280px, 34vw);
  z-index: 7;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}

.fight-feed.hidden {
  display: none;
}

.fight-toast {
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 8, 14, 0.55);
  border: 1px solid rgba(90, 90, 120, 0.35);
  color: rgba(236, 226, 200, 0.92);
  font: 13px/1.35 var(--ui);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  text-shadow: 0 1px 0 #000;
  word-break: break-word;
}

.fight-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.fight-toast.hide {
  opacity: 0;
  transform: translateX(-8px);
}

.fight-toast b {
  color: #f3dc94;
  margin-right: 6px;
  font-size: 12px;
}

.fight-compose {
  position: absolute;
  left: max(calc(var(--k) * 8px), 14px);
  bottom: max(calc(var(--k) * 46px), 64px);
  z-index: 8;
  width: min(260px, 32vw);
}

.fight-compose.hidden {
  display: none;
}

.fight-compose-form {
  display: flex;
}

.fight-compose-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: 13px var(--ui);
  color: var(--bone);
  background: rgba(10, 10, 18, 0.72);
  border: 1px solid rgba(90, 90, 120, 0.45);
  border-radius: 8px;
  outline: none;
}

.fight-chat {
  display: none !important;
}

/* ------------------------------------------------------------- heroes */

.hs-wrap {
  width: min(1180px, 94vw);
}

.scr-head {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  margin-bottom: 14px;
}

.scr-head p {
  margin: 0;
}

.hs-body {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 22px;
}

.hs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  perspective: 1000px;
}

.hcard {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(180deg, #1d1e2c, #101119);
  border: 1px solid #3a3b55;
  border-radius: 10px;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.hcard canvas {
  width: 100%;
  aspect-ratio: 96 / 80;
  display: block;
}

.hcard .hc-meta {
  padding: 8px 12px 12px;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(6, 6, 12, 0.55);
}

.hcard b {
  display: block;
  font: 800 18px var(--ui);
  letter-spacing: 0.08em;
  color: var(--bone);
}

.hcard span {
  font-size: 14px;
  color: var(--accent);
}

.hcard:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, white);
}

.hcard.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 28px color-mix(in srgb, var(--accent) 40%, transparent), 0 14px 30px rgba(0, 0, 0, 0.5);
}

.hcard.sel::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--accent);
}

.hs-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: linear-gradient(180deg, rgba(28, 29, 43, 0.97), rgba(14, 15, 22, 0.98));
  border: 1px solid #3c3d58;
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.hd-stage {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2c2d42;
}

.hd-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 200 / 120;
}

.hd-info {
  padding: 12px 4px 0;
  flex: 1;
}

.hd-name {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hd-name b {
  font: 800 30px var(--ui);
  letter-spacing: 0.08em;
  color: var(--bone);
}

.hd-name span {
  font-size: 16px;
  color: var(--accent);
}

.hd-lore {
  margin: 4px 0 12px;
  font-size: 15px;
  font-style: italic;
  line-height: 1.4;
  color: #b8b2a4;
  min-height: 42px;
}

.hd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.hd-stats div {
  font-size: 12px;
  color: var(--mist);
  letter-spacing: 0.06em;
}

.hd-stats .bar {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.hd-stats .bar i {
  flex: 1;
  height: 6px;
  background: #24253a;
  transform: skewX(-20deg);
}

.hd-stats .bar i.on {
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent);
}

.hd-skins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
}

.skin {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
  background: #12131c;
  border: 1px solid #3c3d58;
  border-radius: 8px;
  color: var(--mist);
  cursor: pointer;
  font: 700 12px var(--ui);
}

.skin canvas {
  image-rendering: pixelated;
}

.skin em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #8a8478;
}

.skin.on {
  border-color: var(--gold-2);
  color: #f3e6c4;
}

.skin.lock em {
  color: var(--gold-2);
}

.hd-skills {
  display: grid;
  gap: 6px;
}

.hd-skill {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 8px;
  background: rgba(8, 8, 14, 0.55);
  border: 1px solid #2a2b40;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.hd-skill:hover {
  border-color: var(--accent);
  background: rgba(20, 20, 30, 0.8);
}

.hd-skill .ico {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #24253a, #0c0c14);
  border: 1px solid #4a4b68;
  border-radius: 6px;
}

.hd-skill .ico img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  display: block;
}

.hd-skill .ico kbd {
  position: absolute;
  bottom: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  font-size: 8px;
}

.hd-skill b {
  display: block;
  font-size: 16px;
  color: var(--bone);
}

.hd-skill p {
  margin: 2px 0 0;
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.35;
  color: var(--mist);
  white-space: normal;
  overflow-wrap: break-word;
}

.hd-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

.diff {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: #0c0c14;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.diff span {
  padding: 0 8px;
  font-size: 12px;
  color: var(--mist);
  letter-spacing: 0.08em;
}

.diff button {
  border: 0;
  background: transparent;
  padding: 6px 9px;
  border-radius: 6px;
  font: 700 13px var(--ui);
  color: var(--mist);
}

.diff button.on {
  background: var(--stone-3);
  color: var(--gold-2);
  box-shadow: inset 0 0 0 1px var(--gold-d);
}

/* ------------------------------------------------------------- stakes */

.stake-panel {
  width: min(900px, 92vw);
  text-align: left;
}

.stake-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  perspective: 900px;
}

.stake {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px 12px 14px;
  min-height: 150px;
  text-align: center;
  background: linear-gradient(180deg, #212234, #13141e);
  border: 1px solid #3a3b55;
  border-radius: 10px;
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.2s;
}

.stake:hover {
  transform: translateY(-3px) rotateX(6deg);
  border-color: var(--gold-d);
}

.stake.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 26px rgba(217, 180, 90, 0.3);
}

.stake .amt {
  font: 15px var(--num);
  color: var(--gold-2);
}

.stake .amt small {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  color: var(--mist);
}

.stake .gem {
  width: 28px;
  height: 28px;
  margin: 0 auto 4px;
  background: linear-gradient(135deg, #9b6bff, #3fd1c4);
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
  filter: drop-shadow(0 0 8px rgba(130, 120, 255, 0.6));
}

.stake.free .gem {
  background: linear-gradient(135deg, #cfd3e0, #6a6e86);
  filter: none;
}

.stake .info {
  font-size: 13px;
  line-height: 1.35;
  color: var(--mist);
}

.stake .info b {
  color: var(--bone);
}

/* ------------------------------------------------------------- lobby */

.lobby-panel {
  width: min(760px, 92vw);
}

.wallet-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--mist);
}

.wallet-stack {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 140px;
}

.wallet-stack .btn {
  margin-left: 0;
  width: 100%;
}

.wallet-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--bone);
  text-align: center;
  line-height: 1.25;
}

.wallet-dot {
  width: 9px;
  height: 9px;
  margin-top: 12px;
  border-radius: 50%;
  background: #5a5c78;
}

.wallet-dot.on {
  background: #7dffb0;
  box-shadow: 0 0 8px #7dffb0;
}

.wallet-row b {
  color: var(--bone);
  font-weight: 700;
}

.wallet-row .btn {
  margin-left: 0;
}

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

.lobby-head h2 {
  margin: 0;
}

.lobby-stakes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}

.stake-chip {
  display: grid;
  gap: 2px;
  min-width: 92px;
  padding: 8px 10px;
  text-align: left;
  color: var(--paper);
  background: #1c1e2e;
  border: 1px solid #3c3d58;
  border-radius: 8px;
  cursor: pointer;
}

.stake-chip b {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.stake-chip small {
  color: var(--mist);
  font-size: 12px;
}

.stake-chip.sel {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 1px var(--gold-2);
}

.room-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  min-height: 120px;
}

.room-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(8, 8, 14, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.room-row canvas {
  display: block;
  width: 44px;
  height: 40px;
  background: radial-gradient(circle at 50% 70%, #2a2b44, #0c0c14);
  border-radius: 6px;
  overflow: hidden;
}

.watch-intro {
  margin: 12px 0 6px;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

#btn-room-browse,
#btn-room-browse span {
  text-transform: none;
  letter-spacing: 0.02em;
}

.hosting-pill {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--gold-2);
  border-radius: 10px;
  background: rgba(24, 20, 8, 0.75);
  text-align: center;
}

.hosting-pill .hosting-text {
  display: block;
  font-size: 14px;
  color: var(--bone);
  margin-bottom: 10px;
}

.hosting-pill .hosting-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.room-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(520px, 94vw);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--gold-2);
  background: rgba(10, 10, 18, 0.94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.room-dock.hidden {
  display: none;
}

.room-dock #room-dock-text {
  display: block;
  font-size: 14px;
  color: var(--bone);
  margin-bottom: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.room-dock-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.room-row .room-thumb {
  width: 44px;
  height: 40px;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 70%, #2a2b44, #0c0c14);
}

.room-row .who b {
  display: block;
  font-size: 16px;
  color: var(--bone);
}

.room-row .who span {
  font-size: 13px;
  color: var(--mist);
}

.room-row .stake-tag {
  font: 11px var(--num);
  color: var(--gold-2);
}

.room-empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--mist);
  font-size: 16px;
}

.room-panel {
  width: min(640px, 92vw);
  text-align: center;
}

.room-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 10px 0 16px;
}

.room-seat {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 160px;
}

.room-seat canvas {
  width: 150px;
  height: 135px;
}

.room-seat b {
  font-size: 16px;
  color: var(--bone);
}

.room-panel p {
  color: var(--gold-2);
  font: 12px var(--num);
}

/* ------------------------------------------------------------- matchmaking */

.mm {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.mm-vs {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 12px;
}

.mm-vs canvas {
  width: 200px;
  height: 180px;
}

.mm-ring {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
}

.mm-ring i {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-right-color: rgba(217, 180, 90, 0.3);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.mm-ring i + i {
  inset: 14px;
  border-top-color: var(--ember);
  animation-duration: 1.7s;
  animation-direction: reverse;
}

.mm-ring b {
  font: 800 30px var(--ui);
  color: var(--gold-2);
}

.mm h2 {
  margin: 0;
}

.mm p {
  margin: 0;
  color: var(--mist);
}

.mm-stake {
  margin-top: 10px;
  font: 11px var(--num);
  color: var(--gold-2);
}

/* ------------------------------------------------------------- fight */

#screen-fight {
  background: transparent;
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
}

#fight-stage {
  --k: 2;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#game {
  position: absolute;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

#hud {
  position: absolute;
  z-index: 3;
  top: calc(var(--k) * 6px);
  left: calc(var(--k) * 8px);
  right: calc(var(--k) * 8px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
  font-size: calc(var(--k) * 6px);
}

.hud-side {
  display: flex;
  gap: calc(var(--k) * 4px);
  align-items: flex-start;
}

.hud-side.right {
  justify-content: flex-end;
}

.hud-face {
  width: calc(var(--k) * 26px);
  height: calc(var(--k) * 26px);
  padding: calc(var(--k) * 1px);
  background: linear-gradient(#2c2d42, #12131c);
  border: calc(var(--k) * 1px) solid var(--gold-d);
  box-shadow: 0 0 0 calc(var(--k) * 0.5px) #000;
}

.hud-face canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: radial-gradient(circle at 50% 70%, #2a2b44, #0c0c14);
}

.hud-bars {
  width: calc(var(--k) * 150px);
}

.hud-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--k) * 1.5px);
  font: calc(var(--k) * 5px) var(--num);
  letter-spacing: 0.05em;
  color: var(--bone);
  text-shadow: 0 calc(var(--k) * 0.6px) 0 #000;
}

.right .hud-name {
  flex-direction: row;
}

.pips {
  display: flex;
  gap: calc(var(--k) * 2px);
}

.pips i {
  width: calc(var(--k) * 4px);
  height: calc(var(--k) * 4px);
  transform: rotate(45deg);
  border: calc(var(--k) * 0.7px) solid var(--gold-d);
  background: #12121a;
}

.pips i.on {
  background: var(--gold-2);
  box-shadow: 0 0 calc(var(--k) * 3px) var(--gold);
}

.hp {
  position: relative;
  height: calc(var(--k) * 8px);
  background: #0c0b12;
  border: calc(var(--k) * 1px) solid #000;
  box-shadow: 0 0 0 calc(var(--k) * 0.6px) var(--gold-d), inset 0 calc(var(--k) * 1px) 0 rgba(255, 255, 255, 0.04);
}

.hp i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.right .hp i {
  left: auto;
  right: 0;
}

.hp .trail {
  background: #f4e6c6;
  transition: width 0.5s 0.25s;
}

.hp .fill {
  background: linear-gradient(180deg, #ff7a62 0%, #d23c34 45%, #8e1e22 100%);
  box-shadow: inset 0 calc(var(--k) * 1px) 0 rgba(255, 255, 255, 0.3);
}

.hp .fill.low {
  animation: low 0.5s steps(2) infinite;
}

@keyframes low {
  50% {
    filter: brightness(1.5);
  }
}

.hp em {
  position: absolute;
  right: calc(var(--k) * 3px);
  top: 50%;
  transform: translateY(-50%);
  font: normal calc(var(--k) * 4.5px) var(--num);
  color: #fff;
  text-shadow: 0 calc(var(--k) * 0.6px) 0 #000;
}

.right .hp em {
  right: auto;
  left: calc(var(--k) * 3px);
}

.guard {
  height: calc(var(--k) * 2.5px);
  margin-top: calc(var(--k) * 1.5px);
  width: 70%;
  background: #0c0b12;
  border: calc(var(--k) * 0.6px) solid #000;
}

.right .guard {
  margin-left: auto;
}

.guard i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6aa0e0, #c8e4ff);
}

.right .guard i {
  margin-left: auto;
}

.hud-mid {
  display: grid;
  justify-items: center;
  gap: calc(var(--k) * 2px);
  padding: 0 calc(var(--k) * 8px);
}

.hud-timer {
  min-width: calc(var(--k) * 26px);
  padding: calc(var(--k) * 3px) calc(var(--k) * 4px);
  text-align: center;
  font: calc(var(--k) * 9px) var(--num);
  color: var(--gold-2);
  background: linear-gradient(#26273a, #11121a);
  border: calc(var(--k) * 1px) solid var(--gold-d);
  text-shadow: 0 calc(var(--k) * 1px) 0 #000;
}

.hud-timer.warn {
  color: #ff8060;
}

.hud-ping {
  min-height: calc(var(--k) * 5px);
  font: calc(var(--k) * 4px) var(--num);
  color: #7fe0b8;
  text-shadow: 0 calc(var(--k) * 0.6px) 0 #000;
  letter-spacing: 0.04em;
}

.hud-ping.ok {
  color: #7fe0b8;
}
.hud-ping.mid {
  color: #e2b340;
}
.hud-ping.bad {
  color: #ff8060;
}

.hud-pot {
  font: calc(var(--k) * 4px) var(--num);
  color: var(--mist);
  text-shadow: 0 calc(var(--k) * 0.6px) 0 #000;
}

#skillbar {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(calc(var(--k) * 8px), 12px);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: calc(var(--k) * 4px);
  pointer-events: auto;
  padding-bottom: calc(var(--k) * 10px);
}

.sb-moves {
  display: flex;
  flex-direction: column;
  gap: calc(var(--k) * 2px);
  margin-right: calc(var(--k) * 4px);
  opacity: 0.75;
}

.sb-moves kbd {
  min-width: calc(var(--k) * 8px);
  height: calc(var(--k) * 8px);
  font-size: calc(var(--k) * 3.5px);
  padding: 0 calc(var(--k) * 1.5px);
  border-bottom-width: calc(var(--k) * 1px);
}

.sk {
  position: relative;
  width: calc(var(--k) * 33px);
  height: calc(var(--k) * 33px);
  padding: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #2a2b44, #0b0b12 75%);
  border: calc(var(--k) * 1px) solid var(--gold-d);
  border-radius: calc(var(--k) * 3px);
  box-shadow: 0 0 0 calc(var(--k) * 0.6px) #000, inset 0 0 calc(var(--k) * 4px) rgba(0, 0, 0, 0.8);
  transition: transform 0.08s;
}

.sk > * {
  grid-area: 1 / 1;
}

.sk img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  display: block;
  margin: 0;
  pointer-events: none;
}

.sk .cd {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  background: rgba(4, 4, 8, 0.78);
  border-radius: inherit;
}

.sk .cdn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: normal calc(var(--k) * 6px) var(--num);
  color: #fff;
  text-shadow: 0 calc(var(--k) * 0.6px) 0 #000;
}

.sk kbd.alt {
  left: calc(var(--k) * 8px);
  font-size: calc(var(--k) * 3px);
  opacity: 0.85;
}

.sk kbd {
  position: absolute;
  left: calc(var(--k) * -3px);
  bottom: calc(var(--k) * -3px);
  min-width: calc(var(--k) * 9px);
  height: calc(var(--k) * 9px);
  padding: 0;
  font-size: calc(var(--k) * 4px);
  border-width: calc(var(--k) * 0.5px);
  border-bottom-width: calc(var(--k) * 1.2px);
  border-radius: calc(var(--k) * 1.5px);
  color: #1d1205;
  background: linear-gradient(#ffe7a0, #c99a3e);
  border-color: #fff2c4;
}

.sk b {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: calc(var(--k) * 1.5px);
  white-space: nowrap;
  font: 700 calc(var(--k) * 4.6px) var(--ui);
  letter-spacing: 0.04em;
  color: var(--bone);
  text-shadow: 0 calc(var(--k) * 0.6px) 0 #000;
  display: block;
  max-width: calc(var(--k) * 34px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sk.ready {
  border-color: var(--gold);
  box-shadow: 0 0 0 calc(var(--k) * 0.6px) #000, 0 0 calc(var(--k) * 6px) rgba(255, 210, 120, 0.35), inset 0 0 calc(var(--k) * 4px) rgba(0, 0, 0, 0.7);
}

.sk.flash {
  animation: skflash 0.35s ease-out;
}

@keyframes skflash {
  0% {
    box-shadow: 0 0 0 calc(var(--k) * 0.6px) #000, 0 0 calc(var(--k) * 14px) rgba(255, 240, 180, 0.9);
    transform: scale(1.08);
  }
}

.sk.press {
  transform: scale(0.92);
}

.sk-block .ward {
  width: calc(var(--k) * 12px);
  height: calc(var(--k) * 15px);
  background: linear-gradient(180deg, #c8e4ff, #4a78c0);
  clip-path: polygon(50% 0, 100% 16%, 92% 62%, 50% 100%, 8% 62%, 0 16%);
  box-shadow: inset 0 0 0 2px #000;
}

#banner {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--k) * 4px);
  pointer-events: none;
}

#banner small {
  font: normal calc(var(--k) * 6px) var(--num);
  letter-spacing: 0.04em;
  color: var(--bone);
  opacity: 0;
  text-align: center;
  max-width: 90%;
  line-height: 1.4;
  text-shadow: 0 calc(var(--k) * 1px) 0 #000;
}

#banner small.show {
  animation: bn 0.85s ease-out 0.1s forwards;
}

#banner span.win {
  color: #ffe08a;
}

#banner span.hint {
  font-size: calc(var(--k) * 14px);
  color: #d8e8ff;
}

#banner span {
  font: 800 calc(var(--k) * 28px) var(--ui);
  letter-spacing: 0.06em;
  color: var(--gold-2);
  opacity: 0;
  text-shadow: 0 calc(var(--k) * 1px) 0 #6a4a18, 0 calc(var(--k) * 2px) 0 #3a2608, 0 0 calc(var(--k) * 20px) rgba(255, 180, 80, 0.5);
}

#banner span.small {
  font-size: calc(var(--k) * 16px);
}

#banner span.show {
  animation: bn 0.9s ease-out forwards;
}

#banner span.ko {
  color: #ff6a4a;
  animation: bn-ko 2.4s ease-out forwards;
}

@keyframes bn {
  0% {
    opacity: 0;
    transform: scale(1.8);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes bn-ko {
  0% {
    opacity: 0;
    transform: scale(2.4);
  }
  10% {
    opacity: 1;
    transform: scale(1);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#pause {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 4, 8, 0.7);
  backdrop-filter: blur(2px);
}

.pause-box {
  padding: 26px 34px;
  text-align: center;
  background: linear-gradient(#1f2030, #11121a);
  border: 1px solid var(--gold-d);
  border-radius: 12px;
}

.pause-box p {
  color: var(--mist);
  margin: 0 0 18px;
}

/* ------------------------------------------------------------- result */

.result-panel {
  width: min(560px, 92vw);
  text-align: center;
  display: grid;
  justify-items: center;
}

.result-panel canvas {
  width: 240px;
  height: 200px;
}

.result-panel h2 {
  font-size: 52px;
  margin: 0;
}

.result-panel h2.lose {
  color: #ff7a62;
}

.result-panel p {
  margin: 4px 0 8px;
  color: #cfc9b8;
  font-size: 17px;
}

.res-score {
  font: 16px var(--num);
  color: var(--gold-2);
  margin-bottom: 12px;
}

.res-econ {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-bottom: 20px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--mist);
  background: rgba(8, 8, 14, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.res-econ b {
  color: var(--gold-2);
}

/* ------------------------------------------------------------- toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 10;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  font: 700 15px var(--ui);
  color: #1d1205;
  background: linear-gradient(#ffe7a0, #d9b45a);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}

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

@media (max-width: 1100px) {
  .hs-body {
    grid-template-columns: 1fr;
  }
  .stake-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
