* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #120a24;
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  color: #fff;
  user-select: none;
}
#app,
#app canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hidden {
  display: none !important;
}
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: radial-gradient(ellipse at 50% 40%, #2a1458, #0a0418 70%);
  z-index: 50;
  transition: opacity 0.45s ease, visibility 0.45s;
}
#loading.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#loading .logo-top {
  font-size: clamp(40px, 7vw, 84px);
}
#loading .logo-bottom {
  font-size: clamp(32px, 5.5vw, 64px);
}
.load-bar {
  width: min(320px, 60vw);
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.load-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #ffd34d, #ff6a2a);
  animation: loadbar 1.1s ease-in-out infinite;
}
@keyframes loadbar {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, rgba(40, 18, 80, 0.75), rgba(10, 4, 24, 0.92));
  z-index: 10;
  padding: 20px;
  text-align: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: screenin 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* screens fade in and settle, their contents rise in one after another */
@keyframes screenin {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
}
.screen > * {
  animation: risein 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.screen > :nth-child(2) {
  animation-delay: 0.04s;
}
.screen > :nth-child(3) {
  animation-delay: 0.08s;
}
.screen > :nth-child(4) {
  animation-delay: 0.12s;
}
.screen > :nth-child(n + 5) {
  animation-delay: 0.16s;
}
@keyframes risein {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen,
  .screen > *,
  #item-slot,
  #item-slot.got {
    animation: none !important;
  }
}
.ico {
  width: 1em;
  height: 1em;
  vertical-align: -0.16em;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}
.screen > :first-child {
  margin-top: auto;
}
.screen > :last-child {
  margin-bottom: auto;
}
.screen h2 {
  margin: 0 0 6px;
  font-size: 34px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #000;
}
button {
  font: inherit;
  font-weight: bold;
  font-size: 18px;
  padding: 10px 22px;
  border-radius: 12px;
  border: 3px solid #fff;
  background: #2a1a4f;
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.12s ease, background-color 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
button:hover,
button:focus-visible {
  background: #4b2d8f;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(255, 211, 77, 0.35), 0 8px 18px rgba(0, 0, 0, 0.35);
}
button:active {
  transform: translateY(1px) scale(0.98);
}
button.big {
  font-size: 24px;
  padding: 12px 40px;
  background: linear-gradient(#ffb43a, #ff6a2a);
  border-color: #fff3c4;
  color: #2a0d00;
  box-shadow: 0 5px 0 #8a2c00;
}
button.big:hover,
button.big:focus-visible {
  filter: brightness(1.1);
  box-shadow: 0 5px 0 #8a2c00, 0 0 0 3px rgba(255, 211, 77, 0.45), 0 10px 22px rgba(0, 0, 0, 0.4);
}
.logo {
  line-height: 0.9;
  font-weight: 900;
  font-style: italic;
  transform: skew(-8deg);
}
.logo-top {
  font-size: clamp(48px, 9vw, 110px);
  color: #ffd34d;
  text-shadow: 0 6px 0 #c4361d, 0 10px 18px rgba(0, 0, 0, 0.6);
  letter-spacing: 4px;
}
.logo-bottom {
  font-size: clamp(40px, 7vw, 86px);
  color: #5ee2ff;
  text-shadow: 0 6px 0 #2a3ba8, 0 10px 18px rgba(0, 0, 0, 0.6);
  letter-spacing: 18px;
}
.tag {
  font-size: 20px;
  margin: 4px 0 10px;
  opacity: 0.9;
}
.controls {
  margin-top: 10px;
  font-size: 15px;
  line-height: 2;
  opacity: 0.9;
}
.hint {
  max-width: 560px;
  opacity: 0.75;
  font-size: 14px;
}
kbd {
  display: inline-block;
  min-width: 26px;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 6px;
  background: #fff;
  color: #1b1035;
  font-weight: bold;
  font-family: inherit;
  box-shadow: 0 2px 0 #9a8fbf;
  line-height: 1.5;
}

/* ---------- select ---------- */
#roster {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 1180px;
}
.fighter {
  position: relative;
  width: 128px;
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  cursor: pointer;
  transition: transform 0.1s;
}
.fighter img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
}
.fighter .fname {
  font-weight: bold;
  font-size: 14px;
}
.fighter.sel {
  border-color: #ffd34d;
  background: rgba(255, 211, 77, 0.18);
  transform: translateY(-4px) scale(1.05);
}
#fighter-info {
  min-height: 170px;
  max-width: 640px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 30px;
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 14px 20px;
}
#fighter-info .head {
  grid-column: 1 / 3;
}
#fighter-info .head b {
  font-size: 24px;
}
#fighter-info .head i {
  opacity: 0.75;
  margin-left: 8px;
}
#fighter-info .blurb {
  grid-column: 1 / 3;
  opacity: 0.85;
  margin-bottom: 6px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.stat span {
  width: 70px;
}
.pips {
  display: flex;
  gap: 3px;
}
.pips i {
  width: 18px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.pips i.on {
  background: #ffd34d;
}
.special-line {
  grid-column: 1 / 3;
  margin-top: 4px;
  color: #ffb43a;
}
.special-line.ult-line {
  color: #ffe066;
}
/* kart picker: ◀ thumbnail + name ▶ */
.kart-pick {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kart-pick > button {
  font-size: 20px;
  padding: 8px 14px;
}
.kart-pick {
  flex-wrap: wrap;
  justify-content: center;
}
.kart-pick .kart-match {
  flex-basis: 100%;
  justify-content: center;
  margin: 0;
  font-size: 14px;
}
.kart-pick.locked > button {
  opacity: 0.3;
  pointer-events: none;
}
.kart-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 4px 16px 4px 4px;
  text-align: left;
}
.kart-card img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
}
.kart-card small {
  display: block;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}
.kart-card b {
  font-size: 18px;
}
.kart-card b i {
  display: block;
  font-weight: normal;
  font-size: 13px;
  opacity: 0.75;
}
.kart-card {
  max-width: 560px;
  padding: 6px 16px 8px 6px;
}
.kart-card img {
  width: 110px;
  height: 110px;
  flex: none;
}
.kart-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
  margin: 6px 0 4px;
}
.kart-stats .stat span {
  width: 64px;
}
.kart-passive {
  font-size: 13px;
  line-height: 1.3;
  color: #9fe7ff;
}
.kart-passive b {
  font-size: 13px;
  color: #6fd8ff;
  margin-right: 4px;
}
.select-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* ---------- results ---------- */
#results-table {
  border-collapse: collapse;
  font-size: 18px;
  min-width: 420px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  overflow: hidden;
}
#results-table th,
#results-table td {
  padding: 8px 16px;
  text-align: left;
}
#results-table th {
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#results-table tr.me td {
  background: rgba(255, 211, 77, 0.2);
  font-weight: bold;
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 2px 0 #000, 0 0 8px rgba(0, 0, 0, 0.6);
}
#btn-ff {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  font-size: 16px;
  padding: 8px 18px;
  z-index: 6;
}
#btn-ff.on {
  background: #ffd34d;
  color: #1b1035;
}
#hud-tl {
  position: absolute;
  top: 14px;
  left: 18px;
  font-weight: 900;
  font-style: italic;
}
#hud-pos {
  font-size: 64px;
  line-height: 1;
  color: #ffd34d;
}
#hud-pos span {
  font-size: 26px;
}
#hud-lap {
  font-size: 26px;
}
#hud-time {
  font-size: 18px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
