/* Beat Battle — minimal flat UI */

@font-face {
  font-family: "Pixeled";
  src: url("font/Pixeled.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BodyPixelFont";
  src: url("font/Pixellari.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --red: #e02020;
  --red-bright: #ff2a2a;
  --text: #f0f0f0;
  --text-muted: #9a9a9a;
  --text-heading: #ffffff;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pixeled", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  line-height: 1.45;
  background: var(--bg);
  overflow-x: hidden;
  text-transform: uppercase;
}

/* Keep natural casing for names, codes, errors, and editable fields */
input,
textarea,
select,
.auth-corner-name,
.name-with-rank,
.lb-player,
.results-winner-name,
.mp-chat-who,
.server-code,
.lobby-id,
.lobby-name,
.slide-player,
.lobby-wave-toast-name,
.app-error-toast-msg,
.app-error-toast-meta,
.mp-presence-toast-text,
.rank-up-title,
.dev-stats-panel__card,
.credits-entry-name,
.credits-entry-role {
  text-transform: none;
}

input.lobby-code-input {
  text-transform: uppercase;
}

.page {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1.25rem, 4vw, 2.2rem);
}

.header {
  text-align: center;
  margin-bottom: 2.7rem;
}

.title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.9rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-heading);
}

.subtitle {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.field-inline {
  width: min(340px, 100%);
}

.field-label {
  display: block;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

#spice {
  flex: 1;
  accent-color: var(--red);
}

.field-value {
  min-width: 2.1rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-heading);
}

.toolbar-actions {
  min-height: 2.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.btn,
.btn-primary,
.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  padding: 0.66rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: #141414;
  color: var(--text-heading);
}

.btn:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red-bright);
  color: #0a0a0a;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  text-align: center;
  min-height: 1.35rem;
  margin: 0 0 1.2rem;
  color: var(--text-heading);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 1rem;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: rgba(224, 32, 32, 0.4);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.62rem;
}

.card-title {
  margin: 0;
  flex: 1;
  color: var(--text-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-download {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-heading);
  background: #0c0c0c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card-download:hover {
  border-color: var(--red);
  background: #141414;
}

.waveform-wrap {
  width: 100%;
  height: 72px;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.15s ease;
}

.waveform-wrap:hover {
  border-color: rgba(224, 32, 32, 0.45);
}

.waveform-wrap.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a8a82;
  font-size: 0.75rem;
}

