:root {
  --font-ui: 'Roboto', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-chat: 'Rajdhani', 'Roboto', 'Segoe UI', Arial, sans-serif;
  --bg: #0d0e18;
  --panel: rgba(18, 20, 34, 0.92);
  --accent: #4de1c1;
  --accent2: #7c6cff;
  --text: #e8ecf8;
  --muted: #8b90ad;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Form controls don't inherit the page font on their own. */
button,
input,
textarea,
select {
  font-family: inherit;
}

/*
 * One cursor everywhere — menus, HUD, the playfield, over any control.
 * Forced so nothing (pointer, text, not-allowed, …) can swap it out, and
 * there's no setting to change it. Hotspot sits on the triangle's top-left
 * corner, which is where you naturally aim.
 */
html,
body,
*,
*::before,
*::after {
  cursor: url('/assets/cursor.png') 2 2, auto !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
}

#game,
#game-overlay {
  position: fixed;
  inset: 0;
  display: block;
}

/* Sits directly above the WebGL canvas, below the HUD. */
#game-overlay {
  z-index: 1;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* ---------------------------------------------------------------- motion */
/* Shared easing: a gentle overshoot-free curve that decelerates into place. */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.68, 0.35);
  --dur: 260ms;
}

/*
 * `display: none` can't be transitioned, so panels that should fade in and out
 * stay laid out and are hidden with visibility/opacity instead. Each rule is
 * more specific than `.hidden` so it wins.
 */

/* Menu: backdrop fades, card lifts into place */
#menu {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out), visibility 0s;
}

#menu.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms var(--ease-in), visibility 0s linear 200ms;
}

.menu-card {
  transform: translateY(0) scale(1);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

#menu.hidden .menu-card {
  transform: translateY(14px) scale(0.97);
  opacity: 0;
}

/* Settings dialog */
#settings {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out), visibility 0s;
}

#settings.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms var(--ease-in), visibility 0s linear 200ms;
}

.settings-panel {
  transform: translateY(0) scale(1);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

#settings.hidden .settings-panel {
  transform: translateY(18px) scale(0.96);
  opacity: 0;
}

/* Skins browser */
#skins-modal {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out), visibility 0s;
}

#skins-modal.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms var(--ease-in), visibility 0s linear 200ms;
}

.skins-panel {
  transform: translateY(0) scale(1);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

#skins-modal.hidden .skins-panel {
  transform: translateY(18px) scale(0.96);
  opacity: 0;
}

/* Admin panel */
#admin-modal {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out), visibility 0s;
}

#admin-modal.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms var(--ease-in), visibility 0s linear 200ms;
}

.admin-panel {
  transform: translateY(0) scale(1);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

#admin-modal.hidden .admin-panel {
  transform: translateY(18px) scale(0.96);
  opacity: 0;
}

/* Emoji board rises out of the chat bar */
#emoji-board {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  transform-origin: bottom right;
  transition:
    transform 220ms var(--ease-out),
    opacity 220ms var(--ease-out),
    visibility 0s;
}

#emoji-board.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.94);
  transition:
    transform 170ms var(--ease-in),
    opacity 170ms var(--ease-in),
    visibility 0s linear 170ms;
}

/* Spectate banner drops in from the top */
#spectate-banner {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition:
    transform 300ms var(--ease-out),
    opacity 300ms var(--ease-out),
    visibility 0s;
}

#spectate-banner.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-18px);
  transition:
    transform 200ms var(--ease-in),
    opacity 200ms var(--ease-in),
    visibility 0s linear 200ms;
}

/* HUD + chat cross-fade with the menu */
#hud,
#chat {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur) var(--ease-out), visibility 0s;
}

#hud.hidden,
#chat.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms var(--ease-in), visibility 0s linear 180ms;
}

/* Chat input slides up when opened */
#chat-input {
  transform: translateY(0);
  opacity: 1;
  transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out),
    border-color 0.2s ease, box-shadow 0.2s ease;
}

#chat-input.hidden {
  display: block !important;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  border-width: 0;
  overflow: hidden;
  transition: all 170ms var(--ease-in);
}

/* Emoji toggle fades in alongside the input.
   Deliberately no scale() here: a leftover transform would shrink the button's
   real layout box, so only opacity and width animate. */
#emoji-toggle {
  opacity: 1;
  transition: opacity 200ms var(--ease-out), width 200ms var(--ease-out),
    border-color 0.15s, background 0.15s;
}

#emoji-toggle.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
  width: 0;
  min-width: 0;
  padding: 0;
  border-width: 0;
  overflow: hidden;
  transition: opacity 170ms var(--ease-in), width 170ms var(--ease-in);
}