#hud-tr {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
#item-slot {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: radial-gradient(circle at 50% 35%, rgba(120, 80, 220, 0.55), rgba(24, 10, 52, 0.85) 70%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 10px 18px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  font-size: 52px;
  overflow: hidden;
}
#item-slot.rolling {
  border-color: #ffd34d;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 211, 77, 0.6);
}
#item-slot.rolling #item-icon {
  animation: roll 0.07s linear infinite;
}
@keyframes roll {
  from {
    transform: translateY(-40%);
    filter: blur(1.5px);
  }
  to {
    transform: translateY(40%);
    filter: blur(1.5px);
  }
}
#item-slot.got {
  animation: gotitem 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes gotitem {
  from {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
  }
}
#item-icon {
  display: grid;
  place-items: center;
}
#item-name {
  font-size: 14px;
  font-weight: bold;
}
.meter {
  position: relative;
  width: 180px;
  height: 22px;
  border-radius: 11px;
  border: 2px solid #fff;
  background: rgba(30, 14, 60, 0.75);
  overflow: hidden;
}
#basic-bar {
  height: 18px;
  width: 150px;
}
.meter .fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #7a3cff, #ff4fd8);
}
#basic-bar .fill {
  background: linear-gradient(90deg, #2a8fbf, #5ee2ff);
}
.meter.ready .fill {
  background: linear-gradient(90deg, #ffb43a, #ffe066);
}
#basic-bar.charging {
  border-color: #fff3c4;
}
#basic-bar.charging .fill {
  background: linear-gradient(90deg, #ff8a3a, #ffe066);
}
#basic-bar.charged {
  box-shadow: 0 0 12px #ffd34d;
  animation: charged-pulse 0.25s ease-in-out infinite alternate;
}
#basic-bar.charged .fill {
  background: linear-gradient(90deg, #ffe066, #ffffff);
}
@keyframes charged-pulse {
  to {
    box-shadow: 0 0 20px #fff3c4;
  }
}
#special-bar.ult {
  width: 230px;
  height: 28px;
  border-color: #fff3c4;
  box-shadow: 0 0 14px #ffd34d;
}
#special-bar.ult .fill {
  width: 100% !important;
  background: linear-gradient(90deg, #ff4f4f, #ffb43a, #ffe066, #5eff8a, #5ee2ff, #b16cff, #ff4f4f);
  background-size: 200% 100%;
  animation: rainbow 1s linear infinite;
}
#special-bar.ult span {
  line-height: 24px;
  font-size: 13px;
  color: #1b1035;
  text-shadow: none;
}
@keyframes rainbow {
  to {
    background-position: 200% 0;
  }
}
.meter span {
  position: relative;
  font-size: 12px;
  font-weight: bold;
  line-height: 18px;
  display: block;
  text-align: center;
}
#minimap {
  width: 170px;
  height: 170px;
  margin-top: 6px;
  opacity: 0.9;
}
#hud-speed {
  position: absolute;
  right: 22px;
  bottom: 120px;
  font-weight: 900;
  font-style: italic;
  text-align: right;
}
#speed-num {
  font-size: 42px;
}
#hud-speed small {
  font-size: 14px;
  margin-left: 4px;
}
#drift-meter {
  height: 8px;
  width: 0;
  margin-left: auto;
  border-radius: 4px;
  transition: width 0.05s;
}
#center-msg {
  position: absolute;
  top: 32%;
  width: 100%;
  text-align: center;
  font-size: 96px;
  font-weight: 900;
  font-style: italic;
  color: #ffd34d;
  text-shadow: 0 6px 0 #c4361d, 0 10px 20px rgba(0, 0, 0, 0.6);
}
#center-msg.pop {
  animation: pop 0.35s ease-out;
}
@keyframes pop {
  from {
    transform: scale(1.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
#ult-banner {
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  padding: 10px 0 14px;
  text-align: center;
  font-style: italic;
  font-weight: 900;
  opacity: 0;
  transform: skewY(-3deg);
}
#ult-banner.show {
  animation: ultin 1.8s ease-out forwards;
}
#ult-banner .ult-who {
  font-size: 22px;
  letter-spacing: 4px;
  text-transform: uppercase;
}
#ult-banner .ult-name {
  font-size: 60px;
  color: #ffe066;
  text-shadow: 0 5px 0 #000, 0 0 20px rgba(255, 220, 80, 0.8);
}
@keyframes ultin {
  0% {
    opacity: 0;
    transform: skewY(-3deg) translateX(-60%);
  }
  15% {
    opacity: 1;
    transform: skewY(-3deg) translateX(0);
  }
  80% {
    opacity: 1;
    transform: skewY(-3deg) translateX(0);
  }
  100% {
    opacity: 0;
    transform: skewY(-3deg) translateX(40%);
  }
}
#sub-msg {
  position: absolute;
  top: 50%;
  width: 100%;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
}
#feed {
  position: absolute;
  left: 18px;
  top: 190px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
  font-weight: bold;
}
#feed div {
  background: linear-gradient(90deg, rgba(20, 8, 40, 0.8), rgba(20, 8, 40, 0.45));
  border-left: 3px solid #ffd34d;
  border-radius: 4px 10px 10px 4px;
  padding: 4px 12px 4px 9px;
  animation: slidein 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  backdrop-filter: blur(4px);
}
#feed .ico {
  margin-right: 4px;
}
@keyframes slidein {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
}
#cards {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 200px 0 10px;
}
.card {
  width: 104px;
  border-radius: 10px;
  background: rgba(20, 8, 40, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 4px 6px 2px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.card.me {
  border-color: #ffd34d;
}
.card.out {
  opacity: 0.4;
}
.card .cname {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .cdmg {
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.05;
}
.card .cdmg small {
  font-size: 16px;
}
.card .ckos {
  font-size: 10px;
  opacity: 0.8;
}
.card .stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.card.shake {
  animation: shake 0.25s;
}
@keyframes shake {
  25% {
    transform: translate(-3px, 1px);
  }
  50% {
    transform: translate(3px, -1px);
  }
  75% {
    transform: translate(-2px, 0);
  }
}
@media (max-width: 800px) {
  #cards {
    padding: 0 10px;
  }
  .card {
    width: 84px;
  }
  #hud-speed {
    display: none;
  }
}

/* ---------- online lobby ---------- */
.title-buttons {
  display: flex;
  gap: 14px;
}
button.big.alt {
  background: linear-gradient(#5ee2ff, #2a7bd8);
  border-color: #d8f6ff;
  color: #071a33;
  box-shadow: 0 5px 0 #173c7a;
}
.online-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
#online input {
  font: inherit;
  font-size: 18px;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 10px;
  border: 3px solid #fff;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  width: 180px;
  user-select: text;
}
#net-code {
  width: 120px !important;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
}
.or {
  opacity: 0.7;
}
.mini-roster {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.mini-roster .fighter {
  width: 84px;
  padding: 3px;
}
.mini-roster .fighter .fname {
  font-size: 11px;
}
#net-room {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 12px 24px;
  min-width: 320px;
}
#net-code-show {
  font-size: 18px;
}
#net-code-show b {
  font-size: 40px;
  letter-spacing: 8px;
  color: #ffd34d;
  display: block;
}
#net-players {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  text-align: left;
  font-size: 17px;
  line-height: 1.7;
}
#net-status {
  min-height: 1.2em;
  color: #9fe8ff;
  margin: 0;
}
#results-wait {
  opacity: 0.85;
}

/* ---------- settings ---------- */
#btn-settings {
  margin-top: 4px;
}
#settings {
  justify-content: flex-start;
  padding: 28px 16px;
  overflow-y: auto;
}
.settings-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  width: min(980px, 96vw);
}
.settings-panel section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.settings-panel section.wide {
  grid-column: 1 / -1;
}
.settings-panel h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd84a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.setting {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting > label {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}
.setting label b {
  color: #ffd84a;
}
.setting input[type='range'] {
  width: 100%;
  accent-color: #ffd84a;
}
.settings-panel small,
.settings-panel .note {
  opacity: 0.7;
  line-height: 1.4;
  font-size: 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: #ffd84a;
}
.seg {
  display: flex;
  gap: 6px;
}
.seg button {
  flex: 1;
  padding: 7px 0;
  font-size: 14px;
}
.seg button.on {
  background: #ffd84a;
  color: #2a1440;
}
button.small {
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
#key-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 6px 18px;
}
.key-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.key-row span {
  flex: 1;
  font-weight: 700;
}
.key-row button {
  min-width: 82px;
  padding: 5px 8px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
.key-row button.listening {
  background: #ffd84a;
  color: #2a1440;
}

/* ---------- results podium ---------- */
#results {
  overflow-y: auto;
  justify-content: flex-start;
  padding-top: 24px;
}
#results-title {
  font-size: 46px;
  letter-spacing: 0.06em;
  margin: 4px 0 0;
}
#results-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
}
.podium {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 55%, transparent), rgba(10, 4, 24, 0.85) 75%);
  border: 3px solid color-mix(in srgb, var(--c) 70%, white);
  box-shadow: 0 0 28px color-mix(in srgb, var(--c) 45%, transparent);
  animation: podium-in 0.5s ease-out both;
}
.podium img {
  width: 170px;
  height: 170px;
}
.podium.p1 img {
  width: 250px;
  height: 250px;
}
.podium.p1 {
  animation-delay: 0.25s;
}
.podium-place {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 38px;
  font-weight: 900;
  font-style: italic;
  color: #ffd84a;
  text-shadow: 3px 3px 0 #2a1440;
}
.podium.p1 .podium-place {
  font-size: 56px;
}
.podium-place small {
  font-size: 0.45em;
}
.podium-name {
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.podium.p1 .podium-name {
  font-size: 24px;
}
.podium-who {
  font-size: 13px;
  opacity: 0.75;
}
@keyframes podium-in {
  from {
    transform: translateY(40px) scale(0.9);
    opacity: 0;
  }
}

/* ---------- gamepad focus ---------- */
.pad-focus {
  outline: 4px solid #ffffff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(255, 120, 40, 0.9), 0 0 22px rgba(255, 216, 74, 0.8);
}
.fighter.pad-focus {
  outline-offset: 1px;
}

/* ---------- race setup ---------- */
.setup-panel {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  width: min(1100px, 96vw);
  max-height: 70vh;
}
.setup-rules {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.transfer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}
.transfer-row input[type='text'] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  font: 13px monospace;
}
.setup-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.setup-pair .seg button {
  padding-left: 6px;
  padding-right: 6px;
}
.setup-desc {
  margin: 4px 0 0;
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.4;
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
}
.map-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(20, 10, 40, 0.75);
}
.map-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  display: block;
}
.map-card .mname {
  font-size: 17px;
}
.map-card .mblurb {
  font-size: 12px;
  font-weight: normal;
  opacity: 0.8;
  line-height: 1.3;
}
.map-card.on {
  border-color: #ffd84a;
  box-shadow: 0 0 0 3px rgba(255, 216, 74, 0.5);
}
.cup-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.cup-thumbs img {
  aspect-ratio: 16 / 10;
}
#net-rules {
  font-size: 15px;
  opacity: 0.9;
  margin: 4px 0;
}