/* Structured kit layout (solo cook + multiplayer cook) */
.kit-layout {
  --kit-row-min: 146px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.kit-band--synth,
.kit-band--drums {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.kit-band--drums {
  gap: 0.75rem;
}

.kit-divider {
  height: 1px;
  margin: 0;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.kit-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kit-section-heading {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-heading);
  opacity: 0.88;
}

.kit-row {
  display: grid;
  gap: 0.5rem;
  align-items: stretch;
  min-height: var(--kit-row-min);
}

.kit-row--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.kit-row--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kit-row--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kit-layout .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.65rem;
}

.kit-layout .card-head {
  flex-shrink: 0;
  margin-bottom: 0.38rem;
}

.kit-layout .waveform-wrap {
  flex: 1 1 auto;
  min-height: max(68px, calc(var(--kit-row-min) - 4.35rem));
  height: auto;
}

audio {
  display: none;
}

/* --- App shell & multiplayer screens --- */

.app-root {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.8rem) clamp(1rem, 3vw, 1.75rem);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Tighter page gutters when kit preview is shown (solo / cook) */
.app-root:has(#mp-sound-grid),
.app-root:has(#sound-grid:not(.hidden)) {
  padding-inline: clamp(0.55rem, 2vw, 1.2rem);
  padding-block: clamp(0.85rem, 2.5vw, 2rem);
}

/* Reserve space for fixed .mp-chat (log + composer + quick row); default ~13.5rem. */
body.mp-chat-open .app-root {
  padding-bottom: max(13.5rem, calc(2.8rem + env(safe-area-inset-bottom, 0px)));
}

/* Kit grid last row (e.g. 808) sits low — extra scroll room so it clears the chat. */
body.mp-chat-open .app-root:has(#mp-sound-grid),
body.mp-chat-open .app-root:has(#sound-grid:not(.hidden)) {
  padding-bottom: max(19rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
}

/* Fixed match chat (lobby → results) */
.mp-chat {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  padding: 0.5rem clamp(0.65rem, 3vw, 1.25rem) max(0.5rem, env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.mp-chat-inner {
  pointer-events: auto;
  max-width: 1020px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 6, 6, 0.97);
  padding: 0.55rem 0.65rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-transform: none;
}

.mp-chat-inner .mp-chat-send {
  text-transform: none;
}

.mp-chat-label {
  margin: 0;
  font-size: 0.58rem;
  font-family: "Pixeled", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.mp-chat-log {
  max-height: 5.5rem;
  overflow-y: auto;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text);
  padding: 0.15rem 0.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-chat-empty {
  margin: 0.2rem 0;
  text-align: center;
  font-size: 0.65rem;
}

.mp-chat-line {
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.mp-chat-line--emoji {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mp-chat-who {
  color: var(--text-muted);
  margin-right: 0.35rem;
  font-family: "Pixeled", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.mp-chat-text {
  color: var(--text-heading);
  font-family: "BodyPixelFont", "Segoe UI", system-ui, sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
}

.mp-chat-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.mp-chat-err {
  margin: 0;
  font-size: 0.62rem;
  min-height: 0.9rem;
}

.mp-chat-composer {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
}

/* Override .arcade-input (later in file: width 100% / max-width 320px / margin-bottom). */
.mp-chat-composer .mp-chat-input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  margin-bottom: 0;
}

.mp-chat-send {
  flex: 0 0 auto;
  align-self: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.62rem;
}

.mp-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-start;
}

.mp-chat-emoji-btn {
  min-width: 1.95rem;
  min-height: 1.95rem;
  font-size: 1rem;
}

.screen {
  position: relative;
  width: 100%;
}

/* Short menu screens — vertical center in viewport */
.screen--vert-center {
  margin-block: auto;
}

.home-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
}

/* Fixed height so translateY bob stays inside the box (transform doesn’t affect flex gap). */
.home-chili-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 7.5rem;
  flex-shrink: 0;
}

.home-chili {
  display: block;
  width: min(24rem, 136vw);
  height: auto;
  max-height: 11rem;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  user-select: none;
  animation: home-chili-float 2.4s ease-in-out infinite;
}

@keyframes home-chili-float {
  0%,
  100% {
    transform: translate3d(0, 14px, 0);
  }
  50% {
    transform: translate3d(0, -18px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-chili {
    animation: none;
  }
}

.arcade-panel {
  position: relative;
  background: #0c0c0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.arcade-title {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-heading);
}

.arcade-tagline {
  text-align: center;
  color: var(--text-muted);
  margin: 0.75rem 0 1.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.arcade-heading {
  margin: 0 0 1rem;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-heading);
}

.spice-toggle-hint {
  margin-top: -0.35rem;
  margin-bottom: 0.75rem;
}

.arcade-hint,
.arcade-status {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.arcade-error {
  color: var(--red);
  font-size: 0.72rem;
  min-height: 1rem;
  margin: 0.5rem 0 0;
}

/* Global error toasts (bug reports: Ref / Code) */
.app-error-toast-host {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(92vw, 22rem);
  pointer-events: none;
}

.app-error-toast {
  pointer-events: auto;
  border: 1px solid rgba(220, 72, 72, 0.4);
  background: rgba(10, 8, 8, 0.97);
  padding: 0.9rem 1rem 0.75rem;
  opacity: 0;
  transform: translateY(-0.4rem);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.app-error-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.app-error-toast-msg {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-heading);
}

.app-error-toast-meta {
  margin: 0 0 0.65rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--text-muted);
}

.app-error-toast-dismiss {
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.62rem;
}

/* Server restart / WS loss (multiplayer) */
.server-restart-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 6, 6, 0.72);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.server-restart-overlay--visible {
  opacity: 1;
}

.server-restart-card {
  max-width: min(92vw, 22rem);
  border: 1px solid rgba(255, 200, 120, 0.35);
  background: rgba(14, 12, 10, 0.98);
  padding: 1.35rem 1.5rem 1.15rem;
  text-align: center;
}

.server-restart-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
  color: var(--text-heading);
}

.server-restart-hint {
  margin: 0 0 1.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--text-muted);
}

.server-restart-dismiss {
  margin: 0 auto;
}

.credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 125;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  background: rgba(10, 3, 3, 0.82);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.credits-overlay--visible {
  opacity: 1;
}

.credits-panel {
  width: 100%;
  max-width: min(52rem, calc(100vw - 2rem));
  max-height: min(calc(100vh - clamp(1.5rem, 5vw, 2.75rem)), 90rem);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 70, 70, 0.5);
  background: rgba(22, 8, 8, 0.98);
  box-shadow: 0 0 0 1px rgba(224, 32, 32, 0.12);
  padding: clamp(1.5rem, 4vw, 2.35rem) clamp(1.65rem, 4vw, 2.45rem);
  box-sizing: border-box;
  overflow-y: auto;
}

.credits-panel-title {
  margin: 0 0 1.45rem;
  text-align: center;
  font-size: clamp(1.55rem, 5.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--red-bright);
}

.credits-list {
  list-style: none;
  margin: 0 0 1.45rem;
  padding: 0;
  flex: 0 0 auto;
}

.credits-entry {
  margin: 0;
  padding: 1.05rem 0;
  border-bottom: 1px solid rgba(224, 48, 48, 0.22);
}

.credits-entry:first-child {
  padding-top: 0;
}

.credits-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.credits-entry-name {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--text-heading);
}

.credits-entry-role {
  margin: 0 0 0.65rem;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: rgba(200, 170, 170, 0.95);
}

.credits-panel-close {
  margin: 0 auto;
  flex-shrink: 0;
}

.arcade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.arcade-btn,
.arcade-btn-primary,
.arcade-btn-secondary,
.arcade-btn-fire {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: #141414;
  color: var(--text-heading);
}

.arcade-btn:hover:not(:disabled),
.arcade-btn-primary:hover:not(:disabled),
.arcade-btn-secondary:hover:not(:disabled),
.arcade-btn-fire:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red-bright);
  color: #0a0a0a;
}

