:root {
  --bg: #060812;
  --bg-soft: #0a0f1d;
  --surface: #0f1526;
  --surface-raised: #141b30;
  --surface-glass: rgba(15, 21, 38, 0.82);
  --line: rgba(186, 202, 255, 0.1);
  --line-bright: rgba(186, 202, 255, 0.22);
  --text: #f5f7ff;
  --muted: #8e99b8;
  --muted-bright: #b7c2dd;
  --cyan: #45e7ff;
  --cyan-soft: #9af4ff;
  --pink: #ff3d7f;
  --pink-soft: #ff7da8;
  --yellow: #ffd93d;
  --orange: #ff8a3d;
  --green: #4dff9d;
  --purple: #c77dff;
  --red: #ff4d5f;
  --blue: #5b7cff;
  --shadow-deep: 0 30px 90px rgba(0, 0, 0, 0.5);
  --display: "Bahnschrift", "Arial Black", "Franklin Gothic Heavy", Impact, sans-serif;
  --body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --header-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 4%, rgba(69, 231, 255, 0.09), transparent 34%),
    radial-gradient(circle at 83% 10%, rgba(255, 61, 127, 0.09), transparent 33%),
    linear-gradient(180deg, #070a15 0%, #060812 55%, #080c18 100%);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

::selection {
  color: #050812;
  background: var(--cyan);
}

[hidden] {
  display: none !important;
}

.scene-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.scene-grid {
  position: absolute;
  inset: -22% -10%;
  background-image:
    linear-gradient(rgba(132, 165, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 165, 255, 0.075) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(900px) rotateX(62deg) translateY(12%);
  transform-origin: 50% 50%;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse at 50% 45%, black 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, black 0%, transparent 72%);
}

.scene-glow {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.11;
  animation: drift-glow 16s ease-in-out infinite alternate;
}

.scene-glow-one {
  left: -12vw;
  top: 12vh;
  background: var(--cyan);
}

.scene-glow-two {
  right: -8vw;
  bottom: -8vw;
  background: var(--pink);
  animation-delay: -7s;
}

.scene-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 4px,
    transparent 5px
  );
  opacity: 0.6;
}

@keyframes drift-glow {
  from { transform: translate3d(-2%, -3%, 0) scale(0.92); }
  to { transform: translate3d(6%, 5%, 0) scale(1.08); }
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1520px);
  height: var(--header-height);
  margin: 0 auto;
}

.site-brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-blocks {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-auto-rows: 8px;
  gap: 2px;
  transform: rotate(-4deg);
}

.brand-blocks i:nth-child(1) { background: var(--cyan); }
.brand-blocks i:nth-child(2) { background: var(--pink); }
.brand-blocks i:nth-child(3) { background: var(--pink); }
.brand-blocks i:nth-child(4) { background: var(--yellow); }

.brand-text {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-text b {
  color: var(--pink);
  font-weight: 900;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(8, 12, 22, 0.5);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 9px var(--yellow);
  animation: status-pulse 1.4s ease infinite;
}

.connection-pill[data-state="online"] {
  color: var(--green);
  border-color: rgba(77, 255, 157, 0.22);
}

.connection-pill[data-state="online"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
  animation: none;
}

.connection-pill[data-state="offline"] {
  color: var(--red);
  border-color: rgba(255, 77, 95, 0.25);
}

.connection-pill[data-state="offline"] .status-dot {
  background: var(--red);
  box-shadow: 0 0 9px var(--red);
  animation: none;
}

@keyframes status-pulse {
  50% { opacity: 0.35; transform: scale(0.82); }
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-bright);
  background: rgba(8, 12, 22, 0.45);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  color: var(--cyan);
  border-color: rgba(69, 231, 255, 0.35);
  background: rgba(69, 231, 255, 0.08);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-sound-off { display: none; }
.sound-muted .icon-sound-on { display: none; }
.sound-muted .icon-sound-off { display: block; }

.screen {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
}

.screen.is-active {
  display: block;
  animation: screen-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.menu-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.72fr);
  gap: clamp(36px, 6vw, 100px);
  align-items: center;
  width: min(100% - 64px, 1450px);
  min-height: calc(100vh - var(--header-height) - 150px);
  min-height: calc(100dvh - var(--header-height) - 150px);
  margin: 0 auto;
  padding: clamp(30px, 5vh, 72px) 0 clamp(22px, 4vh, 52px);
}

.hero-copy {
  position: relative;
  min-width: 0;
  padding-bottom: 8px;
}