/* Death panel and reward badge ease in */
#death,
.earned {
  animation: popIn 320ms var(--ease-out) both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Settings panel body fades when switching tabs */
.settings-content {
  animation: fadeSlide 240ms var(--ease-out) both;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect people who'd rather not have motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

#leaderboard {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 270px;
  background: linear-gradient(180deg, rgba(22, 24, 42, 0.8), rgba(13, 14, 24, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    0 14px 34px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lb-title {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--col-lb-title, var(--accent));
  margin-bottom: 9px;
  font-size: 18px;
  text-transform: uppercase;
}

#lb-list {
  list-style: none;
  counter-reset: rank;
  font-size: 16px;
}

#lb-list li {
  counter-increment: rank;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Masses line up and read at a glance. */
#lb-list li span:last-child {
  font-weight: 700;
  color: var(--text);
}

#lb-list li::before {
  content: counter(rank) ".";
  width: 22px;
  color: var(--muted);
  flex: 0 0 auto;
}

#lb-list li .lb-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

#lb-list li.me {
  color: var(--accent);
  font-weight: 700;
}

#score {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-size: 22px;
  font-weight: 500;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* The number is the thing you actually read mid-game. */
#score-value {
  color: var(--accent);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#stats {
  position: absolute;
  left: 66px; /* clears the settings button */
  top: 22px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

#minimap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 160px;
  height: 160px;
  background: rgba(13, 14, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

#hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--muted);
  background: rgba(13, 14, 24, 0.5);
  padding: 5px 12px;
  border-radius: 20px;
}

#hint b {
  color: var(--text);
}

/* ------------------------------------------------------------ Chat */

#chat {
  position: fixed;
  left: 14px;
  bottom: 52px; /* sits above the score / hint row */
  width: 264px;
  max-width: 40vw;
  z-index: 6;
  pointer-events: none; /* only the log + input capture the mouse */
  font-family: var(--font-chat);
}

#chat-input,
#chat-input::placeholder {
  font-family: var(--font-chat);
}

/* ALL / PARTY switch above the log */
#chat-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
  pointer-events: auto;
}

.chat-tab {
  position: relative;
  padding: 3px 12px;
  font-family: var(--font-chat);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--muted);
  background: rgba(13, 14, 24, 0.55);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  transition: color 0.15s, background 0.15s;
}

.chat-tab:hover {
  color: var(--text);
}

.chat-tab.active {
  color: #08131a;
  background: var(--col-chat-tab, var(--accent));
  text-shadow: none;
}

/* Marks unread traffic in the tab you're not looking at. */
.chat-dot {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b5c;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

/* Only the selected channel's messages are on screen. Both live in the same
   log, so scrolling and history handling stay in one place. */
#chat.ch-all #chat-log .msg[data-ch='party'],
#chat.ch-party #chat-log .msg[data-ch='all'] {
  display: none;
}

/* Nicknames in chat pick up the themed colour. Party lines override it so
   they're never mistaken for public chat. */
#chat-log .msg .n {
  color: var(--col-chat-nick, var(--text));
}

#chat-log .msg[data-ch='party'] .n {
  color: var(--col-team-title, #4de1c1) !important;
}

#chat-log .msg[data-ch='party'] .t::after {
  content: ' P';
  color: var(--col-team-title, #4de1c1);
  font-weight: 800;
}

/* No panel behind it — the messages sit straight on the playfield, so a
   text shadow does the work of keeping them readable. */
#chat-log {
  display: flex;
  flex-direction: column;
  /* ~14 lines at the 17px line-height below. */
  height: 238px;
  overflow-y: auto;
  padding: 0 6px 0 2px;
  background: none;
  border: none;
  box-shadow: none;
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* Push messages to the bottom of the box when there aren't many yet. */
#chat-log::before {
  content: '';
  margin-top: auto;
}

/* Popup mode: no scrollback, messages just drift in and fade out again. */
#chat.popup #chat-log {
  height: auto;
  max-height: 170px;
  overflow: hidden;
  pointer-events: none;
}

#chat.popup #chat-log .msg {
  animation: chatPopIn 220ms var(--ease-out) both;
}

#chat-log .msg.fading {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 850ms ease, transform 850ms ease;
}

@keyframes chatPopIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

#chat-log::-webkit-scrollbar {
  width: 6px;
}
#chat-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
  border-radius: 5px;
}
#chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
#chat-log::-webkit-scrollbar-track {
  background: transparent;
}