.arcade-btn-primary.arcade-btn--locked:hover:not(:disabled) {
  background: #1c1c1c;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text-heading);
}

.arcade-btn:disabled,
.arcade-btn-primary:disabled,
.arcade-btn-secondary:disabled,
.arcade-btn-fire:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.arcade-btn--locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.22);
  cursor: help;
}

.arcade-btn-lock {
  font-size: 0.75rem;
  line-height: 1;
}

.mode-mp-lock-hint {
  margin-top: 0.75rem;
  text-align: center;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* Top row: small pixel-style back + centered title (no overlap) */
.screen-topbar {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  min-height: 1.65rem;
}

.screen-topbar-title {
  grid-column: 2;
  margin: 0;
  text-align: center;
  justify-self: stretch;
}

.screen-topbar .arcade-heading {
  margin-bottom: 0;
}

.screen-topbar-spacer {
  grid-column: 3;
  width: 2rem;
  height: 1px;
  visibility: hidden;
  pointer-events: none;
}

.screen-topbar .arcade-back {
  grid-column: 1;
  justify-self: start;
}

.arcade-back {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  font-family: inherit;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: #141414;
  color: var(--text-heading);
  cursor: pointer;
  image-rendering: pixelated;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.arcade-back:hover {
  border-color: var(--red);
  background: #1a1a1a;
}

.mode-select .arcade-actions,
.mp-hub-body {
  text-align: center;
}

.mp-hub-body .arcade-label {
  text-align: center;
}

.mp-hub-body .visibility-field {
  margin-left: auto;
  margin-right: auto;
}

.server-browser > .arcade-hint,
.server-browser > .arcade-status {
  text-align: center;
}

.screen.solo {
  position: relative;
}

.solo .solo-toolbar {
  text-align: center;
}

.solo .field-inline {
  margin-left: auto;
  margin-right: auto;
}

.solo .status {
  text-align: center;
}

.arcade-input--center {
  margin-left: auto;
  margin-right: auto;
}

.arcade-label {
  display: block;
  color: var(--text-heading);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.arcade-label-optional {
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-size: 0.9em;
}

.visibility-field {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1.25rem;
  max-width: 420px;
  background: #0a0a0a;
}

.visibility-field legend {
  padding: 0 0.35rem;
}

.vis-option {
  display: block;
  color: var(--text);
  font-size: 0.68rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  cursor: pointer;
}

.vis-option input {
  margin-right: 0.5rem;
  vertical-align: middle;
}

.mp-hub-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
  width: 100%;
  max-width: min(20rem, 100%);
  margin: 1rem auto 0;
}

.server-table-wrap {
  margin-top: 0.5rem;
}

.server-table {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.server-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.35rem;
  font-size: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.server-row-head {
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.58rem;
}

.server-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.server-join-btn {
  padding: 0.35rem 0.5rem;
  font-size: 0.58rem;
}

.lobby-code-input {
  text-transform: uppercase;
  letter-spacing: 0.1em;
   font-variant-numeric: tabular-nums;
}

.arcade-input {
  width: 100%;
  max-width: 320px;
  display: block;
  margin-bottom: 1.25rem;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  border-radius: 0;
}

.spice-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.spice-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  min-height: 4.75rem;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: #141414;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.spice-card:not(.spice-card--active) {
  opacity: 0.65;
  filter: grayscale(0.45) brightness(0.88);
}

.spice-card-chilis {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
}

.spice-chili-icon {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  user-select: none;
}

.spice-card--active {
  border-color: var(--red);
  opacity: 1;
  filter: none;
}

.lobby-id {
  font-size: 0.55em;
  color: var(--red);
  letter-spacing: 0.06em;
}

.lobby-list {
  margin: 1rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
}

.lobby-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
}

.lobby-row-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.lobby-row-name-wrap--kick-hover {
  position: relative;
  gap: 0;
  padding-left: 0;
  transition: padding-left 0.14s ease;
}

.lobby-row-name-wrap--kick-hover:is(:hover, :focus-within) {
  padding-left: 1.3rem;
}

.lobby-kick-slot {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 1.05rem;
  height: 1.05rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.lobby-row-name-wrap--kick-hover:is(:hover, :focus-within) .lobby-kick-slot {
  opacity: 1;
  pointer-events: auto;
}

.lobby-kick-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(28, 10, 10, 0.92);
  color: var(--text-heading);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 0;
  cursor: pointer;
  font-family: inherit;
  box-shadow: inset 0 0 0 1px rgba(224, 32, 32, 0.35);
}

.lobby-kick-btn:hover,
.lobby-kick-btn:focus-visible {
  background: rgba(48, 14, 14, 0.98);
  border-color: rgba(255, 60, 60, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 74, 74, 0.5);
}

.lobby-kick-btn:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

.lobby-kick-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 0.25rem);
  z-index: 40;
  padding: 0.2rem 0.4rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-heading);
  background: #0c0a0a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.lobby-row-name-wrap--kick-hover:is(:hover, :focus-within) .lobby-kick-tip {
  display: block;
}