.game-logo {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 20px 0 15px;
  font-family: var(--display);
  font-size: clamp(4.8rem, 10.2vw, 11.2rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.69;
  text-transform: uppercase;
}

.logo-line {
  display: flex;
  align-items: flex-start;
  gap: 0.16em;
  width: max-content;
  max-width: 100%;
}

.logo-word {
  display: block;
  position: relative;
  transform: skewX(-5deg);
  transform-origin: left center;
}

.logo-word-top {
  color: #f6f8ff;
  text-shadow:
    0 2px 0 #454b64,
    0 8px 32px rgba(255, 255, 255, 0.08);
}

.logo-word-bottom {
  width: max-content;
  margin-top: 0.13em;
  margin-left: 0.11em;
  color: transparent;
  background: linear-gradient(100deg, var(--cyan) 3%, #79c3ff 22%, var(--pink) 65%, var(--yellow) 105%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 8px 24px rgba(255, 61, 127, 0.18));
}

.logo-word-bottom::after {
  content: "FIGHTERS";
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

.logo-badge {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.7em;
  height: 1.35em;
  margin-top: 0.1em;
  padding-top: 0.1em;
  color: #090b14;
  background: linear-gradient(135deg, #ffe66d 0%, var(--yellow) 55%, #ffbf29 100%);
  border-radius: 0.12em;
  box-shadow:
    7px 7px 0 rgba(255, 61, 127, 0.22),
    inset 0 0 0 1px rgba(9, 11, 20, 0.32);
  font-family: var(--display);
  font-size: 0.26em;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  transform: rotate(7deg);
  z-index: 2;
}

.hero-tagline {
  margin: 25px 0 0;
  max-width: 540px;
  color: var(--muted-bright);
  font-size: clamp(1.05rem, 1.5vw, 1.32rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.55;
}

.hero-tagline strong {
  color: var(--text);
  font-weight: 750;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 740px;
  margin-top: clamp(32px, 5vh, 58px);
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.feature-icon {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-bright);
  background: rgba(15, 21, 38, 0.7);
}

.feature-icon-stack::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 8px;
  top: 8px;
  background: var(--cyan);
  box-shadow:
    9px 0 var(--cyan),
    9px 9px var(--pink),
    18px 9px var(--pink),
    0 18px var(--yellow);
}

.feature-icon-attack::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: linear-gradient(145deg, var(--pink), var(--orange));
  clip-path: polygon(56% 0, 100% 0, 68% 42%, 92% 42%, 26% 100%, 42% 55%, 10% 55%);
  filter: drop-shadow(0 0 6px rgba(255, 61, 127, 0.4));
}

.feature-icon-king::before {
  content: "";
  position: absolute;
  inset: 8px 9px 10px;
  background: var(--yellow);
  clip-path: polygon(0 38%, 24% 8%, 49% 44%, 74% 8%, 100% 38%, 87% 100%, 13% 100%);
  opacity: 0.9;
}

.feature b {
  display: block;
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.feature small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.hero-art {
  position: absolute;
  right: 3%;
  bottom: -2%;
  width: 280px;
  height: 150px;
  opacity: 0.46;
  pointer-events: none;
  filter: blur(0.2px);
}

.floating-tetro {
  position: absolute;
  width: 15px;
  height: 15px;
  transform: rotate(24deg);
  animation: tetro-float 7s ease-in-out infinite alternate;
}

.tetro-t {
  top: 26px;
  right: 88px;
  background: var(--purple);
  box-shadow: 16px 0 var(--purple), 32px 0 var(--purple), 16px 16px var(--purple);
  box-shadow:
    16px 0 var(--purple),
    32px 0 var(--purple),
    16px 16px var(--purple);
}

.tetro-i {
  right: 15px;
  bottom: 16px;
  background: var(--cyan);
  box-shadow: 16px 0 var(--cyan), 32px 0 var(--cyan), 48px 0 var(--cyan);
  transform: rotate(-9deg);
  animation-delay: -2.5s;
}

.tetro-l {
  left: 45px;
  bottom: 0;
  background: var(--orange);
  box-shadow: 0 16px var(--orange), 0 32px var(--orange), 16px 32px var(--orange);
  animation-delay: -4s;
}

.tetro-s {
  left: 114px;
  top: 3px;
  background: var(--green);
  box-shadow: 16px 0 var(--green), 16px 16px var(--green), 32px 16px var(--green);
  transform: rotate(-13deg);
  animation-delay: -1s;
}

@keyframes tetro-float {
  from { transform: translateY(3px) rotate(18deg); }
  to { transform: translateY(-12px) rotate(31deg); }
}

.menu-panel {
  position: relative;
  width: 100%;
  max-width: 470px;
  justify-self: end;
  padding: 25px;
  border: 1px solid rgba(165, 190, 255, 0.17);
  border-top: 2px solid rgba(69, 231, 255, 0.6);
  background:
    linear-gradient(135deg, rgba(69, 231, 255, 0.055), transparent 30%),
    linear-gradient(180deg, rgba(17, 24, 43, 0.93), rgba(9, 13, 25, 0.93));
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  backdrop-filter: blur(18px);
}

.menu-panel::before,
.menu-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.menu-panel::before {
  left: 0;
  top: 0;
  width: 52px;
  height: 1px;
  background: var(--cyan);
}

.menu-panel::after {
  right: 0;
  bottom: 18px;
  width: 1px;
  height: 34px;
  background: rgba(255, 61, 127, 0.5);
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.live-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}

.live-marker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
}

.field-label {
  display: block;
  margin-top: 25px;
  margin-bottom: 8px;
  color: var(--muted-bright);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.name-field {
  display: flex;
  align-items: center;
  height: 51px;
  border: 1px solid var(--line-bright);
  background: rgba(4, 7, 15, 0.67);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.name-field:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(69, 231, 255, 0.08), inset 0 0 20px rgba(69, 231, 255, 0.03);
}

.name-prompt {
  padding-left: 15px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}

.name-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 9px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  outline: 0;
}

.name-field input::placeholder {
  color: #4f5975;
  text-transform: none;
  letter-spacing: 0.02em;
}

.random-name {
  display: grid;
  place-items: center;
  width: 42px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.random-name:hover {
  color: var(--yellow);
  background: rgba(255, 217, 61, 0.05);
}

.random-name svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  color: var(--text);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 170ms ease, filter 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  filter: saturate(0.2) brightness(0.7);
  opacity: 0.62;
}

.button-primary {
  color: #07101a;
  background: linear-gradient(100deg, var(--yellow) 0%, #ffc83d 32%, var(--pink) 75%, #ff678e 100%);
  box-shadow: 0 10px 35px rgba(255, 61, 127, 0.2);
}

.button-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 13px 42px rgba(255, 61, 127, 0.27);
}

.button-secondary {
  border-color: var(--line-bright);
  color: var(--text);
  background: rgba(12, 18, 33, 0.7);
}

.button-secondary:hover:not(:disabled) {
  border-color: rgba(69, 231, 255, 0.4);
  background: rgba(69, 231, 255, 0.08);
}

.button-small {
  min-height: 37px;
  padding: 0 15px;
  font-size: 10px;
}

.button-quick {
  width: 100%;
  min-height: 71px;
  margin-top: 15px;
  justify-content: space-between;
  padding: 0 22px;
  text-align: left;
}

.button-shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.button-shine::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -25%;
  width: 30%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(22deg);
  animation: button-sweep 5s ease-in-out infinite;
}

@keyframes button-sweep {
  0%, 65% { transform: translateX(-120%) rotate(22deg); }
  85%, 100% { transform: translateX(460%) rotate(22deg); }
}

.button-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.button-copy b {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.09em;
}

.button-copy small {
  color: rgba(7, 16, 26, 0.7);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(7, 16, 26, 0.2);
  border-radius: 50%;
}

.button-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.split-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 19px 0 13px;
  color: #65708d;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.split-rule::before,
.split-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.menu-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 91px;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 1px;
  color: var(--text);
  background: rgba(7, 11, 21, 0.58);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(69, 231, 255, 0.27);
  background: rgba(69, 231, 255, 0.045);
}

.choice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  color: var(--cyan);
  border: 1px solid rgba(69, 231, 255, 0.23);
  background: rgba(69, 231, 255, 0.055);
}

.choice-icon svg {
  width: 14px;
  fill: currentColor;
}

.choice-card b,
.join-copy label b {
  display: block;
  color: var(--text);
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.choice-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.choice-card-join {
  cursor: default;
}

.choice-card-join:hover {
  transform: none;
  border-color: var(--line);
  background: rgba(7, 11, 21, 0.58);
}

.join-copy {
  flex: 1;
  min-width: 0;
}

.join-field {
  display: flex;
  align-items: center;
  height: 33px;
  margin-top: 7px;
  border-bottom: 1px solid var(--line-bright);
}

.join-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  outline: 0;
  text-transform: uppercase;
}

.join-field input::placeholder {
  color: #505a75;
  letter-spacing: 0.09em;
}

.join-field button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid rgba(69, 231, 255, 0.25);
  color: var(--cyan);
  background: rgba(69, 231, 255, 0.08);
  cursor: pointer;
}

.join-field button:hover {
  background: rgba(69, 231, 255, 0.16);
}

.join-field button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.practice-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 15px;
  padding: 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  cursor: pointer;
  transition: color 150ms ease;
}

.practice-link:hover {
  color: var(--cyan);
}

.practice-link small {
  color: #59637d;
  font-size: 9px;
  letter-spacing: 0.03em;
}

.practice-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 7px var(--purple);
}

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #5a657f;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.panel-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.foot-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}

.menu-footer {
  width: min(100% - 64px, 1450px);
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
}