#chat-log .msg {
  /* Rajdhani runs narrow, so it needs a touch more size than Roboto would. */
  font-family: var(--font-chat);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 17px;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  /* Carries readability now that there's no panel behind the text. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 4px rgba(0, 0, 0, 0.8);
}

#chat-log .msg .t {
  color: var(--muted);
  margin-right: 5px;
}

#chat-log .msg .n {
  font-weight: 700;
  margin-right: 4px;
}

/* Role tag in chat, e.g. [Admin] — coloured text only, no chip. */
#chat-log .msg .chat-tag {
  font-weight: 800;
  margin-right: 2px;
}

#chat-log .msg .chat-tag.admin {
  color: #4de1c1;
}

#chat-log .msg.server {
  color: #ff6b8b;
  font-weight: 600;
}

#chat-log .msg.server .server-name {
  font-weight: 800;
  color: #ff5277;
}

/* Row holding the message input + emoji button. */
#chat-bar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  pointer-events: none; /* children opt back in */
}

#chat-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: rgba(0, 0, 0, 0.72);
  color: var(--text);
  outline: none;
  pointer-events: auto;
}

#chat-input::placeholder {
  color: var(--muted);
}

#emoji-toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 1;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(13, 14, 24, 0.72);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
#emoji-toggle:hover {
  border-color: var(--accent);
}
#emoji-toggle:active {
  transform: scale(0.94);
}
#emoji-toggle.active {
  border-color: var(--accent);
  background: rgba(77, 225, 193, 0.16);
}

/* Emoji picker, popping up just above the chat bar. */
#emoji-board {
  position: absolute;
  right: 0;
  bottom: 42px;
  width: 264px;
  max-width: 92vw;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: rgba(13, 14, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  z-index: 7;
}

.emoji-btn {
  font-size: 17px;
  line-height: 1;
  padding: 3px 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s, transform 0.06s;
}
.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.emoji-btn:active {
  transform: scale(0.85);
}

/* ------------------------------------------------------------ Settings */

/* Skin carousel (sidebar) — the preview doubles as the profile avatar */
.skin-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.skin-picker button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.08s;
}

.skin-picker button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.skin-picker button:active {
  transform: scale(0.9);
}

.skin-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/*
 * Two skin slots side by side: slot 1 is your normal cell, slot 2 is the
 * second cell you get in dual worlds. The arrows page whichever slot is
 * selected. These are <button>s inside .skin-picker, so every rule here has to
 * out-specify the small round arrow-button styling above.
 */
.skin-picker .skin-slot {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s var(--ease-out);
}

.skin-picker .skin-slot:hover {
  border: 0;
}

.skin-picker .skin-slot:active {
  transform: scale(0.96);
}

/* The selected slot is the one the arrows and the skin browser act on. */
.skin-picker .skin-slot.selected .skin-preview {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(255, 92, 179, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.4),
    inset 0 6px 14px rgba(255, 255, 255, 0.18),
    inset 0 -8px 16px rgba(0, 0, 0, 0.3);
}

.skin-picker .skin-slot:not(.selected) .skin-preview {
  opacity: 0.72;
}

.skin-picker .skin-slot:not(.selected):hover .skin-preview {
  opacity: 1;
}

/* Small corner numeral so it's obvious which cell each circle dresses. */
.skin-slot-no {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  color: var(--text);
  text-align: center;
  background: rgba(6, 7, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9px;
  pointer-events: none;
}

.skin-slot.selected .skin-slot-no {
  color: #0d0810;
  background: var(--accent);
  border-color: var(--accent);
}

/* Which slot the arrows are currently paging. */
.skin-slot-hint {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sphere-like: rim light on top, contact shadow beneath. */
.skin-preview {
  position: relative;
  /* Sized so two of them plus the arrows fit the sidebar rail. */
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background-color: #4de1c1;
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.45),
    0 12px 28px rgba(0, 0, 0, 0.4),
    inset 0 6px 14px rgba(255, 255, 255, 0.18),
    inset 0 -8px 16px rgba(0, 0, 0, 0.3);
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.skin-picker:not(.locked) .skin-preview:hover {
  transform: translateY(-2px) scale(1.03);
}

/* Signed out: skins are locked */
.skin-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  background: rgba(6, 7, 12, 0.62);
  backdrop-filter: blur(1px);
}

.skin-picker.locked .skin-preview {
  border-color: rgba(255, 255, 255, 0.35);
  filter: saturate(0.5);
}

.skin-picker.locked button {
  opacity: 0.35;
  cursor: not-allowed;
}

.skin-picker.locked button:hover {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.skin-name.locked {
  color: #8f96c9;
}

.skin-name {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settings {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 12, 0.55);
  backdrop-filter: blur(2px);
}

.settings-panel {
  position: relative;
  display: flex;
  width: 760px;
  max-width: 94vw;
  height: 440px;
  max-height: 86vh;
  background: linear-gradient(180deg, #171a30 0%, var(--panel) 45%, #101223 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.45),
    0 28px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

/* Shared close button for every dialog: red, round, glows on hover. */
#settings-close,
#skins-close,
#admin-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #ff6b8b;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 107, 139, 0.45);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.14s var(--ease-out);
}

#settings-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

#settings-close:hover,
#skins-close:hover,
#admin-close:hover {
  color: #fff;
  background: #ff4d6d;
  border-color: #ff4d6d;
  transform: rotate(90deg) scale(1.06);
  box-shadow:
    0 0 0 4px rgba(255, 77, 109, 0.16),
    0 4px 14px rgba(255, 77, 109, 0.45);
}

#settings-close:active,
#skins-close:active,
#admin-close:active {
  transform: rotate(90deg) scale(0.94);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.2);
}