.lobby-row:last-child {
  border-bottom: none;
}

.lobby-ready {
  color: var(--text-heading);
}

.lobby-wave-wrap {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  margin: 0;
  padding: 0;
  border: none;
  pointer-events: auto;
}

.lobby-wave-row {
  display: flex;
  justify-content: center;
}

.lobby-wave-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: 1.35rem;
}

.lobby-wave-toast-host {
  position: fixed;
  bottom: calc(1.25rem + 2.75rem + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.4rem;
  max-width: min(92vw, 20rem);
  pointer-events: none;
}

.lobby-wave-toast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 6, 6, 0.94);
  font-size: 0.8rem;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(0.35rem);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.lobby-wave-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.lobby-wave-toast-name {
  font-style: italic;
  color: var(--text-heading);
}

.lobby-wave-toast-emoji {
  font-size: 1.15rem;
  line-height: 1;
}

/* Multiplayer — player joined / left (top center, slide from top) */
.mp-presence-toast-host {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  max-width: min(92vw, 22rem);
  pointer-events: none;
}

.mp-presence-toast {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  background: rgba(8, 6, 6, 0.94);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(-120%);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.mp-presence-toast--join {
  border: 1px solid rgba(72, 160, 92, 0.95);
  box-shadow: 0 0 0 1px rgba(72, 160, 92, 0.25);
}

.mp-presence-toast--leave {
  border: 1px solid rgba(200, 72, 72, 0.95);
  box-shadow: 0 0 0 1px rgba(200, 72, 72, 0.22);
}

.mp-presence-toast--rematch {
  border: 1px solid rgba(200, 170, 72, 0.95);
  box-shadow: 0 0 0 1px rgba(200, 170, 72, 0.22);
}

.mp-presence-toast--kick {
  border: 1px solid rgba(200, 64, 64, 0.95);
  box-shadow: 0 0 0 1px rgba(200, 64, 64, 0.22);
}

.mp-presence-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.mp-presence-toast-text {
  color: var(--text-heading);
}

.lobby-emoji-btn {
  box-sizing: border-box;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.2rem 0.35rem;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(8, 6, 6, 0.85);
  color: var(--text-heading);
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lobby-emoji-btn:hover {
  border-color: var(--red);
  background: rgba(20, 8, 8, 0.9);
}

.lobby-emoji-btn.lobby-emoji-btn--cooldown,
.lobby-emoji-btn:disabled {
  opacity: 0.38;
  filter: grayscale(1);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.55);
  color: rgba(220, 210, 205, 0.42);
}

.lobby-emoji-btn.lobby-emoji-btn--cooldown:hover,
.lobby-emoji-btn:disabled:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.55);
}