.rule-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.rule-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.rule-number {
  color: var(--pink);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.rule-card b {
  color: var(--muted-bright);
  font-family: var(--display);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.rule-card p {
  margin: 5px 0 0;
  color: #727c96;
  font-size: 10.5px;
  line-height: 1.55;
}

.menu-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 13px 27px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: #626d88;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.menu-controls span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid rgba(177, 194, 238, 0.2);
  border-bottom-color: rgba(177, 194, 238, 0.32);
  border-radius: 3px;
  color: var(--muted-bright);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

/* Queue */

.screen-queue {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

.queue-stage {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(340px, 1fr);
  gap: clamp(40px, 8vw, 130px);
  align-items: center;
  width: min(100% - 64px, 1120px);
  min-height: calc(100vh - var(--header-height) - 130px);
  min-height: calc(100dvh - var(--header-height) - 130px);
  margin: 0 auto;
  padding: 48px 0;
}

.queue-radar {
  position: relative;
  width: min(34vw, 420px);
  aspect-ratio: 1;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(69, 231, 255, 0.18);
  background:
    radial-gradient(circle, rgba(69, 231, 255, 0.065), rgba(3, 7, 15, 0.85) 58%, rgba(6, 8, 18, 0.95) 70%),
    repeating-radial-gradient(circle, transparent 0 48px, rgba(69, 231, 255, 0.04) 49px 50px);
  box-shadow:
    0 0 80px rgba(69, 231, 255, 0.08),
    inset 0 0 80px rgba(0, 0, 0, 0.6);
}

.queue-radar::before,
.queue-radar::after {
  content: "";
  position: absolute;
  background: rgba(69, 231, 255, 0.11);
}

.queue-radar::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.queue-radar::after {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(69, 231, 255, 0.12);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.radar-ring-one { width: 32%; height: 32%; }
.radar-ring-two { width: 58%; height: 58%; border-style: dashed; animation: radar-spin 28s linear infinite; }
.radar-ring-three { width: 83%; height: 83%; border-color: rgba(255, 61, 127, 0.13); }

@keyframes radar-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 292deg, rgba(69, 231, 255, 0.06) 330deg, rgba(69, 231, 255, 0.28) 355deg, transparent 360deg);
  animation: radar-sweep 4.5s linear infinite;
  mask-image: radial-gradient(circle, black 0 76%, transparent 77%);
  -webkit-mask-image: radial-gradient(circle, black 0 76%, transparent 77%);
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

.radar-core {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  gap: 4px;
  transform: translate(-50%, -50%) rotate(9deg);
}

.radar-block {
  width: clamp(12px, 2.2vw, 25px);
  height: clamp(12px, 2.2vw, 25px);
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(69, 231, 255, 0.5);
}

.radar-block:nth-child(2) {
  margin-top: clamp(12px, 2.2vw, 25px);
  background: var(--pink);
  box-shadow: 0 0 16px rgba(255, 61, 127, 0.5);
}

.radar-block:nth-child(3) {
  margin-top: calc(clamp(12px, 2.2vw, 25px) * 0.4);
  background: var(--yellow);
  box-shadow: 0 0 16px rgba(255, 217, 61, 0.4);
}

.queue-copy h2 {
  margin: 22px 0 15px;
  font-family: var(--display);
  font-size: clamp(3.4rem, 6.4vw, 6.8rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.81;
  text-transform: uppercase;
}

.queue-copy h2 span {
  color: transparent;
  background: linear-gradient(90deg, var(--cyan), var(--purple) 60%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

.queue-status {
  color: var(--muted-bright);
  font-size: 14px;
}

.queue-readout {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 36px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.queue-readout > div:not(.queue-divider) {
  display: flex;
  align-items: center;
  gap: 13px;
}

.queue-number {
  color: var(--text);
  font-family: var(--display);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.queue-number-small {
  color: var(--yellow);
  font-size: 36px;
}

.queue-readout small {
  max-width: 80px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.queue-divider {
  width: 1px;
  height: 44px;
  background: var(--line);
}

.queue-progress {
  height: 4px;
  margin-top: 19px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.queue-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 10px rgba(69, 231, 255, 0.45);
  transition: width 300ms linear;
}

.queue-bot-note {
  margin-top: 14px;
  color: #75809c;
  font-size: 11.5px;
}

.queue-bot-note b {
  color: var(--muted-bright);
}

#cancel-queue {
  margin-top: 29px;
}

.queue-tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: min(100% - 64px, 1120px);
  margin: 0 auto 48px;
  border-top: 1px solid var(--line);
}

.queue-tip {
  padding: 20px 25px 0 0;
}

.queue-tip + .queue-tip {
  padding-left: 25px;
  border-left: 1px solid var(--line);
}

.queue-tip span {
  color: var(--pink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.queue-tip p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.queue-tip kbd {
  margin: 0 1px;
}

/* Lobby */

.screen-lobby {
  padding-bottom: 60px;
}

.lobby-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  width: min(100% - 64px, 1360px);
  margin: 0 auto;
  padding: 44px 0 31px;
  border-bottom: 1px solid var(--line);
}

.lobby-heading h2 {
  margin: 15px 0 7px;
  font-family: var(--display);
  font-size: clamp(2.3rem, 4.2vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-transform: uppercase;
}

.lobby-heading h2 span {
  color: var(--cyan);
}

.lobby-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.room-code-card {
  min-width: 270px;
  padding: 14px 17px;
  border: 1px solid rgba(69, 231, 255, 0.22);
  background: linear-gradient(135deg, rgba(69, 231, 255, 0.08), rgba(12, 18, 31, 0.7));
}

.room-code-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.room-code-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 5px 0 4px;
}

.room-code-row strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-shadow: 0 0 22px rgba(69, 231, 255, 0.2);
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--muted-bright);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.copy-button:hover {
  color: var(--cyan);
  border-color: rgba(69, 231, 255, 0.3);
}

.copy-button svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.room-code-card small {
  color: #68738d;
  font-size: 9.5px;
}

.lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
  width: min(100% - 64px, 1360px);
  margin: 30px auto 0;
}

.roster-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 25, 44, 0.9), rgba(9, 13, 24, 0.94));
}

.roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 21px;
  border-bottom: 1px solid var(--line);
}

.roster-title {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted-bright);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.roster-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 8px;
}

.roster-live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
}

.roster-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
}

.roster-count strong {
  color: var(--cyan);
  font-size: 17px;
}

.roster-count span {
  color: var(--muted);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 17px;
  min-height: 268px;
  align-content: start;
}

.roster-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(177, 194, 238, 0.09);
  background: rgba(6, 10, 19, 0.48);
  animation: roster-in 280ms ease both;
}

@keyframes roster-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.roster-player.is-you {
  border-color: rgba(69, 231, 255, 0.28);
  background: rgba(69, 231, 255, 0.045);
}

.roster-player.is-host::after {
  content: "HOST";
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 5px;
  color: #0a101b;
  background: var(--yellow);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.roster-avatar {
  --avatar-color: var(--cyan);
  position: relative;
  flex: 0 0 31px;
  width: 31px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--avatar-color);
  border: 1px solid color-mix(in srgb, var(--avatar-color) 34%, transparent);
  background: color-mix(in srgb, var(--avatar-color) 10%, transparent);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 900;
}

.roster-avatar::before {
  content: "";
  position: absolute;
  inset: 4px 4px auto;
  width: 4px;
  height: 4px;
  background: var(--avatar-color);
  box-shadow: 13px 0 var(--avatar-color), 0 17px color-mix(in srgb, var(--avatar-color) 50%, transparent);
}

.roster-avatar span {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.roster-info {
  min-width: 0;
}

.roster-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-role {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.roster-role i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

.roster-player.is-bot .roster-role i {
  background: var(--purple);
}

.empty-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 17px 17px;
}

.empty-slot {
  display: grid;
  place-items: center;
  min-height: 62px;
  border: 1px dashed rgba(177, 194, 238, 0.09);
  background: rgba(5, 8, 15, 0.3);
  color: #38435b;
}

.empty-slot span {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1;
}

.empty-slots-more {
  grid-column: 1 / -1;
  margin: 0;
  padding: 5px 0;
  color: #4f5972;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
}

@media (max-width: 900px) {
  .empty-slot {
    min-height: 55px;
  }
}

.roster-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  color: #65708b;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
}

.roster-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-human { background: var(--cyan); }
.legend-bot { background: var(--purple); }
.legend-host { background: var(--yellow); }

.roster-footer-note {
  margin-left: auto;
  color: #4f5972;
}

.lobby-side {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.host-card,
.lobby-brief {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 42, 0.94), rgba(9, 13, 24, 0.94));
}

.host-card {
  padding: 20px;
}

.side-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-bright);
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

#host-badge {
  padding: 2px 6px;
  color: #0d1220;
  background: var(--yellow);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.host-card.is-guest #host-badge {
  display: none;
}

.host-card.is-guest .bot-controls,
.host-card.is-guest .button-launch,
.host-card.is-guest .launch-note {
  display: none;
}

.host-card.is-guest .waiting-panel {
  display: flex;
}

.host-card:not(.is-guest) .waiting-panel {
  display: none;
}

.host-card:not(.is-guest) .bot-controls {
  display: block;
}

.bot-controls {
  margin-top: 21px;
}

.bot-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.bot-label-row output {
  color: var(--cyan);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.bot-slider {
  width: 100%;
  height: 24px;
  margin: 8px 0 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.bot-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, rgba(69, 231, 255, 0.55), rgba(255, 61, 127, 0.4));
}

.bot-slider::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, rgba(69, 231, 255, 0.55), rgba(255, 61, 127, 0.4));
}

.bot-slider::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border: 2px solid #07101b;
  border-radius: 0;
  background: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 0 12px rgba(69, 231, 255, 0.45);
  -webkit-appearance: none;
}

.bot-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 2px solid #07101b;
  border-radius: 0;
  background: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 0 12px rgba(69, 231, 255, 0.45);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  color: #56617b;
  font-family: var(--mono);
  font-size: 7px;
}

.bot-controls p {
  margin: 12px 0 0;
  color: #717c96;
  font-size: 10px;
  line-height: 1.5;
}

.button-launch {
  width: 100%;
  min-height: 55px;
  margin-top: 20px;
  font-size: 15px;
}

.button-launch svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.launch-note {
  margin: 11px 0 0;
  color: #66718b;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-align: center;
}

.waiting-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(255, 217, 61, 0.14);
  background: rgba(255, 217, 61, 0.035);
  color: var(--muted);
  font-size: 10.5px;
}

.waiting-icon {
  flex: 0 0 25px;
  height: 25px;
  color: var(--yellow);
}