#settings-close:focus-visible,
#skins-close:focus-visible,
#admin-close:focus-visible {
  outline: 2px solid #ff8a9e;
  outline-offset: 2px;
}

/* Big categories, down the left side */
.settings-rail {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  background: rgba(0, 0, 0, 0.26);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.cat-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cat-btn.active {
  background: rgba(77, 225, 193, 0.16);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(77, 225, 193, 0.45);
}

.cat-ico {
  font-size: 15px;
  line-height: 1;
}

/* Sub-tabs across the top of the content area */
.settings-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 12px 46px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  padding: 9px 14px 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Intentionally blank for now — panels get built later. */
.settings-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.settings-content::-webkit-scrollbar {
  width: 8px;
}

.settings-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}

/* Setting rows: label on the left, control on the right. */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Controls -> Keyboard: the key cap a binding lives on. */
.set-key {
  min-width: 96px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.set-key:hover {
  border-color: var(--accent);
}

.set-key.unbound {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.14);
}

.set-key.listening {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(77, 225, 193, 0.08);
  animation: keyPulse 1s ease-in-out infinite;
}

@keyframes keyPulse {
  50% {
    box-shadow: 0 0 0 4px rgba(77, 225, 193, 0.15);
  }
}

.set-keys-hint {
  padding: 14px 4px 6px;
  font-size: 12px;
  color: var(--muted);
}