/* ---------- stocks + grand prix ---------- */
.card .cstock {
  font-size: 11px;
  letter-spacing: 1px;
  color: #ffd84a;
  min-height: 13px;
}
.card.elim {
  opacity: 0.35;
  filter: grayscale(1);
}
#results-sub {
  font-size: 18px;
  opacity: 0.9;
  margin-top: -8px;
}
.results-tables {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}
#results-gp {
  border-collapse: collapse;
  font-size: 17px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  overflow: hidden;
}
#results-gp th,
#results-gp td {
  padding: 7px 14px;
  text-align: left;
}
#results-gp th {
  background: rgba(255, 216, 74, 0.2);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#results-gp tr.me td {
  background: rgba(255, 211, 77, 0.2);
  font-weight: bold;
}
#results-gp td.plus {
  color: #9dff8a;
  font-size: 14px;
}
@media (max-width: 760px) {
  .setup-panel {
    grid-template-columns: 1fr;
  }
}
/* Grand Prix results carry a second table, so shrink the podium to fit */
#results.compact {
  gap: 8px;
}
#results.compact .podium img {
  width: 110px;
  height: 110px;
}
#results.compact .podium.p1 img {
  width: 160px;
  height: 160px;
}
#results.compact .podium-place {
  font-size: 28px;
}
#results.compact .podium.p1 .podium-place {
  font-size: 40px;
}
#results.compact #results-table,
#results.compact #results-gp {
  font-size: 15px;
}
#results.compact #results-table td,
#results.compact #results-gp td {
  padding: 5px 12px;
}

/* ---------- touch controls ---------- */
#touch {
  display: none;
}
body.touch #touch {
  display: block;
}
body.touch .controls {
  display: none;
}
#touch .t-steer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46%;
  height: 62%;
  pointer-events: auto;
  touch-action: none;
}
#touch .t-base {
  position: absolute;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 8, 40, 0.25);
  opacity: 0;
  transition: opacity 0.15s;
}
#touch .t-base.on {
  opacity: 1;
}
#touch .t-base::before,
#touch .t-base::after {
  content: '◀';
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  opacity: 0.6;
  font-size: 14px;
}
#touch .t-base::after {
  content: '▶';
  left: auto;
  right: 8px;
}
#touch .t-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}
#touch .t-steer::after {
  content: 'slide to steer';
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 12px;
  opacity: 0.45;
  white-space: nowrap;
}
#touch .t-btn {
  pointer-events: auto;
  touch-action: none;
  position: absolute;
  border-radius: 50%;
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.6);
  background: rgba(30, 14, 60, 0.55);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}
#touch .t-btn.down {
  transform: scale(0.92);
  background: rgba(255, 211, 77, 0.6);
}
#touch .t-pad {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 250px;
  height: 230px;
}
#touch .t-drift {
  right: 18px;
  bottom: 22px;
  width: 92px;
  height: 92px;
  font-size: 15px;
  background: rgba(94, 160, 255, 0.5);
}
#touch .t-brake {
  right: 124px;
  bottom: 14px;
  width: 66px;
  height: 66px;
}
#touch .t-basic {
  right: 118px;
  bottom: 92px;
  width: 70px;
  height: 70px;
  background: rgba(255, 122, 58, 0.5);
}
#touch .t-special {
  right: 40px;
  bottom: 126px;
  width: 70px;
  height: 70px;
  background: rgba(200, 80, 255, 0.5);
}
#touch .t-item {
  right: 190px;
  bottom: 150px;
  width: 58px;
  height: 58px;
  background: rgba(80, 200, 120, 0.5);
}
#touch .t-dodge {
  right: 194px;
  bottom: 84px;
  width: 54px;
  height: 54px;
  font-size: 11px;
  background: rgba(190, 232, 255, 0.35);
}
#touch .t-pause {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
}
#touch .t-pause.down {
  transform: translateX(-50%) scale(0.92);
}
/* make room for the buttons: speed and cards move out of their way */
body.touch #hud-speed {
  right: 50%;
  transform: translateX(50%);
  bottom: 8px;
  text-align: center;
}
body.touch #cards {
  bottom: auto;
  top: 60px;
  padding: 0 150px;
}
body.touch #feed {
  display: none;
}

/* ---------- small screens (phones) ---------- */
@media (max-height: 560px), (max-width: 760px) {
  .screen {
    padding: 10px 12px;
    gap: 8px;
  }
  .screen > * {
    flex-shrink: 0;
  }
  .screen h2 {
    font-size: 22px;
  }
  button {
    font-size: 15px;
    padding: 8px 16px;
  }
  button.big {
    font-size: 18px;
    padding: 10px 22px;
  }
  .logo-top {
    font-size: clamp(36px, 9vh, 70px);
  }
  .logo-bottom {
    font-size: clamp(30px, 7vh, 56px);
    letter-spacing: 10px;
  }
  .tag {
    font-size: 14px;
    margin: 0;
  }
  .hint,
  .controls {
    font-size: 12px;
  }
  /* fighter select: one scrolling row of fighters, compact info */
  #roster {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    max-width: 100%;
    gap: 8px;
    padding: 6px 4px;
    scrollbar-width: none;
  }
  .fighter {
    width: 72px;
    flex: none;
    padding: 3px;
    border-radius: 10px;
  }
  .fighter .fname {
    font-size: 11px;
  }
  .fighter.sel {
    transform: none;
  }
  #fighter-info {
    min-height: 0;
    padding: 8px 12px;
    gap: 2px 16px;
    font-size: 12px;
  }
  #fighter-info .head b {
    font-size: 17px;
  }
  #fighter-info .blurb {
    display: none;
  }
  .special-line {
    font-size: 12px;
  }
  .kart-card {
    min-width: 220px;
  }
  .kart-card img {
    width: 40px;
    height: 40px;
  }
  .kart-pick > button {
    padding: 4px 12px;
  }
  .stat {
    font-size: 12px;
  }
  .pips i {
    width: 14px;
    height: 8px;
  }
  .kart-card b {
    font-size: 14px;
  }
  .kart-card img {
    width: 56px;
    height: 56px;
  }
  .kart-stats {
    gap: 0 10px;
    margin: 2px 0;
  }
  .kart-passive,
  .kart-passive b {
    font-size: 11px;
  }
  .select-actions {
    position: sticky;
    bottom: -10px;
    padding: 6px 0 10px;
    width: 100%;
    justify-content: center;
    background: linear-gradient(transparent, rgba(20, 10, 45, 0.85) 40%);
  }
  /* race setup */
  .setup-panel {
    grid-template-columns: 210px 1fr;
    gap: 10px;
    max-height: none;
    height: calc(100vh - 110px);
  }
  .setup-rules {
    padding: 8px 10px;
    gap: 6px;
    overflow-y: auto;
  }
  .setup-desc {
    font-size: 11px;
  }
  .seg button {
    font-size: 12px;
    padding: 6px 8px;
  }
  .map-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
  }
  .map-card .mblurb {
    display: none;
  }
  /* HUD */
  #hud-tl {
    top: 8px;
    left: 10px;
  }
  #hud-pos {
    font-size: 40px;
  }
  #hud-pos span {
    font-size: 16px;
  }
  #hud-lap {
    font-size: 16px;
  }
  #hud-time {
    font-size: 12px;
  }
  #hud-tr {
    top: 8px;
    right: 10px;
  }
  #item-slot {
    width: 54px;
    height: 54px;
    border-width: 3px;
    border-radius: 12px;
    font-size: 30px;
  }
  .meter {
    transform: scale(0.8);
    transform-origin: right center;
  }
  #minimap {
    width: 104px;
    height: 104px;
  }
  #speed-num {
    font-size: 26px;
  }
  #center-msg {
    font-size: 48px !important;
  }
  #cards {
    gap: 4px;
    padding: 0 120px;
  }
  .card {
    width: 70px;
    padding: 2px 3px 1px;
    font-size: 10px;
  }
  .card .cdmg {
    font-size: 18px;
  }
  .card .cname {
    font-size: 9px;
  }
  .settings-panel {
    max-height: none;
  }
  #results-podium {
    transform: scale(0.7);
    margin: -30px 0;
  }
}
/* phones held upright: ask for landscape */
#rotate {
  display: none;
}
@media (orientation: portrait) and (max-width: 600px) {
  body.touch #rotate {
    display: grid;
    position: fixed;
    inset: 0;
    z-index: 60;
    place-items: center;
    background: #120a24;
    font-size: 20px;
    text-align: center;
    padding: 30px;
  }
}