.cook-download-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.screen.cook.arcade-panel .cook-download-row .cook-action-btn {
  padding: 0.52rem 1.05rem;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
}

.cook-finished-hint {
  margin-top: 0;
  text-align: center;
}

.host-cook-duration {
  margin: 0 0 1rem;
  text-align: center;
}

.arcade-select {
  display: block;
  margin: 0.35rem auto 0;
  max-width: 12rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.72rem;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  border-radius: 0;
  cursor: pointer;
}

.cook-timer {
  font-size: clamp(2.5rem, 10vw, 4rem);
  text-align: center;
  letter-spacing: 0.12em;
  color: var(--text-heading);
  margin: 0.5rem 0 1rem;
}

/* Kit stack spacing — solo cook + multiplayer cook */
.mp-grid {
  margin-top: 0.65rem;
}

.screen.cook.arcade-panel .mp-grid {
  margin-top: 1.35rem;
}

.solo-toolbar {
  margin-top: 0.5rem;
}

.slideshow-wave {
  min-height: 120px;
  margin: 1rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: #080606;
}

.slide-player {
  text-align: center;
  color: var(--red);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.slideshow-reactions {
  margin: 0.75rem 0 0;
  text-align: center;
}

.slideshow-reaction-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.slideshow-reaction-btn {
  box-sizing: border-box;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.2rem 0.4rem;
  font-family: inherit;
  font-size: 1.15rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(8, 6, 6, 0.85);
  color: var(--text-heading);
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.slideshow-reaction-btn:hover {
  border-color: var(--red);
  background: rgba(20, 8, 8, 0.9);
}

.slideshow-reaction-btns--cooldown .slideshow-reaction-btn,
.slideshow-reaction-btn:disabled {
  opacity: 0.38;
  filter: grayscale(1);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.55);
  color: rgba(220, 210, 205, 0.42);
}

.slideshow-reaction-btns--cooldown .slideshow-reaction-btn:hover,
.slideshow-reaction-btn:disabled:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.55);
}

.vote-unlock-hint .vote-phase-remain {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.vote-timer-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 20rem;
  margin: 0.35rem auto 0.5rem;
}

.vote-timer-bar-wrap {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.vote-timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: rgba(220, 60, 60, 0.95);
  transition: width 0.2s linear;
}

.vote-timer-label {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--text-heading);
  min-width: 3.25rem;
  text-align: right;
}

/* Multiplayer: title | phase timer | progress hint (one row) */
.mp-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(1rem, 3.5vw, 1.75rem);
  row-gap: 0.65rem;
  width: 100%;
  margin-bottom: 1.15rem;
}

.mp-panel-head-title {
  margin: 0;
  justify-self: start;
  text-align: left;
  line-height: 1.2;
}

.mp-panel-head .arcade-heading {
  margin: 0;
}

.mp-panel-head-timer {
  justify-self: stretch;
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
}

.mp-panel-head-timer .mp-phase-timer {
  margin: 0;
  max-width: none;
  width: 100%;
}

.mp-panel-head-timer .slideshow-vote-deadline-wrap {
  margin: 0;
  max-width: none;
  width: 100%;
}

.mp-panel-head-roster {
  justify-self: end;
  align-self: start;
  min-width: 0;
}

.mp-panel-head-roster .mp-progress-hint-wrap {
  margin: 0;
  max-width: min(100%, 14rem);
  text-align: right;
}