.set-keys-reset {
  margin: 8px 4px 4px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.set-keys-reset:hover {
  border-color: var(--accent);
}

/* Import/Export: the three big action buttons. */
.io-actions {
  display: flex;
  gap: 10px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.io-btn {
  flex: 1;
  padding: 11px 0;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #0d0e18;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}

.io-btn:hover {
  filter: brightness(1.12);
}

.io-btn:active {
  transform: translateY(1px);
}

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

.set-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.set-hint {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

/* Toggle switch */
.set-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 24px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.2s var(--ease-out);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.set-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease-out);
}

.set-switch.on {
  background: var(--accent);
}

.set-switch.on::after {
  transform: translateX(22px);
}

/* Dropdown */
.set-select {
  position: relative;
  flex: 0 0 auto;
}

.set-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.set-select-btn:hover,
.set-select.open .set-select-btn {
  border-color: var(--accent);
  color: var(--accent);
}

.set-select-btn .caret {
  font-size: 10px;
  opacity: 0.8;
}

.set-options {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 5;
  min-width: 100%;
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 1px;
  background: #1a1d34;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.set-select.open .set-options {
  display: flex;
}

.set-option {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.set-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.set-option.active {
  color: var(--accent);
  background: rgba(77, 225, 193, 0.14);
}

/* Full-width text field (image URL), label stacked above it. */
.set-row.textfield {
  display: block;
  padding: 16px 4px;
}

.set-row.textfield .set-label {
  margin-bottom: 10px;
}

.set-text {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s ease;
}

.set-text:focus {
  border-color: var(--accent);
}

.set-text::placeholder {
  color: var(--muted);
}

/* Colour picker: hex readout plus a swatch that opens the OS picker. */
.set-color {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.set-color input[type='text'] {
  width: 84px;
  padding: 7px 9px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

.set-color .swatch {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  cursor: pointer;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* The real control sits invisibly on top so the swatch is the click target. */
.set-color .swatch input[type='color'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  padding: 0;
  cursor: pointer;
}

.set-color:focus-within {
  border-color: var(--accent);
}

/* Slider row: label + value badge above, full-width track below. */
.set-row.slider {
  display: block;
  padding: 18px 4px;
}

.set-slider-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.set-value {
  min-width: 34px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
}

.set-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* The filled portion is painted via a gradient set from JS. */
.set-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s var(--ease-out);
}

.set-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}

.set-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.set-range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.settings-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .settings-panel {
    flex-direction: column;
    height: 78vh;
  }
  .settings-rail {
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 10px;
  }
  .cat-btn {
    white-space: nowrap;
  }
  .settings-tabs {
    padding-right: 14px;
  }
}

/* ------------------------------------------------------------ Skins browser */

#skins-modal {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 12, 0.6);
  backdrop-filter: blur(2px);
}

.skins-panel {
  display: flex;
  flex-direction: column;
  width: 720px;
  max-width: 94vw;
  height: 460px;
  max-height: 86vh;
  background: linear-gradient(180deg, #171a30 0%, var(--panel) 45%, #101223 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.45),
    0 28px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.skins-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}

.skins-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.skins-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.skins-tabs .tab-btn {
  padding: 9px 14px 11px;
}

/* Intentionally blank for now — each category gets built later. */
.skins-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  animation: fadeSlide 240ms var(--ease-out) both;
}

.skins-content::-webkit-scrollbar {
  width: 8px;
}

.skins-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}

/* The avatar is a button into this browser. */
.skin-picker:not(.locked) .skin-preview {
  cursor: pointer;
}

/* Skin grid */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.skin-tile {
  position: relative;
  padding: 8px 6px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.26);
  cursor: pointer;
  text-align: center;
  transition:
    transform 0.16s var(--ease-out),
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.skin-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.skin-tile.equipped {
  border-color: var(--accent);
  background: rgba(77, 225, 193, 0.12);
  box-shadow:
    0 0 0 1px rgba(77, 225, 193, 0.35),
    0 6px 18px rgba(77, 225, 193, 0.15);
}

.skin-tile-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.skin-tile-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skin-tile-name {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Favorite star */
.skin-fav {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  background: rgba(6, 7, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.12s var(--ease-out);
}

.skin-fav:hover {
  color: #ffd93d;
  border-color: rgba(255, 217, 61, 0.6);
  transform: scale(1.12);
}

.skin-fav.on {
  color: #ffd93d;
  border-color: rgba(255, 217, 61, 0.7);
  background: rgba(255, 217, 61, 0.16);
}

/* Submit form */
.submit-form {
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.submit-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.submit-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 16px;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.submit-drop:hover,
.submit-drop.dragover {
  border-color: var(--accent);
  background: rgba(77, 225, 193, 0.08);
}

.submit-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.submit-hint {
  font-size: 12px;
  color: var(--muted);
}

.submit-form input[type='text'] {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
}

.submit-form input[type='text']:focus {
  border-color: var(--accent);
}

#submit-send {
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  color: #08131a;
  background: linear-gradient(90deg, var(--accent), #57c8ff);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s var(--ease-out), filter 0.15s;
}

#submit-send:hover { filter: brightness(1.08); }
#submit-send:active { transform: translateY(1px) scale(0.985); }
#submit-send:disabled { filter: grayscale(0.6) brightness(0.7); cursor: default; }

.submit-msg {
  min-height: 16px;
  font-size: 12.5px;
  text-align: center;
  font-weight: 600;
}
.submit-msg.ok { color: var(--accent); }
.submit-msg.err { color: #ff8a9e; }

/* Pending badge — sits in flow under the art so it never covers the skin. */
.skin-tile .skin-status {
  display: block;
  width: fit-content;
  margin: 6px auto 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255, 217, 61, 0.18);
  color: #ffd93d;
  border: 1px solid rgba(255, 217, 61, 0.5);
}

.skin-tile.pending .skin-tile-art {
  filter: saturate(0.55) brightness(0.8);
}

/* Toast notifications — stack up from the bottom-right corner. */
#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1a1d34, #121427);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 14px 34px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  /* Slide in from the right while fading up. */
  animation: toastIn 380ms var(--ease-out) both;
}

.toast.leaving {
  animation: toastOut 260ms var(--ease-in) both;
}

.toast-ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

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

.toast-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.toast-text {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

/* A thin bar that drains, showing how long it stays. */
.toast-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  transform-origin: left center;
  opacity: 0.5;
  animation: toastDrain linear both;
}

.toast { position: relative; overflow: hidden; padding-bottom: 14px; }

.toast.ok .toast-ico { background: rgba(77, 225, 193, 0.18); color: var(--accent); }
.toast.ok .toast-bar { background: var(--accent); }
.toast.pending .toast-ico { background: rgba(255, 217, 61, 0.18); color: #ffd93d; }
.toast.pending .toast-bar { background: #ffd93d; }
.toast.err .toast-ico { background: rgba(255, 107, 139, 0.18); color: #ff8a9e; }
.toast.err .toast-bar { background: #ff8a9e; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); max-height: 120px; }
  to   { opacity: 0; transform: translateX(40px) scale(0.96); max-height: 0; }
}

@keyframes toastDrain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Admin panel */
#admin-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 12, 0.62);
  backdrop-filter: blur(2px);
}

.admin-panel {
  display: flex;
  flex-direction: column;
  width: 720px;
  max-width: 94vw;
  height: 470px;
  max-height: 86vh;
  background: linear-gradient(180deg, #171a30 0%, var(--panel) 45%, #101223 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.45),
    0 28px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.admin-sub {
  padding: 0 16px 10px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-queue {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.26);
}

.admin-row-art {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.admin-row-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.admin-row-info { flex: 1 1 auto; min-width: 0; }
.admin-row-name { font-size: 14px; font-weight: 700; }
.admin-row-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-actions { display: flex; gap: 7px; flex: 0 0 auto; }

.admin-actions button {
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.admin-actions button:active { transform: scale(0.96); }

.btn-approve { background: rgba(77, 225, 193, 0.18); color: var(--accent); border-color: rgba(77, 225, 193, 0.5) !important; }
.btn-reject { background: rgba(255, 107, 139, 0.16); color: #ff8a9e; border-color: rgba(255, 107, 139, 0.5) !important; }
.admin-actions button:hover { filter: brightness(1.18); }

.admin-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.skins-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------ Menu */

#menu {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  /* Start screen: the same build as the brand banner — grid, centre bloom and
     soft neon cells over a cool diagonal base. */
  background:
    radial-gradient(circle at 13% 20%, rgba(77, 225, 193, 0.16), transparent 24%),
    radial-gradient(circle at 87% 16%, rgba(255, 93, 143, 0.14), transparent 22%),
    radial-gradient(circle at 80% 84%, rgba(124, 108, 255, 0.17), transparent 26%),
    radial-gradient(circle at 16% 82%, rgba(87, 200, 255, 0.13), transparent 22%),
    radial-gradient(circle at 50% 8%, rgba(255, 217, 61, 0.08), transparent 16%),
    radial-gradient(1100px 640px at 50% 45%, rgba(77, 225, 193, 0.1), transparent 62%),
    radial-gradient(1100px 640px at 50% 45%, rgba(124, 108, 255, 0.08), transparent 72%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 34px),
    linear-gradient(135deg, #0b0c16 0%, #121424 50%, #090a11 100%);
}

/* Vignette over the backdrop, under the card. */
#menu::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 38%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Keep the card and footer above the backdrop layers. */
#menu > .menu-card,
#menu > footer {
  position: relative;
  z-index: 1;
}

/* Pause overlay: drop the decorative backdrop entirely so the live game
   shows through behind the panel. */
#menu.paused {
  background: rgba(8, 9, 15, 0.35);
  backdrop-filter: blur(1.5px);
}

#menu.paused::after {
  display: none;
}

#menu.paused footer {
  display: none;
}

/* Three columns: sidebar (profile/skins/settings), main, server browser.
   The stacked shadows read as one soft light source above the card, and the
   inset top edge acts as a rim highlight so it sits off the page. */
.menu-card {
  display: flex;
  gap: 0;
  width: 940px;
  max-width: 96vw;
  background: linear-gradient(180deg, #171a30 0%, var(--panel) 42%, #101223 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 6px 16px rgba(0, 0, 0, 0.4),
    0 22px 48px rgba(0, 0, 0, 0.5),
    0 44px 90px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.menu-side {
  /* Wide enough for the two skin slots plus both arrows. */
  flex: 0 0 250px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  /* Recessed rail: darker, with a lit inner edge on the right. */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.2));
  border-right: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.side-spacer {
  flex: 1 1 auto;
  min-height: 14px;
}

.menu-left {
  flex: 1 1 auto;
  min-width: 0;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
}

.menu-right {
  flex: 0 0 42%;
  padding: 20px 20px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.18));
  border-left: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Progression: level, coins, XP bar */
/* Recessed card: sunk into the rail, lit along its top inner edge. */
.profile {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 2px 6px rgba(0, 0, 0, 0.28);
}

/* Signed-out state */
.locked-note {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 9px;
}

#discord-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: #5865f2;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s;
}

#discord-login:hover {
  filter: brightness(1.1);
}

#discord-login:active {
  transform: scale(0.98);
}

#discord-login:disabled {
  filter: grayscale(0.7) brightness(0.7);
  cursor: default;
}

.locked-hint {
  margin-top: 8px;
  font-size: 11px;
  color: #ff8a9e;
  text-align: center;
  line-height: 1.4;
}

/* Signed-in state */
/* Plain header strip — the user's Discord banner is deliberately not used. */
.account-banner {
  height: 40px;
  margin: -12px -12px 0;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -18px; /* let the avatar overlap the banner */
  margin-bottom: 8px;
}

/* Discord handle (@name) — sits where the email used to. */
.account-email {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-email:empty {
  display: none;
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #1a1c2e;
  border: 3px solid var(--panel);
  object-fit: cover;
}

.account-id-block {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.account-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-gameid {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

#copy-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.12s;
}

#copy-id:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(77, 225, 193, 0.14);
}

#copy-id:active {
  transform: scale(0.88);
}

#copy-id.copied {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(77, 225, 193, 0.22);
}

#discord-logout {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

#discord-logout:hover {
  color: #ff6b8b;
  border-color: #ff6b8b;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.level-badge {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.level-badge b {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  margin-left: 2px;
}