/* mouse steering: where the wheel is */
#mouse-wheel {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 240px;
  height: 8px;
  margin-left: -120px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
#mouse-wheel::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 2px;
  height: 14px;
  background: rgba(255, 255, 255, 0.5);
}
#mouse-wheel i {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 14px;
  height: 16px;
  margin-left: -7px;
  border-radius: 4px;
  background: #ffd34d;
  box-shadow: 0 0 8px rgba(255, 211, 77, 0.8);
}
body.mouse-steer #mouse-wheel {
  display: block;
}
body.touch #mouse-wheel {
  display: none;
}
#keys-mode {
  font-size: 12px;
  opacity: 0.7;
  font-weight: normal;
}

/* Settings > Items: one toggle chip per item */
#item-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.item-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  opacity: 0.5;
  filter: grayscale(0.85);
  transition: opacity 0.15s, filter 0.15s, border-color 0.15s, transform 0.1s;
}
.item-chip:active {
  transform: scale(0.97);
}
.item-chip.on {
  opacity: 1;
  filter: none;
  border-color: #ffd84a;
  background: rgba(255, 216, 74, 0.12);
  box-shadow: 0 0 12px rgba(255, 216, 74, 0.25);
}
.item-chip .chip-ico {
  font-size: 34px;
  line-height: 0;
  flex: none;
}
.item-chip .chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.item-chip b {
  font-size: 14px;
}
.item-chip small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.75;
  line-height: 1.3;
}
.h3-btns {
  display: flex;
  gap: 6px;
}
#item-picker-count {
  margin-left: 8px;
  font-size: 11px;
  color: #fff;
  opacity: 0.6;
  letter-spacing: 0.04em;
}

/* ---------- trophies ---------- */
.title-small {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
#btn-trophies small {
  opacity: 0.75;
  font-size: 13px;
  margin-left: 4px;
}
#trophies {
  justify-content: flex-start;
  padding: 28px 16px;
}
#trophy-count {
  font-size: 18px;
  color: #ffd84a;
  vertical-align: middle;
  margin-left: 6px;
}
.acct {
  width: min(980px, 96vw);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.acct p {
  margin: 0;
  line-height: 1.4;
}
.acct-note,
.acct-state {
  opacity: 0.75;
  font-size: 14px;
}
.acct-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.acct-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
}
.acct-fields input {
  font: inherit;
  font-size: 16px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 2px solid #fff;
  background: #1a1035;
  color: #fff;
  width: 200px;
  max-width: 80vw;
}
.acct-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.acct-btns .primary {
  background: #ffd84a;
  color: #2a1440;
}
.acct-btns .danger {
  background: #ff5a4a;
  color: #fff;
}
.acct-msg {
  color: #ffd84a;
  font-weight: 700;
}
.rec-code {
  font-family: ui-monospace, monospace;
  font-size: 26px;
  letter-spacing: 3px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #000;
  border: 2px dashed #ffd84a;
  user-select: all;
}
#trophy-tabs {
  width: min(480px, 96vw);
}
#trophy-list {
  width: min(980px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 8px;
}
.ach {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  text-align: left;
  opacity: 0.72;
}
.ach.got {
  opacity: 1;
  background: linear-gradient(90deg, rgba(255, 216, 74, 0.22), rgba(0, 0, 0, 0.25));
  box-shadow: inset 0 0 0 1px rgba(255, 216, 74, 0.5);
}
.ach-icon {
  font-size: 24px;
  filter: grayscale(1);
}
.ach.got .ach-icon {
  filter: none;
}
.ach-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.ach-text span,
.ach-text small {
  font-size: 12px;
  opacity: 0.8;
}
.ach-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  margin-top: 3px;
}
.ach-bar i {
  display: block;
  height: 100%;
  background: #ffd84a;
}
.ach-group {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, transparent), rgba(255, 255, 255, 0.05));
  border: 2px solid color-mix(in srgb, var(--c) 50%, transparent);
}
.ach-group.mastered {
  border-color: #ffd84a;
  box-shadow: 0 0 22px rgba(255, 216, 74, 0.45);
}
.ach-group h3 {
  margin: 0 0 4px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ach-reward {
  margin: 0 0 8px;
  font-size: 13px;
  opacity: 0.8;
  text-align: left;
}
.ach-group.mastered .ach-reward {
  color: #ffd84a;
  opacity: 1;
}
#trophy-note {
  opacity: 0.65;
  font-size: 12px;
}
.fighter .master-star {
  position: absolute;
  top: 4px;
  right: 6px;
  color: #ffd84a;
  text-shadow: 0 0 6px #ff9a2e, 0 2px 0 #000;
  font-size: 18px;
}
#ach-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 60;
  min-width: 260px;
  max-width: min(440px, 92vw);
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3a1f6e, #1a0c35);
  border: 2px solid #ffd84a;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 216, 74, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#ach-toast.show {
  transform: translate(-50%, 0);
}
#ach-toast .toast-head {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffd84a;
}
#ach-toast span {
  font-size: 13px;
  opacity: 0.85;
}
#ach-toast .toast-master {
  margin-top: 4px;
  font-weight: 700;
  color: #fff3a0;
  text-shadow: 0 0 8px #ff9a2e;
}
#ach-toast.master {
  border-color: #fff3a0;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 216, 74, 0.8);
}
.kart-star {
  color: #ffd84a;
  text-shadow: 0 0 6px #ff9a2e;
}

/* =====================================================================
   Menu theme: one look for every menu screen (title, setup, select,
   online, settings, trophies, pause, results). Later rules here override
   the older per-screen styles above. HUD and touch controls are untouched.
   ===================================================================== */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(vendor/fonts/rubik-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Rubik';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(vendor/fonts/rubik-latin-italic.woff2) format('woff2');
}
:root {
  --ui-font: 'Rubik', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --ui-text: #f5f1ff;
  --ui-muted: rgba(232, 224, 255, 0.66);
  --ui-faint: rgba(232, 224, 255, 0.42);
  --ui-panel: rgba(18, 10, 40, 0.72);
  --ui-panel-2: rgba(255, 255, 255, 0.045);
  --ui-line: rgba(255, 255, 255, 0.11);
  --ui-line-2: rgba(255, 255, 255, 0.2);
  --ui-gold: #ffd34d;
  --ui-orange: #ff7a2a;
  --ui-cyan: #5ee2ff;
  --ui-radius: 16px;
  --ui-shadow: 0 18px 40px rgba(4, 0, 16, 0.45);
}
html,
body {
  font-family: var(--ui-font);
}

/* ---- screen frame ---- */
.screen {
  color: var(--ui-text);
  gap: 16px;
  padding: 28px 24px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(94, 50, 190, 0.38), transparent 60%),
    radial-gradient(90% 70% at 50% 110%, rgba(255, 106, 42, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(14, 6, 34, 0.78), rgba(8, 3, 20, 0.93));
  backdrop-filter: blur(3px);
}
/* a faint diagonal speed-stripe texture over every menu */
.screen::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(-62deg, rgba(255, 255, 255, 0.022) 0 2px, transparent 2px 22px);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
  z-index: -1;
}
.screen h2 {
  position: relative;
  margin: 0 0 4px;
  padding-bottom: 12px;
  font-size: 36px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.4);
}
.screen h2::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 64px;
  height: 4px;
  margin-left: -32px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-orange));
  transform: skewX(-24deg);
  box-shadow: 0 0 14px rgba(255, 160, 50, 0.55);
}