.waiting-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.waiting-panel b {
  display: block;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.waiting-panel p {
  margin: 5px 0 0;
  line-height: 1.45;
}

.lobby-brief {
  padding: 20px;
}

.lobby-brief ul {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.lobby-brief li {
  display: flex;
  gap: 10px;
  color: #78839d;
  font-size: 10.5px;
  line-height: 1.45;
}

.lobby-brief li span {
  color: var(--pink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 900;
}

.text-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.text-button:hover {
  color: var(--pink);
  border-color: rgba(255, 61, 127, 0.25);
}

.text-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Game */

body[data-screen="game"] {
  overflow: hidden;
  background: #05070e;
}

body[data-screen="game"] .site-header {
  display: none;
}

#screen-game.is-active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 0 14px 8px;
  overflow: hidden;
}

.game-topbar {
  display: flex;
  flex: 0 0 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 1760px);
  margin: 0 auto;
  border-bottom: 1px solid rgba(176, 194, 238, 0.08);
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  color: var(--muted-bright);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.game-brand b {
  color: var(--pink);
}

.game-brand-mark {
  display: flex;
  gap: 2px;
  align-items: flex-end;
}

.game-brand-mark i {
  display: block;
  width: 6px;
  height: 9px;
  background: var(--cyan);
}

.game-brand-mark i:nth-child(2) {
  height: 15px;
  background: var(--pink);
}

.game-brand-mark i:nth-child(3) {
  height: 6px;
  background: var(--yellow);
}

.hud-metrics {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 34px;
}

.hud-metric {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 78px;
  padding: 0 15px;
  border-left: 1px solid var(--line);
}

.hud-metric:first-child {
  border-left: 0;
}

.hud-metric span {
  color: #65708c;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hud-metric strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.hud-metric-speed strong {
  color: var(--yellow);
}

.hud-metric-badge strong {
  color: var(--pink);
}

.game-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 160px;
}

.top-button {
  height: 31px;
  padding: 0 13px;
  border: 1px solid var(--line);
  color: var(--muted-bright);
  background: rgba(14, 20, 35, 0.75);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.top-button:hover {
  color: var(--cyan);
  border-color: rgba(69, 231, 255, 0.3);
}

.top-button-leave:hover {
  color: var(--pink);
  border-color: rgba(255, 61, 127, 0.3);
}

.battlefield {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(150px, 1fr) clamp(420px, 43vw, 580px) minmax(150px, 1fr);
  gap: 12px;
  width: min(100%, 1760px);
  min-height: 0;
  margin: 0 auto;
  padding: 10px 0;
}

.opponent-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(176, 194, 238, 0.065);
  background: rgba(6, 9, 17, 0.35);
}

.rail-heading {
  display: flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid rgba(176, 194, 238, 0.065);
  color: #6d7894;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.rail-heading span:last-child {
  color: var(--cyan);
  font-size: 9px;
}

.opponent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(30px, 2.1vw, 46px), 1fr));
  grid-auto-rows: max-content;
  gap: 5px;
  flex: 1;
  min-height: 0;
  padding: 7px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(69, 231, 255, 0.22) transparent;
  scrollbar-width: thin;
}

.opponent-grid::-webkit-scrollbar {
  width: 4px;
}

.opponent-grid::-webkit-scrollbar-thumb {
  background: rgba(69, 231, 255, 0.22);
}

.opponent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 3px;
  border: 1px solid rgba(176, 194, 238, 0.09);
  color: var(--muted);
  background: rgba(5, 8, 15, 0.72);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
  animation: mini-in 220ms ease both;
}

@keyframes mini-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.opponent-card:hover {
  border-color: rgba(69, 231, 255, 0.28);
  background: rgba(69, 231, 255, 0.035);
}

.opponent-card.is-target {
  border-color: var(--pink);
  background: rgba(255, 61, 127, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 61, 127, 0.18), 0 0 10px rgba(255, 61, 127, 0.12);
}

.opponent-card.is-attacking {
  border-color: rgba(255, 217, 61, 0.5);
}

.mini-canvas {
  display: block;
  width: 100%;
  background: #050810;
  image-rendering: auto;
}

.mini-name {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-bright);
  font-family: var(--mono);
  font-size: clamp(5.5px, 0.48vw, 8px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  margin-top: 1px;
  color: #6b7793;
  font-family: var(--mono);
  font-size: clamp(5px, 0.43vw, 7px);
  font-weight: 700;
  line-height: 1.2;
}

.mini-meta span {
  overflow: hidden;
  white-space: nowrap;
}

.mini-badge {
  color: var(--yellow);
}

.mini-kos {
  color: var(--pink-soft);
}

.mini-incoming {
  position: absolute;
  inset: 3px 3px auto;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange));
  box-shadow: 0 0 8px rgba(255, 77, 95, 0.5);
}

.opponent-grid:empty::before {
  content: "SCANNING THE ARENA";
  grid-column: 1 / -1;
  padding: 18px 6px;
  color: #59647e;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.rail-fade {
  flex: 0 0 14px;
  margin-top: -14px;
  background: linear-gradient(180deg, transparent, rgba(6, 9, 17, 0.85));
  pointer-events: none;
}

.arena {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.arena-frame {
  display: grid;
  flex: 1;
  grid-template-columns: clamp(58px, 5.2vw, 86px) minmax(0, 1fr) clamp(58px, 5.2vw, 86px);
  gap: clamp(5px, 0.8vw, 11px);
  min-width: 0;
  min-height: 0;
  align-items: center;
}

.arena-column {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: clamp(5px, 0.8vh, 9px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.arena-column-left {
  justify-content: flex-start;
}

.arena-column-right {
  justify-content: flex-start;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: clamp(6px, 0.8vh, 9px);
  border: 1px solid rgba(176, 194, 238, 0.08);
  background: linear-gradient(180deg, rgba(16, 22, 39, 0.88), rgba(8, 12, 22, 0.88));
}

.info-label {
  color: #64708b;
  font-family: var(--mono);
  font-size: clamp(6px, 0.55vw, 8px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.info-label small {
  color: #435069;
  font-size: inherit;
}

.info-card strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(17px, 1.7vw, 27px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.hold-card {
  flex: 0 0 auto;
}

.hold-canvas-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin: 2px 0;
  border: 1px solid rgba(176, 194, 238, 0.06);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    rgba(4, 7, 13, 0.7);
  background-size: 25% 25%;
}

.hold-canvas-wrap canvas {
  width: 100%;
  height: 100%;
}

.info-foot {
  color: #4f5c77;
  font-family: var(--mono);
  font-size: clamp(5px, 0.45vw, 7px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.badge-card strong {
  color: var(--yellow);
}

.badge-multiplier {
  color: var(--pink-soft);
  font-family: var(--mono);
  font-size: clamp(7px, 0.65vw, 9px);
  font-weight: 700;
}

.ko-card strong {
  color: var(--pink);
}

.next-card {
  flex: 1;
  min-height: 0;
}

.next-stack {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 3px;
  flex: 1;
  min-height: 0;
}

.next-piece {
  display: grid;
  place-items: center;
  min-height: 0;
  border: 1px solid rgba(176, 194, 238, 0.045);
  background: rgba(4, 7, 13, 0.56);
}

.next-piece canvas {
  width: 100%;
  height: 100%;
}

.rank-card {
  flex: 0 0 auto;
}

.rank-card strong {
  color: var(--cyan);
}

.playfield-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.playfield-shell {
  position: relative;
  width: 100%;
  max-height: calc(100% - 37px);
  aspect-ratio: 1 / 2;
  flex: 0 1 auto;
  border: 1px solid rgba(69, 231, 255, 0.25);
  background: #050810;
  box-shadow:
    0 0 0 4px rgba(3, 6, 12, 0.9),
    0 0 34px rgba(69, 231, 255, 0.09),
    inset 0 0 30px rgba(0, 0, 0, 0.62);
  overflow: visible;
}

.playfield-shell::before,
.playfield-shell::after {
  content: "";
  position: absolute;
  z-index: 5;
  width: 13px;
  height: 13px;
  pointer-events: none;
  border-color: var(--cyan);
  border-style: solid;
  opacity: 0.8;
}

.playfield-shell::before {
  left: -1px;
  top: -1px;
  border-width: 2px 0 0 2px;
}

.playfield-shell::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
}

#playfield {
  display: block;
  width: 100%;
  height: 100%;
}

.board-inner-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 61, 127, 0.05), transparent 12%, transparent 88%, rgba(69, 231, 255, 0.04)),
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.28));
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5);
}