.coins {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #ffd93d;
  font-variant-numeric: tabular-nums;
}

.coin-ico {
  font-size: 12px;
}

/* Carved groove with the fill glowing inside it. */
.xp-bar {
  height: 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.05);
}

.xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #57c8ff);
  box-shadow:
    0 0 10px rgba(77, 225, 193, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.xp-text {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.earned {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(77, 225, 193, 0.12);
  border: 1px solid rgba(77, 225, 193, 0.35);
}

.earned.levelup {
  color: #ffd93d;
  background: rgba(255, 217, 61, 0.14);
  border-color: rgba(255, 217, 61, 0.45);
}

/* Sidebar action buttons */
.side-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.side-actions button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.08s;
}

.side-actions button {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 5px rgba(0, 0, 0, 0.3);
}

.side-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 5px 14px rgba(0, 0, 0, 0.38);
}

.side-actions button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

.side-actions button.active {
  border-color: var(--accent);
  background: rgba(77, 225, 193, 0.16);
  color: var(--accent);
}

/* Unreviewed submissions counter on the Admin button. */
#admin-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: #ff3b5c;
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px rgba(255, 59, 92, 0.25), 0 2px 6px rgba(255, 59, 92, 0.5);
  animation: badgePulse 1.8s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 59, 92, 0.25), 0 2px 6px rgba(255, 59, 92, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 59, 92, 0), 0 2px 10px rgba(255, 59, 92, 0.7);
  }
}