/* ---- buttons ---- */
.screen button {
  font-family: var(--ui-font);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1.5px solid var(--ui-line-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
  color: var(--ui-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.22);
}
.screen button:hover,
.screen button:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 211, 77, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 3px rgba(255, 211, 77, 0.18), 0 8px 18px rgba(0, 0, 0, 0.32);
}
.screen button.big {
  font-size: 19px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.08em;
  padding: 13px 34px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffc65a 0%, #ff8a2e 55%, #f2601e 100%);
  color: #2a0d00;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(120, 30, 0, 0.35), 0 5px 0 #8a2c00, 0 10px 22px rgba(255, 106, 42, 0.28);
}
.screen button.big:hover,
.screen button.big:focus-visible {
  filter: brightness(1.08) saturate(1.05);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(120, 30, 0, 0.35), 0 5px 0 #8a2c00, 0 0 0 3px rgba(255, 211, 77, 0.4), 0 14px 28px rgba(255, 106, 42, 0.35);
}
.screen button.big.alt {
  background: linear-gradient(180deg, #8af0ff 0%, #3cb6f4 55%, #2a7bd8 100%);
  color: #04163a;
  text-shadow: 0 1px 0 rgba(220, 250, 255, 0.6);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(0, 30, 90, 0.3), 0 5px 0 #173c7a, 0 10px 22px rgba(60, 180, 244, 0.25);
}
.screen button.big.alt:hover,
.screen button.big.alt:focus-visible {
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(0, 30, 90, 0.3), 0 5px 0 #173c7a, 0 0 0 3px rgba(94, 226, 255, 0.4), 0 14px 28px rgba(60, 180, 244, 0.32);
}
.screen button.small {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 9px;
  gap: 6px;
}
.screen button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
/* button icons: data-icon="name" before the label, data-icon-after after it */
[data-icon]::before,
[data-icon-after]::after {
  content: '';
  flex: none;
  width: 1.05em;
  height: 1.05em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
[data-icon='back'] { --icon: var(--i-back); }
[data-icon='next'],
[data-icon-after='next'] { --icon: var(--i-next); }
[data-icon='play'] { --icon: var(--i-play); }
[data-icon='globe'] { --icon: var(--i-globe); }
[data-icon='gear'] { --icon: var(--i-gear); }
[data-icon='trophy'] { --icon: var(--i-trophy); }
[data-icon='restart'] { --icon: var(--i-restart); }
[data-icon='fighter'] { --icon: var(--i-fighter); }
[data-icon='map'] { --icon: var(--i-map); }
[data-icon='home'] { --icon: var(--i-home); }
[data-icon='check'] { --icon: var(--i-check); }
[data-icon='host'] { --icon: var(--i-host); }
[data-icon-after]::after { --icon: var(--i-next); }
.screen button.icon-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
}

/* ---- panels: one surface for every grouped block ---- */
.settings-panel section,
.setup-rules,
#fighter-info,
.kart-card,
.acct,
#net-room,
.online-panel,
.pause-card,
#results-table,
#results-gp {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)), var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--ui-shadow);
}
.settings-panel h3,
.ach-group h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ui-gold);
}
.settings-panel h3 {
  padding-bottom: 10px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--ui-line);
  gap: 10px;
}
.settings-panel small,
.settings-panel .note,
.note {
  color: var(--ui-muted);
  opacity: 1;
}

/* ---- segmented controls ---- */
.seg {
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--ui-line);
}
.screen .seg button {
  flex: 1;
  padding: 8px 6px;
  font-size: 13px;
  letter-spacing: 0.03em;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ui-muted);
  box-shadow: none;
  transform: none;
}
.screen .seg button:hover,
.screen .seg button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ui-text);
  box-shadow: none;
  transform: none;
}
.screen .seg button.on {
  background: linear-gradient(180deg, #ffe07a, #ffc23a);
  color: #2a1440;
  box-shadow: 0 2px 8px rgba(255, 196, 58, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---- labels, sliders, switches ---- */
.setting > label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ui-text);
}
.setting label b {
  color: var(--ui-gold);
  font-variant-numeric: tabular-nums;
}
.screen input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.screen input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-orange));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.screen input[type='range']::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
}
.screen input[type='range']::-moz-range-progress {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-orange));
}
.screen input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ui-orange);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.screen input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ui-orange);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.screen input[type='range']:focus-visible {
  outline: none;
}
.screen input[type='range']:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(255, 211, 77, 0.35);
}
/* checkboxes become switches; the hint text sits under the label */
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 1px;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
}
.check small {
  grid-column: 2;
  font-weight: 400;
}
.check input[type='checkbox'] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  grid-row: span 2;
  align-self: start;
  margin: 0;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.check input[type='checkbox']::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s cubic-bezier(0.3, 0.7, 0.3, 1.2);
}
.check input[type='checkbox']:checked {
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-orange));
  box-shadow: none;
}
.check input[type='checkbox']:checked::before {
  transform: translateX(16px);
}
.check input[type='checkbox']:focus-visible {
  outline: 2px solid var(--ui-gold);
  outline-offset: 2px;
}
.check:has(input:only-of-type):not(:has(small)) input {
  grid-row: auto;
  align-self: center;
}
/* text fields */
.screen input[type='text'],
.screen input[type='password'],
.screen input:not([type]),
#online input {
  font-family: var(--ui-font);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.5px solid var(--ui-line-2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ui-text);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.screen input[type='text']:focus,
.screen input[type='password']:focus,
.screen input:not([type]):focus,
#online input:focus {
  border-color: var(--ui-gold);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 211, 77, 0.2);
}
.screen input::placeholder {
  color: var(--ui-faint);
}
kbd {
  font-family: var(--ui-font);
  font-size: 0.82em;
  font-weight: 700;
  border-radius: 6px;
  padding: 0 6px;
  min-width: 22px;
  text-align: center;
  background: #f5f1ff;
  color: #1b1035;
  box-shadow: 0 2px 0 #8f84b8;
}

/* ---- action bars ---- */
.select-actions {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.sticky-actions {
  position: sticky;
  bottom: -28px;
  z-index: 2;
  display: flex;
  justify-content: center;
  width: calc(100% + 48px);
  margin: 0 -24px -28px;
  padding: 18px 0 22px;
  background: linear-gradient(180deg, transparent, rgba(8, 3, 20, 0.92) 45%);
}

/* ---- title ---- */
#title {
  gap: 12px;
}
#title .logo {
  filter: drop-shadow(0 0 40px rgba(255, 160, 60, 0.25));
  margin-bottom: 2px;
}
#title .logo-top,
#loading .logo-top {
  font-weight: 900;
  background: linear-gradient(180deg, #fff6c8 0%, #ffd34d 45%, #ffa02a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 6px 0 #c4361d) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}
#title .logo-bottom,
#loading .logo-bottom {
  font-weight: 900;
  background: linear-gradient(180deg, #e8fbff 0%, #5ee2ff 50%, #2aa8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 6px 0 #2a3ba8) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}
#title .tag {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ui-muted);
  opacity: 1;
  margin: 2px 0 14px;
}
.title-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(340px, 86vw);
}
.title-menu > button.big {
  width: 100%;
  font-size: 21px;
  padding: 15px 20px;
}
.title-small {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}
.title-small button {
  width: 100%;
  padding: 11px 10px;
}
#btn-settings {
  margin-top: 0;
}
#btn-trophies small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255, 211, 77, 0.18);
  color: var(--ui-gold);
  opacity: 1;
  margin-left: 0;
}
.hint {
  color: var(--ui-muted);
  opacity: 1;
  font-size: 13px;
  line-height: 1.5;
}
.hint.tip {
  margin-top: 12px;
  padding: 9px 16px;
  border-radius: 40px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--ui-line);
}
.hint.tip::before {
  content: 'TIP';
  display: inline-block;
  margin-right: 10px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #2a1440;
  background: var(--ui-gold);
  vertical-align: 1px;
}

/* ---- race setup ---- */
.setup-panel {
  gap: 18px;
  width: min(1180px, 96vw);
  grid-template-columns: 320px 1fr;
}
.setup-rules {
  gap: 14px;
  padding: 18px;
}
.setup-desc {
  color: var(--ui-muted);
  opacity: 1;
  padding-top: 10px;
  border-top: 1px solid var(--ui-line);
}
.map-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding: 6px;
  align-content: start;
}
.screen .map-card {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 4px;
  padding: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-panel);
  font-style: normal;
  font-weight: 700;
  text-align: left;
}
.screen .map-card img {
  border-radius: 0;
  margin-bottom: 6px;
  transition: transform 0.25s ease;
}
.screen .map-card:hover img {
  transform: scale(1.04);
}
.map-card .mname,
.map-card .mblurb {
  padding: 0 12px;
}
.map-card .mname {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.map-card .mblurb {
  color: var(--ui-muted);
  opacity: 1;
}
.screen .map-card.on {
  border-color: var(--ui-gold);
  box-shadow: 0 0 0 2px var(--ui-gold), 0 0 26px rgba(255, 211, 77, 0.35);
  background: linear-gradient(180deg, rgba(255, 211, 77, 0.12), rgba(255, 211, 77, 0.02)), var(--ui-panel);
}
.screen .map-card.on::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ui-gold) var(--i-check) center / 15px no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.cup-thumbs {
  gap: 2px;
}
.cup-thumbs img {
  margin-bottom: 0 !important;
}