.board-underbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid rgba(176, 194, 238, 0.075);
  border-top: 0;
  background: rgba(8, 12, 22, 0.84);
}

.board-underbar > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.board-underbar span {
  color: #59647e;
  font-family: var(--mono);
  font-size: clamp(6px, 0.55vw, 8px);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.board-underbar strong {
  color: var(--muted-bright);
  font-family: var(--display);
  font-size: clamp(10px, 0.9vw, 14px);
  font-weight: 900;
}

.incoming-meter {
  position: absolute;
  left: 4px;
  top: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: clamp(13px, 1.25vw, 19px);
  height: min(42%, 250px);
  padding: 5px 3px;
  border: 1px solid rgba(255, 77, 95, 0.2);
  background: rgba(10, 4, 7, 0.78);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-5px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.incoming-meter.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.incoming-meter.is-critical {
  border-color: rgba(255, 77, 95, 0.65);
  animation: danger-pulse 500ms ease infinite alternate;
}

.incoming-header {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.incoming-header span {
  color: #ff7f8e;
  font-family: var(--mono);
  font-size: clamp(4px, 0.34vw, 5.5px);
  font-weight: 800;
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.incoming-header strong {
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(9px, 0.8vw, 12px);
  font-weight: 900;
}

.incoming-track {
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: 3px;
  min-height: 0;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.incoming-track span {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(0deg, var(--yellow), var(--orange), var(--red));
  box-shadow: 0 0 7px rgba(255, 77, 95, 0.6);
  transition: height 130ms linear;
}

@keyframes danger-pulse {
  from { box-shadow: 0 0 0 rgba(255, 77, 95, 0); }
  to { box-shadow: 0 0 18px rgba(255, 77, 95, 0.38); }
}

.danger-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 30, 80, 0.26));
}

.danger-flash.is-active {
  animation: screen-danger 420ms ease-out;
}

@keyframes screen-danger {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 13, 0.78);
  backdrop-filter: blur(4px);
  text-align: center;
}

.countdown-overlay.is-go {
  background: rgba(3, 6, 13, 0.38);
}

.countdown-kicker {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: clamp(7px, 0.7vw, 10px);
  font-weight: 700;
  letter-spacing: 0.22em;
}

.countdown-overlay strong {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(5rem, 9vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  text-shadow: 0 0 42px rgba(69, 231, 255, 0.2);
}

.countdown-overlay strong.is-go-text {
  color: var(--yellow);
  font-size: clamp(3rem, 6vw, 6rem);
  letter-spacing: 0.03em;
}

.countdown-hint {
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(7px, 0.65vw, 9px);
  font-weight: 600;
  letter-spacing: 0.12em;
}

.ko-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(22, 4, 10, 0.88), rgba(4, 6, 13, 0.92));
  text-align: center;
  backdrop-filter: blur(2px);
}

.ko-overlay strong {
  color: var(--pink);
  font-family: var(--display);
  font-size: clamp(3rem, 6.5vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.ko-kicker {
  color: var(--red);
  font-family: var(--mono);
  font-size: clamp(7px, 0.65vw, 9px);
  font-weight: 700;
  letter-spacing: 0.19em;
}

#ko-subtitle {
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(8px, 0.7vw, 10px);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.ko-overlay .button {
  margin-top: 13px;
}

.target-panel {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(275px, 1.25fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 59px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(176, 194, 238, 0.08);
  background: linear-gradient(180deg, rgba(16, 22, 39, 0.88), rgba(8, 12, 22, 0.9));
}

.target-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
  padding-left: 3px;
}

.target-kicker {
  display: block;
  color: #66728d;
  font-family: var(--mono);
  font-size: clamp(5.5px, 0.48vw, 7px);
  font-weight: 700;
  letter-spacing: 0.13em;
}

.target-current strong {
  display: block;
  overflow: hidden;
  max-width: 180px;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(9px, 0.8vw, 12px);
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-mode-label {
  flex: 0 0 auto;
  padding: 2px 5px;
  color: var(--cyan);
  border: 1px solid rgba(69, 231, 255, 0.2);
  font-family: var(--mono);
  font-size: clamp(5px, 0.43vw, 6.5px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.target-mode-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.target-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 33px;
  padding: 0 4px;
  border: 1px solid rgba(176, 194, 238, 0.09);
  color: #7d89a5;
  background: rgba(4, 7, 14, 0.55);
  font-family: var(--mono);
  font-size: clamp(6px, 0.5vw, 7.5px);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.target-button kbd {
  opacity: 0.6;
  min-width: 13px;
  height: 13px;
  font-size: 6px;
}

.target-button:hover {
  color: var(--muted-bright);
  border-color: rgba(69, 231, 255, 0.2);
}

.target-button.is-active {
  color: var(--text);
  border-color: rgba(255, 61, 127, 0.35);
  background: rgba(255, 61, 127, 0.1);
}

.target-button.is-active kbd {
  color: var(--pink-soft);
  border-color: rgba(255, 61, 127, 0.25);
}

.target-next-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 33px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted-bright);
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(6px, 0.5vw, 7.5px);
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
}

.target-next-button:hover {
  color: var(--cyan);
  border-color: rgba(69, 231, 255, 0.3);
}

.target-next-button svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.game-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(100%, 1760px);
  min-height: 35px;
  margin: 0 auto;
}

.key-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 19px;
  color: #5f6a85;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.key-hints span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mobile-controls {
  display: none;
}

.spectator-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pink-soft);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

#screen-game.is-spectating .mobile-controls {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(1);
}

#screen-game.is-spectating .target-panel {
  opacity: 0.55;
  pointer-events: none;
}

#screen-game.is-spectating .playfield-shell {
  filter: saturate(0.72) brightness(0.8);
}

#screen-game.is-spectating .kill-feed {
  opacity: 0.8;
}

.spectator-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink);
  animation: status-pulse 1.3s ease infinite;
}

.kill-feed {
  position: fixed;
  left: 50%;
  top: 67px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(330px, 44vw);
  transform: translateX(-50%);
  pointer-events: none;
}

.feed-item {
  padding: 7px 10px;
  border-left: 2px solid var(--pink);
  color: var(--muted-bright);
  background: rgba(9, 13, 23, 0.88);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.25);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  animation: feed-in 250ms ease both;
}

.feed-item.is-ko {
  border-left-color: var(--pink);
}

.feed-item.is-attack {
  border-left-color: var(--yellow);
}

.feed-item.is-notice {
  border-left-color: var(--cyan);
}

.feed-item b {
  color: var(--text);
  font-weight: 700;
}

.feed-item.is-ko b:first-child {
  color: var(--pink-soft);
}

@keyframes feed-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.attack-alert {
  position: fixed;
  left: 50%;
  top: 110px;
  z-index: 29;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 61, 127, 0.3);
  color: var(--pink-soft);
  background: rgba(30, 6, 14, 0.82);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transform: translateX(-50%);
  pointer-events: none;
  animation: alert-in 300ms ease both;
}

.attack-alert strong {
  color: var(--red);
  font-family: var(--display);
  font-size: 15px;
}

@keyframes alert-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Overlays and results */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(360px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-bright);
  border-left: 2px solid var(--cyan);
  color: var(--muted-bright);
  background: rgba(10, 15, 27, 0.94);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in 280ms ease both;
}

.toast.is-error {
  border-left-color: var(--pink);
}

.toast.is-success {
  border-left-color: var(--green);
}

.toast.is-warning {
  border-left-color: var(--yellow);
}

.toast svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  fill: var(--cyan);
}

.toast.is-error svg { fill: var(--pink); }
.toast.is-success svg { fill: var(--green); }
.toast.is-warning svg { fill: var(--yellow); }