.logo {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo span {
  -webkit-text-fill-color: var(--muted);
  opacity: 0.7;
}

.tagline {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 16px;
}

/* Tag sits in front of the nickname, sharing one sunken row. */
.name-row {
  display: flex;
  gap: 8px;
}

#tag {
  flex: 0 0 62px;
  width: 62px;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.42);
  color: var(--accent);
  outline: none;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#tag::placeholder {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

#tag:focus {
  border-color: var(--accent);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(77, 225, 193, 0.16);
}

/* Sunken field */
#nick {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  outline: none;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#nick:focus {
  border-color: var(--accent);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(77, 225, 193, 0.16);
}

/* Play + Spectate */
.play-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.play-row button {
  flex: 1 1 0;
  padding: 13px 8px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  /* Raised key: lit top edge, shadow beneath. */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 -2px 0 rgba(0, 0, 0, 0.25) inset,
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 8px 18px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.14s ease,
    filter 0.18s ease;
}

.play-row button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 -2px 0 rgba(0, 0, 0, 0.25) inset,
    0 4px 8px rgba(0, 0, 0, 0.38),
    0 12px 26px rgba(0, 0, 0, 0.36);
}

/* Press it down into the page. */
.play-row button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 2px 6px rgba(0, 0, 0, 0.4);
}

.play-row .icon {
  font-size: 13px;
}

#play {
  color: #08131a;
  background: linear-gradient(90deg, var(--accent), #57c8ff);
}

#spectate {
  color: var(--text);
  background: rgba(124, 108, 255, 0.18);
  border: 1px solid rgba(124, 108, 255, 0.5) !important;
}

.play-row button:hover {
  filter: brightness(1.1);
}
.play-row button:disabled {
  filter: grayscale(0.6) brightness(0.7);
  cursor: default;
  transform: none;
}

.join-msg {
  min-height: 16px;
  margin-top: 8px;
  font-size: 12.5px;
  color: #ff8a9e;
  font-weight: 600;
}

/* Advertisement */
.ad {
  margin-top: auto;
  padding-top: 18px;
}

.ad-label {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}