/* ---- fighter select ---- */
#roster {
  gap: 10px;
}
.fighter {
  --c: #8a7ad8;
  width: 118px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--ui-line);
  background: radial-gradient(90% 70% at 50% 35%, color-mix(in srgb, var(--c) 42%, transparent), transparent 75%), var(--ui-panel);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.fighter:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 70%, white);
}
.fighter img {
  padding: 4px 4px 0;
}
.fighter .fname {
  padding: 5px 4px 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, #120a24), color-mix(in srgb, var(--c) 25%, #120a24));
  border-top: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
}
.fighter.sel {
  border-color: var(--ui-gold);
  background: radial-gradient(90% 70% at 50% 35%, color-mix(in srgb, var(--c) 60%, transparent), transparent 80%), rgba(40, 22, 80, 0.9);
  box-shadow: 0 0 0 2px var(--ui-gold), 0 0 24px rgba(255, 211, 77, 0.45), 0 10px 22px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px) scale(1.04);
}
.fighter.sel .fname {
  background: linear-gradient(90deg, #ffe07a, #ffb43a);
  color: #2a1440;
  border-top-color: transparent;
}
#fighter-info {
  --c: #ffd34d;
  width: min(720px, 96vw);
  max-width: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-left: 4px solid var(--c);
}
#fighter-info .head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#fighter-info .head b {
  font-size: 26px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--c);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}
#fighter-info .head i {
  margin: 0;
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  color: var(--ui-muted);
  opacity: 1;
}
#fighter-info .blurb {
  color: var(--ui-muted);
  opacity: 1;
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.45;
}
.special-line {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: baseline;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--ui-line);
  color: var(--ui-text);
  font-size: 14px;
  line-height: 1.4;
}
.special-line .move-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffb43a;
  white-space: nowrap;
}
.special-line.ult-line .move-tag {
  color: #ffe066;
}
.special-line .move-tag kbd {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
.special-line .move-text b {
  color: #fff;
  margin-right: 4px;
}
.special-line .move-text {
  color: var(--ui-muted);
}
.special-line.ult-line {
  color: inherit;
}
.kart-pick {
  gap: 12px;
}
.kart-card {
  min-width: 360px;
  padding: 8px 18px 10px 8px;
  gap: 14px;
}
.kart-card img {
  border-radius: 11px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.25));
}
.kart-card small {
  color: var(--ui-faint);
  opacity: 1;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.kart-card b {
  font-size: 19px;
  font-weight: 800;
}
.kart-card b i {
  color: var(--ui-muted);
  opacity: 1;
  font-style: normal;
  font-weight: 500;
}
.stat span {
  color: var(--ui-muted);
  font-weight: 600;
  font-size: 13px;
}
.pips {
  gap: 3px;
}
.pips i {
  width: 16px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.13);
  transform: skewX(-20deg);
}
.pips i.on {
  background: linear-gradient(180deg, #ffe07a, #ffb43a);
  box-shadow: 0 0 6px rgba(255, 196, 58, 0.45);
}
.kart-passive {
  color: #a8ecff;
}
.kart-passive b {
  color: var(--ui-cyan);
}
.kart-pick .kart-match {
  display: inline-grid;
  flex-basis: auto;
  width: 100%;
  justify-content: center;
  color: var(--ui-muted);
}

/* ---- online lobby ---- */
#online {
  gap: 14px;
}
.online-name label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ui-muted);
}
#online input {
  font-size: 17px;
}
#net-name-note {
  color: var(--ui-muted);
  font-size: 12px;
}
#net-actions {
  padding: 12px 14px;
  border-radius: var(--ui-radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ui-line);
}
.or {
  color: var(--ui-faint);
  opacity: 1;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mini-roster .fighter {
  width: 78px;
}
.mini-roster .fighter .fname {
  font-size: 10px;
  padding: 3px 2px 4px;
}
#net-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 26px;
  min-width: min(420px, 94vw);
}
#net-code-show {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ui-muted);
}
#net-code-show b {
  margin-top: 4px;
  padding: 4px 18px 6px;
  border-radius: 12px;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ui-gold);
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 211, 77, 0.5);
  user-select: all;
}
#net-rules {
  color: var(--ui-muted);
  opacity: 1;
  font-size: 14px;
}
#net-players {
  width: 100%;
  margin: 2px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#net-players li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}
#net-players li i {
  margin-left: auto;
  font-style: normal;
  font-weight: 500;
  font-size: 13px;
  color: var(--ui-muted);
}
#net-status {
  color: var(--ui-cyan);
  font-weight: 600;
}

/* ---- settings ---- */
#settings,
#trophies {
  padding: 28px 24px;
}
.settings-panel {
  gap: 16px;
  width: min(1020px, 96vw);
}
.settings-panel section {
  gap: 12px;
  padding: 16px 20px 18px;
}
#item-picker {
  gap: 10px;
}
.screen .item-chip {
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ui-line);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: none;
  font-style: normal;
  letter-spacing: 0;
}
.screen .item-chip.on {
  border-color: rgba(255, 211, 77, 0.8);
  background: linear-gradient(180deg, rgba(255, 211, 77, 0.16), rgba(255, 211, 77, 0.05));
  box-shadow: 0 0 14px rgba(255, 211, 77, 0.18);
}
.item-chip b {
  font-weight: 700;
}
.item-chip small {
  color: var(--ui-muted);
  opacity: 1;
}
#item-picker-count {
  color: var(--ui-muted);
  opacity: 1;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}
.key-row {
  padding: 4px 4px 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}
.key-row span {
  font-weight: 600;
  font-size: 14px;
}
.screen .key-row button {
  min-width: 90px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 8px;
  background: #f5f1ff;
  color: #1b1035;
  border: 0;
  box-shadow: 0 2px 0 #8f84b8;
}
.screen .key-row button:hover,
.screen .key-row button:focus-visible {
  background: #fff;
  box-shadow: 0 2px 0 #8f84b8, 0 0 0 3px rgba(255, 211, 77, 0.35);
}
.screen .key-row button.listening {
  background: linear-gradient(180deg, #ffe07a, #ffc23a);
  color: #2a1440;
  animation: listen 0.9s ease-in-out infinite;
}
@keyframes listen {
  50% {
    box-shadow: 0 2px 0 #a8781a, 0 0 0 5px rgba(255, 211, 77, 0.35);
  }
}
.transfer-row input[type='text'] {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}
#keys-mode {
  color: var(--ui-muted);
  opacity: 1;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ---- trophies + accounts ---- */
#trophy-count {
  display: inline-block;
  vertical-align: 8px;
  margin-left: 8px;
  padding: 3px 12px;
  border-radius: 30px;
  font-size: 15px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2a1440;
  background: linear-gradient(180deg, #ffe07a, #ffc23a);
  text-shadow: none;
}
.acct {
  padding: 16px 20px;
  gap: 12px;
}
.acct p {
  color: var(--ui-text);
}
.acct-note,
.acct-state {
  color: var(--ui-muted);
  opacity: 1;
}
.acct-fields label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-muted);
}
.acct-fields input {
  font-size: 16px;
  width: 210px;
}
.screen .acct-btns .primary {
  border-color: transparent;
  background: linear-gradient(180deg, #ffe07a, #ffc23a);
  color: #2a1440;
}
.screen .acct-btns .danger {
  border-color: transparent;
  background: linear-gradient(180deg, #ff7a6a, #e8303a);
  color: #fff;
}
.acct-msg {
  color: var(--ui-gold);
}
.rec-code {
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px dashed var(--ui-gold);
  color: var(--ui-gold);
}
#trophy-tabs {
  width: min(460px, 96vw);
}
.ach-grid {
  gap: 10px;
}
.ach {
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ui-line);
  opacity: 1;
}
.ach:not(.got) b {
  color: var(--ui-muted);
}
.ach.got {
  background: linear-gradient(90deg, rgba(255, 211, 77, 0.2), rgba(255, 211, 77, 0.03));
  border-color: rgba(255, 211, 77, 0.55);
  box-shadow: none;
}
.ach-icon {
  font-size: 30px;
  line-height: 0;
  filter: none;
  opacity: 0.6;
}
.ach.got .ach-icon {
  opacity: 1;
}
.ach-text span,
.ach-text small {
  color: var(--ui-muted);
  opacity: 1;
}
.ach-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
}
.ach-bar i {
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-orange));
  border-radius: 3px;
}
.ach-group {
  padding: 16px 18px;
  border-radius: var(--ui-radius);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%), var(--ui-panel);
}
.ach-group h3 {
  color: var(--ui-text);
  align-items: baseline;
}
.ach-group h3 small {
  color: var(--ui-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.ach-reward {
  color: var(--ui-muted);
  opacity: 1;
}
#trophy-note {
  color: var(--ui-faint);
  opacity: 1;
}
#ach-toast {
  border-radius: 16px;
  border: 1px solid rgba(255, 211, 77, 0.8);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent), linear-gradient(135deg, #3a1f6e, #160a30);
}
#ach-toast .toast-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
}
#ach-toast .toast-head .ico {
  font-size: 18px;
}

/* ---- pause ---- */
#pause {
  backdrop-filter: blur(8px);
}
.pause-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(340px, 90vw);
  padding: 24px 24px 26px;
}
.pause-card h2 {
  margin-bottom: 10px;
}
.pause-card button {
  width: 100%;
}
.pause-card button.big {
  margin-bottom: 8px;
}