.mp-panel-head-roster .mp-progress-hint-text {
  color: rgba(235, 230, 225, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.mp-panel-head-roster .mp-tooltip {
  left: auto;
  right: 0;
  transform: none;
  text-align: left;
}

.mp-phase-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 22rem;
  margin: 0.35rem auto 0.65rem;
}

.mp-phase-timer-bar-wrap {
  width: 100%;
  max-width: min(20rem, 100%);
  margin-inline: auto;
  height: 3px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mp-phase-timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 0;
  background: var(--red);
  transition: width 0.2s linear;
}

.mp-phase-timer-label {
  display: block;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.05rem, 2.6vw, 1.38rem);
  letter-spacing: 0.07em;
  color: var(--text-heading);
  text-align: center;
  line-height: 1.1;
}

.mp-progress-hint-wrap {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 22rem;
  margin: 0;
  cursor: help;
}

.mp-progress-hint-wrap .mp-progress-hint-text {
  border-bottom: 1px dotted rgba(255, 255, 255, 0.32);
}

.mp-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 0.3rem);
  z-index: 60;
  min-width: 9.5rem;
  max-width: 18rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: left;
  background: #0c0a0a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.mp-progress-hint-wrap:hover .mp-tooltip {
  display: block;
}

.mp-tip-name {
  display: block;
}

.mp-tip-name--done {
  color: #6fcf7a;
}

.mp-tip-name--todo {
  color: #e05555;
}

.slideshow-vote-deadline-wrap {
  margin-top: 0.35rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.slideshow-vote-deadline-wrap[hidden] {
  display: none;
}

.vote-beat-hint {
  margin-top: 0.35rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.vote-beat-grid {
  margin-top: 1rem;
}

.vote-beat-card {
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.vote-beat-card:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

.vote-beat-card--locked {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
}

.vote-beat-wave {
  cursor: default;
}

.results-winner {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text-heading);
  margin: 1rem 0;
  line-height: 1.6;
}

.results-winner-name {
  display: block;
  font-size: 1.1rem;
  color: var(--red-bright);
  margin-top: 0.35rem;
}

.results-no-winner-2p {
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1rem 0;
  line-height: 1.5;
}

.results-beats-section {
  margin: 1.25rem 0 1rem;
  width: 100%;
}

.results-beat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.results-beat-card-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.results-beat-card-head .card-title {
  min-width: 0;
}

.results-beat-vote-count {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-heading);
  line-height: 1.2;
  padding: 0.2rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 8, 0.55);
}

@media (max-width: 720px) {
  .results-beat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .results-beat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.results-beats-miss {
  margin: 1rem 0;
}

.results-beat-grid .results-beat-card {
  opacity: 0;
  transform: translateY(12px);
}

.results-beat-grid--reveal .results-beat-card {
  animation: results-beat-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--stagger, 0) * 55ms);
}

@keyframes results-beat-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .results-beat-grid .results-beat-card {
    opacity: 1;
    transform: none;
  }

  .results-beat-grid--reveal .results-beat-card {
    animation: none;
  }
}

.results-panel-head .mp-panel-head-timer {
  min-height: 1.35rem;
}

.results-title-standalone {
  margin: 0 0 1rem;
  text-align: left;
}

.results-rematch-roster-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.results-rematch-btn {
  padding: 0.52rem 1.05rem;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
}

.upload-timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  margin: 0.25rem 0 0.75rem;
}