.toast.is-leaving {
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 200ms ease, transform 200ms ease;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(255, 61, 127, 0.09), transparent 50%),
    rgba(2, 4, 10, 0.83);
  backdrop-filter: blur(9px);
  animation: modal-fade 220ms ease both;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.results-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(90vh, 780px);
  max-height: min(90dvh, 780px);
  border: 1px solid rgba(176, 194, 238, 0.19);
  background:
    linear-gradient(135deg, rgba(69, 231, 255, 0.05), transparent 30%),
    linear-gradient(180deg, rgba(18, 25, 45, 0.98), rgba(7, 11, 21, 0.98));
  box-shadow: var(--shadow-deep);
  overflow: hidden;
  animation: modal-rise 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.results-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--yellow));
}

.results-hero {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 30px 32px 24px;
  border-bottom: 1px solid var(--line);
}

.results-kicker {
  color: var(--pink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.results-hero h2 {
  margin: 8px 0 5px;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.85;
  text-transform: uppercase;
}

.results-hero.is-victory h2 {
  color: transparent;
  background: linear-gradient(100deg, var(--yellow), var(--pink) 64%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.results-hero.is-out h2 {
  color: var(--muted-bright);
}

.results-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.results-subtitle b {
  color: var(--text);
}

.results-placement {
  flex: 0 0 125px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.results-placement span {
  color: #66718c;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.results-placement strong {
  color: var(--cyan);
  font-family: var(--display);
  font-size: 65px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.results-hero.is-victory .results-placement strong {
  color: var(--yellow);
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}

.result-stat {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.result-stat:last-child {
  border-right: 0;
}

.result-stat span {
  display: block;
  color: #66718b;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.result-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.result-stat strong.is-yellow { color: var(--yellow); }
.result-stat strong.is-pink { color: var(--pink); }

.results-standings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 31px 10px;
}

.results-standings-head span {
  color: var(--muted-bright);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.results-standings-head small {
  color: #59647f;
  font-family: var(--mono);
  font-size: 8px;
}

.results-standings {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 31px 14px;
  scrollbar-color: rgba(69, 231, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.standings-row {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) repeat(3, 65px);
  gap: 12px;
  align-items: center;
  min-height: 38px;
  border-top: 1px solid rgba(176, 194, 238, 0.065);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.standings-row.is-you {
  background: rgba(69, 231, 255, 0.055);
  border-color: rgba(69, 231, 255, 0.17);
}

.standings-row.is-winner {
  color: var(--yellow);
}

.standings-rank {
  color: var(--cyan);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 900;
}

.standings-row.is-winner .standings-rank {
  color: var(--yellow);
}

.standings-name {
  overflow: hidden;
  color: var(--muted-bright);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings-name small {
  margin-left: 5px;
  padding: 1px 4px;
  color: var(--purple);
  border: 1px solid color-mix(in srgb, var(--purple) 25%, transparent);
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.standings-row.is-you .standings-name::after {
  content: "YOU";
  margin-left: 5px;
  color: var(--cyan);
  font-size: 6px;
}

.standings-metric {
  text-align: right;
}

.results-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 17px 31px;
  border-top: 1px solid var(--line);
  background: rgba(4, 7, 14, 0.3);
}

.results-actions .button {
  min-height: 40px;
  font-size: 10px;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(5, 8, 16, 0.6);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--cyan);
  border-color: rgba(69, 231, 255, 0.3);
}

.modal-close svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.leave-confirm {
  width: min(410px, 100%);
  padding: 29px;
  border: 1px solid var(--line-bright);
  background: linear-gradient(180deg, rgba(18, 24, 42, 0.98), rgba(8, 12, 22, 0.98));
  box-shadow: var(--shadow-deep);
  animation: modal-rise 260ms ease both;
}

.leave-confirm h2 {
  margin: 0 0 9px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.leave-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.leave-confirm .confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.connection-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(3, 5, 11, 0.9);
  backdrop-filter: blur(10px);
}

.connection-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line-bright);
  background: linear-gradient(180deg, rgba(16, 23, 41, 0.98), rgba(7, 11, 21, 0.98));
  text-align: center;
  box-shadow: var(--shadow-deep);
}

.connection-spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(69, 231, 255, 0.13);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spinner 900ms linear infinite;
}

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

.connection-card h2 {
  margin: 21px 0 8px;
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: -0.02em;
}

.connection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.connection-card .button {
  margin-top: 22px;
}

/* Responsive */

@media (max-width: 1280px) {
  .menu-hero {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
    gap: 44px;
  }

  .game-logo {
    font-size: clamp(4.2rem, 9.2vw, 8.8rem);
  }

  .hero-features {
    gap: 13px;
  }

  .feature small {
    font-size: 10.5px;
  }

  .battlefield {
    grid-template-columns: minmax(120px, 1fr) clamp(390px, 46vw, 540px) minmax(120px, 1fr);
  }
}

@media (max-width: 1100px) {
  .menu-hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
    width: min(100% - 48px, 1100px);
    gap: 35px;
  }

  .menu-panel {
    max-width: 430px;
    padding: 22px;
  }

  .hero-art {
    opacity: 0.28;
  }

  .menu-choices {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 72px;
  }

  .choice-card-join {
    min-height: 86px;
  }

  .button-quick {
    min-height: 66px;
  }

  .button-copy b {
    font-size: 17px;
  }

  .roster-grid,
  .empty-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lobby-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .hud-metric {
    min-width: 65px;
    padding: 0 10px;
  }

  .game-topbar {
    gap: 10px;
  }

  .battlefield {
    grid-template-columns: minmax(110px, 1fr) clamp(380px, 50vw, 490px) minmax(110px, 1fr);
    gap: 8px;
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 60px;
  }

  .site-header {
    width: min(100% - 30px, 900px);
  }

  .menu-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(100% - 30px, 680px);
    min-height: 0;
    padding-top: 31px;
  }

  .hero-copy {
    width: 100%;
  }

  .game-logo {
    font-size: clamp(4.5rem, 16vw, 8.2rem);
  }

  .hero-tagline {
    max-width: 490px;
    margin-top: 20px;
    font-size: 15px;
  }

  .hero-features {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 28px;
    gap: 13px;
  }

  .feature {
    display: block;
  }

  .feature-icon {
    margin-bottom: 9px;
  }

  .feature small {
    display: none;
  }

  .hero-art {
    display: none;
  }

  .menu-panel {
    max-width: none;
    width: 100%;
    margin-top: 35px;
    padding: 22px;
  }

  .menu-choices {
    grid-template-columns: 1fr 1fr;
  }

  .choice-card {
    min-height: 82px;
  }

  .button-quick {
    min-height: 68px;
  }

  .menu-footer {
    width: min(100% - 30px, 680px);
    padding-bottom: 22px;
  }

  .rule-strip {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .rule-card p {
    font-size: 10px;
  }

  .menu-controls {
    justify-content: flex-start;
  }

  .queue-stage {
    grid-template-columns: 1fr;
    gap: 24px;
    width: min(100% - 30px, 620px);
    min-height: 0;
    padding: 43px 0 30px;
    text-align: center;
  }

  .queue-radar {
    width: min(64vw, 310px);
    order: 2;
  }

  .queue-copy {
    order: 1;
  }

  .queue-copy .eyebrow {
    justify-content: center;
  }

  .queue-copy h2 {
    font-size: clamp(3rem, 11vw, 5.4rem);
  }

  .queue-readout {
    justify-content: center;
    gap: 20px;
  }

  .queue-tips {
    grid-template-columns: 1fr;
    width: min(100% - 30px, 620px);
    padding: 0;
    margin-bottom: 30px;
    border-top: 0;
  }

  .queue-tip {
    padding: 13px 0;
    border-top: 1px solid var(--line);
  }

  .queue-tip + .queue-tip {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .lobby-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    width: min(100% - 30px, 700px);
    padding: 31px 0 24px;
  }

  .room-code-card {
    width: 100%;
    min-width: 0;
  }

  .room-code-row strong {
    font-size: 25px;
  }

  .lobby-layout {
    grid-template-columns: 1fr;
    width: min(100% - 30px, 700px);
    margin-top: 20px;
  }

  .roster-grid,
  .empty-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roster-grid {
    padding: 12px;
    min-height: 190px;
  }

  .empty-slots {
    padding: 0 12px 12px;
  }

  .lobby-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .text-button {
    grid-column: span 2;
  }

  .screen-lobby {
    padding-bottom: 30px;
  }

  #screen-game.is-active {
    padding: 0 8px max(7px, env(safe-area-inset-bottom));
  }

  .game-topbar {
    flex-basis: 51px;
    width: 100%;
  }

  .game-brand {
    min-width: 0;
    font-size: 10px;
  }

  .game-brand span:last-child {
    display: none;
  }

  .game-brand-mark i {
    width: 5px;
  }

  .hud-metrics {
    height: 31px;
    margin-left: auto;
  }

  .hud-metric {
    min-width: 57px;
    padding: 0 7px;
    gap: 5px;
  }

  .hud-metric span {
    font-size: 6.5px;
  }

  .hud-metric strong {
    font-size: 14px;
  }

  .hud-metric-badge {
    display: none;
  }

  .game-actions {
    min-width: 0;
    gap: 5px;
  }

  .game-actions .sound-toggle {
    width: 29px;
    height: 29px;
  }

  .top-button {
    height: 29px;
    padding: 0 8px;
    font-size: 7px;
  }

  .battlefield {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 7px 0;
    width: 100%;
  }

  .opponent-rail {
    display: none;
  }

  .arena {
    flex: 1;
    min-height: 0;
  }

  .arena-frame {
    grid-template-columns: clamp(55px, 14vw, 78px) minmax(0, 1fr) clamp(55px, 14vw, 78px);
    gap: 5px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }

  .arena-column {
    gap: 5px;
  }

  .info-card {
    padding: 5px;
  }

  .hold-canvas-wrap {
    aspect-ratio: 1;
  }

  .info-label {
    font-size: 6.5px;
  }

  .info-foot {
    display: none;
  }

  .info-card strong {
    font-size: 18px;
  }

  .badge-multiplier {
    font-size: 7px;
  }

  .next-card {
    flex: 1;
    min-height: 0;
  }

  .next-stack {
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 2px;
  }

  .rank-card {
    display: none;
  }

  .playfield-shell {
    max-height: calc(100% - 31px);
    box-shadow:
      0 0 0 3px rgba(3, 6, 12, 0.9),
      0 0 25px rgba(69, 231, 255, 0.09);
  }

  .board-underbar {
    min-height: 28px;
    padding: 0 7px;
  }

  .board-underbar span {
    font-size: 6px;
  }

  .board-underbar strong {
    font-size: 10px;
  }

  .incoming-meter {
    width: 14px;
    height: 38%;
  }

  .incoming-header span {
    font-size: 4.5px;
  }

  .incoming-header strong {
    font-size: 9px;
  }

  .target-panel {
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.3fr);
    grid-template-rows: auto auto;
    gap: 5px;
    width: 100%;
    max-width: 560px;
    min-height: 0;
    margin: 5px auto 0;
    padding: 6px;
  }

  .target-current {
    grid-column: 1;
  }

  .target-mode-buttons {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .target-button {
    height: 28px;
    font-size: 6.5px;
  }

  .target-button kbd {
    display: none;
  }

  .target-next-button {
    grid-column: 2;
    grid-row: 1;
    height: 28px;
    font-size: 6.5px;
    padding: 0 7px;
  }

  .game-footer {
    width: 100%;
    min-height: 0;
    margin-top: 3px;
  }

  .key-hints {
    display: none;
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding-top: 3px;
  }

  .touch-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(176, 194, 238, 0.11);
    color: var(--muted-bright);
    background: rgba(15, 22, 39, 0.82);
    font-family: var(--mono);
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.03em;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
  }

  .touch-button:active,
  .touch-button.is-pressed {
    border-color: rgba(69, 231, 255, 0.4);
    background: rgba(69, 231, 255, 0.12);
  }

  .touch-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }

  .touch-button span {
    font-size: 5.5px;
  }

  .touch-soft {
    color: var(--cyan);
  }

  .touch-hard {
    border-color: rgba(255, 61, 127, 0.25);
    color: var(--pink-soft);
    background: rgba(255, 61, 127, 0.08);
  }

  .touch-hard svg {
    width: 17px;
  }

  .kill-feed {
    top: 56px;
    width: min(300px, 76vw);
  }

  .feed-item {
    padding: 5px 8px;
    font-size: 7.5px;
  }

  .attack-alert {
    top: 92px;
  }

  .spectator-label {
    font-size: 7px;
    justify-content: center;
    width: 100%;
  }

  .results-hero {
    flex-direction: column;
    gap: 14px;
    padding: 23px 21px 18px;
  }

  .results-placement {
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    padding-left: 0;
    border-left: 0;
  }

  .results-placement strong {
    font-size: 45px;
  }

  .results-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .result-stat {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .result-stat:nth-child(3n) {
    border-right: 0;
  }

  .result-stat:nth-child(4),
  .result-stat:nth-child(5) {
    border-bottom: 0;
  }

  .result-stat strong {
    font-size: 18px;
  }

  .results-standings-head {
    padding: 16px 20px 8px;
  }

  .results-standings {
    padding: 0 20px 10px;
  }

  .standings-row {
    grid-template-columns: 27px minmax(0, 1fr) repeat(2, 47px);
    gap: 7px;
    min-height: 34px;
    font-size: 8px;
  }

  .standings-row .standings-metric:nth-child(5) {
    display: none;
  }

  .results-actions {
    flex-wrap: wrap;
    padding: 13px 20px;
  }

  .results-actions .button {
    flex: 1 1 auto;
    min-height: 38px;
    font-size: 9px;
  }

  .modal-close {
    top: 9px;
    right: 9px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: min(340px, calc(100vw - 24px));
  }

  .menu-controls {
    gap: 10px 18px;
  }

  .lobby-side {
    display: flex;
  }

  .text-button {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .site-header {
    height: 58px;
  }

  .connection-pill {
    padding: 0 9px;
    font-size: 8px;
    height: 29px;
  }

  .header-actions {
    gap: 7px;
  }

  .site-brand {
    gap: 8px;
  }

  .brand-text {
    font-size: 12px;
  }

  .brand-blocks {
    grid-template-columns: repeat(2, 7px);
    grid-auto-rows: 7px;
  }

  .menu-hero {
    width: calc(100% - 24px);
    padding-top: 22px;
  }

  .eyebrow {
    gap: 8px;
    font-size: 9px;
    letter-spacing: 0.11em;
  }

  .eyebrow-line {
    width: 22px;
  }

  .game-logo {
    margin-top: 16px;
    font-size: clamp(4rem, 19vw, 6.8rem);
    letter-spacing: -0.062em;
  }

  .logo-badge {
    font-size: 0.34em;
  }

  .hero-tagline {
    font-size: 13px;
    line-height: 1.5;
  }

  .hero-features {
    gap: 8px;
    margin-top: 22px;
  }

  .feature {
    padding-top: 11px;
  }

  .feature-icon {
    width: 33px;
    height: 33px;
    flex-basis: 33px;
    margin-bottom: 7px;
  }

  .feature b {
    font-size: 9px;
  }

  .feature-icon-stack::before {
    left: 7px;
    top: 7px;
    box-shadow:
      8px 0 var(--cyan),
      8px 8px var(--pink),
      16px 8px var(--pink),
      0 16px var(--yellow);
  }

  .feature-icon-attack::before {
    inset: 7px;
  }

  .feature-icon-king::before {
    inset: 7px 8px 9px;
  }

  .menu-panel {
    margin-top: 25px;
    padding: 18px;
  }

  .panel-topline {
    font-size: 8px;
  }

  .field-label {
    margin-top: 18px;
  }

  .name-field {
    height: 46px;
  }

  .name-field input {
    font-size: 13px;
  }

  .button-quick {
    min-height: 61px;
    padding: 0 15px;
    margin-top: 11px;
  }

  .button-copy b {
    font-size: 15px;
  }

  .button-copy small {
    font-size: 8px;
  }

  .button-arrow {
    width: 31px;
    height: 31px;
  }

  .menu-choices {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 65px;
    padding: 10px;
  }

  .choice-card-join {
    min-height: 79px;
  }

  .choice-card small {
    font-size: 9.5px;
  }

  .split-rule {
    margin: 14px 0 10px;
  }

  .practice-link {
    margin-top: 10px;
    font-size: 8.5px;
  }

  .practice-link small {
    display: none;
  }

  .panel-foot {
    margin-top: 18px;
    padding-top: 11px;
    font-size: 7px;
  }

  .panel-foot span:last-child {
    display: none;
  }

  .menu-footer {
    width: calc(100% - 24px);
    padding-top: 18px;
  }

  .rule-card {
    gap: 10px;
  }

  .rule-number {
    font-size: 18px;
  }

  .rule-card b {
    font-size: 9.5px;
  }

  .rule-card p {
    font-size: 9.5px;
  }

  .menu-controls {
    font-size: 7px;
  }

  .queue-stage {
    width: calc(100% - 24px);
    padding-top: 30px;
  }

  .queue-copy h2 {
    font-size: clamp(2.6rem, 13vw, 4rem);
    margin-top: 16px;
  }

  .queue-status {
    font-size: 12px;
  }

  .queue-readout {
    margin-top: 25px;
    padding: 13px 0;
    gap: 14px;
  }

  .queue-number {
    font-size: 38px;
  }

  .queue-number-small {
    font-size: 30px;
  }

  .queue-readout small {
    font-size: 7.5px;
    max-width: 64px;
  }

  .queue-divider {
    height: 36px;
  }

  .queue-bot-note {
    font-size: 10px;
  }

  .queue-tips {
    width: calc(100% - 24px);
  }

  .queue-tip p {
    font-size: 9.5px;
  }

  .lobby-heading,
  .lobby-layout {
    width: calc(100% - 24px);
  }

  .lobby-heading h2 {
    font-size: 2.1rem;
  }

  .lobby-heading p {
    font-size: 10px;
  }

  .room-code-card {
    padding: 11px 13px;
  }

  .room-code-row strong {
    font-size: 22px;
    letter-spacing: 0.13em;
  }

  .copy-button span {
    display: none;
  }

  .copy-button {
    width: 27px;
    height: 27px;
    justify-content: center;
    padding: 0;
  }

  .room-code-card small {
    font-size: 8.5px;
  }

  .roster-grid,
  .empty-slots {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .roster-player {
    min-height: 55px;
    padding: 8px;
    gap: 8px;
  }

  .roster-avatar {
    flex-basis: 27px;
    width: 27px;
    height: 31px;
  }

  .roster-name {
    font-size: 9.5px;
  }

  .roster-role {
    font-size: 6.5px;
  }

  .roster-header {
    padding: 14px;
  }

  .roster-footer {
    padding: 10px 14px;
    font-size: 6.5px;
  }

  .roster-footer-note {
    display: none !important;
  }

  .host-card,
  .lobby-brief {
    padding: 15px;
  }

  .side-card-title {
    font-size: 9px;
  }

  .button-launch {
    min-height: 50px;
    font-size: 13px;
  }

  .lobby-brief li {
    font-size: 9px;
  }

  .game-topbar {
    flex-basis: 47px;
  }

  .game-brand-mark i:nth-child(2) {
    height: 13px;
  }

  .hud-metric {
    min-width: 45px;
    padding: 0 5px;
    gap: 3px;
  }

  .hud-metric span {
    font-size: 5.5px;
  }

  .hud-metric strong {
    font-size: 12px;
  }

  .hud-metric-speed {
    display: none;
  }

  .game-actions .sound-toggle {
    display: none;
  }

  .top-button {
    height: 27px;
    padding: 0 6px;
    font-size: 6px;
  }

  .battlefield {
    padding: 5px 0;
  }

  .arena-frame {
    grid-template-columns: clamp(49px, 16vw, 68px) minmax(0, 1fr) clamp(49px, 16vw, 68px);
    gap: 4px;
  }

  .playfield-shell {
    max-height: calc(100% - 26px);
  }

  .info-card {
    padding: 4px;
    gap: 3px;
  }

  .info-label {
    font-size: 5.5px;
  }

  .hold-canvas-wrap {
    border-color: transparent;
  }

  .info-card strong {
    font-size: 16px;
  }

  .badge-multiplier {
    font-size: 6px;
  }

  .board-underbar {
    min-height: 24px;
    padding: 0 4px;
    gap: 2px;
  }

  .board-underbar > div {
    gap: 3px;
  }

  .board-underbar span {
    font-size: 5px;
  }

  .board-underbar strong {
    font-size: 8px;
  }

  .target-panel {
    border-color: rgba(176, 194, 238, 0.055);
    padding: 4px;
    margin-top: 3px;
  }

  .target-current strong {
    font-size: 8px;
    max-width: 115px;
  }

  .target-kicker {
    font-size: 5px;
  }

  .target-mode-label {
    font-size: 5px;
  }

  .target-button {
    height: 25px;
    font-size: 5.8px;
    letter-spacing: 0;
  }

  .target-next-button {
    height: 25px;
    font-size: 5.8px;
  }

  .target-next-button svg {
    width: 10px;
    height: 10px;
  }

  .game-footer {
    margin-top: 2px;
  }

  .mobile-controls {
    gap: 4px;
  }

  .touch-button {
    height: 44px;
    border-color: rgba(176, 194, 238, 0.09);
  }

  .touch-button svg {
    width: 16px;
    height: 16px;
  }

  .touch-button span {
    font-size: 5px;
  }

  .kill-feed {
    top: 52px;
    width: min(270px, 80vw);
    gap: 2px;
  }

  .feed-item {
    font-size: 7px;
    padding: 4px 6px;
  }

  .ko-overlay strong {
    font-size: 3.3rem;
  }

  .results-card {
    max-height: 92vh;
    max-height: 92dvh;
  }

  .results-hero {
    padding: 21px 17px 15px;
  }

  .results-kicker {
    font-size: 7.5px;
  }

  .results-hero h2 {
    font-size: 2.4rem;
  }

  .results-subtitle {
    font-size: 10.5px;
  }

  .results-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .result-stat {
    padding: 10px;
  }

  .result-stat span {
    font-size: 6.5px;
  }

  .result-stat strong {
    font-size: 16px;
  }

  .results-standings-head {
    padding: 14px 15px 7px;
  }

  .results-standings {
    padding: 0 15px 8px;
  }

  .results-actions {
    padding: 11px 15px;
  }

  .standings-row {
    grid-template-columns: 24px minmax(0, 1fr) repeat(2, 38px);
    gap: 5px;
    font-size: 7.5px;
  }

  .standings-row.is-you .standings-name::after {
    display: none;
  }

  .modal-backdrop {
    padding: 10px;
  }
}

@media (max-width: 390px) {
  .game-logo {
    font-size: clamp(3.5rem, 18vw, 5.5rem);
  }

  .hero-features {
    grid-template-columns: 1fr 1fr;
  }

  .feature:last-child {
    display: none;
  }

  .choice-card b {
    font-size: 9.5px;
  }

  .choice-card small {
    font-size: 8.8px;
  }

  .name-field {
    height: 44px;
  }

  .queue-readout {
    gap: 9px;
  }

  .queue-number {
    font-size: 31px;
  }

  .queue-number-small {
    font-size: 26px;
  }

  .queue-divider {
    height: 30px;
  }

  .queue-readout small {
    font-size: 6.5px;
    max-width: 53px;
  }

  .mobile-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .touch-button {
    height: 42px;
  }

  .touch-button:nth-child(7) {
    grid-column: span 1;
  }

  .fight {
    display: none;
  }

  .hud-metric {
    min-width: 41px;
    padding: 0 4px;
  }
}

@media (max-height: 740px) and (min-width: 901px) {
  .game-topbar {
    flex-basis: 48px;
  }

  .battlefield {
    padding: 7px 0;
  }

  .target-panel {
    min-height: 52px;
    margin-top: 6px;
  }

  .target-button,
  .target-next-button {
    height: 28px;
  }

  .game-footer {
    min-height: 29px;
  }

  .key-hints {
    font-size: 6.5px;
  }

  .hold-canvas-wrap {
    aspect-ratio: 1;
  }

  .tab-panel {
    padding-top: 0;
  }
}

@media (max-height: 650px) and (max-width: 900px) {
  .game-topbar {
    flex-basis: 43px;
  }

  .battlefield {
    padding: 3px 0;
  }

  .target-panel {
    grid-template-rows: auto;
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.3fr) auto;
    margin-top: 2px;
  }

  .target-mode-buttons {
    grid-column: auto;
    grid-row: auto;
  }

  .target-next-button {
    grid-column: auto;
    grid-row: auto;
  }

  .touch-button {
    height: 37px;
  }

  .mobile-controls {
    padding-top: 0;
  }

  .game-footer {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