/* ---- results ---- */
#results {
  padding-top: 28px;
  gap: 14px;
}
#results-title {
  font-size: 48px;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(180deg, #fff6c8, #ffd34d 55%, #ffa02a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 0 rgba(120, 30, 0, 0.9)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
}
#results-sub {
  margin-top: -2px;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ui-muted);
  opacity: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ui-line);
}
.podium {
  border-radius: 18px;
  border-width: 1.5px;
}
.podium-name {
  font-weight: 900;
  font-style: italic;
}
.podium-who {
  color: var(--ui-muted);
  opacity: 1;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}
#results-table,
#results-gp {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
#results-table th,
#results-gp th {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
#results-gp th {
  color: var(--ui-gold);
}
#results-table td,
#results-gp td {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#results-table tr:last-child td,
#results-gp tr:last-child td {
  border-bottom: 0;
}
#results-table td:first-child,
#results-gp td:first-child {
  font-weight: 900;
  font-style: italic;
  color: var(--ui-muted);
  width: 1%;
}
#results-table tr:nth-child(2) td:first-child,
#results-gp tr:nth-child(2) td:first-child {
  color: var(--ui-gold);
}
#results-table tr.me td,
#results-gp tr.me td {
  background: linear-gradient(90deg, rgba(255, 211, 77, 0.24), rgba(255, 211, 77, 0.08));
  color: #fff;
}
#results-table tr.me td:first-child,
#results-gp tr.me td:first-child {
  box-shadow: inset 3px 0 0 var(--ui-gold);
}
.swatch {
  border-radius: 4px;
}
#results-wait {
  color: var(--ui-muted);
  opacity: 1;
  font-weight: 600;
}

/* ---- rotate prompt ---- */
#rotate > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
#rotate .rotate-ico {
  font-size: 88px;
  line-height: 0;
}
#rotate p {
  margin: 0;
}

/* ---- gamepad focus: same ring everywhere ---- */
.screen .pad-focus {
  outline: 3px solid #fff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(255, 140, 50, 0.75), 0 0 24px rgba(255, 211, 77, 0.7);
}

/* ---- small screens and phones in landscape ---- */
@media (max-height: 560px), (max-width: 760px) {
  .screen {
    padding: 12px 14px;
    gap: 9px;
  }
  .screen h2 {
    font-size: 22px;
    padding-bottom: 8px;
  }
  .screen h2::after {
    width: 44px;
    height: 3px;
    margin-left: -22px;
  }
  .screen button {
    font-size: 13px;
    padding: 8px 14px;
    gap: 7px;
  }
  .screen button.big {
    font-size: 16px;
    padding: 10px 22px;
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(120, 30, 0, 0.35), 0 4px 0 #8a2c00;
  }
  .screen button.big.alt {
    box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(0, 30, 90, 0.3), 0 4px 0 #173c7a;
  }
  .screen button.icon-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  /* title: logo on the left, menu on the right, so it fits a short screen */
  #title {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: 1fr auto auto 1fr;
    column-gap: 36px;
    row-gap: 4px;
    justify-content: center;
    align-items: center;
  }
  #title > * {
    margin: 0 !important;
  }
  #title .logo {
    grid-column: 1;
    grid-row: 2;
  }
  #title .tag {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    font-size: 13px;
    max-width: 300px;
  }
  .title-menu {
    grid-column: 2;
    grid-row: 2 / 4;
    width: 250px;
    gap: 9px;
  }
  .title-menu > button.big {
    font-size: 17px;
    padding: 11px 16px;
  }
  .hint.tip {
    grid-column: 1 / 3;
    grid-row: 4;
    align-self: start;
    margin-top: 10px !important;
    font-size: 11px;
    padding: 6px 12px;
  }
  .setup-panel {
    grid-template-columns: 230px 1fr;
    gap: 10px;
    height: calc(100vh - 116px);
  }
  .setup-rules {
    padding: 10px 12px;
    gap: 8px;
  }
  .setting > label,
  .check {
    font-size: 12px;
  }
  .screen .seg button {
    font-size: 11px;
    padding: 6px 4px;
  }
  .map-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
  .map-card .mname {
    font-size: 13px;
  }
  .screen .map-card {
    padding-bottom: 8px;
  }
  .screen .map-card.on::after {
    width: 20px;
    height: 20px;
    background-size: 12px;
  }
  .fighter {
    width: 70px;
    border-radius: 10px;
  }
  .fighter .fname {
    font-size: 9px;
    padding: 3px 2px 4px;
  }
  .fighter.sel {
    transform: none;
  }
  #fighter-info {
    padding: 8px 14px;
    gap: 4px;
  }
  #fighter-info .head b {
    font-size: 17px;
  }
  #fighter-info .head i {
    font-size: 12px;
  }
  .special-line {
    grid-template-columns: 84px 1fr;
    gap: 8px;
    padding-top: 4px;
    font-size: 11px;
  }
  .special-line .move-tag,
  .special-line .move-tag kbd {
    font-size: 9px;
  }
  .kart-card {
    min-width: 0;
    padding: 4px 12px 6px 4px;
  }
  .kart-card b {
    font-size: 14px;
  }
  .sticky-actions {
    bottom: -12px;
    width: calc(100% + 28px);
    margin: 0 -14px -12px;
    padding: 10px 0 12px;
  }
  .select-actions {
    background: linear-gradient(transparent, rgba(8, 3, 20, 0.9) 40%);
  }
  #settings,
  #trophies {
    padding: 12px 14px;
  }
  .settings-panel section {
    padding: 12px 14px;
  }
  #net-code-show b {
    font-size: 30px;
  }
  #net-room {
    padding: 12px 16px;
  }
  .pause-card {
    padding: 16px 18px;
    gap: 8px;
  }
  #results-title {
    font-size: 28px;
  }
  #results-sub {
    font-size: 12px;
    padding: 4px 12px;
  }
  #results-table,
  #results-gp {
    font-size: 13px;
    min-width: 0;
  }
  #results-table th,
  #results-gp th,
  #results-table td,
  #results-gp td {
    padding: 5px 10px;
  }
}

/* screens scroll instead of squashing their contents into each other */
.screen > * {
  flex-shrink: 0;
}
/* a hidden toast must sit fully off screen (it used to peek out at the top) */
#ach-toast {
  transform: translate(-50%, calc(-100% - 40px));
}
#ach-toast.show {
  transform: translate(-50%, 0);
}

/* fighter select on big screens: roster on the left, details on the right */
@media (min-width: 1100px) and (min-height: 620px) {
  #select {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(0, 560px);
    grid-template-rows: 1fr auto auto auto auto auto 1fr;
    grid-template-areas: '. .' 'h h' 'roster info' 'roster kart' 'roster guests' 'act act' '. .';
    column-gap: 28px;
    row-gap: 16px;
    justify-content: center;
  }
  #select > * {
    margin: 0 !important;
  }
  #select h2 {
    grid-area: h;
  }
  #select #roster {
    grid-area: roster;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-content: start;
    gap: 12px;
  }
  #select .fighter {
    width: auto;
  }
  #select #fighter-info {
    grid-area: info;
    width: auto;
    align-self: stretch;
  }
  #select .kart-pick {
    grid-area: kart;
    flex-wrap: nowrap;
    display: grid;
    grid-template-columns: auto 1fr auto;
  }
  #select .kart-card {
    min-width: 0;
  }
  #select .kart-match {
    grid-column: 1 / -1;
  }
  #select .select-actions {
    grid-area: act;
  }
  #select #guest-strip {
    grid-area: guests;
    justify-content: flex-start;
    align-content: start;
  }
  #select .guest-card {
    min-width: 0;
    flex: 1 1 240px;
  }
}
/* the race HUD steps back while the results are up */
#hud {
  transition: opacity 0.3s ease;
}
body:has(#results:not(.hidden)) #hud {
  opacity: 0;
}

/* ---- fixes from review ---- */
#title {
  backdrop-filter: none;
}
.map-grid {
  grid-auto-rows: max-content;
}
.kart-card .kart-passive b {
  font-size: 13px;
  font-weight: 700;
}
#select .kart-card {
  width: 100%;
  max-width: none;
}
.special-line .move-text b {
  margin-right: 0;
}
.key-row span {
  text-align: left;
}
#pad-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 6px 18px;
}
#online .check input[type='checkbox'] {
  width: 38px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