.upload-hint-muted {
  margin-top: 0.35rem;
  max-width: 22rem;
  opacity: 0.78;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.upload-form input[type="file"] {
  font-family: inherit;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.leaderboard-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.leaderboard-screen .arcade-status {
  width: 100%;
  text-align: center;
}

.leaderboard-table-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
  align-self: stretch;
}

.leaderboard-table {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.lb-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr 3.5rem;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.72rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-row > span {
  display: flex;
  align-items: center;
  min-height: 0;
}

.lb-row > span:first-child {
  justify-content: center;
  color: var(--red);
}

.lb-row > span:last-child {
  justify-content: flex-end;
  color: var(--text-heading);
}

.lb-row-head {
  color: var(--text-muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

/* Top-left social links — stack, matches auth-corner chrome */
.corner-social-stack {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.corner-social-link {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 6, 6, 0.94);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.corner-social-link:hover {
  border-color: var(--red);
  color: var(--red-bright);
  background: rgba(20, 8, 8, 0.96);
}

.corner-social-link:focus-visible {
  outline: 1px solid var(--red-bright);
  outline-offset: 2px;
}

.corner-social-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 6, 6, 0.94);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-family: inherit;
  text-transform: uppercase;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.corner-social-trigger:hover {
  border-color: var(--red);
  color: var(--red-bright);
  background: rgba(20, 8, 8, 0.96);
}

.corner-social-trigger:focus-visible {
  outline: 1px solid var(--red-bright);
  outline-offset: 2px;
}

.corner-social-icon {
  display: block;
  width: 42px;
  height: 32px;
  flex-shrink: 0;
}

.corner-social-icon--heart {
  width: 38px;
  height: 34px;
}

/* Supporter heart + shared cursor-tooltip target */
.supporter-wrap {
  display: inline;
  cursor: default;
}

.supporter-heart {
  margin-right: 0.12em;
}

.corner-social-tooltip {
  position: fixed;
  z-index: 400;
  left: 0;
  top: 0;
  max-width: min(300px, calc(100vw - 20px));
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 6, 6, 0.96);
  backdrop-filter: blur(8px);
  color: var(--text-heading);
  font-family: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  visibility: visible;
  -webkit-font-smoothing: none;
  transition: opacity 0.1s ease;
}

.corner-social-tooltip--hidden {
  opacity: 0;
}

/* Fixed account — top-right, card above actions */
.auth-corner {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 50;
  max-width: min(220px, calc(100vw - 1.5rem));
  text-align: right;
}

.auth-corner-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.auth-corner-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 6, 6, 0.94);
  backdrop-filter: blur(8px);
}

.auth-corner-card-label {
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-corner-name {
  font-size: 0.72rem;
  color: var(--red-bright);
  letter-spacing: 0.06em;
  max-width: 100%;
  word-break: break-word;
}

.auth-corner-wins {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.auth-corner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.auth-corner-actions--guest {
  gap: 0.35rem;
}

.auth-corner-actions--wide {
  max-width: min(320px, 100vw - 1.5rem);
  justify-content: flex-end;
}

.auth-corner-btn {
  font-family: inherit;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-heading);
  cursor: pointer;
}

.auth-corner-btn:hover {
  border-color: var(--red);
  color: var(--red-bright);
}

.auth-corner-btn--leave {
  border-color: rgba(224, 32, 32, 0.45);
  color: var(--red-bright);
}

.auth-corner-btn--leave:hover {
  background: rgba(224, 32, 32, 0.12);
  border-color: var(--red-bright);
  color: var(--text-heading);
}

/* Dev-only metrics — right-edge tab + slide-out card (shown after / when allowed) */
.dev-stats-panel--concealed {
  display: none !important;
}

.dev-stats-panel {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  max-width: min(calc(100vw - 0.5rem), 260px);
}

.dev-stats-panel__card {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 2px solid #22c55e;
  border-radius: 0;
  background: rgba(6, 12, 8, 0.92);
  backdrop-filter: blur(8px);
  color: #22c55e;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-align: left;
  overflow: hidden;
  transition:
    max-width 0.22s ease,
    opacity 0.18s ease,
    padding 0.22s ease,
    border-color 0.18s ease;
  max-width: min(220px, calc(100vw - 2.5rem));
  opacity: 1;
}

.dev-stats-panel--collapsed .dev-stats-panel__card {
  max-width: 0;
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  pointer-events: none;
}

.dev-stats-panel__tab {
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.35rem;
  min-height: 4.5rem;
  width: 1.65rem;
  border: 2px solid #22c55e;
  border-left: none;
  border-right: none;
  border-radius: 0;
  background: rgba(6, 12, 8, 0.94);
  backdrop-filter: blur(8px);
  color: #22c55e;
  font-family: inherit;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dev-stats-panel__tab:hover {
  background: rgba(12, 28, 18, 0.96);
  border-color: #4ade80;
  color: #4ade80;
}

.dev-stats-panel__tab:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

.dev-stats-panel__label {
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(34, 197, 94, 0.75);
  margin-bottom: 0.25rem;
}

.dev-stats-panel__row {
  white-space: nowrap;
}

.dev-stats-panel__row span {
  font-variant-numeric: tabular-nums;
}

.dev-stats-panel__row--block {
  white-space: normal;
  word-break: break-word;
  margin-top: 0.35rem;
}

.dev-stats-panel__row--supporter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  margin-top: 0.3rem;
  white-space: normal;
}

.dev-stats-panel__input {
  flex: 1 1 6rem;
  min-width: 0;
  font: inherit;
  font-size: 0.65rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
}

.dev-stats-panel__mini-btn {
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem;
  font-size: 0.55rem;
  letter-spacing: 0.06em;
}

.dev-stats-panel__hint {
  margin: 0.25rem 0 0;
  min-height: 0.9rem;
  font-size: 0.55rem;
  color: rgba(250, 250, 250, 0.55);
}

.arcade-actions--mode {
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.screen.lobby {
  position: relative;
}

.lobby-kit-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 20;
  padding: 1.25rem;
}

.lobby-kit-overlay-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.lobby-kit-overlay-title {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.lobby-kit-overlay-msg {
  margin-bottom: 1rem;
  min-height: 1.5em;
}

.lobby-kit-progress {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.lobby-kit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), #ff6b6b);
  border-radius: 4px;
  transition: width 0.22s ease;
}

.lobby-kit-overlay-step {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

/* Full-viewport layer (body); synth UI not clipped by #app-root */
.synth-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 1.75rem);
  background: rgba(0, 0, 0, 0.92);
  overflow-y: auto;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

/* Synth reveal (client-built kit) — playing-card ratio 2.5×3.5 (5:7), vertical shuffle only */
.synth-reveal {
  text-align: center;
  padding: 2rem 1rem 3rem;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.synth-reveal-overlay > .synth-reveal {
  min-height: unset;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.synth-reveal-heading {
  margin: 0 0 1rem;
  max-width: min(36rem, 94vw);
  font-size: clamp(1.45rem, 5.5vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-heading);
}

.synth-reveal-sub {
  margin-top: 2rem;
  min-height: 1.4em;
  max-width: 22rem;
}

.synth-reveal-stack {
  position: relative;
  width: min(300px, 82vw);
  min-height: clamp(360px, 58vw, 440px);
  margin: 1.75rem 0 0;
}

.synth-card {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: min(270px, 76vw);
  max-width: 300px;
  aspect-ratio: 5 / 7;
  margin-left: 0;
  padding: 1.5rem 1.25rem;
  border: 1px solid rgba(240, 240, 240, 0.42);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  /* Start above the stack; motion is vertical only (no rotate / tilt). */
  transform: translate(-50%, calc(-50% - 240px));
  transition:
    opacity 0.45s ease,
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.synth-card-label {
  font-size: clamp(0.78rem, 2.4vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Back of pile lower on screen; newest (2) highest. z-index set in JS per reveal. */
.synth-card--in.synth-card--placed[data-synth-i="0"] {
  opacity: 1;
  transform: translate(-50%, calc(-50% + 34px));
}

.synth-card--in.synth-card--placed[data-synth-i="1"] {
  opacity: 1;
  transform: translate(-50%, calc(-50% + 17px));
}

.synth-card--in.synth-card--placed[data-synth-i="2"] {
  opacity: 1;
  transform: translate(-50%, calc(-50% + 0px));
}

/* Competitive ranks */
.rank-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 0.30em;
  line-height: 0;
}

.rank-badge__img {
  display: block;
  width: 2.2em;
  height: 2.2em;
  object-fit: contain;
  flex-shrink: 0;
}

/* Rank icon + name — same vertical alignment as leaderboard rows */
.name-with-rank,
.lb-player {
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.15em;
  min-width: 0;
  word-break: break-word;
}

.name-with-rank {
  display: inline-flex;
}

.lb-player {
  justify-content: flex-start;
}

.rank-up-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.rank-up-overlay--in {
  opacity: 1;
}

.rank-up-overlay--out {
  opacity: 0;
}

.rank-up-card {
  width: min(20rem, 100%);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 4px;
  text-align: center;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--rank-up-accent, #cd7f32) 42%, #1a1a1a) 0%,
    #141414 100%
  );
  border: 1px solid color-mix(in srgb, var(--rank-up-accent, #cd7f32) 55%, transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.45);
  transform: translateY(12px) scale(0.94);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease;
}

.rank-up-overlay--in .rank-up-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.rank-up-overlay--out .rank-up-card {
  transform: translateY(-8px) scale(0.96);
  opacity: 0;
}

.rank-up-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.rank-up-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-heading);
}

.rank-up-badge-wrap {
  margin: 0 0 1.25rem;
  display: flex;
  justify-content: center;
}

.rank-up-badge-img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
}

.rank-up-dismiss {
  min-width: 7rem;
}