.ad-box {
  position: relative;
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(124, 108, 255, 0.28), transparent 60%),
    radial-gradient(120% 100% at 100% 100%, rgba(77, 225, 193, 0.22), transparent 60%),
    #10121f;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ad-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 2px 6px;
}

.ad-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.ad-title span {
  color: var(--muted);
  opacity: 0.75;
}

.ad-copy {
  font-size: 12px;
  color: var(--muted);
  margin: 6px auto 12px;
  max-width: 220px;
  line-height: 1.45;
}

.ad-cta {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 6px 16px;
}

/* Discord invite — full-width blurple call to action under the ad. */
.discord-join {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: #5865f2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.32),
    0 8px 18px rgba(88, 101, 242, 0.28);
  transition:
    transform 0.14s var(--ease-out),
    box-shadow 0.14s ease,
    background 0.18s ease;
}

.discord-join:hover {
  background: #6b78ff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 4px 8px rgba(0, 0, 0, 0.35),
    0 12px 26px rgba(88, 101, 242, 0.35);
}

.discord-join:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

/* No invite configured yet: still visible, but clearly inert. */
.discord-join.unset {
  background: #3a3f6b;
  cursor: not-allowed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.discord-join.unset:hover {
  transform: none;
  background: #3a3f6b;
}

.status {
  margin-top: 10px;
  font-size: 11px;
  color: #ff8a9e;
  text-align: center;
}

/* Collapse entirely when there's nothing to report. */
.status:empty {
  display: none;
}

#death {
  margin-bottom: 12px;
}

.death-title {
  font-size: 18px;
  font-weight: 700;
  color: #ff6b8b;
}

.death-score {
  color: var(--muted);
  margin-top: 2px;
  font-size: 13px;
}

.death-score span {
  color: var(--accent);
  font-weight: 700;
}

/* Server browser */
.servers-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.region-tabs {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 10px;
}

.region-tab {
  flex: 1 1 0;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.region-tab:hover {
  color: var(--text);
}

.region-tab.active {
  color: var(--accent);
  background: rgba(77, 225, 193, 0.12);
}

.servers-head,
.server-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.servers-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.servers-head .col-players,
.server-row .col-players {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.server-list {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 300px;
  margin-top: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.server-list::-webkit-scrollbar {
  width: 8px;
}
.server-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
}

.server-row {
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

/* Locked for launch: listed, struck through, not joinable. */
.server-row.soon {
  cursor: default;
  opacity: 0.55;
}

.server-row.soon .col-name {
  text-decoration: line-through;
  text-decoration-color: #e24b4a;
  text-decoration-thickness: 2px;
}

.server-row.soon .col-players {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.region-tab.soon {
  text-decoration: line-through;
  text-decoration-color: #e24b4a;
  text-decoration-thickness: 2px;
  opacity: 0.6;
}

/* Lift the row toward the light on hover. */
.server-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
  transform: translateX(2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

.server-row.selected {
  background: linear-gradient(90deg, rgba(77, 225, 193, 0.22), rgba(77, 225, 193, 0.1));
  border-color: rgba(77, 225, 193, 0.55);
  box-shadow:
    0 0 0 1px rgba(77, 225, 193, 0.25),
    0 4px 14px rgba(77, 225, 193, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.server-row .col-name {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-row .col-players {
  color: var(--accent);
  font-weight: 900;
}

.server-row.full .col-players {
  color: #ff6b8b;
}


.server-empty {
  padding: 24px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

footer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 0 12px;
}

footer b {
  color: var(--text);
  font-weight: 700;
}

/* Impressum / privacy / terms. Quieter than the key hints above them — always
   there, never competing with the Play button. */
.footer-legal {
  display: flex;
  gap: 6px 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 7px;
}

.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  font-size: 11.5px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.footer-legal a:hover {
  color: var(--accent);
  border-bottom-color: #4de1c166;
}

/* Spectating banner */
#spectate-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  background: rgba(13, 14, 24, 0.72);
  border: 1px solid rgba(124, 108, 255, 0.5);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text);
  backdrop-filter: blur(4px);
}

#spectate-banner .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5277;
  margin-right: 6px;
  vertical-align: middle;
  animation: specpulse 1.4s ease-in-out infinite;
}

#spectate-banner .key {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

@keyframes specpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 960px) {
  .menu-card {
    flex-direction: column;
    width: 440px;
    max-height: 92vh;
    overflow-y: auto;
  }
  .menu-side,
  .menu-left,
  .menu-right {
    flex: 0 0 auto;
    width: 100%;
  }
  .menu-side {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  .side-spacer {
    display: none;
  }
  .side-actions {
    flex-direction: row;
    margin-top: 14px;
  }
  .menu-right {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }
}