#online .check input[type='checkbox']:checked {
  background: linear-gradient(90deg, var(--ui-gold), var(--ui-orange));
  box-shadow: none;
}
/* kart picker: arrows either side of the card at every size */
.kart-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 560px) auto;
  justify-content: center;
}
.kart-pick .kart-card {
  width: 100%;
  min-width: 0;
}
.kart-pick .kart-match {
  grid-column: 1 / -1;
}
@media (max-height: 560px), (max-width: 760px) {
  .kart-pick {
    gap: 8px;
  }
  #title .logo-top {
    font-size: clamp(40px, 13vh, 76px);
  }
  #title .logo-bottom {
    font-size: clamp(32px, 10vh, 60px);
  }
}
@media (max-height: 560px), (max-width: 760px) {
  .mini-roster {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    max-width: 100%;
    padding: 4px;
    scrollbar-width: none;
  }
  .mini-roster .fighter {
    flex: none;
    width: 62px;
  }
}

/* ---- time trials: results card, records screen, HUD ---- */
#hud-pos.trial {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}
#hud-pos.trial span {
  font-size: 14px;
  letter-spacing: 0.12em;
  vertical-align: middle;
}
#results.trial #results-table {
  display: none;
}
#results.trial #results-podium {
  align-items: stretch;
  flex-wrap: wrap;
  width: min(1020px, 96vw);
}
.tt-card {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  font-variant-numeric: tabular-nums;
}
.tt-board {
  flex: 1 1 420px;
}
.tt-big {
  font-size: 54px;
  font-weight: 900;
  font-style: italic;
  color: var(--ui-gold);
  line-height: 1;
}
.tt-pb {
  color: var(--ui-muted);
  font-weight: 600;
  margin: 0;
}
.tt-card h3,
.rec-title {
  margin: 0;
  font-style: italic;
  font-weight: 900;
}
.rec-title small {
  color: var(--ui-muted);
  font-size: 14px;
  margin-left: 6px;
}
.tt-splits,
.tt-table {
  border-collapse: collapse;
  width: 100%;
}
.tt-splits td,
.tt-table td,
.tt-table th {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}
.tt-table th {
  color: var(--ui-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tt-table td:first-child {
  font-weight: 900;
  font-style: italic;
  color: var(--ui-muted);
  width: 1%;
}
.tt-table tr.me td {
  background: rgba(255, 211, 77, 0.18);
  color: #fff;
}
.tt-table tr.tt-gap td {
  text-align: center;
  color: var(--ui-faint);
  padding: 2px;
}
.tt-dim {
  color: var(--ui-muted);
  font-size: 13px;
}
.tt-card .up,
.tt-splits .up {
  color: #5ef58a;
}
.tt-card .down,
.tt-splits .down {
  color: #ff8a6a;
}
.tt-msg {
  margin: 0;
  color: var(--ui-gold);
  font-weight: 700;
}
.tt-note {
  margin: 0;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.4;
}
#records {
  justify-content: flex-start;
  padding: 28px 16px;
  gap: 12px;
  overflow-y: auto;
}
#rec-laps {
  width: min(420px, 96vw);
}
.rec-wrap {
  display: flex;
  gap: 14px;
  width: min(1100px, 96vw);
  align-items: flex-start;
}
.rec-maps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  flex: 1 1 52%;
}
.rec-map {
  padding: 6px;
  gap: 4px;
}
.rec-map .mname {
  font-size: 14px;
}
.rec-map .rec-pb {
  color: var(--ui-gold);
  opacity: 1;
  font-variant-numeric: tabular-nums;
}
.rec-map.on {
  border-color: #ffd84a;
  box-shadow: 0 0 0 3px rgba(255, 216, 74, 0.45);
}
.rec-board {
  flex: 1 1 48%;
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
}
@media (max-height: 560px) {
  .rec-board {
    position: static;
  }
  .rec-maps {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .tt-table .tt-dim:last-child {
    display: none;
  }
}
@media (max-width: 760px) {
  .rec-wrap {
    flex-direction: column-reverse;
  }
  .rec-board {
    position: static;
    width: 100%;
  }
  .rec-maps {
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .tt-big {
    font-size: 40px;
  }
  .tt-table .tt-dim:last-child {
    display: none;
  }
}

/* ---------- split-screen (2 to 4 players on one screen) ---------- */
body.split #hud-tl,
body.split #item-slot,
body.split #item-name,
body.split #basic-bar,
body.split #special-bar,
body.split #hud-speed,
body.split #cards,
body.split #mouse-wheel {
  display: none !important;
}
/* the shared minimap sits where the views meet */
body.split #hud-tr {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  z-index: 2;
}
body.split #minimap {
  width: 130px;
  height: 130px;
  margin: 0;
  background: rgba(20, 8, 40, 0.55);
  border-radius: 50%;
}
/* three players: the empty quarter holds a bigger map */
body.split[data-views='3'] #hud-tr {
  left: 75%;
  top: 75%;
}
body.split[data-views='3'] #minimap {
  width: 220px;
  height: 220px;
  background: none;
}
body.split #center-msg {
  font-size: 64px;
  top: 50%;
  transform: translateY(-50%);
}
body.split #sub-msg {
  top: calc(50% + 46px);
}
body.split #feed {
  top: auto;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  font-size: 13px;
  z-index: 3;
}
#split-hud {
  display: none;
}
body.split #split-hud {
  display: block;
  position: absolute;
  inset: 0;
}
.split-view {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(0, 0, 0, 0.7);
  font-weight: 900;
  font-style: italic;
}
.split-view.out {
  background: rgba(0, 0, 0, 0.25);
}
.split-view > div {
  position: absolute;
}
.sv-tl {
  top: 8px;
  left: 12px;
}
.sv-tag {
  font-size: 14px;
  font-style: normal;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.sv-pos {
  font-size: 44px;
  line-height: 1;
  color: #ffd34d;
}
.sv-pos span {
  font-size: 18px;
}
.sv-lap {
  font-size: 17px;
}
.sv-tr {
  top: 8px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.sv-item {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: radial-gradient(circle at 50% 35%, rgba(120, 80, 220, 0.55), rgba(24, 10, 52, 0.85) 70%);
  display: grid;
  place-items: center;
}
.sv-item svg {
  width: 40px;
  height: 40px;
}
.sv-item.rolling {
  opacity: 0.75;
}
.sv-itemname {
  font-size: 12px;
  font-style: normal;
}
.sv-bl {
  bottom: 8px;
  left: 12px;
}
.sv-dmg {
  font-size: 46px;
  line-height: 1;
}
.sv-dmg small {
  font-size: 20px;
}
.sv-br {
  bottom: 10px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(210px, 42%);
}
.sv-meter {
  position: relative;
  height: 18px;
  border-radius: 9px;
  background: rgba(20, 8, 40, 0.7);
  overflow: hidden;
  font-size: 11px;
  font-style: normal;
}
.sv-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(255, 255, 255, 0.3);
}
.sv-meter.ready i {
  background: var(--c);
}
.sv-meter.charging i {
  background: #ffd34d;
}
.sv-meter.ult i {
  background: linear-gradient(90deg, #ff4fd8, #ffd34d);
}
.sv-meter span {
  position: relative;
  padding: 0 8px;
  line-height: 18px;
  white-space: nowrap;
}
.sv-meter kbd,
.sv-itemname kbd {
  font-size: 10px;
  padding: 0 4px;
}
/* phones and short screens: smaller numbers */
@media (max-height: 560px) {
  .sv-pos,
  .sv-dmg {
    font-size: 30px;
  }
  .sv-item {
    width: 42px;
    height: 42px;
  }
  .sv-meter {
    display: none;
  }
}

/* fighter select: friends joining for split-screen */
#guest-strip {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.guest-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  padding: 6px 12px 6px 6px;
  border-radius: 12px;
  border: 2px solid var(--c, rgba(255, 255, 255, 0.25));
  background: rgba(0, 0, 0, 0.35);
  text-align: left;
}
.guest-card img {
  width: 44px;
  height: 44px;
}
.guest-card b {
  display: block;
}
.guest-card small {
  opacity: 0.8;
  font-size: 12px;
}
.guest-card.ready {
  background: rgba(255, 211, 77, 0.16);
}
.guest-card.empty {
  border-style: dashed;
  opacity: 0.7;
}
.guest-tag {
  font-weight: 900;
  font-style: italic;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c, rgba(255, 255, 255, 0.2));
}
.guest-badges {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
}
.guest-badges i {
  font-style: normal;
  font-weight: 900;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 6px;
  background: #fff;
  color: #1b1035;
  outline: 2px solid var(--c);
}
body.touch #guest-strip { display: none; }
#guest-strip:empty {
  display: none;
}
/* four players: keep each view's inner corner clear of the shared minimap */
body.split[data-views='4'] .split-view:nth-child(1) .sv-br,
body.split[data-views='4'] .split-view:nth-child(3) .sv-tr {
  right: 64px;
}
body.split[data-views='4'] .split-view:nth-child(2) .sv-bl,
body.split[data-views='4'] .split-view:nth-child(4) .sv-tl {
  left: 64px;
}
body.split[data-views='4'] #minimap {
  width: 110px;
  height: 110px;
}
.guest-card.empty b {
  display: inline;
}
