/* DJ Diabetin Online web room — deep violet theme. */
:root {
  color-scheme: dark;
  --bg: #07000c;
  --surface: rgba(15, 7, 25, 0.8);
  --surface-strong: #120920;
  --raised: #140a22;
  --raised-2: #1a0f2c;
  --raised-3: #231736;
  --field: #0b0512;
  --line: #2a1f3d;
  --line-strong: #473368;
  --line-hover: #6b4fa0;
  --text: #f3effa;
  --muted: #a19ea8;
  --lav: #c4a6f5;
  --lav-2: #d7bff7;
  --lav-3: #e0cffb;
  --violet: #8b5cf6;
  --violet-strong: #7c3aed;
  --violet-deep: #4c1d95;
  --danger: #f3a3b8;
  --danger-line: #5b2a3f;
  --glow: rgba(71, 51, 104, 0.4);
  --radius: 18px;
  /* The card scale shared by the home page and the room: cards, then hero bands and the room's big card. */
  --radius-lg: 22px;
  --radius-xl: 28px;
  /* The product's atmosphere, painted once for every page: two soft violet lights, a fine grain and a dot grid. */
  --page-glow:
    radial-gradient(1000px 520px at 82% -140px, rgba(124, 58, 237, 0.22), transparent 70%),
    radial-gradient(800px 480px at 4% 36%, rgba(76, 29, 149, 0.2), transparent 70%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --dot: rgba(196, 166, 245, 0.16);
  /* Space between the library's cards. */
  --lib-gap: 20px;
  --font-body: Manrope, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", Manrope, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar-h: 64px;
  /* Listener rank tiers, Oyente to Eterno, and achievement rarities. */
  --t1: #a19ea8;
  --t2: #7dd3fc;
  --t3: #6ee7b7;
  --t4: #c4a6f5;
  --t5: #f472b6;
  --t6: #fbbf24;
  --t7: #fb923c;
  --t8: #e879f9;
  --t9: #2dd4bf;
  --t10: #f87171;
  --t11: #bae6fd;
  --t12: #818cf8;
  --t13: #22d3ee;
  --t14: #fff7d6;
  --r-common: #a19ea8;
  --r-uncommon: #6ee7b7;
  --r-rare: #7dd3fc;
  --r-epic: #c084fc;
  --r-legendary: #fbbf24;
  --r-mythic: #fb7185;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--page-glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* A fine grain over the whole page: inline SVG noise (--grain), very low opacity, behind the content (z-index -1 puts
   it above the body's own background and below everything else, so no wrapper needs a stacking context) and never in
   the way of a click. Static: no animated filter, one fixed layer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.055;
  background-image: var(--grain);
  background-size: 180px 180px;
}

/* The room's dot grid: the home's hero grid, fading out of the top-right corner behind the top bar and the cards.
   One static fixed layer with a mask (the home page draws its own inside the hero). */
body:not(.home-page)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 55% 50% at 84% 0, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 50% at 84% 0, #000, transparent 75%);
}

a {
  color: var(--lav);
}

a:hover {
  color: var(--lav-3);
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.accent-text {
  color: var(--lav);
}

/* ---------------------------------------------------------------- scrollbars */

/* One thin, theme-coloured scrollbar for the whole page: the page itself, the chat, the queue, the library
   grid and the menus. Rules that hide a scrollbar (scrollbar-width: none) are more specific and keep winning. */
:root {
  --scroll-thumb: var(--line-strong);
  --scroll-thumb-hover: color-mix(in srgb, var(--lav) 45%, var(--line-strong));
}

/* Firefox (Chrome and Safari take the WebKit rules below: Chrome would ignore them if these were set). */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  }
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--scroll-thumb);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}

.time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--muted);
}

.section-label::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.section-label::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: var(--line);
}

/* ---------------------------------------------------------------- motion */

@keyframes o-eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes o-sweep { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
@keyframes o-ripple { from { transform: scale(0); opacity: 0.5; } to { transform: scale(2.4); opacity: 0; } }
@keyframes o-knob { 0% { opacity: 0.6; transform: scale(1); } 60%, 100% { opacity: 0; transform: scale(2); } }
@keyframes o-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.o-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 180ms, box-shadow 180ms, background-color 180ms, color 180ms;
}

.o-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 166, 245, 0.3), transparent 62%);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.o-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.o-btn:active:not(:disabled)::after {
  animation: o-ripple 480ms ease-out;
}

.o-btn:focus-visible,
input:focus-visible,
.seek-bar:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

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

/* A still glow: an animated box-shadow repaints the button on every frame. */
.o-btn-primary {
  box-shadow: 0 0 20px rgba(132, 75, 241, 0.45);
}

@media (hover: hover) {
  /* A quiet hover: the border steps up one neutral. Primary buttons keep their violet border. */
  .o-btn:hover:not(:disabled):not(.primary):not(.o-btn-primary) {
    border-color: var(--line-strong);
  }
  .o-btn:active:not(:disabled) {
    transform: scale(0.94);
  }
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex-shrink: 0;
}

.eq i {
  display: block;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--lav);
  opacity: 0.75;
  transform-origin: bottom;
  animation: o-eq 900ms ease-in-out infinite;
}

.eq i:nth-child(2) { animation-duration: 760ms; animation-delay: -300ms; }
.eq i:nth-child(3) { animation-duration: 1040ms; animation-delay: -600ms; }
.eq i:nth-child(4) { animation-duration: 820ms; animation-delay: -150ms; }

body.is-paused .eq i,
body.is-idle .eq i {
  animation: none;
  transform: scaleY(0.3);
}

/* ---------------------------------------------------------------- shared controls */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip svg {
  flex-shrink: 0;
}

/* Pills, tags, badges and menu rows are labels: they stay on one line. (Buttons that hold a sentence, such as the
   audio gate, are not listed and wrap normally.) */
.listeners-btn,
.room-count,
.bot-tag,
.badge,
.guest-tag,
.item-badge,
.rank-tag,
.sub-rooms-label,
.user-dropdown-item {
  white-space: nowrap;
}

.chip.primary {
  border-color: var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  font-weight: 700;
}

.chip.danger {
  border-color: var(--danger-line);
  color: var(--danger);
  font-weight: 700;
}

.chip[aria-pressed="true"] {
  border-color: var(--violet);
  background: var(--raised-3);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
}

.icon-btn.primary {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border-color: var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
}

.icon-btn[aria-pressed="true"] {
  border-color: var(--violet);
  color: var(--lav-3);
  background: var(--raised-3);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

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

.card-head h2 {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.4px;
}

.head-icon {
  flex-shrink: 0;
  color: var(--muted);
}

/* A heading is a single line: when the column is tight it shortens with an ellipsis instead of breaking
   between words, and the buttons beside it keep their size. */
.card-head h2 > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-head > :not(h2) {
  flex: none;
}

.card-head small {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.card-head-actions {
  display: flex;
  gap: 8px;
}

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

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

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

.app {
  max-width: 1440px;
  margin: 0 auto;
}

body:not(.home-page) .app {
  max-width: 1680px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 0 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}

a.brand:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 4px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px dashed var(--lav);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.rooms {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--field);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.room-link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.room-link[aria-current="page"] {
  border-color: var(--line-strong);
  background: var(--raised-3);
  color: var(--text);
  font-weight: 700;
}

.room-link:hover {
  color: var(--text);
}

.room-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.room-count::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lav);
  opacity: 0.6;
}

.room-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.room-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--raised-3);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.room-link:not([aria-current="page"]) .room-icon {
  opacity: 0.75;
}

.room-switch {
  position: relative;
  display: none;
  min-width: 0;
}

.room-switch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 6px 0 0;
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  max-width: 100%;
}

.room-switch-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-switch-btn svg {
  color: var(--muted);
  flex-shrink: 0;
}

.room-switch .room-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
}

.room-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: o-in 160ms ease-out;
}

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

.user-chip {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.user-menu {
  position: relative;
}

button.user-chip,
.user-menu summary.user-chip {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

/* The user menu (top bar). */
.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 180px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: o-in 160ms ease-out;
}

.user-dropdown[hidden] {
  display: none;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-dropdown-item:hover,
.user-dropdown-item:focus-visible {
  background: var(--raised-2);
}

.user-dropdown-item:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: -2px;
}

.user-dropdown-item svg {
  flex-shrink: 0;
  color: var(--muted);
}

.user-dropdown-item.danger svg {
  color: inherit;
}

.user-dropdown-sep {
  height: 0;
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line);
}

.user-dropdown-item.danger {
  color: var(--danger);
}

.user-dropdown-item.danger:hover,
.user-dropdown-item.danger:focus-visible {
  background: rgba(255, 92, 92, 0.14);
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 16px 48px 40px;
  align-items: start;
}

.col-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* The chat. Wide screens make it as tall as the player column (see "room shell"); its messages scroll inside it and
   the input row stays in view. */
.col-side {
  min-width: 0;
}

/* Queue above library; wide screens put the queue beside the player instead (see "wide room layout"). */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ---------------------------------------------------------------- sub-rooms */

/* The rooms row: rooms on the left, who is listening on the right (its right edge is the card's).
   It sits on a layer above the stage and the chat below it, so its pop-overs (who is listening, the room menu)
   open over them even while the load fade gives each block its own stacking context. */
.room-bar {
  position: relative;
  z-index: 25; /* under the top bar menus (30) and the modals (50+) */
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.room-bar .sub-rooms {
  flex: 1 1 auto;
}

.room-bar .listeners {
  margin-left: auto;
}

.sub-rooms {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* Same 34px box as the chips beside it, centred inside, so label and chips share one axis. */
.sub-rooms-label {
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin-right: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.sub-room-list {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.sub-room {
  text-decoration: none;
  color: var(--muted);
  max-width: 220px;
}

.sub-room-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-room[aria-current="page"] {
  border-color: var(--violet);
  background: var(--raised-3);
  color: var(--text);
  font-weight: 700;
}

.sub-room-new {
  color: var(--muted);
  border-style: dashed;
}

.sub-room-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 260px;
  min-width: 0;
}

.sub-room-form input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}

.sub-room-form input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

#sub-room-close {
  margin-left: auto;
}

/* ---------------------------------------------------------------- now playing */

.now-card {
  background: rgba(18, 9, 31, 0.78);
  border-color: var(--line-strong);
  padding: 0 0 var(--stage-pad);
  gap: 18px;
}

/* The player column: the video runs edge to edge (top and both sides of the card, no padding around it), then
   everything that drives it sits below with the card's padding. The card never gets near the 200px YouTube
   refuses to embed under. */
.now-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.now-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 0 var(--stage-pad);
}

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

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--muted);
  text-transform: uppercase;
}

.kicker #player-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listeners {
  position: relative;
  flex-shrink: 0;
}

.listeners-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 3px 14px 3px 3px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--raised-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.listeners-word {
  margin-left: -4px;
}

.bubbles {
  display: flex;
}

.bubble {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--surface-strong);
  object-fit: cover;
  background: var(--raised-3);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: margin 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bubble + .bubble {
  margin-left: -10px;
}

@media (hover: hover) {
  .listeners-btn:hover .bubble + .bubble {
    margin-left: -3px;
  }
}

.listeners-tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 160ms, transform 160ms, visibility 160ms;
}

.listeners-btn[aria-expanded="true"] + .listeners-tip,
.listeners:focus-within .listeners-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (hover: hover) {
  .listeners:hover .listeners-tip {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

.listener-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.listener-row strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.track-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.12;
  letter-spacing: -0.6px;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  /* "pretty" fills each line to the column's width (balance cut the first line short); two lines, then an ellipsis.
     The full text is in the title attribute. */
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* The copy-link button sits right after the title: small, quiet, never pushing the title onto a third line. */
.title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.title-row .track-title {
  min-width: 0;
}

.share-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  opacity: 0.7;
}

.share-btn:disabled {
  display: none;
}

.share-btn:hover:not(:disabled),
.share-btn:focus-visible {
  opacity: 1;
}

.track-title .hl {
  background: linear-gradient(90deg, var(--lav-2), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.track-meta {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  text-wrap: pretty;
}

/* No frame of its own: the video is flush with the card, so its top corners follow the card's (the top-right one is
   square beside the queue, see "player stage"). */
.player-window {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

/* The sync status floats over the video's top-left corner instead of sitting in a strip above it. */
.window-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.window-bar .dots {
  display: none;
}

.window-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-retry {
  min-height: 22px;
  padding: 0 10px;
  font-size: 11px;
  pointer-events: auto;
}

.player-retry[hidden] {
  display: none;
}

.sync-badge {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 0, 12, 0.72);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--field);
  overflow: hidden;
}

#youtube-player,
#youtube-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.media-cover {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-shell.stream-mode .media-cover[src] {
  display: block;
}

.video-shell.stream-mode #youtube-player {
  visibility: hidden;
}

.player-shield {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.audio-gate {
  position: absolute;
  inset: auto 16px 16px 16px;
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--violet);
  background: rgba(26, 15, 44, 0.94);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
  text-align: center;
}

.audio-gate.visible {
  display: flex;
}

/* The embed must receive the tap on its play button, so the shield opens a hole in the middle only:
   the title and the YouTube logo around it would open youtube.com instead of playing. */
.tap-video .player-shield {
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 30% 28%, 70% 28%, 70% 72%, 30% 72%, 30% 28%);
}

.tap-video .audio-gate {
  inset: 42px 12px auto 12px;
  pointer-events: none;
}

.audio-gate strong {
  color: var(--text);
  font-size: 15px;
}

.audio-gate span {
  color: var(--muted);
  font-size: 12px;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(124, 58, 237, 0.12), transparent 60%), var(--field);
}

.player-placeholder strong {
  font-family: var(--font-display);
  font-size: 18px;
}

.player-placeholder span {
  color: var(--muted);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.seek-bar {
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: #1f1530;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.seek-bar::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}

.seek-bar.disabled {
  cursor: default;
  opacity: 0.5;
}

.seek-fill {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet-strong), var(--violet));
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.seek-fill .shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.seek-fill .shine::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: o-sweep 2.6s ease-in-out infinite;
}

.seek-fill .knob {
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
}

/* The pulse is a ring scaled behind the dot, so the compositor runs it without repainting. */
.seek-fill .knob::before,
.seek-fill .knob::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.seek-fill .knob::before {
  background: rgb(196, 166, 245);
  animation: o-knob 1.8s ease-out infinite;
}

.seek-fill .knob::after {
  background: var(--text);
}

body.is-idle .seek-fill .knob,
body.is-idle .seek-fill .shine {
  display: none;
}

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.repeat-badge {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: 9px;
  font-weight: 800;
  color: var(--lav);
}

.volume {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 190px;
  color: var(--muted);
}

.volume input {
  flex-grow: 1;
  min-width: 0;
  accent-color: var(--violet);
}

.mute-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 180ms, color 180ms;
}

.mute-btn:hover {
  background: var(--raised-2);
  color: var(--text);
}

.mute-btn:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

.mute-btn .ico-muted,
.mute-btn.is-muted .ico-sound {
  display: none;
}

.mute-btn.is-muted .ico-muted {
  display: block;
}

.volume:has(.mute-btn[aria-pressed="true"]) input {
  opacity: 0.45;
}

@media (min-width: 761px) {
  .transport-buttons {
    gap: 8px;
  }

  .transport .icon-btn {
    width: 44px;
    height: 44px;
  }

  .transport .icon-btn.primary {
    width: 52px;
    height: 52px;
  }

  .volume {
    flex: 1 1 150px;
    width: auto;
    max-width: 220px;
  }
}

/* The actions row under the player is gone: Detener is a transport button, Random 20 / Top 10 sit in the "Reproducción
   rápida" card under the transport (and in the empty player), Top canciones in the library header, and Jugar (the
   games modal) tops the chat column. */

/* Detener: the transport's one destructive button, in a soft danger tone (border and icon, no fill). */
.icon-btn.stop-btn {
  border-color: var(--danger-line);
  color: var(--danger);
}

@media (hover: hover) {
  /* The generic hover steps the border to a neutral; this one stays red, a notch brighter. */
  .o-btn.icon-btn.stop-btn:hover:not(:disabled) {
    border-color: var(--danger);
  }
}

/* Jugar: the way into the games. Full width above the chat; primary violet but with no glow, so it never outshouts
   the play/pause button. */
.games-launch {
  min-width: 0;
}

.games-launch .games-btn {
  gap: 8px;
  width: 100%;
  height: 42px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

#btn-games[aria-expanded="true"] {
  border-color: var(--violet);
  background: var(--raised-3);
}

/* Phones' second way in, in the now view's header row. */
.games-now {
  display: none;
}

/* The empty player's two shortcuts (the same commands as the library header's). */
.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.placeholder-actions .chip {
  min-height: 38px;
  padding: 0 16px;
}

/* Reproducción rápida: Random 20 / Top 10, always at hand under the transport (the library is another tab on a
   phone). A small card of its own row at every width (~375px wide), never in the transport row: next to the 312px
   transport buttons it needs ~700px, and the player column's content box is only ~415px at 1281px with the queue open
   and ~627px at 761px, so the volume slider would drop under ~120px or wrap. Secondary buttons only; the one violet
   fill stays on play/pause. The card is data-member-only, so guests never get an empty card. */
.quick-play {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
}

.quick-play-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-play-actions {
  display: flex;
  gap: 8px;
}

.quick-play-actions .chip {
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  white-space: nowrap;
}

.chat-card .card-head .chip,
.queue-card .card-head .chip {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

/* Collapse / expand the queue column: ONE icon button in the queue header (tablet and desktop only, the player-stage
   section turns it on; phones keep the queue as its own view). It stays where it is when collapsed: the column
   shrinks to a narrow rail (desktop) or a slim header row (stacked) and the same button, now with the "open" icon,
   brings it back. The count under it is only drawn in the narrow rail. */
.queue-collapse,
.queue-rail-count {
  display: none;
}

.queue-card .card-head .queue-collapse {
  width: 30px;
  padding: 0;
}

.queue-collapse .ico-open {
  display: none;
}

.player-stage.queue-collapsed .queue-collapse .ico-close {
  display: none;
}

.player-stage.queue-collapsed .queue-collapse .ico-open {
  display: block;
}

.queue-rail-count {
  min-width: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--raised-3);
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  color: var(--text);
}

/* Phone only: the next songs under the player. */
.up-next {
  display: none;
}

.up-next .queue-row {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.icon-btn.liked {
  color: #fb4f7a;
  border-color: #7a2946;
}

.icon-btn.liked svg {
  fill: currentColor;
}

/* ---------------------------------------------------------------- queue */

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-gutter: stable;
}

/* The queue card fills a column on wide screens (the card is sized by the player beside it and the list
   scrolls inside); elsewhere it is an ordinary card that grows with its rows, up to a cap. */
.queue-card {
  padding: 0;
}

.queue-fill {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 22px;
}

.queue-card .queue-list {
  max-height: 420px;
}

/* Secondary to the track title: a small single-line heading beside a compact button. */
.queue-card .card-head {
  gap: 8px;
}

.queue-card .card-head h2 {
  gap: 8px;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.queue-card .head-icon {
  width: 16px;
  height: 16px;
}

.queue-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 40px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 4px 6px 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 200ms, background-color 200ms;
  animation: o-in 180ms ease-out;
}

.queue-row:first-child {
  border-color: var(--line-strong);
  background: var(--raised);
}

.queue-row.editing {
  grid-template-columns: 28px 32px minmax(0, 1fr) auto;
  padding-left: 4px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* Rows are rebuilt on every move; replaying the entrance animation made them flicker. */
  animation: none;
}

.queue-row.editing .grip {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  /* A finger on the grip drags the row instead of scrolling the page. */
  touch-action: none;
}

.queue-list.sorting .queue-row {
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 200ms, background-color 200ms;
}

.queue-list.sorting .queue-row.dragging {
  position: relative;
  z-index: 5;
  transition: none;
  cursor: grabbing;
  border-color: var(--violet);
  background: var(--raised-3);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 22px var(--glow);
}

.queue-row.moved {
  border-color: var(--violet);
  background: var(--raised-2);
}

.queue-row .num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--field);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.queue-row:first-child .num,
.queue-row.moved .num {
  border-color: var(--line-strong);
  color: var(--lav);
}

.queue-row .title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-btn:not(:disabled):hover {
  color: var(--text);
}

.queue-row .moves {
  display: flex;
}

.queue-row .grip {
  color: var(--muted);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 18px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  color: var(--muted);
  opacity: 0.7;
}

.pending-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 10px 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--violet);
  background: var(--raised-2);
  animation: o-in 180ms ease-out;
}

.pending-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pending-copy strong {
  font-size: 13px;
}

.pending-copy span {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- library */

.library-head {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  grid-template-areas: "title tabs quick search";
  gap: 12px 16px;
  align-items: center;
}

.library-head > h2 {
  grid-area: title;
}

.library-head > .seg {
  grid-area: tabs;
}

.library-head .search {
  grid-area: search;
  justify-self: end;
  width: 100%;
  max-width: 400px;
}

/* Library shortcut (Top canciones): a compact secondary button beside the tabs. Random 20 / Top 10 moved to the
   .quick-play card under the transport. */
.library-quick {
  grid-area: quick;
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-quick .chip {
  gap: 6px;
  color: var(--muted);
}

@media (hover: hover) {
  .library-quick .chip:hover:not(:disabled) {
    color: var(--text);
  }
}

/* Narrower than the wide layout: icon-only (aria-label and title keep the names), and the search drops under the
   title row so nothing is squeezed. */
@media (max-width: 1280px) {
  .library-quick .lq-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .library-quick .chip {
    width: 36px;
    padding: 0;
  }
}

@media (min-width: 761px) and (max-width: 960px) {
  .library-head {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "title quick"
      "tabs search";
  }
  .library-quick {
    justify-self: end;
  }
  .library-head .search {
    justify-self: stretch;
    max-width: none;
  }
}

.seg {
  display: flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid var(--line);
}

.seg [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.seg [role="tab"] span:empty {
  display: none;
}

.seg [role="tab"][aria-selected="true"] {
  border-color: var(--line-strong);
  background: var(--raised-3);
  color: var(--text);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 6px 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  transition: border-color 160ms, box-shadow 160ms;
  min-width: 0;
}

.search:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
  color: var(--lav);
}

.search input {
  flex-grow: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: var(--raised-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: o-in 180ms ease-out;
}

.item-row .copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-row .copy strong {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-row .copy span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-row .row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.item-row .square {
  width: 32px;
  height: 32px;
  padding: 0;
}

.item-row mark {
  background: rgba(139, 92, 246, 0.35);
  color: var(--text);
  border-radius: 4px;
  padding: 0 2px;
}

.likes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Playlists are a grid of cards, songs a grid of rows; each scrolls inside the card up to a sensible height.
   The cards never go past five per row: each column is at least a fifth of the row (less the four gaps), and never
   under 220px, so a wide screen gets four or five roomy cards and a narrow one fewer, not six cramped ones. */
#playlist-list,
#search-playlists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(220px, calc((100% - 4 * var(--lib-gap)) / 5)), 1fr));
  grid-auto-rows: 1fr;
  gap: var(--lib-gap);
  align-content: start;
}

#likes-list,
#search-songs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  align-content: start;
}

#playlist-list,
#likes-list,
#library-search {
  max-height: min(560px, 60vh);
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-gutter: stable;
}

#playlist-list > :is(.empty, .meta),
#search-playlists > :is(.empty, .meta),
#likes-list > :is(.empty, .meta),
#search-songs > :is(.empty, .meta) {
  grid-column: 1 / -1;
}

.item-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--raised-3);
  color: var(--muted);
}

.item-icon svg {
  width: 20px;
  height: 20px;
}

/* Every library item speaks one language: a tinted tile with a Lucide glyph, the name, a quieter line under it and
   the actions, play first. Hover and focus change the border and the surface, nothing moves. */
.item-row:focus-within {
  border-color: var(--line-strong);
  background: var(--raised);
}

@media (hover: hover) {
  .item-row:hover {
    border-color: var(--line-strong);
    background: var(--raised);
  }
}

.item-row .o-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.item-row .row-actions .chip:not(.square) {
  min-height: 30px;
}

/* Songs (likes, search results): one compact row of tile, title and detail, actions. */
.item-row.song-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 8px 6px 10px;
}

.song-row .item-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.song-row .item-icon svg {
  width: 16px;
  height: 16px;
}

/* A playlist card, kept small: the order number in a tile, the name with a count badge, the first three songs as a
   numbered list and a compact action row. Cards in a grid row share one height (rows are equal), so the footers
   line up; the list takes whatever height is left. */
.item-row.playlist-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "tile head"
    "tracks tracks"
    "actions actions";
  gap: 10px 12px;
  padding: 14px;
  border-radius: 18px;
  /* The home's game cards: --raised surface, a step brighter on hover. */
  background: var(--raised);
  transition: border-color 160ms, background-color 160ms;
}

@media (hover: hover) {
  .item-row.playlist-card:hover {
    background: var(--raised-2);
  }
}

.item-row.playlist-card:focus-within {
  background: var(--raised-2);
}

.playlist-card .item-number {
  grid-area: tile;
  width: 40px;
  height: 34px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}

.playlist-card .card-title {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.playlist-card .card-title strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-card .item-badge {
  flex: none;
}

/* A real ordered list, small and muted; each track is one line. */
.item-tracks {
  grid-area: tracks;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: decimal inside;
}

.item-tracks li {
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-tracks li::marker {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--muted) 65%, transparent);
}

.playlist-card .row-actions {
  grid-area: actions;
  align-self: end;
  justify-content: flex-end;
}

.playlist-card .row-actions .chip:not(.square) {
  flex: 1 1 auto;
  padding: 0 10px;
  font-size: 12px;
}

.playlist-card .row-actions .chip:not(.square) svg {
  width: 14px;
  height: 14px;
}

.playlist-card .row-actions .square {
  width: 30px;
  height: 30px;
}

/* ---------------------------------------------------------------- chat */

.chat-card {
  position: relative;
  height: 100%;
  border-color: var(--line-strong);
}

.chat-log {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 10px;
  scrollbar-gutter: stable;
}

.chat-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--raised);
  animation: o-in 180ms ease-out;
  overflow-wrap: anywhere;
}

.chat-entry.system,
.chat-entry.error {
  border: 1px solid var(--line-strong);
  background: var(--raised-2);
}

.chat-entry.error {
  border-color: var(--danger-line);
}

/* Messages from people wear a softer version of the bot messages' border. */
.chat-entry.user,
.chat-entry.command {
  border: 1px solid color-mix(in srgb, var(--line-strong) 60%, transparent);
}

.chat-entry.command .chat-body {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-meta strong {
  font-size: 12px;
  font-weight: 800;
}

.chat-meta time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.bot-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #1a0633;
  background: var(--lav);
  border-radius: 5px;
  padding: 2px 5px;
}

.chat-entry.error .bot-tag {
  background: var(--danger);
}

.chat-form {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
}

.chat-form input {
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  min-width: 0;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}

.chat-form input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.commands-toggle {
  width: 44px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 18px;
}

.commands-toggle[aria-expanded="true"] {
  border-color: var(--violet);
  background: var(--raised-3);
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.commands {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 15;
  max-height: min(460px, 70%);
  overflow-y: auto;
  padding: 8px 6px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: o-in 160ms ease-out;
}

.commands .section-label {
  padding: 8px 10px 2px;
}

.commands-hint {
  padding: 2px 10px 6px;
  font-size: 12px;
  color: var(--muted);
}

.command-item {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  text-align: left;
}

.command-item[aria-selected="true"],
.command-item:hover {
  background: var(--raised-3);
}

.command-item code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lav-2);
}

.command-item code em {
  font-style: normal;
  color: #8d86a0;
}

.command-item span {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- command hints */

/* In normal flow between the chat log and the input, so it never overlaps the composer on any viewport. */
.command-hint {
  flex-shrink: 0;
  max-height: 46%;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  font-size: 12px;
  color: var(--muted);
}

.command-hint[hidden] { display: none; }

.command-hint-head strong {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text);
}

.command-hint-usage {
  display: block;
  margin: 4px 0 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lav-2);
  overflow-wrap: anywhere;
}

.command-hint-usage .param.active {
  padding: 1px 4px;
  border-radius: 6px;
  background: var(--violet-deep);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--violet);
}

.command-hint-desc,
.command-hint-params {
  margin: 0 0 6px;
  line-height: 1.4;
}

.command-hint-params {
  padding-left: 16px;
}

.command-hint-desc strong,
.command-hint-params strong {
  color: var(--text);
}

.command-hint-examples {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.command-hint-example {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.command-hint-example:hover { background: var(--raised-3); }

.command-hint-example code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--lav-2);
}

/* Parameter chips and the server's reading of the typed command (src/web/listen.js, "command preview"). */
.command-hint-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 6px 0;
}

.command-hint-command {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lav-2);
}

.hint-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 5px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hint-chip.filled,
.hint-chip.implied,
.hint-chip.defaulted { border-style: solid; }
.hint-chip.filled { color: var(--text); background: var(--raised-3); }
.hint-chip.defaulted .hint-chip-value,
.hint-chip.implied .hint-chip-value { color: var(--lav-2); }

.hint-chip.active {
  border-style: solid;
  border-color: var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--violet);
}

.hint-chip-name { font-weight: 600; }
.hint-chip-note { font-size: 11px; opacity: 0.8; }
.hint-chip-reading { color: var(--lav-2); }
.hint-chip.active .hint-chip-reading { color: #ffffff; }

.command-hint-summary {
  margin: 0 0 6px;
  padding: 5px 8px;
  border-radius: 10px;
  line-height: 1.4;
  color: var(--text);
  background: var(--raised-3);
  overflow-wrap: anywhere;
}

.command-hint-summary[hidden] { display: none; }
.command-hint-summary.ok { border-left: 3px solid #4ade80; }
.command-hint-summary.missing { border-left: 3px solid #fbbf24; }
.command-hint-summary.error { border-left: 3px solid #f87171; }
.command-hint-summary.pending { color: var(--muted); }
.command-hint-summary.stale { opacity: 0.55; }

.command-hint-examples.compact {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.command-hint-examples.compact .command-hint-example {
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

/* ---------------------------------------------------------------- modal shell
   ONE shell for every dialog and game window of the room: the playlist, profile, ranks and games hub modals, the
   kicked screen, the word board and its admin, the truco pad, the install sheet and the game panels. Pieces:

     .modal           the backdrop (fixed, dimmed, blurred). Closing on a click outside is wired per modal in JS.
     .modal-card      the surface: --radius-lg, the room's violet light, one shadow. Size variants set --m-w:
                      .modal-sm 440px, .modal-md 640px (default), .modal-lg 960px; a window can set --m-w itself.
     .modal-head      header on ONE line: .modal-icon (icon tile) + .modal-titles (.modal-eyebrow, the h3 / .modal-title,
                      .modal-sub) + .modal-close (the close button, .icon-btn).
     .modal-body      the content. It only scrolls when it is taller than the viewport allows (last resort).
     .modal-foot      optional footer: actions, right aligned.
     .modal-full      phones: a full-height sheet instead of a bottom sheet (long content: games, profile, ranks).

   Phones (<= 760px): the surface is a full-width sheet glued to the bottom. The entry motion only plays when the
   visitor has not asked for reduced motion. The game panels (.game-panel) wear the same surface and header; see the
   game section for where they sit. */

:root {
  --modal-backdrop: rgba(5, 0, 10, 0.74);
  --modal-radius: var(--radius-lg);
  --modal-pad: 20px;
  --modal-gap: 14px;
  --modal-shadow: 0 28px 72px rgba(0, 0, 0, 0.55);
  --modal-surface:
    radial-gradient(520px 240px at 100% 0, rgba(124, 58, 237, 0.14), transparent 70%),
    var(--surface-strong);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
}

.modal-card {
  --m-w: 640px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--modal-gap);
  width: min(var(--m-w), 100%);
  max-height: 100%;
  min-width: 0;
  padding: var(--modal-pad);
  border-radius: var(--modal-radius);
  border: 1px solid var(--line-strong);
  background: var(--modal-surface);
  box-shadow: var(--modal-shadow);
  outline: none;
}

.modal-sm { --m-w: 440px; }
.modal-md { --m-w: 640px; }
.modal-lg { --m-w: 960px; }

.modal-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* The icon tile: the room's headers and the home's game cards use the same one. */
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  color: var(--lav);
}

.modal-titles {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.modal-eyebrow {
  color: var(--lav);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.modal-head h2,
.modal-head h3,
.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.modal-sub {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.modal-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-close {
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 12px;
}

.modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: var(--modal-gap);
  border-top: 1px solid var(--line);
}

/* Playlist modal rows: the rows of the queue and the chat sit on --field too. */
.modal-song {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 40px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 2px 4px 2px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
}

.modal-song .song-index,
.modal-song .song-duration {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.modal-song .song-name {
  overflow-wrap: anywhere;
}

@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes modal-sheet-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .modal-card {
    animation: modal-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

@media (max-width: 760px) {
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100% - 12px);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: var(--modal-radius) var(--modal-radius) 0 0;
  }

  /* Long content (games, profile, ranks): a full-height sheet that also covers the tab bar. */
  .modal-card.modal-full {
    height: 100%;
    max-height: none;
    padding-top: max(14px, env(safe-area-inset-top));
    border-width: 0;
    border-radius: 0;
  }

  .modal-foot .chip {
    min-height: 44px;
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .modal-card {
    animation-name: modal-sheet-in;
  }
}

/* ---- scroll lock behind modals
   listen.js (wireScrollLock) puts .scroll-locked on <html> while any full-screen modal or overlay shows: every .modal
   (games hub, playlist, profile, ranks, kicked, the word board's admin), the word board (.wordle-overlay) and the truco
   pad (.truco-overlay) that wear the shell too, the level-up screen, the install sheet
   and the room game's large centred panel (.game-panel.playing, not minimized). The page scrolls on the viewport (no
   wrapper has its own scroll), so overflow:hidden on <html> is what stops it; <body> gets it too, to be safe.
   The gutter is always reserved, so the page does not jump sideways when the scrollbar goes away; scrolling inside a
   modal or panel never chains to the page. */
html {
  scrollbar-gutter: stable;
}

html.scroll-locked,
html.scroll-locked body {
  overflow: hidden;
}

:is(.modal, .wordle-overlay, .truco-overlay, .rank-overlay, .install-sheet, .game-panel),
:is(.modal, .wordle-overlay, .truco-overlay, .rank-overlay, .install-sheet, .game-panel) * {
  overscroll-behavior: contain;
}

/* ---------------------------------------------------------------- games hub modal
   The Jugar button opens it (on the modal shell: .modal-lg, .modal-full on phones). One card per game: a static mock
   of the game's own UI (aria-hidden, no motion), what the game is, and the start button. Violet stays on the start
   buttons and on the "active" bits inside the mocks. On wide screens the eight cards sit in four columns and two
   rows, so the hub needs no inner scroll on a 1440x900 window; shorter windows get the scroll as the last resort. */

.games-modal-card {
  outline: none;
}

.games-sub {
  max-width: 64ch;
}

/* The grid is the modal's scroll container (when it has to scroll at all). Rows are as tall as their cards need
   (max-content): a card is never squeezed to fit the modal, the grid scrolls instead. (Cards must not be
   overflow:hidden: a grid item with a scroll/clip overflow has a 0 automatic minimum size and its auto row would
   shrink with the container.) */
.games-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(auto-fill, minmax(204px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 2px 6px 2px 2px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.game-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field);
}

@media (hover: hover) {
  /* A quiet hover, like the other neutral surfaces: the border steps up one neutral. */
  .game-card:hover {
    border-color: var(--line-strong);
  }
}

.game-card:focus-within {
  border-color: var(--line-strong);
}

.gc-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.gc-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.gc-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.gc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.gc-facts li {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* Pinned to the bottom so the buttons line up across a row of cards of different text lengths. */
.gc-play {
  flex: none;
  width: 100%;
  min-height: 38px;
  margin-top: auto;
}

@media (hover: hover) {
  .gc-play:hover:not(:disabled) {
    background: var(--violet-strong);
  }
}

/* A window about 800px tall or less: trim the cards a little so the two rows still get as close to fitting as they can. */
@media (min-width: 761px) and (max-height: 820px) {
  .games-modal-card {
    --modal-pad: 16px;
    --modal-gap: 10px;
  }

  .gc-body {
    gap: 6px;
    padding: 10px 12px 12px;
  }

  .gc-text {
    font-size: 12px;
    line-height: 1.4;
  }
}

/* ---- previews: the game's own colours and shapes, drawn small and still */

/* A fixed-height stage that never shrinks: the mock is centred in it and always fits (the mocks are drawn to stay
   under 84px, the content height of the phone stage). Only the stage clips, never the card. */
.gc-preview {
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  height: 104px;
  padding: 8px 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  border-radius: 15px 15px 0 0;
  background: var(--surface-strong);
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
}

/* A line of text, stood in by a bar. */
.gc-preview i {
  display: block;
  width: 80%;
  height: 5px;
  border-radius: 3px;
  background: var(--line-strong);
}

.gc-preview i.s {
  width: 50%;
}

/* Juego random: the audio strip and the four answer buttons of the song game. */
.gp-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.gp-audio i {
  width: 46%;
}

.gp-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex: none;
}

.gp-eq b {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--lav);
  opacity: 0.75;
}

.gp-eq b:nth-child(1) { height: 5px; }
.gp-eq b:nth-child(2) { height: 12px; }
.gp-eq b:nth-child(3) { height: 8px; }
.gp-eq b:nth-child(4) { height: 10px; }

.gp-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.gp-option {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field);
}

.gp-option i {
  width: 70%;
}

.gp-option.correct {
  border-color: #6ee7b7;
  background: rgba(110, 231, 183, 0.16);
}

.gp-option.correct i {
  background: rgba(110, 231, 183, 0.55);
}

/* ¿Cuál es más vieja? and ¿Cuál tiene más vistas?: the two song cards of a round, answer revealed. */
.gp-compare {
  position: relative;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.gp-cmp {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--field);
}

.gp-cmp i {
  height: 4px;
}

.gp-cmp.correct {
  border-color: #6ee7b7;
  background: rgba(110, 231, 183, 0.16);
}

.gp-cmp.other {
  opacity: 0.75;
}

.gp-thumb {
  display: block;
  height: 24px;
  border-radius: 7px;
  background: var(--raised-3);
}

.gp-cmp strong {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.gp-meter {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}

.gp-meter b {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--lav);
}

.gp-meter b.hi { width: 92%; }
.gp-meter b.lo { width: 8%; }

.gp-vs {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Impostor: the table, one seat to play now, one hidden, and the clue-turn banner. */
.gp-seats {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.gp-av {
  position: relative;
  display: grid;
  flex: 0 1 30px;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  color: var(--muted);
}

.gp-av::before,
.gp-av::after {
  content: "";
  position: absolute;
  left: 50%;
  translate: -50% 0;
  background: currentColor;
  opacity: 0.7;
}

.gp-av::before {
  top: 22%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.gp-av::after {
  top: 62%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50% 50% 0 0;
}

.gp-av.current {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}

.gp-av.masked {
  border-color: var(--danger-line);
  background: rgba(243, 163, 184, 0.12);
  color: var(--danger);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.gp-av.masked::before,
.gp-av.masked::after {
  display: none;
}

.gp-turn,
.gp-banner {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-turn.mine {
  border-color: var(--violet);
}

.gp-banner.mine {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet) 22%, var(--raised));
  color: #ffffff;
}

/* Adiviná tu número and Adiviná tu monto: the player cards (others show their secret, yours is a "?"). */
.gp-ncards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gp-ncards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gp-ncard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
}

.gp-ncard i {
  width: 56%;
}

.gp-ncard.turn {
  border-color: var(--violet);
  box-shadow: 0 0 0 1px var(--violet);
}

.gp-ncard strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.gp-ncard strong.hidden {
  color: var(--muted);
}

.gp-pips {
  display: flex;
  gap: 3px;
}

.gp-pips b {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.gp-pips b.on {
  background: #f472b6;
}

.gp-money .gp-ncard strong {
  font-size: 18px;
}

.gp-range {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gp-track {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.gp-track b {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 18%;
  width: 27%;
  border-radius: 3px;
  background: var(--violet);
}

.gp-range small {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #3f8f73;
}

/* Palabra del día: the board. The three states use the word board's own colours (wordle.css). */
.gp-wordle {
  --tile-correct: #2f8f5b;
  --tile-present: #b88a1e;
  --tile-absent: #3a3347;
  align-items: center;
  gap: 4px;
}

.gp-wrow {
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 4px;
}

.gp-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--field);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.gp-tile.c { border-color: var(--tile-correct); background: var(--tile-correct); }
.gp-tile.p { border-color: var(--tile-present); background: var(--tile-present); }
.gp-tile.a { border-color: var(--tile-absent); background: var(--tile-absent); color: var(--muted); }
.gp-tile.f { border-color: var(--line-hover); }
.gp-tile.cur { border-color: var(--lav); box-shadow: 0 0 0 1px var(--lav); }

/* Anotador de truco: two teams, boxes of five matchsticks (same colours and geometry as truco.css). */
.gp-truco {
  --truco-stick: #e8c48a;
  --truco-head: #d9473a;
}

.gp-pad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gp-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.gp-tname {
  display: flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
}

.gp-tname b {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-tname strong {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
}

.gp-half {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gp-boxes {
  display: flex;
  gap: 2px;
}

.gp-box {
  width: 26px;
  height: 26px;
}

.gp-box g {
  opacity: 0.08;
}

.gp-box g.on {
  opacity: 1;
}

.gp-box line {
  stroke: var(--truco-stick);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.gp-box circle {
  fill: var(--truco-head);
}

@media (max-width: 760px) {
  /* The modal shell's full-height sheet (.modal-full) covers the tab bar; the cards scroll inside it. */
  .games-modal-card {
    gap: 10px;
  }

  .games-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-right: 2px;
    scrollbar-gutter: auto;
  }

  .gc-body {
    padding: 12px 14px 14px;
  }

  .gc-text {
    font-size: 13px;
  }

  .gc-play {
    min-height: 44px;
  }
}

/* ---------------------------------------------------------------- command forms
   The parameter form of a command (listen.js, "command forms"). It lives in #command-form-modal (the chat and the
   command palette open it) and as the second step of the games hub (#games-form, which replaces the cards; the arrow
   in the hub's header goes back). The form is a flex column: .cf-body is the modal body (it scrolls when the screen is
   short) and .cf-foot the footer, so the buttons stay in view.

   Two zones, in the home's card language (--raised cards, icon tiles, display type): .cf-aside is the summary card (the
   game's picture from the hub, the server's reading of the command as a coloured state, the command that will be sent)
   and .cf-fields holds one small card per field. A form with three fields or more, a rival or a playlist is .is-split
   (the summary on the left, sticky); the others, and phones, stack them. On a phone the summary drops below the fields
   and sticks to the bottom of the scroll area, just above the buttons, without its picture.

   Violet only marks what is active: the checked choice, the card picked in the playlist grid, the focus ring and the
   primary button. The summary states borrow the chat hint's colours (ok, missing, error). Nothing moves except for
   visitors who have not asked for reduced motion; the avatars are still (no rank aura animation). */

.cf-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--modal-gap);
  min-height: 0;
  margin: 0;
}

.cf-back {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* The modal around a form: narrow for one field, wide for two zones. */
.command-form-card {
  --m-w: 520px;
}

.command-form-card.is-split {
  --m-w: 880px;
}

.cf-body {
  gap: 16px;
  padding: 2px 6px 2px 2px;
}

.cf-body.is-split {
  display: grid;
  grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  gap: 18px;
}

/* ---- the summary zone */

.cf-aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.cf-body.is-split > .cf-aside {
  position: sticky;
  top: 0;
}

.cf-aside-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

/* Stacked (one field, or a phone): the summary is a strip above the field, its picture a tile on the left. */
.cf-body:not(.is-split) > .cf-aside {
  flex-direction: row;
  align-items: stretch;
}

.cf-body:not(.is-split) .cf-art {
  flex: none;
  width: 92px;
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.cf-body:not(.is-split) .cf-aside-body {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

/* The games' own mock from the hub (cloned), or the command's icon in a tile over a soft violet light. */
.cf-art {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.cf-art .gc-preview {
  width: 100%;
  height: 124px;
  border: 0;
  border-radius: 0;
}

.cf-art.is-tile {
  min-height: 96px;
  background:
    radial-gradient(220px 110px at 50% 0, rgba(124, 58, 237, 0.2), transparent 75%),
    var(--surface-strong);
}

.cf-art-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  color: var(--lav);
}

.cf-art-tile svg {
  width: 28px;
  height: 28px;
}

.cf-blurb {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Nothing to say, or the games hub already shows the blurb under its title. */
.cf-blurb:empty,
.cf-view[data-host="cfg"] .cf-blurb {
  display: none;
}

/* The server's reading of the command: a state (colour, glyph, title) and its words. */
.cf-summary {
  --state: var(--muted);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--state) 40%, var(--line));
  background: color-mix(in srgb, var(--state) 8%, var(--field));
}

.cf-summary[data-state="ok"] {
  --state: #4ade80;
}

.cf-summary[data-state="missing"] {
  --state: #fbbf24;
}

.cf-summary[data-state="error"] {
  --state: #f87171;
}

.cf-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--state) 16%, transparent);
  color: var(--state);
}

.cf-summary-icon svg {
  width: 17px;
  height: 17px;
}

.cf-summary-title {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--state);
}

.cf-summary[data-state="idle"] .cf-summary-title,
.cf-summary[data-state="pending"] .cf-summary-title,
.cf-summary[data-state="offline"] .cf-summary-title {
  color: var(--text);
}

.cf-preview {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}

.cf-summary[data-state="idle"] .cf-preview,
.cf-summary[data-state="pending"] .cf-preview,
.cf-summary[data-state="offline"] .cf-preview {
  color: var(--muted);
}

.cf-summary.is-stale .cf-preview {
  opacity: 0.55;
}

/* The command that will be sent, as a small mono chip. */
.cf-command {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.cf-command-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cf-command code {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--lav-2);
  overflow-wrap: anywhere;
}

.cf-command code.is-empty {
  color: var(--muted);
}

/* ---- the fields: one card each; counts, amounts and switches share a row, the rest take it whole */

.cf-fields {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.cf-field.is-wide {
  flex: 1 1 100%;
}

.cf-field.is-compact {
  flex: 1 1 220px;
}

.cf-field:focus-within {
  border-color: var(--line-strong);
}

.cf-field-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon help";
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
}

.cf-field-icon {
  grid-area: icon;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  color: var(--lav);
}

.cf-field-icon svg {
  width: 17px;
  height: 17px;
}

.cf-label {
  grid-area: label;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.1px;
  color: var(--text);
}

/* Help is a quiet second line under the label. */
.cf-help {
  grid-area: help;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0.85;
}

.cf-error {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.cf-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cf-note {
  flex: 1 1 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* ---- numbers: [-] value [+], and quick picks under it */

.cf-amount {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--text);
  cursor: pointer;
}

.cf-step svg {
  width: 18px;
  height: 18px;
}

.cf-step[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

@media (hover: hover) {
  .cf-step:hover:not([aria-disabled="true"]) {
    border-color: var(--line-hover);
    background: var(--raised-3);
  }
}

.cf-step:focus-visible,
.cf-seg-item:focus-visible,
.cf-mode:focus-visible,
.cf-person:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

/* The value, in display type; the input is as wide as what is typed, and the unit sits beside it. */
.cf-readout {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 56px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
}

.cf-readout:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.cf-bignum {
  min-width: 1ch;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cf-bignum:focus-visible {
  outline: none;
}

.cf-bignum::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.cf-unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.cf-unit:empty {
  display: none;
}

/* ---- segmented choices: radio groups drawn as a row of buttons */

.cf-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
}

.cf-seg-item {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

@media (hover: hover) {
  .cf-seg-item:hover {
    color: var(--text);
  }
}

.cf-seg-item[aria-checked="true"] {
  border-color: var(--violet);
  background: var(--raised-3);
  color: var(--text);
}

/* The stake: two big choices, practice or betting. */
.cf-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cf-mode {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.cf-mode-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--raised-3);
  color: var(--muted);
}

.cf-mode-icon svg {
  width: 17px;
  height: 17px;
}

.cf-mode-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cf-mode strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
}

.cf-mode small {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

@media (hover: hover) {
  .cf-mode:hover {
    border-color: var(--line-strong);
  }
}

.cf-mode[aria-checked="true"] {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet-deep) 38%, var(--field));
  box-shadow: 0 0 0 1px var(--violet);
}

.cf-mode[aria-checked="true"] .cf-mode-icon {
  background: var(--violet-deep);
  color: #ffffff;
}

/* ---- people: avatar chips (a still ring in the listener's rank colour) */

.cf-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  padding: 3px;
  overflow-y: auto;
}

.cf-person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (hover: hover) {
  .cf-person:hover {
    border-color: var(--line-strong);
  }
}

.cf-avatar {
  --c: var(--t1);
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 2px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 75%, transparent);
}

.cf-avatar-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  font-size: 11px;
}

.cf-person.is-all .cf-avatar {
  padding: 0;
  background: var(--raised-3);
  color: var(--lav);
}

.cf-person.is-all .cf-avatar svg {
  width: 16px;
  height: 16px;
}

.cf-person-name {
  min-width: 0;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-person[aria-checked="true"] {
  border-color: var(--violet);
  background: var(--raised-3);
  box-shadow: 0 0 0 1px var(--violet);
}

.cf-people-empty {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---- the playlist picker: the library's cards, selectable, with a search and pages */

.cf-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cf-search {
  height: 42px;
}

.cf-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.cf-picker-meta,
.cf-picked {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.cf-picked {
  max-width: 100%;
  overflow: hidden;
  font-weight: 700;
  color: var(--lav-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-picker-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cf-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-content: start;
  gap: 10px;
  max-height: min(400px, 46vh);
  padding: 3px 6px 3px 3px;
  overflow-y: auto;
}

.cf-picker-grid.is-loading {
  opacity: 0.55;
}

.cf-picker-message {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 18px 12px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* A card of the library, picked instead of played: no actions row, a pointer, a violet state when checked. */
.item-row.playlist-card.cf-pick {
  position: relative;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "tile head"
    "tracks tracks";
  cursor: pointer;
  animation: none;
  user-select: none;
}

.item-row.playlist-card.cf-pick:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

.item-row.playlist-card.cf-pick[aria-checked="true"] {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet-deep) 32%, var(--raised));
  box-shadow: 0 0 0 1px var(--violet);
}

.cf-pick[aria-checked="true"] .item-number {
  border-color: var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
}

/* The check on the number tile: a second cue besides the colour. */
.cf-pick[aria-checked="true"]::after {
  content: "";
  position: absolute;
  top: 37px;
  left: 42px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: 0 0 0 2px var(--raised);
}

/* "Al azar": the same card across the whole row, with a line of text where the songs go. */
.item-row.playlist-card.cf-pick.is-random {
  grid-template-rows: auto auto;
  grid-template-areas:
    "tile head"
    "tile tracks";
  align-items: center;
}

.cf-pick.is-random .item-number {
  align-self: start;
}

.cf-pick.is-random .item-number svg {
  width: 18px;
  height: 18px;
}

.cf-pick-note {
  grid-area: tracks;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

/* Previous / "Página N de M" / next: the picker's pages and the library's playlist grid share it (pagerControl). */
.cf-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.cf-page {
  width: 40px;
  height: 40px;
}

.cf-pager-label {
  min-width: 10ch;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---- text, presets, ranges */

.cf-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font: inherit;
}

.cf-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.cf-input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.cf-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cf-preset {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

/* A range: minimum and maximum side by side. */
.cf-pair {
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}

.cf-pair-item {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cf-sublabel {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.cf-dash {
  padding-bottom: 12px;
  color: var(--muted);
}

.cf-money {
  position: relative;
  display: block;
}

.cf-prefix {
  position: absolute;
  top: 50%;
  left: 12px;
  translate: 0 -50%;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.cf-money .cf-input {
  padding-left: 26px;
}

/* A switch: the checkbox stays in the page for the keyboard and screen readers, the track and the knob are drawn. The
   words come first and the switch sits at the end of the row. */
.cf-toggle {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.cf-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cf-switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--field);
}

.cf-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
}

.cf-toggle input:checked + .cf-switch {
  border-color: var(--violet);
  background: var(--violet-deep);
}

.cf-toggle input:checked + .cf-switch::after {
  background: #ffffff;
  transform: translateX(18px);
}

.cf-toggle input:checked ~ .cf-toggle-text {
  color: var(--text);
}

.cf-toggle input:focus-visible + .cf-switch {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

.cf-submit {
  min-width: 140px;
}

@media (prefers-reduced-motion: no-preference) {
  .cf-switch,
  .cf-switch::after {
    transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 160ms, border-color 160ms;
  }

  .cf-field,
  .cf-step,
  .cf-seg-item,
  .cf-mode,
  .cf-person,
  .cf-readout,
  .cf-input,
  .cf-summary,
  .cf-picker-grid {
    transition: border-color 160ms, background-color 160ms, box-shadow 160ms, opacity 160ms, color 160ms;
  }
}

/* Phones: one column. The picture and the blurb go, and the summary sticks to the bottom of the scroll area, above the buttons. */
@media (max-width: 760px) {
  .cf-body.is-split {
    display: flex;
    align-items: stretch;
  }

  .cf-body {
    gap: 12px;
    padding-right: 2px;
  }

  .cf-aside,
  .cf-body.is-split > .cf-aside {
    position: sticky;
    bottom: 0;
    top: auto;
    z-index: 1;
    order: 2;
    border-radius: 14px;
    border-color: var(--line-strong);
    background: var(--surface-strong);
  }

  .cf-art,
  .cf-blurb {
    display: none;
  }

  .cf-aside-body {
    gap: 8px;
    padding: 10px;
  }

  .cf-command {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .cf-command code {
    flex: 1 1 auto;
    min-width: 0;
  }

  .cf-field.is-compact {
    flex-basis: 100%;
  }

  .cf-modes {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A page is 200 cards: the grid keeps its own scroll here too, so the pager under it stays in reach. */
  .cf-picker-grid {
    max-height: min(420px, 56vh);
    padding-right: 3px;
  }

  .cf-step,
  .cf-seg-item,
  .cf-person {
    min-height: 44px;
  }

  .cf-submit {
    flex: 1 1 auto;
  }
}

/* The palette marks the entries that open a form. */
.command-item .command-form-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 1px;
}

/* ---------------------------------------------------------------- mobile chrome (hidden on desktop) */

.tabbar,
.mini-player {
  display: none;
}

.badge {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--violet);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-icon {
  position: relative;
  display: inline-flex;
}

/* ---------------------------------------------------------------- home: signed-in dashboard, landing, invite */

/* The pages outside the room share one frame: a narrower column, soft violet light, a fine grain, and a single
   staggered reveal on load. Everything is scoped under .home-page so the room page is untouched. */

/* The light (--page-glow) and the grain (body::before) are the shared page atmosphere, defined with the body at the
   top of this file; the room page paints the same ones. */
body.home-page {
  /* The hero light and dot grid reach past the column; clip them at the window so they never add a scrollbar. */
  overflow-x: clip;
}

.home-page .app {
  position: relative;
  z-index: 1;
  max-width: 1296px;
}

.home-page .topbar {
  padding-top: env(safe-area-inset-top);
}

.home-page .home {
  padding: 8px 48px 72px;
}

/* Rank tier and achievement rarity colours, as custom properties the blocks below read. */
.home-page .tier-1 { --tier: var(--t1); }
.home-page .tier-2 { --tier: var(--t2); }
.home-page .tier-3 { --tier: var(--t3); }
.home-page .tier-4 { --tier: var(--t4); }
.home-page .tier-5 { --tier: var(--t5); }
.home-page .tier-6 { --tier: var(--t6); }
.home-page .tier-7 { --tier: var(--t7); }
.home-page .tier-8 { --tier: var(--t8); }
.home-page .tier-9 { --tier: var(--t9); }
.home-page .tier-10 { --tier: var(--t10); }
.home-page .tier-11 { --tier: var(--t11); }
.home-page .tier-12 { --tier: var(--t12); }
.home-page .tier-13 { --tier: var(--t13); }
.home-page .tier-14 { --tier: var(--t14); }
.home-page .rar-common { --rar: var(--r-common); }
.home-page .rar-uncommon { --rar: var(--r-uncommon); }
.home-page .rar-rare { --rar: var(--r-rare); }
.home-page .rar-epic { --rar: var(--r-epic); }
.home-page .rar-legendary { --rar: var(--r-legendary); }
.home-page .rar-mythic { --rar: var(--r-mythic); }

@keyframes home-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes home-spin { to { transform: rotate(360deg); } }
@keyframes home-ping { from { transform: scale(1); opacity: 0.55; } to { transform: scale(2.6); opacity: 0; } }
@keyframes home-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* The one load moment: the first blocks rise in, one after another. */
@media (prefers-reduced-motion: no-preference) {
  .home-page .rise {
    animation: home-rise 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 80ms);
  }
}

/* ---- shared type */

.home-page .home-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.08;
}

.home-page .home-greeting {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.home-page .home-greeting strong {
  color: var(--text);
  font-weight: 700;
}

.home-page .home-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.home-page .hx-h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.home-page .hx-h2 svg {
  flex-shrink: 0;
  color: var(--muted);
}

.home-page .hx-h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.home-page .hx-section-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.home-page .hx-section {
  margin-top: 56px;
}

.home-page .hx-section-head {
  margin-bottom: 20px;
}

.home-page .home-empty {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.home-page .home-login {
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  text-decoration: none;
}

.home-page :is(.w45, .w55, .w60, .w65, .w70, .w80) {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: var(--line-strong);
}

.home-page .w45 { width: 45%; }
.home-page .w55 { width: 55%; }
.home-page .w60 { width: 60%; }
.home-page .w65 { width: 65%; }
.home-page .w70 { width: 70%; }
.home-page .w80 { width: 80%; }

/* Progress bar (XP to the next level, achievement progress). Tier colour when a tier is in scope, violet otherwise. */
.home-page .hx-bar {
  display: block;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field);
  overflow: hidden;
}

.home-page .hx-bar.is-thin {
  height: 6px;
}

.home-page .hx-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tier, var(--violet)) 65%, #000), var(--tier, var(--violet)));
}

.home-page .hx-bar[class*="rar-"] > span {
  background: var(--rar);
}

/* ---- signed-in hero */

.home-page .hx-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 24px;
  margin-top: 8px;
  padding: 40px 48px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(620px 340px at 88% 10%, rgba(124, 58, 237, 0.3), transparent 70%),
    radial-gradient(520px 300px at 0 100%, rgba(76, 29, 149, 0.28), transparent 70%),
    var(--surface);
  overflow: hidden;
}

/* A dot grid that fades out away from the record. */
.home-page .hx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 80% 40%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 80% 40%, #000, transparent 75%);
}

.home-page .hx-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.home-page .hx-live {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 0;
  color: #cfc9db;
  font-size: 16px;
  line-height: 1.45;
}

.home-page .hx-live strong {
  color: var(--text);
}

.home-page .hx-live-dot {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.home-page .hx-live-dot.is-on {
  background: var(--lav);
}

.home-page .hx-live-dot.is-on::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--lav);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .home-page .hx-live-dot.is-on::after {
    animation: home-ping 2s ease-out infinite;
  }
}

.home-page .hx-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
}

.home-page .hx-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(11, 5, 18, 0.6);
  color: var(--muted);
  font-size: 13px;
}

.home-page .hx-chips strong {
  color: var(--text);
  font-weight: 800;
}

.home-page .hx-chips svg {
  flex-shrink: 0;
}

.home-page .hx-hero-art {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.home-page .hx-art {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.hx-art .art-disc { fill: #0d0716; stroke: var(--line-strong); stroke-width: 2; }
.hx-art .art-groove { fill: none; stroke: #2a1f3d; stroke-width: 1.2; }
.hx-art .art-label-ring { fill: none; stroke: rgba(224, 207, 251, 0.35); stroke-width: 1; }
.hx-art .art-hole { fill: #0d0716; }
.hx-art .art-pivot { fill: var(--raised-3); stroke: var(--line-strong); stroke-width: 2; }
.hx-art .art-pivot-dot { fill: var(--line-hover); }
.hx-art .art-arm-bar { fill: none; stroke: var(--line-strong); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.hx-art .art-arm-head { fill: var(--raised-3); stroke: var(--line-strong); stroke-width: 2; }
.hx-art .art-bar { fill: var(--violet); opacity: 0.85; transform-box: fill-box; transform-origin: 50% 100%; }
.hx-art .art-bar:nth-child(2n) { fill: var(--lav); opacity: 0.7; }
.hx-art .art-spin { transform-origin: 165px 165px; }

@media (prefers-reduced-motion: no-preference) {
  .hx-art .art-spin { animation: home-spin 24s linear infinite; }
  .hx-art .art-bar { animation: o-eq 1.1s ease-in-out infinite; }
  .hx-art .art-bar:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.3s; }
  .hx-art .art-bar:nth-child(3) { animation-duration: 1.3s; animation-delay: -0.6s; }
  .hx-art .art-bar:nth-child(4) { animation-duration: 1s; animation-delay: -0.2s; }
  .hx-art .art-bar:nth-child(5) { animation-duration: 1.2s; animation-delay: -0.8s; }
}

/* ---- profile strip */

.home-page .hx-profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  padding: 24px 28px 24px 32px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

/* A thin edge in the colour of the viewer's rank tier. */
.home-page .hx-profile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--tier, var(--line-strong));
}

.home-page .hx-pf-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.home-page .hx-pf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 68px;
  height: 68px;
  padding: 3px;
  border-radius: 50%;
  border: 2px solid var(--tier, var(--line-strong));
  background: var(--raised-3);
  object-fit: cover;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
}

.home-page .hx-pf-who {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.home-page .hx-pf-who p {
  margin: 0;
}

.home-page .hx-pf-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
}

.home-page .hx-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tier) 55%, transparent);
  background: color-mix(in srgb, var(--tier) 14%, transparent);
  color: var(--tier);
  font-size: 12px;
  font-weight: 800;
}

.home-page .hx-pf-where {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.home-page .hx-pf-xp {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.home-page .hx-pf-xp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.home-page .hx-pf-level {
  color: var(--text);
  font-size: 14px;
}

.home-page .hx-pf-level strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.home-page .hx-pf-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.home-page .hx-pf-hint strong {
  color: var(--text);
}

.home-page .hx-pf-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 0;
  padding: 0;
}

.home-page .hx-pf-stats li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  line-height: 1.25;
}

.home-page .hx-pf-stats svg {
  grid-row: 1 / span 2;
  place-self: center;
  color: var(--muted);
}

.home-page .hx-pf-stats strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.home-page .hx-pf-stats span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.home-page .hx-pf-ach {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.home-page .hx-pf-ach-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.home-page .hx-pf-ach-head strong {
  color: var(--text);
}

.home-page .hx-ach-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.home-page .hx-ach-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--rar) 45%, transparent);
  background: color-mix(in srgb, var(--rar) 10%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.home-page .hx-ach-list svg {
  flex-shrink: 0;
  color: var(--rar);
}

.home-page .hx-ach-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-page .hx-pf-next {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.home-page .hx-pf-next p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.home-page .hx-pf-next strong {
  color: var(--text);
}

.home-page .hx-pf-next small {
  color: var(--muted);
  font-size: 11px;
}

.home-page .hx-pf-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.home-page .hx-profile.is-empty {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
}

.home-page .hx-pf-cta {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  text-decoration: none;
}

/* ---- server cards */

.home-page .home-servers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.home-page .home-server-item {
  display: flex;
  min-width: 0;
}

@media (min-width: 761px) {
  .home-page .home-server-item.is-featured {
    grid-column: span 2;
  }
}

.home-page .home-server {
  --card-bg: var(--raised);
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 180ms, background-color 180ms, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-page .home-server.is-featured {
  background:
    radial-gradient(520px 260px at 100% 0, rgba(124, 58, 237, 0.26), transparent 70%),
    var(--card-bg);
}

/* Somebody is listening: the border picks up a little violet. */
.home-page .home-server.is-live {
  border-color: color-mix(in srgb, var(--violet) 40%, var(--line));
}

.home-page .home-server:hover {
  --card-bg: var(--raised-2);
  color: var(--text);
  border-color: var(--line-strong);
}

.home-page .home-server.is-live:hover {
  border-color: color-mix(in srgb, var(--violet) 62%, var(--line));
}

.home-page .home-server:active {
  transform: scale(0.99);
}

.home-page .home-server:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 3px;
}

.home-page .hs-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
}

.home-page .is-featured .hs-body {
  gap: 20px;
  padding: 28px;
}

.home-page .hs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-page .home-server .room-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  font-size: 18px;
}

.home-page .hs-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.home-page .is-featured .hs-name {
  font-size: 22px;
  font-weight: 800;
}

/* What plays right now: the cover, the "Sonando ahora" accent and the title on up to two lines. */
.home-page .hs-now {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field);
}

.home-page .hs-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--raised-3);
  color: var(--muted);
}

.home-page .hs-art-idle {
  border: 1px dashed var(--line-strong);
  background: transparent;
}

.home-page .hs-track {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.home-page .hs-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lav);
  font-size: 12px;
  font-weight: 800;
}

.home-page .hs-status .eq,
.home-page .hs-status .eq i {
  height: 12px;
}

.home-page .hs-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.home-page .is-featured .hs-title {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.25;
}

.home-page .hs-now.is-paused .hs-status {
  color: var(--muted);
}

.home-page .hs-now.is-empty .hs-title {
  color: var(--muted);
  font-weight: 600;
}

.home-page .hs-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.home-page .hs-flat {
  width: 100%;
  max-width: 150px;
  height: 18px;
  margin-top: 2px;
  fill: var(--line-strong);
}

/* The record beside a featured card: the cover is its label, and it turns while music plays. */
.home-page .hs-stage {
  display: none;
}

@media (min-width: 761px) {
  .home-page .is-featured .hs-stage {
    display: flex;
    flex: 0 0 36%;
    align-items: center;
    justify-content: center;
    padding: 24px 32px 24px 0;
  }

  .home-page .is-featured .hs-art {
    display: none;
  }
}

.home-page .hs-disc {
  position: relative;
  width: 100%;
  max-width: 230px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    conic-gradient(from 30deg, transparent 0 18%, rgba(224, 207, 251, 0.1) 24%, transparent 30% 68%, rgba(224, 207, 251, 0.08) 74%, transparent 80%),
    repeating-radial-gradient(circle, #0d0716 0 2px, #1a0f2c 2px 4px);
}

.home-page .hs-label {
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(224, 207, 251, 0.25);
  background: radial-gradient(circle at 35% 30%, var(--violet), var(--violet-deep));
}

.home-page .hs-label img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-page .hs-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12%;
  height: 12%;
  translate: -50% -50%;
  border-radius: 50%;
  background: #0d0716;
}

@media (prefers-reduced-motion: no-preference) {
  .home-page .hs-disc.is-spinning {
    animation: home-spin 14s linear infinite;
  }
}

.home-page .hs-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.home-page .hs-people {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-page .hs-avatars {
  display: flex;
  flex: none;
  padding-left: 8px;
}

.home-page .hs-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
  object-fit: cover;
  background: var(--raised-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  transition: border-color 180ms;
}

.home-page .is-featured .hs-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.home-page .hs-avatar-more {
  color: var(--muted);
  font-size: 11px;
}

.home-page .hs-people-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.home-page .hs-count {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.home-page .home-server:not(.is-live) .hs-count {
  color: var(--muted);
  font-weight: 600;
}

.home-page .hs-rooms {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.home-page .hs-enter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  margin-left: auto;
  padding: 0 12px 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 180ms, background-color 180ms;
}

.home-page .hs-enter.is-primary {
  min-height: 42px;
  padding: 0 16px 0 18px;
  border-color: var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  font-size: 14px;
}

.home-page .hs-enter svg {
  flex-shrink: 0;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-page .home-server:hover .hs-enter,
.home-page .home-server:focus-visible .hs-enter {
  border-color: var(--line-strong);
  background: var(--raised-3);
}

.home-page .home-server:hover .hs-enter.is-primary,
.home-page .home-server:focus-visible .hs-enter.is-primary {
  border-color: var(--violet);
  background: var(--violet-strong);
}

.home-page .home-server:hover .hs-enter svg,
.home-page .home-server:focus-visible .hs-enter svg {
  transform: translateX(3px);
}

/* ---- top songs and ranking */

.home-page .hx-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 56px;
}

.home-page .hx-duo.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.home-page .hx-panel {
  min-width: 0;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.home-page .hx-panel-head {
  margin-bottom: 16px;
}

.home-page .hx-songs,
.home-page .hx-leaders {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.home-page .hx-songs li,
.home-page .hx-leaders li {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--field);
}

.home-page .hx-songs li {
  grid-template-columns: 24px 52px minmax(0, 1fr) auto;
}

.home-page .hx-leaders li {
  grid-template-columns: 24px 42px minmax(0, 1fr) auto;
}

.home-page .hx-songs li:first-child,
.home-page .hx-leaders li:first-child {
  border-color: var(--line-strong);
}

.home-page .hx-pos {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.home-page .hx-song-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--raised-3);
  color: var(--muted);
}

.home-page .hx-song-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.home-page .hx-song-plays {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.home-page .hx-leaders li.is-you {
  border-color: color-mix(in srgb, var(--violet) 50%, var(--line));
  background: color-mix(in srgb, var(--violet) 10%, var(--field));
}

.home-page .hx-leader-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 2px;
  border-radius: 50%;
  border: 2px solid var(--tier, var(--line-strong));
  object-fit: cover;
  background: var(--raised-3);
  font-weight: 800;
}

.home-page .hx-leader-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.home-page .hx-leader-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.home-page .hx-leader-name em {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--violet-deep);
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.home-page .hx-leader-rank {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tier, var(--muted));
  font-size: 12px;
}

.home-page .hx-leader-xp {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---- games and the daily word */

.home-page .hx-games-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.home-page .hx-games-layout.has-wordle {
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  align-items: stretch;
}

.home-page .hx-wordle {
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.home-page .hx-wordle .gc-preview {
  height: 148px;
  border-radius: 0;
}

.home-page .hx-wordle-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.home-page .hx-wordle-head {
  margin: 0;
  font-weight: 700;
}

.home-page .hx-wordle-head span {
  color: var(--muted);
  font-weight: 500;
}

.home-page .hx-boards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.home-page .hx-boards li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  font-size: 13px;
}

.home-page .hx-board-name {
  font-weight: 700;
}

.home-page .hx-board-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.home-page .hx-board-state {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.home-page .hx-boards li.is-won .hx-board-state {
  border-color: #2f8f5b;
  background: rgba(47, 143, 91, 0.18);
  color: #7fe0ae;
}

.home-page .hx-boards li.is-playing .hx-board-state {
  border-color: #b88a1e;
  background: rgba(184, 138, 30, 0.16);
  color: #e6c35a;
}

.home-page .hx-boards li.is-lost .hx-board-state {
  border-color: var(--danger-line);
  color: var(--danger);
}

.home-page .hx-wordle-cta {
  align-self: flex-start;
  min-height: 40px;
  margin-top: auto;
  border-radius: 12px;
  text-decoration: none;
}

.home-page .hx-game-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.home-page .has-wordle .hx-game-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-page .hx-game {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  text-decoration: none;
  transition: border-color 180ms, background-color 180ms;
}

.home-page .hx-game:hover {
  border-color: var(--line-strong);
  background: var(--raised-2);
  color: var(--text);
}

.home-page .hx-game:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 3px;
}

.home-page .hx-game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
}

.home-page .hx-game-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.home-page .hx-game-copy strong {
  font-family: var(--font-display);
  font-size: 15px;
}

.home-page .hx-game-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ---- landing (signed out) */

.home-page .lp-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 40px;
  padding: 56px 0 24px;
}

/* Soft violet light behind the hero, and a dot grid fading out of it. */
.home-page .lp-hero::before {
  content: "";
  position: absolute;
  inset: -90px -200px auto -200px;
  z-index: -1;
  height: 640px;
  background:
    radial-gradient(540px 330px at 72% 42%, rgba(124, 58, 237, 0.34), transparent 70%),
    radial-gradient(440px 280px at 8% 22%, rgba(76, 29, 149, 0.3), transparent 70%);
  pointer-events: none;
}

.home-page .lp-hero::after {
  content: "";
  position: absolute;
  inset: 0 -48px;
  z-index: -1;
  background-image: radial-gradient(rgba(196, 166, 245, 0.14) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 70% 45%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 80% at 70% 45%, #000, transparent 75%);
  pointer-events: none;
}

.home-page .lp-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.home-page .lp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 10, 34, 0.7);
  color: var(--lav-2);
  font-size: 13px;
  font-weight: 700;
}

.home-page .lp-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 5.4vw, 64px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.03;
}

.home-page .lp-lead {
  max-width: 52ch;
  margin: 20px 0 0;
  color: #bdb8c8;
  font-size: 18px;
  line-height: 1.55;
}

.home-page .lp-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-page .lp-secondary {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 15px;
  text-decoration: none;
}

.home-page .lp-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* The hero visual: a still drawing of the room player. */
.home-page .lp-visual {
  position: relative;
  padding: 28px 8px;
  min-width: 0;
}

.home-page .lp-mock {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--raised-2), var(--surface-strong));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
}

.home-page .lp-mock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.home-page .lp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.home-page .lp-mock-title {
  flex: 1;
  margin-left: 10px;
}

.home-page .lp-mock-title i {
  display: block;
  width: 38%;
  height: 8px;
  border-radius: 4px;
  background: var(--line-strong);
}

.home-page .lp-mock-avs,
.home-page .lp-vg-avs {
  display: inline-flex;
  padding-left: 8px;
}

.home-page .lp-mock-avs b,
.home-page .lp-vg-avs b {
  display: block;
  width: 24px;
  height: 24px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid var(--surface-strong);
  background: var(--violet-deep);
}

.home-page .lp-mock-avs b:nth-child(2),
.home-page .lp-vg-avs b:nth-child(2) { background: #6d4aa8; }
.home-page .lp-mock-avs b:nth-child(3),
.home-page .lp-vg-avs b:nth-child(3) { background: #473368; }
.home-page .lp-mock-avs b:nth-child(4),
.home-page .lp-vg-avs b:nth-child(4) { background: var(--raised-3); }
.home-page .lp-mock-avs b.more { background: var(--raised-3); }

.home-page .lp-mock-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.home-page .lp-mock-player {
  display: flex;
  align-items: center;
  gap: 18px;
}

.home-page .lp-cover {
  position: relative;
  flex: none;
  width: 128px;
  aspect-ratio: 1;
  margin-right: 16px;
}

.home-page .lp-cover-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--violet) 0%, var(--violet-deep) 70%);
  color: rgba(255, 255, 255, 0.85);
}

.home-page .lp-cover-disc {
  position: absolute;
  top: 6%;
  left: 34%;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: repeating-radial-gradient(circle, #0d0716 0 2px, #1a0f2c 2px 4px);
}

.home-page .lp-track {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.home-page .lp-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.home-page .lp-eq i {
  display: block;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--lav);
  opacity: 0.8;
  transform-origin: bottom;
  transform: scaleY(0.55);
}

.home-page .lp-eq i:nth-child(2) { transform: scaleY(1); }
.home-page .lp-eq i:nth-child(3) { transform: scaleY(0.4); }
.home-page .lp-eq i:nth-child(4) { transform: scaleY(0.8); }

@media (prefers-reduced-motion: no-preference) {
  .home-page .lp-eq i { animation: o-eq 900ms ease-in-out infinite; }
  .home-page .lp-eq i:nth-child(2) { animation-duration: 760ms; animation-delay: -300ms; }
  .home-page .lp-eq i:nth-child(3) { animation-duration: 1040ms; animation-delay: -600ms; }
  .home-page .lp-eq i:nth-child(4) { animation-duration: 820ms; animation-delay: -150ms; }
}

.home-page .lp-seek {
  position: relative;
  display: block;
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--line);
}

.home-page .lp-seek b {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
}

.home-page .lp-seek u {
  position: absolute;
  left: 38%;
  top: 50%;
  width: 12px;
  height: 12px;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--lav-3);
  text-decoration: none;
}

.home-page .lp-ctrls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
}

.home-page .lp-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
}

.home-page .lp-mock-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.home-page .lp-msg {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-page .lp-msg b {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--raised-3);
}

.home-page .lp-msg i {
  height: 26px;
  border-radius: 13px;
  background: var(--field);
  border: 1px solid var(--line);
}

.home-page .lp-msg.me {
  justify-content: flex-end;
}

.home-page .lp-msg.me i {
  border-color: color-mix(in srgb, var(--violet) 50%, transparent);
  background: color-mix(in srgb, var(--violet) 18%, var(--field));
}

.home-page .lp-msg .w80 { width: 62%; }
.home-page .lp-msg .w70 { width: 48%; }
.home-page .lp-msg .w60 { width: 40%; }

.home-page .lp-float {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  font-weight: 700;
}

.home-page .lp-float-a {
  top: 0;
  right: 16px;
  color: var(--r-legendary);
}

.home-page .lp-float-a i {
  display: block;
  width: 46px;
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
}

.home-page .lp-float-b {
  bottom: 0;
  left: 20px;
  color: var(--lav-2);
}

@media (prefers-reduced-motion: no-preference) {
  .home-page .lp-float-a { animation: home-bob 6s ease-in-out infinite; }
  .home-page .lp-float-b { animation: home-bob 7s ease-in-out -2s infinite; }
}

.home-page .lp-stats {
  margin-top: 40px;
}

.home-page .lp-stats ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--line);
  overflow: hidden;
}

.home-page .lp-stats li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 20px 24px;
  background: var(--surface-strong);
}

.home-page .lp-stats svg {
  margin-bottom: 8px;
  color: var(--muted);
}

.home-page .lp-stats strong {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.home-page .lp-stats span {
  color: var(--muted);
  font-size: 13px;
}

.home-page .lp-section {
  margin-top: 96px;
}

.home-page .lp-section-head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.home-page .lp-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.1;
}

.home-page .lp-section-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.home-page .lp-features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
}

.home-page .lp-feature {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 26px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--raised);
  overflow: hidden;
}

.home-page .lp-feature-art {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 176px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(280px 150px at 50% 0, rgba(124, 58, 237, 0.2), transparent 70%),
    var(--surface-strong);
}

.home-page .lp-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -24px 24px 0;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  position: relative;
}

.home-page .lp-feature-title {
  margin: 6px 24px 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.home-page .lp-feature-text {
  margin: 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.home-page .lp-vg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 290px;
}

.home-page .lp-vg-avs {
  align-self: flex-start;
}

.home-page .lp-vg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
}

.home-page .lp-vg-row s {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--raised-3);
  text-decoration: none;
}

.home-page .lp-vg-row > i {
  flex: 1 1 auto;
}

.home-page .lp-vg-row.is-now {
  border-color: color-mix(in srgb, var(--violet) 45%, var(--line));
}

.home-page .lp-vg-row.is-now s {
  background: var(--violet-deep);
}

.home-page .lp-vg-game {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-page .lp-vg-ranks {
  align-items: center;
  gap: 14px;
}

.home-page .lp-tiers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.home-page .lp-tier {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tier) 55%, transparent);
  background: color-mix(in srgb, var(--tier) 14%, transparent);
  color: var(--tier);
  font-size: 12px;
  font-weight: 800;
}

.home-page .lp-vg-ranks .hx-bar {
  width: 100%;
}

.home-page .lp-room-tabs {
  display: flex;
  gap: 6px;
}

.home-page .lp-room-tabs b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-page .lp-room-tabs b.on {
  border-color: var(--line-strong);
  background: var(--raised-3);
  color: var(--text);
}

.home-page .lp-room-tabs em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.home-page .lp-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.home-page .lp-link i {
  flex: 1 1 auto;
}

.home-page .lp-field {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--field);
}

.home-page .lp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.home-page .lp-vg-app {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.home-page .lp-phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 84px;
  height: 140px;
  border-radius: 18px;
  border: 2px solid var(--line-strong);
  background: var(--field);
}

.home-page .lp-phone-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--lav);
}

.home-page .lp-install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  font-size: 12px;
  font-weight: 700;
}

.home-page .lp-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
}

.home-page .lp-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 34px 26px 26px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* A dashed link from each step to the next. */
.home-page .lp-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50px;
  right: -24px;
  width: 24px;
  border-top: 2px dashed var(--line-strong);
}

.home-page .lp-step-num {
  position: absolute;
  top: -16px;
  left: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
}

.home-page .lp-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
}

.home-page .lp-step-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.home-page .lp-step-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.home-page .lp-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 96px;
  padding: 56px 24px;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(620px 260px at 50% 0, rgba(124, 58, 237, 0.3), transparent 70%),
    var(--surface);
  text-align: center;
  overflow: hidden;
}

.home-page .lp-final-wave {
  width: min(100%, 480px);
  height: 40px;
  fill: var(--line-strong);
}

.home-page .lp-final-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -1.2px;
}

.home-page .lp-final-text {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 16px;
}

.home-page .lp-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

.home-page .lp-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 48px calc(40px + env(safe-area-inset-bottom));
}

.home-page .lp-footer-brand p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.home-page .lp-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}

.home-page .lp-footer-links a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.home-page .lp-footer-links a:hover {
  color: var(--text);
}

.home-page .lp-footer-install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

/* ---- invite page (/join/<code>) */

.home-page .home-join {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 90px);
  padding: 16px 24px 56px;
}

.home-page .jn-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 520px;
  padding: 0 36px 32px;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  overflow: hidden;
}

.home-page .jn-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 -36px;
  padding: 44px 0 20px;
  background: radial-gradient(380px 170px at 50% 0, rgba(124, 58, 237, 0.3), transparent 72%);
}

.home-page .jn-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  translate: 0 -30%;
  width: 100%;
  height: 48px;
  fill: var(--line-strong);
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}

/* The server icon in rings: solid translucent steps, no glow. */
.home-page .jn-ring {
  position: relative;
  display: inline-flex;
  padding: 6px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.1), 0 0 0 16px rgba(139, 92, 246, 0.05);
}

.home-page .jn-ring-inner {
  display: inline-flex;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--violet);
  background: var(--raised-3);
  overflow: hidden;
}

.home-page .jn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  object-fit: cover;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
}

.home-page .jn-title {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--font-display);
  line-height: 1.1;
}

.home-page .jn-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.home-page .jn-room {
  display: block;
  color: var(--lav);
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: -1.2px;
  overflow-wrap: anywhere;
}

.home-page .jn-where {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.home-page .jn-where strong {
  color: var(--text);
}

.home-page .jn-caps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
}

.home-page .jn-caps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  font-size: 13px;
  font-weight: 600;
}

.home-page .jn-caps svg {
  flex-shrink: 0;
  color: var(--muted);
}

.home-page .join-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.home-page .join-label {
  font-size: 14px;
  font-weight: 700;
}

.home-page .join-input {
  min-height: 50px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.home-page .join-input:focus-visible {
  border-color: var(--violet);
}

.home-page .join-submit {
  gap: 8px;
  min-height: 50px;
  border-radius: 12px;
  font-size: 15px;
  text-decoration: none;
}

.home-page .join-fine {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.home-page .jn-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.home-page .jn-sep::before,
.home-page .jn-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.home-page .jn-discord {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

.home-page .join-error {
  border-style: solid;
  border-color: var(--danger-line);
  background: rgba(91, 42, 63, 0.18);
  color: var(--danger);
}

.home-page .jn-card.is-invalid {
  align-items: center;
  padding-top: 44px;
  text-align: center;
}

.home-page .jn-broken {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 156px;
  height: 156px;
  margin-bottom: 6px;
}

.home-page .jn-broken-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
}

.home-page .jn-broken-disc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid var(--danger-line);
  background: color-mix(in srgb, var(--danger) 10%, var(--field));
  color: var(--danger);
}

.home-page .jn-broken-ticket {
  position: absolute;
  right: 4px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  color: var(--muted);
  transform: rotate(14deg);
}

.home-page .jn-title.is-center {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.8px;
}

.home-page .jn-text {
  max-width: 36ch;
  margin: 0;
  color: #cfc9db;
  font-size: 15px;
  line-height: 1.5;
}

.home-page .jn-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.home-page .jn-tip svg {
  flex-shrink: 0;
  color: var(--lav);
}

.home-page .jn-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

/* ---- phones and small tablets */

@media (max-width: 960px) {
  .home-page .hx-profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-page .hx-profile.is-empty {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-page .lp-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.home-page {
    background-attachment: scroll;
  }

  .home-page .home {
    padding: 4px 16px calc(40px + env(safe-area-inset-bottom));
  }

  .home-page .hx-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 26px 20px 8px;
    border-radius: 22px;
  }

  .home-page .hx-hero-art {
    justify-content: center;
  }

  .home-page .hx-art {
    max-width: 260px;
  }

  .home-page .hx-live {
    font-size: 15px;
  }

  .home-page .hx-profile {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 22px 20px 22px 24px;
  }

  .home-page .hx-section {
    margin-top: 44px;
  }

  .home-page .home-servers {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .home-page .hs-body,
  .home-page .is-featured .hs-body {
    gap: 14px;
    padding: 16px;
  }

  .home-page .is-featured .hs-title {
    font-size: 18px;
  }

  .home-page .hx-duo {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 44px;
  }

  .home-page .hx-panel {
    padding: 18px;
  }

  .home-page .hx-songs li {
    grid-template-columns: 22px 46px minmax(0, 1fr);
  }

  .home-page .hx-song-art {
    width: 46px;
    height: 46px;
  }

  .home-page .hx-song-plays {
    grid-column: 3;
    margin-top: -6px;
  }

  .home-page .hx-games-layout.has-wordle,
  .home-page .has-wordle .hx-game-list,
  .home-page .hx-game-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-page .lp-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-top: 24px;
  }

  .home-page .lp-title {
    letter-spacing: -1.2px;
  }

  .home-page .lp-lead {
    font-size: 16px;
  }

  .home-page .lp-cta .o-btn {
    flex: 1 1 100%;
  }

  .home-page .lp-mock {
    transform: none;
  }

  .home-page .lp-cover {
    width: 96px;
    margin-right: 10px;
  }

  .home-page .lp-mock-player {
    gap: 12px;
  }

  .home-page .lp-section {
    margin-top: 64px;
  }

  .home-page .lp-features,
  .home-page .lp-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .home-page .lp-step:not(:last-child)::after {
    display: none;
  }

  .home-page .lp-stats li {
    padding: 16px 18px;
  }

  .home-page .lp-final {
    margin-top: 64px;
    padding: 40px 20px;
  }

  .home-page .lp-footer-inner {
    padding: 28px 16px calc(32px + env(safe-area-inset-bottom));
  }

  .home-page .home-join {
    min-height: calc(100dvh - 70px);
    padding: 8px 16px 40px;
  }

  .home-page .jn-card {
    padding: 0 20px 24px;
    border-radius: 24px;
  }

  .home-page .jn-head {
    margin: 0 -20px;
  }

  .home-page .jn-card.is-invalid {
    padding-top: 36px;
  }
}

@media (max-width: 420px) {
  .home-page .jn-caps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .home-server,
  .home-page .hs-enter,
  .home-page .hs-enter svg,
  .home-page .hx-game {
    transition: none;
  }
}

/* ---------------------------------------------------------------- install */

.install-btn {
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}

.install-btn svg {
  flex-shrink: 0;
}

/* The iOS "add to home screen" help is the shell's small card (install.js adds .modal and .modal-card): always a
   bottom sheet, since it only exists on iPhones and iPads. */
.install-sheet {
  z-index: 60;
  align-items: flex-end;
  backdrop-filter: blur(6px);
}

.install-card {
  --m-w: 420px;
}

.install-close {
  flex: 1 1 auto;
  min-height: 46px;
}

.install-steps {
  align-self: stretch;
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
}

.install-steps strong {
  color: var(--text);
}

.install-steps svg {
  vertical-align: -3px;
  color: var(--lav);
}

/* ---------------------------------------------------------------- player stage */

/* The player and the queue are one card: the stage is the surface, both parts sit on it with the same padding
   and a hairline between them. Phones keep two views, so there the stage disappears and each part is its own card. */
.player-stage {
  --stage-pad: 24px;
  display: contents;
}

@media (min-width: 761px) {
  .player-stage {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* A soft violet light in the top-right corner (the queue column's side), like the home's featured card. */
    background:
      radial-gradient(520px 260px at 100% 0, rgba(124, 58, 237, 0.2), transparent 70%),
      var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
  }
  .player-stage > .card {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .player-stage > .now-card {
    padding: 0 0 var(--stage-pad);
  }
  .player-stage > .queue-card {
    border-top: 1px solid var(--line);
  }
  /* The queue card is out when nothing is queued after the current track (the JS adds .has-queue otherwise, and keeps
     it off until the first state arrives): no card, no divider, and the player takes the whole stage. display:none
     keeps it out of the tab order. Phones are not here: their queue is its own view and keeps its empty state. */
  .player-stage:not(.has-queue) > .queue-card {
    display: none;
  }
  /* With no queue, or with it collapsed to its rail / header row, the player is (nearly) full width and the 16:9 video
     would tower over everything: cap it and letterbox on black. */
  .player-stage:not(.has-queue) .video-shell,
  .player-stage.queue-collapsed .video-shell {
    max-height: 420px;
    background: #000000;
  }
  .player-stage:not(.has-queue) .media-cover,
  .player-stage.queue-collapsed .media-cover {
    object-fit: contain;
  }
  /* The card fades in when songs get queued again; .queue-motion is only set after the page has settled, so the first
     paint never animates. */
  .player-stage.queue-motion > .queue-card {
    animation: o-in 180ms ease-out;
  }
  .queue-card .card-head .queue-collapse {
    display: inline-flex;
  }
  /* Collapsed, stacked under the player: a slim header row ("A continuación · N", the toggle on the right), no list. */
  .player-stage.queue-collapsed .queue-list,
  .player-stage.queue-collapsed .pending-bar,
  .player-stage.queue-collapsed #queue-edit {
    display: none;
  }
  .player-stage.queue-collapsed .queue-fill {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .queue-fill {
    padding: var(--stage-pad) 14px var(--stage-pad) var(--stage-pad);
  }
  .queue-card .queue-row {
    grid-template-columns: 28px minmax(0, 1fr) auto 34px;
    gap: 8px;
    min-height: 46px;
  }
  .queue-card .queue-row.editing {
    grid-template-columns: 28px 28px minmax(0, 1fr) auto;
  }
  .queue-card .row-btn {
    width: 34px;
    height: 34px;
  }
}

/* Wide screens: the queue is a narrow column on the right of the player, as tall as the player (the card is
   sized by the player alone; the queue's rows live in an absolutely positioned layer and scroll inside it). */
@media (min-width: 1281px) {
  .player-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .player-stage.has-queue {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 30%, 340px);
  }
  /* Collapsed: the column stays, as a narrow rail with the toggle at the top and the count under it. */
  .player-stage.has-queue.queue-collapsed {
    grid-template-columns: minmax(0, 1fr) 56px;
  }
  .player-stage > .now-card {
    grid-column: 1;
    grid-row: 1;
  }
  /* The queue (or its rail) is beside the player here, so the video's top-right corner meets the divider: square.
     Without a queue the video runs to the card's edge and follows the card radius. */
  .player-stage.has-queue .player-window {
    border-top-right-radius: 0;
  }
  .player-stage.queue-collapsed .queue-fill {
    align-items: center;
    padding: var(--stage-pad) 0;
  }
  .player-stage.queue-collapsed .card-head {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .player-stage.queue-collapsed .card-head h2 {
    display: none;
  }
  .player-stage.queue-collapsed .card-head-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .player-stage.queue-collapsed .queue-rail-count {
    display: block;
  }
  .player-stage > .queue-card {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    min-height: 340px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .queue-fill {
    position: absolute;
    inset: 0;
  }
  .queue-card .queue-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
  .queue-card #queue-edit {
    width: 30px;
    padding: 0;
  }
  .queue-card #queue-edit-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------- tablet */

@media (max-width: 1120px) {
  .topbar,
  .layout {
    padding-left: 24px;
    padding-right: 24px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .col-side {
    position: static;
    height: auto;
    min-height: 0;
  }
  .chat-card {
    height: 560px;
  }
}

/* ---------------------------------------------------------------- room shell */

/* On tablet and desktop the rooms row, the player card and the chat sit inside ONE big card; the library is its own
   card under it. The big card is drawn by .layout::before over the padded tracks of the grid, so the DOM (and the
   phone's one-view-at-a-time rules, which this does not touch) stays as it is. */
@media (min-width: 761px) {
  .layout {
    --shell-pad: 18px;
    grid-template-columns: var(--shell-pad) minmax(0, 1fr) var(--shell-pad);
    grid-template-rows: var(--shell-pad) auto 16px auto 16px auto var(--shell-pad) 24px auto;
    gap: 0;
    align-items: stretch;
  }
  /* The home hero's treatment: a light in each corner and a dot grid that fades out of the top-right one. The veil
     (opaque at the edges, clear in the middle) is what makes the grid fade; the colour underneath stays --raised-2. */
  .layout::before {
    content: "";
    grid-column: 1 / -1;
    grid-row: 1 / 8;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    background:
      radial-gradient(560px 300px at 100% 0, rgba(124, 58, 237, 0.22), transparent 70%),
      radial-gradient(480px 280px at 0 100%, rgba(76, 29, 149, 0.26), transparent 70%),
      radial-gradient(ellipse 55% 130% at 88% 0, transparent, var(--raised-2) 75%),
      radial-gradient(var(--dot) 1px, transparent 1.3px) 0 0 / 22px 22px,
      var(--raised-2);
  }
  .col-main {
    display: contents;
  }
  .room-bar {
    grid-column: 2;
    grid-row: 2;
  }
  .player-stage {
    grid-column: 2;
    grid-row: 4;
  }
  /* The chat column: Jugar on top, the chat card under it. */
  .col-side {
    grid-column: 2;
    grid-row: 6;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .chat-card {
    flex: none;
    height: 560px;
    background:
      radial-gradient(420px 240px at 100% 0, rgba(124, 58, 237, 0.16), transparent 70%),
      var(--surface-strong);
  }
  .grid-2 {
    grid-column: 1 / -1;
    grid-row: 9;
  }
}

/* Wide: the chat sits on the right of the rooms row and the player card, as tall as both together. The player
   column sets the height; the chat is out of flow, so its messages scroll inside it instead of stretching the card. */
@media (min-width: 1281px) {
  .layout {
    grid-template-columns: var(--shell-pad) minmax(0, 1fr) 24px clamp(400px, 28vw, 480px) var(--shell-pad);
    grid-template-rows: var(--shell-pad) auto 16px auto var(--shell-pad) 24px auto;
  }
  .layout::before {
    grid-row: 1 / 6;
  }
  /* Jugar sits level with the rooms row (42px, the height of the listeners pill) and the chat starts where the
     player card starts, 16px under it: the same two rows the left column uses. Both are out of flow, so the left
     column still sets the height. */
  .col-side {
    --bar-h: 42px;
    grid-column: 4;
    grid-row: 2 / 5;
    position: relative;
    min-height: calc(420px + var(--bar-h) + 16px);
  }
  .games-launch {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
  }
  .chat-card {
    position: absolute;
    inset: calc(var(--bar-h) + 16px) 0 0 0;
    height: auto;
  }
  .grid-2 {
    grid-row: 7;
  }
}

/* ---------------------------------------------------------------- phone: one view at a time */

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  .topbar {
    min-height: 60px;
    padding: 8px 16px 0;
    gap: 10px;
  }

  .brand,
  .rooms,
  .user-chip {
    display: none;
  }

  /* The user menu holds Perfil, Top XP and Invitar, so the phone keeps it (the name is trimmed to fit). */
  .user-menu .user-chip {
    display: inline-block;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 38px;
    padding: 0 12px;
  }

  .room-switch {
    display: block;
    flex-grow: 1;
  }

  .layout {
    padding: 8px 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom));
    gap: 14px;
  }

  .col-main,
  .grid-2 {
    gap: 14px;
  }

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

  .view-now,
  .view-queue,
  .view-library,
  .view-chat {
    display: none;
  }

  body[data-view="now"] .view-now,
  body[data-view="queue"] .view-queue,
  body[data-view="library"] .view-library,
  body[data-view="chat"] .view-chat {
    display: flex;
  }

  body[data-view="chat"] .col-main,
  body[data-view="now"] .col-side,
  body[data-view="queue"] .col-side,
  body[data-view="library"] .col-side {
    display: none;
  }

  .card {
    padding: 16px;
    border-radius: 18px;
  }

  .player-stage {
    --stage-pad: 16px;
  }

  .now-card {
    padding: 0 0 var(--stage-pad);
    gap: 14px;
  }

  /* One view at a time: the video sits above the info, flush with the card's sides and top. */
  .now-main {
    gap: 14px;
  }

  .player-window {
    border-radius: 17px 17px 0 0;
  }

  .now-info {
    gap: 14px;
  }

  .listeners-word {
    display: none;
  }

  .listeners-tip {
    width: min(280px, calc(100vw - 32px));
  }

  /* The centered title stays centered: the left padding mirrors the share button on the right. */
  .title-row {
    justify-content: center;
    padding-left: 34px;
  }

  .track-title {
    text-align: center;
    font-size: 24px;
    letter-spacing: -0.6px;
  }

  .track-meta {
    text-align: center;
    font-size: 14px;
  }

  .transport {
    flex-direction: column;
    gap: 14px;
  }

  .transport-buttons {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  /* Six buttons share the row (Detener joined the five): the small ones give up a few pixels, keeping their square,
     instead of the last one spilling over the card's padding. The play button keeps its size. */
  .transport-buttons > .icon-btn:not(.primary) {
    width: min(46px, calc((100% - 66px - 5 * 6px) / 5));
    height: auto;
    aspect-ratio: 1;
  }

  .icon-btn.primary {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }

  .volume {
    width: 100%;
  }

  /* Reproducción rápida on a phone: its own card under the transport and volume, title on top, the two buttons side by
     side across the card's full width. */
  .quick-play {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .quick-play-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-play-actions .chip {
    min-height: 44px;
    padding: 0 10px;
  }

  /* Jugar: full width at the top of the chat view; the now view has a compact one in its header row (the chat is
     another tab on a phone). */
  .games-launch .games-btn {
    height: 44px;
  }

  .games-now {
    display: inline-flex;
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }

  .user-dropdown-item {
    padding: 12px 14px;
  }

  .library-head {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "tabs"
      "quick"
      "search";
  }

  .library-head .search {
    justify-self: stretch;
    max-width: none;
  }

  /* Plenty of room on a phone's own row: the button takes it and keeps its label. */
  .library-quick {
    gap: 6px;
  }

  .library-quick .chip {
    flex: 1 1 0;
    width: auto;
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }

  .library-quick .lq-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }

  .queue-card {
    padding: 0;
  }

  .queue-fill {
    padding: 16px;
  }

  .seg [role="tab"] {
    flex: 1;
  }

  .queue-list,
  .queue-card .queue-list,
  #likes-list,
  #playlist-list,
  #library-search {
    max-height: none;
    padding-right: 0;
    scrollbar-gutter: auto;
  }

  .chat-log {
    padding-right: 4px;
    scrollbar-gutter: auto;
  }

  #likes-list,
  #search-songs {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-btn {
    width: 44px;
    height: 44px;
  }

  /* The chat view is a flex row by default, which shrank the card to its messages' width. */
  .col-side.view-chat {
    flex-direction: column;
    gap: 12px;
  }

  .chat-card {
    /* Fills the space between the top bar and the mini player, so the input is never covered (the 56px is the
       Jugar button above it and its gap). */
    width: 100%;
    height: calc(100dvh - 68px - 56px - var(--tabbar-h) - 96px - env(safe-area-inset-bottom));
    min-height: 320px;
    max-height: none;
  }

  /* Nothing playing: no mini player, so the chat reaches down to the tab bar. */
  body:has(#mini-player[hidden]) .layout {
    padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
  }

  body:has(#mini-player[hidden]) .chat-card {
    height: calc(100dvh - 68px - 56px - var(--tabbar-h) - 24px - env(safe-area-inset-bottom));
  }

  body:has(#mini-player[hidden]) .commands {
    bottom: calc(var(--tabbar-h) + 100px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - var(--tabbar-h) - 100px - 80px - env(safe-area-inset-bottom));
  }

  .install-btn span {
    display: none;
  }

  .install-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  /* The home page has no room switcher, so it keeps the brand and the sign-out chip. */
  .home-page .brand {
    display: flex;
  }

  .home-page .user-chip:not(.install-btn) {
    display: inline-block;
    line-height: 38px;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Sits just above the chat input. */
  .commands {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--tabbar-h) + 172px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - var(--tabbar-h) - 172px - 80px - env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 40;
    height: var(--tabbar-h);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(15, 7, 25, 0.94);
    backdrop-filter: blur(10px);
  }

  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    border-radius: 18px;
  }

  .tab[aria-current="page"] {
    color: var(--lav-3);
  }

  .mini-player {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom));
    z-index: 39;
    height: 62px;
    padding: 0 8px 0 14px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: var(--raised-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    overflow: hidden;
  }

  body[data-view="now"] .mini-player {
    display: none;
  }

  .mini-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mini-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mini-copy span {
    font-size: 12px;
    color: var(--muted);
  }

  .mini-player .icon-btn.primary {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .mini-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--violet-strong), var(--violet));
  }
}

/* ---------------------------------------------------------------- listener ranks */

@keyframes rank-spin { to { transform: rotate(360deg); } }
@keyframes rank-spin-rev { to { transform: rotate(-360deg); } }
@keyframes rank-breathe { 0%, 100% { opacity: 0.45; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes rank-twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes rank-pop { 0% { opacity: 0; transform: scale(0.6); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes rank-toast-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes rank-rise { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-90px) scale(1); } }

svg.ico {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* Avatar + aura: --s size, --c tier color. */
.av {
  --s: 48px;
  --gap: max(2px, calc(var(--s) * 0.05));
  --ring: max(2px, calc(var(--s) * 0.055));
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  flex-shrink: 0;
  isolation: isolate;
}

.av-face {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 var(--gap) var(--gap-color, var(--surface-strong));
  font-size: calc(var(--s) * 0.38);
}

.av-aura {
  position: absolute;
  z-index: 1;
  inset: calc((var(--gap) + var(--ring)) * -1);
  border-radius: 50%;
  background: var(--c);
}

.av::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -38%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent) 0%, transparent 62%);
  opacity: 0;
  pointer-events: none;
}

.av-lvl {
  position: absolute;
  z-index: 5;
  right: -8%;
  bottom: -8%;
  min-width: calc(var(--s) * 0.38);
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid var(--c);
  background: var(--raised);
  color: var(--c);
  font-family: var(--font-mono);
  font-size: max(9px, calc(var(--s) * 0.17));
  line-height: 1.35;
  text-align: center;
}

.av-sparks {
  position: absolute;
  z-index: 4;
  inset: -24%;
  pointer-events: none;
  animation: rank-spin 9s linear infinite;
}

.av-sparks i {
  position: absolute;
  width: max(3px, calc(var(--s) * 0.065));
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px 1px var(--c);
  animation: rank-twinkle 1.8s ease-in-out infinite;
}

.av-sparks i:nth-child(1) { top: 2%; left: 48%; }
.av-sparks i:nth-child(2) { top: 30%; right: 1%; animation-delay: -0.5s; }
.av-sparks i:nth-child(3) { bottom: 8%; right: 18%; animation-delay: -1.1s; }
.av-sparks i:nth-child(4) { bottom: 14%; left: 6%; animation-delay: -0.8s; }
.av-sparks i:nth-child(5) { top: 18%; left: 8%; animation-delay: -1.4s; }

.av-crown {
  position: absolute;
  z-index: 6;
  top: calc(var(--s) * -0.34);
  left: 50%;
  width: calc(var(--s) * 0.36);
  height: calc(var(--s) * 0.36);
  translate: -50% 0;
  color: var(--t6);
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
}

/* Oyente: thin, faded ring. Melómano: solid ring. Disquero: double ring, like a record groove. */
.av.t1 .av-aura { background: color-mix(in srgb, var(--c) 50%, transparent); inset: calc((var(--gap) + 1.5px) * -1); }
.av.t3 .av-aura { box-shadow: 0 0 0 var(--gap) var(--gap-color, var(--surface-strong)), 0 0 0 calc(var(--gap) + 1.5px) color-mix(in srgb, var(--c) 55%, transparent); }
/* DJ de Barrio: still glow. Selector: breathing glow. */
.av.t4::before { opacity: 0.55; }
.av.t5::before { opacity: 1; animation: rank-breathe 2.6s ease-in-out infinite; }
/* Productor: spinning gold ring. */
.av.t6 .av-aura { background: conic-gradient(from 0deg, var(--c), #fff3c4, #d97706, var(--c), #fde68a, #b45309, var(--c)); animation: rank-spin 4.5s linear infinite; }
.av.t6::before { opacity: 0.7; }
/* Ídolo: spinning fire ring, breathing glow, sparks. */
.av.t7 .av-aura { background: conic-gradient(from 0deg, #fde047, var(--c), #ef4444, #f472b6, #fde047, var(--c), #fde047); animation: rank-spin 3.2s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.25) * -1); }
.av.t7::before { opacity: 1; animation: rank-breathe 2.2s ease-in-out infinite; }
/* Mito: prismatic ring, colour-shifting halo, sparks and crown. */
.av.t8 .av-aura { background: conic-gradient(from 0deg, #a78bfa, #f472b6, #fbbf24, #34d399, #38bdf8, #a78bfa); animation: rank-spin 2.6s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.35) * -1); }
.av.t8::before {
  opacity: 1;
  inset: -48%;
  background: conic-gradient(from 90deg, rgba(167, 139, 250, 0.5), rgba(244, 114, 182, 0.45), rgba(251, 191, 36, 0.4), rgba(56, 189, 248, 0.45), rgba(167, 139, 250, 0.5));
  filter: blur(calc(var(--s) * 0.14));
  animation: rank-spin-rev 7s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%);
  mask: radial-gradient(circle, #000 35%, transparent 70%);
}

.av.sm::before { inset: -26%; }

/* Tier palettes for the top tiers: one list of stops, reused by aura, badge, crest, chat name and overlay. */
.t9, .rank-overlay[data-tier="9"] { --g: #2dd4bf, #fde68a, #14b8a6, #fef9c3, #2dd4bf; }
.t10, .rank-overlay[data-tier="10"] { --g: #f87171, #fb923c, #b91c1c, #fdba74, #f87171; }
.t11, .rank-overlay[data-tier="11"] { --g: #e0f2fe, #bae6fd, #ffffff, #93c5fd, #e0f2fe; }
.t12, .rank-overlay[data-tier="12"] { --g: #818cf8, #c7d2fe, #6366f1, #f5f3ff, #818cf8; }
.t13, .rank-overlay[data-tier="13"] { --g: #22d3ee, #a855f7, #ec4899, #6366f1, #22d3ee; }
.t14, .rank-overlay[data-tier="14"] { --g: #fff7d6, #f472b6, #38bdf8, #a3e635, #fbbf24, #c084fc, #fff7d6; }

@keyframes rank-glitch {
  0%, 88%, 100% { transform: none; opacity: 1; }
  90% { transform: translate(2px, -1px); opacity: 0.55; }
  92% { transform: translate(-2px, 1px); opacity: 1; }
  94% { transform: translate(1px, 1px) scale(1.02); opacity: 0.8; }
  96% { transform: translate(-1px, 0); opacity: 1; }
}
@keyframes rank-flow { to { background-position: 200% 0; } }
@keyframes rank-starfield { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }

/* From Leyenda on, an outer ring (.av::after) joins the aura and turns the other way. */
.av::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: calc((var(--gap) + var(--ring) * 1.4) * -1 - var(--s) * 0.08);
  border-radius: 50%;
  pointer-events: none;
  display: none;
}

.av:is(.t9, .t10, .t11, .t12, .t13, .t14)::after { display: block; }
.av:is(.t9, .t10, .t11, .t12, .t13, .t14) .av-crown { color: var(--c); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 80%, transparent)); }

/* Leyenda: teal and gold ring, breathing glow, dashed outer ring turning the other way. */
.av.t9 .av-aura { background: conic-gradient(from 0deg, var(--g)); animation: rank-spin 3s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.35) * -1); }
.av.t9::before { opacity: 1; animation: rank-breathe 2.2s ease-in-out infinite; }
.av.t9::after { border: max(1px, calc(var(--s) * 0.02)) dashed color-mix(in srgb, var(--c) 75%, transparent); animation: rank-spin-rev 7s linear infinite; }

/* Titán: molten ring, fast heartbeat glow, heavy dotted outer ring. */
.av.t10 .av-aura { background: conic-gradient(from 0deg, var(--g)); animation: rank-spin 2.4s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.5) * -1); }
.av.t10::before { opacity: 1; inset: -46%; animation: rank-breathe 1.3s ease-in-out infinite; }
.av.t10::after { border: max(2px, calc(var(--s) * 0.035)) dotted color-mix(in srgb, var(--c) 85%, transparent); animation: rank-spin-rev 5s linear infinite; }

/* Celestial: white-blue ring, slow light rays behind and a fine halo ring. */
.av.t11 .av-aura { background: conic-gradient(from 0deg, var(--g)); animation: rank-spin 3.6s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.5) * -1); }
.av.t11::before {
  opacity: 1;
  inset: -60%;
  background: repeating-conic-gradient(from 0deg, rgba(224, 242, 254, 0.55) 0deg 6deg, transparent 6deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 68%);
  mask: radial-gradient(circle, #000 30%, transparent 68%);
  animation: rank-spin 16s linear infinite;
}
.av.t11::after { border: max(1px, calc(var(--s) * 0.018)) solid rgba(255, 255, 255, 0.7); box-shadow: 0 0 calc(var(--s) * 0.12) rgba(186, 230, 253, 0.8); animation: rank-breathe 2.8s ease-in-out infinite; }

/* Astral: indigo ring, colour-shifting halo, dashed outer ring and lights in orbit. */
.av.t12 .av-aura { background: conic-gradient(from 0deg, var(--g)); animation: rank-spin 2.2s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.5) * -1); }
.av.t12::before,
.av.t13::before,
.av.t14::before {
  opacity: 1;
  inset: -52%;
  background: conic-gradient(from 90deg, var(--g));
  filter: blur(calc(var(--s) * 0.14));
  animation: rank-spin-rev 7s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 32%, transparent 70%);
  mask: radial-gradient(circle, #000 32%, transparent 70%);
}
.av.t12::after { border: max(1px, calc(var(--s) * 0.022)) dashed color-mix(in srgb, var(--c) 80%, transparent); animation: rank-spin-rev 6s linear infinite; }

/* Cósmico: nebula behind, starfield, double outer ring, orbiting lights. */
.av.t13 .av-aura { background: conic-gradient(from 0deg, var(--g)); animation: rank-spin 1.9s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.6) * -1); }
.av.t13::before { inset: -62%; animation-duration: 5.5s; }
.av.t13::after { border: max(3px, calc(var(--s) * 0.04)) double color-mix(in srgb, var(--c) 85%, transparent); animation: rank-spin-rev 4.5s linear infinite; }

/* Eterno: holographic ring, everything above, and a glitching chromatic outer ring. */
.av.t14 .av-aura { background: conic-gradient(from 0deg, var(--g)); animation: rank-spin 1.5s linear infinite; inset: calc((var(--gap) + var(--ring) * 1.7) * -1); }
.av.t14::before { inset: -66%; animation-duration: 4.5s; }
.av.t14::after {
  border: max(2px, calc(var(--s) * 0.03)) solid rgba(255, 247, 214, 0.9);
  box-shadow: calc(var(--s) * -0.03) 0 0 rgba(56, 189, 248, 0.75), calc(var(--s) * 0.03) 0 0 rgba(244, 114, 182, 0.75), 0 0 calc(var(--s) * 0.2) rgba(255, 247, 214, 0.6);
  animation: rank-glitch 3.6s steps(1) infinite;
}

/* Lights in orbit (Astral and up). */
.av-orbit {
  position: absolute;
  z-index: 4;
  inset: -30%;
  border-radius: 50%;
  pointer-events: none;
  animation: rank-spin 4s linear infinite;
}

.av-orbit i {
  position: absolute;
  width: max(4px, calc(var(--s) * 0.08));
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px 2px var(--c);
}

.av-orbit i:nth-child(1) { top: 0; left: 50%; translate: -50% 0; }
.av-orbit i:nth-child(2) { bottom: 12%; right: 6%; width: max(3px, calc(var(--s) * 0.05)); }
.av-orbit i:nth-child(3) { bottom: 12%; left: 6%; width: max(3px, calc(var(--s) * 0.06)); }

/* Starfield (Cósmico and up). */
.av-stars {
  position: absolute;
  z-index: 0;
  inset: -55%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 12% 30%, #fff, transparent),
    radial-gradient(1px 1px at 24% 78%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 38% 12%, #fff, transparent),
    radial-gradient(1px 1px at 66% 88%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 82% 22%, #fff, transparent),
    radial-gradient(1px 1px at 90% 62%, #fff, transparent),
    radial-gradient(1px 1px at 8% 58%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 54% 96%, #fff, transparent);
  -webkit-mask: radial-gradient(circle, transparent 30%, #000 45%, transparent 72%);
  mask: radial-gradient(circle, transparent 30%, #000 45%, transparent 72%);
  animation: rank-starfield 3s ease-in-out infinite;
}

/* Small avatars (lists, chat) keep the coloured ring and drop the heavier layers. */
.av.sm::after { display: none; }
.av.sm:is(.t12, .t13, .t14)::before { filter: none; }
.av.sm.t11::before { inset: -26%; background: radial-gradient(circle, rgba(224, 242, 254, 0.55) 0%, transparent 62%); -webkit-mask: none; mask: none; }

/* Rank badge */
.rank {
  --c: var(--t1);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.rank svg { width: 12px; height: 12px; }

.rank.t6::after,
.rank.t7::after,
.rank.t8::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: o-sweep 2.8s ease-in-out infinite;
}

.rank.t8 {
  border-color: transparent;
  background: linear-gradient(var(--raised-2), var(--raised-2)) padding-box, linear-gradient(90deg, #a78bfa, #f472b6, #fbbf24, #38bdf8) border-box;
}

.rank.t8 span,
.chat-author.t8 {
  background: linear-gradient(90deg, #c4b5fd, #f9a8d4, #fde68a, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Leyenda and up: gradient border and name in the tier palette; it flows from Astral, glitches at Eterno. */
.rank:is(.t9, .t10, .t11, .t12, .t13, .t14) {
  border-color: transparent;
  background: linear-gradient(var(--raised-2), var(--raised-2)) padding-box, linear-gradient(90deg, var(--g)) border-box;
}

.rank:is(.t9, .t10, .t11, .t12, .t13, .t14)::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: o-sweep 2.4s ease-in-out infinite;
}

.rank:is(.t9, .t10, .t11, .t12, .t13, .t14) span,
.chat-author:is(.t9, .t10, .t11, .t12, .t13, .t14) {
  background: linear-gradient(90deg, var(--g));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rank:is(.t12, .t13, .t14) span,
.chat-author:is(.t12, .t13, .t14) {
  animation: rank-flow 4s linear infinite;
}

.rank.t10,
.rank.t13 { box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent); }
.rank.t14 { box-shadow: 0 0 14px rgba(255, 247, 214, 0.45); animation: rank-glitch 4.2s steps(1) infinite; }
.chat-author.t14 { text-shadow: -1px 0 rgba(56, 189, 248, 0.35), 1px 0 rgba(244, 114, 182, 0.35); }

.rank.lg { height: 26px; font-size: 12px; padding: 0 11px 0 8px; gap: 6px; }
.rank.lg svg { width: 15px; height: 15px; }

/* Crest: the tier icon in a tile */
.crest {
  --c: var(--t1);
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--c);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 6%, var(--raised)) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  isolation: isolate;
  overflow: hidden;
}

.crest svg { width: 18px; height: 18px; }
.crest.t4, .crest.t5 { box-shadow: 0 0 22px color-mix(in srgb, var(--c) 35%, transparent); }
.crest.t6, .crest.t7, .crest.t8 { border-color: transparent; box-shadow: 0 0 28px color-mix(in srgb, var(--c) 45%, transparent); }

.crest.t6::before,
.crest.t7::before,
.crest.t8::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -40%;
  background: conic-gradient(from 0deg, var(--c), transparent 30%, var(--c) 50%, transparent 80%, var(--c));
  animation: rank-spin 4s linear infinite;
}

.crest.t8::before { background: conic-gradient(#a78bfa, #f472b6, #fbbf24, #34d399, #38bdf8, #a78bfa); }

.crest.t6::after,
.crest.t7::after,
.crest.t8::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1.5px;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 32%, var(--raised)), var(--raised) 75%);
}

/* Leyenda and up: spinning ring in the tier palette, faster as the tier climbs. */
.crest:is(.t9, .t10, .t11, .t12, .t13, .t14) { border-color: transparent; box-shadow: 0 0 32px color-mix(in srgb, var(--c) 50%, transparent); }

.crest:is(.t9, .t10, .t11, .t12, .t13, .t14)::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -40%;
  background: conic-gradient(from 0deg, var(--g));
  animation: rank-spin 3.4s linear infinite;
}

.crest:is(.t9, .t10, .t11, .t12, .t13, .t14)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px;
  border-radius: 8.5px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 36%, var(--raised)), var(--raised) 75%);
}

.crest:is(.t12, .t13)::before { animation-duration: 2.4s; }
.crest.t14::before { animation-duration: 1.8s; }
.crest:is(.t10, .t13, .t14) svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 80%, transparent)); }
.crest.t14 { box-shadow: 0 0 36px rgba(255, 247, 214, 0.5), -3px 0 18px rgba(56, 189, 248, 0.35), 3px 0 18px rgba(244, 114, 182, 0.35); animation: rank-glitch 4.8s steps(1) infinite; }

.crest.xl { width: 96px; height: 96px; border-radius: 28px; }
.crest.xl svg { width: 46px; height: 46px; }
.crest.xl::after { border-radius: 26px; }

/* XP bar */
.xp {
  --c: var(--lav);
  --p: 0%;
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--line);
  overflow: hidden;
}

.xp > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p);
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, transparent), var(--c));
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent);
  transition: width 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.xp.shine > i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: o-sweep 2.4s ease-in-out infinite;
}

.xp.lg { height: 10px; }

/* Listener bubbles and list */
.bubbles .av { --gap-color: var(--raised-2); }
.bubbles .av + .av { margin-left: -6px; }

.listener-row {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.listener-row:hover,
.listener-row:focus-visible {
  background: var(--raised-2);
}

.listener-row .av { --gap-color: var(--raised); }
.listener-copy { min-width: 0; }
.listener-row .top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.listener-row .top strong { min-width: 0; }
.listener-row .sub { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 5px; }
.listener-row .sub .lvl { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.listener-row .xp { height: 4px; border: 0; }
.listeners-tip { width: 300px; }

/* Chat */
.chat-entry.with-author {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.chat-entry.with-author .av {
  --gap-color: var(--raised);
  margin-top: 2px;
  cursor: pointer;
}

.chat-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chat-author {
  color: var(--c);
  cursor: pointer;
}

.chat-meta .mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--c);
}

.chat-meta .mini svg { width: 11px; height: 11px; }

.chat-entry.rank-up {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%), var(--raised-2);
}

.chat-entry.rank-up .chat-body { font-weight: 700; color: var(--lav-3); }

/* Profile modal (the shell: .modal-lg, .modal-full on phones). listen.js fills the header (setProfileHead: icon, eyebrow,
   name) and #profile-body, which is also where the block list, the guest card and the invites render. --c is the
   viewer's rank tier colour; everything tinted by it reads it from there. */
.profile {
  --c: var(--t1);
  gap: 14px;
}

.profile-loading {
  margin: 0;
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

/* Hero: avatar with its aura, level, rank badge and the progress to the next level. A thin edge in the tier colour and
   a light behind the avatar, like the home's profile strip. Clipped to its rounded corners, so the aura's glow stays
   inside; the padding leaves room for the crown and the rings. */
.pf-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "avatar id" "avatar prog";
  align-items: center;
  column-gap: 30px;
  row-gap: 10px;
  flex-shrink: 0; /* overflow: hidden drops its min-height to 0; the scrolling .modal-body would squash it on phones */
  padding: 22px 24px 22px 40px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--c) 32%, var(--line));
  background:
    radial-gradient(360px 220px at 84px 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%),
    var(--raised);
}

.pf-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--c);
}

.pf-avatar {
  grid-area: avatar;
  display: grid;
  place-items: center;
}

.pf-avatar .av {
  --gap-color: var(--raised);
}

.pf-id {
  grid-area: id;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.pf-id .handle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.pf-prog {
  grid-area: prog;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.lvl-big { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); }
.lvl-big b { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1.5px; color: var(--c); }
.lvl-big span { color: var(--muted); font-size: 13px; font-weight: 700; font-family: var(--font-body); }
.lvl-next { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.lvl-next b { color: var(--lav-3); }
.profile .xp-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 12px; color: var(--muted); }
.xp-howto { margin: 0; font-size: 11px; color: var(--muted); cursor: help; }

.pf-tiers { display: flex; align-items: center; gap: 12px; }
.tier-track { display: grid; flex: 1 1 auto; min-width: 0; padding: 10px 0; margin: -10px 0; border: 0; background: none; cursor: pointer; align-content: center; grid-template-columns: repeat(var(--n, 14), minmax(0, 1fr)); gap: 4px; }
.tier-track i { height: 4px; align-self: center; border-radius: 99px; background: var(--line); }
.tier-track i.on { background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.tier-track:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 8px; }
.all-ranks { flex: none; min-height: 34px; padding: 0 12px; font-size: 12px; }

/* Stats: four tiles, each with its icon in a tile like the headers'. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 0; padding: 10px 12px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.stat .s-ico { grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised-3); color: var(--lav); }
.stat .s-ico svg { width: 16px; height: 16px; }
.stat .k { font-size: 11px; color: var(--muted); font-weight: 700; }
.stat .v { overflow: hidden; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.4px; text-overflow: ellipsis; white-space: nowrap; }
.stat.flame .v { color: #fb923c; }
.stat.flame .s-ico { border-color: rgba(251, 146, 60, 0.45); color: #fb923c; }
.stat.flame .s-ico svg { filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.7)); animation: rank-breathe 1.6s ease-in-out infinite; }

/* Achievements: unlocked ones as chips tinted by rarity (like the home strip), the next ones as progress cards. */
.pf-cols { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.pf-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ach-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ach-head b { color: var(--text); font-size: 13px; }
.achs { display: flex; flex-wrap: wrap; gap: 8px; }

.ach {
  --c: var(--r-common);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 12px 6px 6px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 70%), var(--raised);
}

.ach .ic, .ach-next .ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.ach .ic svg, .ach-next .ic svg { width: 16px; height: 16px; }
.ach > div { min-width: 0; }
.ach strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ach small { font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--c); }
.ach.legendary { box-shadow: 0 0 18px rgba(251, 191, 36, 0.18); }
.ach.mythic,
.ach-next.mythic { position: relative; overflow: hidden; box-shadow: 0 0 22px rgba(251, 113, 133, 0.22); }

/* Mythic: a light sweep over the card and a gradient rarity label. */
.ach.mythic::after,
.ach-next.mythic:not(.locked)::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  pointer-events: none;
  animation: o-sweep 3.2s ease-in-out infinite;
}

.ach.mythic small,
.ach-next.mythic small {
  background: linear-gradient(90deg, #fb7185, #fbbf24, #c084fc, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Next achievements: how to get each one and how far along it is. */
.ach-next-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ach-next-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ach-next-list[hidden] { display: none; }

/* "Ver todos": the rest of the locked achievements, full width under both columns, as many per row as fit. */
.ach-all-section { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.ach-all-section[hidden] { display: none; }
.ach-all-section .ach-all { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ach-all .ach-next .an-how { -webkit-line-clamp: 1; }

.ach-next {
  --c: var(--r-common);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 28%, var(--line));
  background: var(--field);
  min-width: 0;
}

.ach-next .an-copy { min-width: 0; }
.ach-next .an-title { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ach-next .an-title strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.ach-next .an-title small { flex-shrink: 0; font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--c); }
.ach-next .an-how { display: -webkit-box; margin: 2px 0 6px; overflow: hidden; font-size: 11.5px; line-height: 1.35; color: var(--lav-3); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ach-next .an-bar { position: relative; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ach-next .an-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, transparent), var(--c));
}
.ach-next .an-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.ach-next .an-xp { color: var(--c); font-weight: 800; white-space: nowrap; }

/* The full list beyond the closest ones: dimmed until hovered. */
.ach-next.locked { opacity: 0.62; transition: opacity 160ms; }
.ach-next.locked:hover,
.ach-next.locked:focus-within { opacity: 1; }
.ach-next.locked .ic { filter: grayscale(0.85); }
.ach-toggle { align-self: flex-start; }

/* All-ranks list: opens above the profile (50) and below the celebration overlay (70). A tier card is a compact row:
   three columns on wide screens, so the fourteen tiers need no inner scroll on a 1440x900 window. */
.ranks-modal { z-index: 55; }
.ranks-card { --m-w: 1040px; }
.ranks-sub { margin: 2px 0 0; }
.ranks-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  padding: 2px 6px 2px 2px;
  overscroll-behavior: contain;
}
.rank-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field);
  scroll-margin: 8px;
}
.rank-card.unlocked { border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.rank-card.current {
  border-color: var(--c);
  background: radial-gradient(260px 120px at 0% 50%, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%), var(--field);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 28%, transparent);
}
.rank-card-preview { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; }
.rank-card .av { --gap-color: var(--field); }
.rank-card-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.rank-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rank-card-range { font-size: 12px; color: var(--muted); font-weight: 700; }
.rank-card-state { font-size: 12px; color: var(--muted); }
.rank-card-state.ok { color: var(--c); font-weight: 700; }
.rank-tag { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; background: var(--violet-deep); color: #ffffff; }
.rank-tag.now { background: color-mix(in srgb, var(--c) 30%, transparent); }
.rank-try { min-height: 40px; min-width: 40px; padding: 0 10px; }
.rank-try svg { flex: none; }

/* Between a phone and a wide window: two columns, the button with its words. */
@media (max-width: 1000px) {
  .ranks-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Three columns leave no room for the words: the button is its icon (the label stays for assistive tech). */
@media (min-width: 1001px) {
  .rank-try { padding: 0; }
  .rank-try .rank-try-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (min-width: 1700px) and (min-height: 900px) {
  .profile-card { --m-w: 1080px; }
}

@media (max-width: 760px) {
  .ranks-list { grid-template-columns: minmax(0, 1fr); }
  .rank-card { grid-template-columns: auto minmax(0, 1fr); }
  .rank-try { grid-column: 1 / -1; width: 100%; min-height: 44px; }

  .pf-hero {
    grid-template-areas: "avatar id" "prog prog";
    column-gap: 18px;
    padding: 34px 16px 16px 28px;
  }
  .pf-id { gap: 4px 10px; }
  .lvl-next { flex-basis: 100%; margin-left: 0; text-align: left; }
  .all-ranks { min-height: 44px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-cols { grid-template-columns: minmax(0, 1fr); }
  .ach-next-list { grid-template-columns: minmax(0, 1fr); }
}

/* Level up toast */
.rank-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.rank-toast {
  --c: var(--t4);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 50%, var(--line-strong));
  background: var(--raised);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 26px color-mix(in srgb, var(--c) 25%, transparent);
  animation: rank-toast-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: opacity 400ms, transform 400ms;
}

.rank-toast.leaving { opacity: 0; transform: translateY(-10px); }
.rank-toast .av { --gap-color: var(--raised); }
.rank-toast .t-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.rank-toast .t-title b { color: var(--c); }
.rank-toast .t-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* New rank overlay */
.rank-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
}

.rank-overlay[hidden] { display: none; }

.rank-overlay-stage {
  position: relative;
  width: min(460px, 100%);
  padding: 36px 20px 28px;
  border-radius: var(--modal-radius);
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line-strong));
  background: radial-gradient(500px 280px at 50% 0%, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%), var(--surface-strong);
  box-shadow: 0 0 80px color-mix(in srgb, var(--c) 30%, transparent);
  overflow: hidden;
}

.rank-overlay .rays {
  position: absolute;
  width: 640px;
  height: 640px;
  left: 50%;
  top: 40%;
  margin: -320px 0 0 -320px;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c) 22%, transparent) 0deg 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%);
  mask: radial-gradient(circle, #000 10%, transparent 60%);
  animation: rank-spin 22s linear infinite;
  pointer-events: none;
}

.rank-overlay .confetti { position: absolute; inset: 0; pointer-events: none; }
.rank-overlay .confetti i { position: absolute; bottom: 30%; width: 6px; height: 6px; border-radius: 2px; animation: rank-rise 2.4s ease-out infinite backwards; }

.newrank {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.newrank .crest { animation: rank-pop 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.newrank .nr-text { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: o-in 500ms ease-out 450ms both; }
.newrank .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.newrank h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; letter-spacing: -1.2px; line-height: 1; color: var(--c); text-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.newrank p { margin: 0; color: var(--lav-3); font-size: 13px; }
.unlocks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.unlocks span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--lav-3); background: var(--raised-2); border: 1px solid var(--line-strong); }
.unlocks svg { width: 12px; height: 12px; color: var(--c); }

/* Leyenda and up: a second ray layer turning the other way, a shockwave and rising sparks. */
@keyframes rank-shockwave { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(4.2); } }
@keyframes rank-rise-high { 0% { opacity: 0; transform: translateY(0) scale(0.5); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-170px) scale(1.1); } }

.rank-overlay.epic .rank-overlay-stage {
  border-color: transparent;
  background:
    radial-gradient(500px 280px at 50% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 70%) padding-box,
    linear-gradient(var(--surface-strong), var(--surface-strong)) padding-box,
    linear-gradient(120deg, var(--g)) border-box;
  box-shadow: 0 0 120px color-mix(in srgb, var(--c) 42%, transparent);
}

.rank-overlay.epic .rank-overlay-stage::before {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  left: 50%;
  top: 40%;
  margin: -320px 0 0 -320px;
  background: repeating-conic-gradient(from 11deg, rgba(255, 255, 255, 0.08) 0deg 4deg, transparent 4deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 58%);
  mask: radial-gradient(circle, #000 8%, transparent 58%);
  animation: rank-spin-rev 30s linear infinite;
  pointer-events: none;
}

.rank-overlay.epic .rank-overlay-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 92px;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border-radius: 50%;
  border: 2px solid var(--c);
  opacity: 0;
  animation: rank-shockwave 2.2s ease-out infinite;
  pointer-events: none;
}

.rank-overlay .confetti i.spark { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.7); animation-name: rank-rise-high; }

.rank-overlay.epic .newrank h3 {
  background: linear-gradient(90deg, var(--g));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rank-flow 5s linear infinite;
}

/* Phones: the tooltip stays inside the screen and the rank-up name is a size smaller. */
@media (max-width: 760px) {
  .listeners-tip { width: min(300px, calc(100vw - 32px)); }
  .newrank h3 { font-size: 32px; }
}

/* ---------------------------------------------------------------- moderation */

.mod-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--danger-line);
  background: var(--field);
}

.mod-title { font-family: var(--font-display); font-size: 14px; color: var(--danger); }
.mod-label { font-size: 12px; color: var(--muted); }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-actions .chip { white-space: normal; text-align: center; }

/* The block list, the guest card and the invites render in the profile modal's body; their title is in its header. */
.mod-blocks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mod-block-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.mod-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
}

.mod-block-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mod-block-copy strong { overflow-wrap: anywhere; }
.mod-block-copy .meta { font-size: 12px; color: var(--muted); }

.listener-row.mod-open {
  display: block;
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
}

/* The kicked / blocked screen: the shell's smallest card, no close button (there is nothing to go back to). */
.kicked-screen { z-index: 60; }
.kicked-actions a { text-decoration: none; }

@media (max-width: 760px) {
  .mod-block { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- room harmony */

/* The room speaks the home page's language: display type, icon tiles, quiet surfaces, and a few touches of music (the
   equalizer, the record). The page atmosphere (light, grain, dot grid) sits at the top of this file, the big card and
   the stage and chat surfaces in "room shell" and "player stage", and the library grid under "library". Everything
   here is scoped to the room's own classes, so the home page, which loads this file too, is untouched. */

/* Section headers: the glyph sits in a tile, like the icons on the home's game cards. The queue keeps a bare glyph
   (its column is only ~260px wide and its heading must stay on one line). */
.chat-card .head-icon,
.library-card .head-icon {
  box-sizing: content-box;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised-3);
  color: var(--lav);
}

.queue-card .head-icon {
  color: var(--lav);
}

/* The eyebrow above the title takes the home's live-status colour while music plays, and goes quiet when paused or idle. */
.kicker {
  color: var(--lav);
}

body.is-paused .kicker,
body.is-idle .kicker {
  color: var(--muted);
}

/* Reproducción rápida: a heading with a glyph, like the home's section titles (sentence case; the card keeps its height). */
.quick-play {
  border-radius: 14px;
}

.quick-play-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
}

.quick-play-title svg {
  flex-shrink: 0;
  color: var(--lav);
}

/* Rows of the queue and the chat sit on --field, like the home's song and ranking rows. The first queue row, the bot's
   messages and the rank-ups keep the brighter surfaces their own rules give them. */
.queue-row,
.chat-entry {
  background: var(--field);
}

/* Library: the card gets the home panels' faint light, and the playlist's number tile a border like the icon tiles. */
.library-card {
  background:
    radial-gradient(520px 240px at 100% 0, rgba(124, 58, 237, 0.12), transparent 70%),
    var(--surface);
}

.playlist-card .item-number {
  border: 1px solid var(--line-strong);
  color: var(--lav-2);
}

/* ---- the empty player: the home's turntable
   Nothing is playing, so the record stands still, the tonearm is parked beside it and the equalizer rests. The art sits
   on the right of the video, the message and the two shortcuts on the left (the home hero's composition). Phones keep
   the plain centred message: the video is only ~200px tall there. */
.room-art {
  display: none;
}

.room-art .art-spin,
.room-art .art-bar {
  animation: none;
}

.room-art .art-bar {
  transform: scaleY(0.55);
}

.room-art .art-arm {
  transform-origin: 352px 44px;
  transform: rotate(-30deg);
}

@media (min-width: 761px) {
  .player-placeholder {
    align-items: flex-start;
    padding: 24px 52% 24px clamp(24px, 5%, 56px);
    text-align: left;
    background:
      radial-gradient(440px 300px at 78% 50%, rgba(124, 58, 237, 0.28), transparent 70%),
      var(--field);
  }

  /* The home hero's dot grid, fading out around the record. */
  .player-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 50% 80% at 78% 50%, #000, transparent 75%);
    mask-image: radial-gradient(ellipse 50% 80% at 78% 50%, #000, transparent 75%);
  }

  .player-placeholder strong {
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.1;
  }

  .placeholder-actions {
    justify-content: flex-start;
  }

  /* z-index -1 sits above the placeholder's own background and below its text and buttons (it is a stacking context). */
  .room-art {
    display: block;
    position: absolute;
    z-index: -1;
    right: 2%;
    top: 50%;
    translate: 0 -50%;
    width: 50%;
    height: auto;
    max-height: 94%;
    aspect-ratio: 400 / 320;
    pointer-events: none;
  }
}

/* ---- a track that plays through the bot
   There is no video to show, so the cover becomes a sleeve and a record slides out of it (the home landing's motif).
   The record turns only while the music plays. */
.video-shell .record {
  display: none;
}

.player-window .video-shell.stream-mode {
  background-image: radial-gradient(60% 90% at 60% 50%, rgba(124, 58, 237, 0.22), transparent 70%);
}

.video-shell.stream-mode .media-cover[src] {
  inset: auto;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: auto;
  height: 72%;
  aspect-ratio: 1;
  translate: -75% -50%;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

/* The sleeve is 72% of the video tall; the record is 92% of the sleeve and starts 58% of the way across it, so its label
   clears the sleeve. Both are centred as one group (the translates are shares of each one's own width). */
.video-shell.stream-mode .record {
  display: block;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  height: 66%;
  aspect-ratio: 1;
  translate: -18.5% -50%;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    conic-gradient(from 30deg, transparent 0 18%, rgba(224, 207, 251, 0.1) 24%, transparent 30% 68%, rgba(224, 207, 251, 0.08) 74%, transparent 80%),
    repeating-radial-gradient(circle, #0d0716 0 2px, #1a0f2c 2px 4px);
}

/* No cover to show: the record stands alone in the middle. */
.video-shell.stream-mode .media-cover:not([src]) + .record {
  height: 78%;
  translate: -50% -50%;
}

.video-shell.stream-mode .record::before {
  content: "";
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  border: 2px solid rgba(224, 207, 251, 0.25);
  background: radial-gradient(circle at 35% 30%, var(--violet), var(--violet-deep));
}

.video-shell.stream-mode .record::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.5%;
  height: 4.5%;
  translate: -50% -50%;
  border-radius: 50%;
  background: #0d0716;
}

@media (prefers-reduced-motion: no-preference) {
  body:not(.is-paused):not(.is-idle) .video-shell.stream-mode .record {
    animation: home-spin 14s linear infinite;
  }
}

/* ---- the load reveal
   The home page's one staggered entrance, on the room's four blocks (wide layouts only: a phone shows one view at a
   time and swaps them with display, which would replay it on every tab). A fade, not a rise: the blocks never move,
   so measuring them mid-entrance (or clicking) is always exact. Fill mode is `backwards`, not `both`: the blocks stay
   hidden during their delay, but once the fade ends the animated opacity is released. A `both` fill would keep every
   block a stacking context for the page's lifetime, trapping the room menu and the user dropdown (inside .room-bar)
   under the later .player-stage, and would override any opacity set elsewhere. */
@keyframes room-fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .room-bar,
  .player-stage,
  .col-side,
  .grid-2 {
    animation: room-fade 560ms ease-out backwards;
  }

  .player-stage { animation-delay: 80ms; }
  .col-side { animation-delay: 160ms; }
  .grid-2 { animation-delay: 240ms; }
}

@media (max-width: 760px) {
  :root {
    --lib-gap: 14px;
  }
}

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .eq i,
  .o-btn-primary,
  .seek-fill .shine::before,
  .seek-fill .knob::before,
  .queue-row,
  .item-row,
  .chat-entry,
  .pending-bar,
  .commands,
  .room-menu,
  .user-dropdown,
  .modal-card,
  .install-card,
  .player-stage.queue-motion > .queue-card,
  .av-aura,
  .av::before,
  .av::after,
  .av-sparks,
  .av-sparks i,
  .av-orbit,
  .av-stars,
  .rank,
  .rank span,
  .rank::after,
  .chat-author,
  .crest,
  .crest::before,
  .ach.mythic::after,
  .ach-next.mythic::after,
  .rank-overlay-stage::before,
  .rank-overlay.epic .newrank h3,
  .xp > i::after,
  .stat.flame svg,
  .rank-toast,
  .rank-overlay .rays,
  .newrank .crest,
  .newrank .nr-text {
    animation: none;
  }
  .rank-overlay .confetti,
  .rank-overlay.epic .rank-overlay-stage::after {
    display: none;
  }
  /* Tier rules are more specific than the list above (.av.t9::after, .rank.t14 span...): force it. */
  .av *,
  .av::before,
  .av::after,
  .rank,
  .rank *,
  .rank::after,
  .crest,
  .crest::before,
  .chat-author,
  .ach::after,
  .ach-next::after,
  .rank-overlay-stage::before,
  .rank-overlay .newrank h3 {
    animation: none !important;
  }
  .o-btn,
  .o-btn:hover,
  .o-btn:active {
    transition: none;
    transform: none;
  }
  .o-btn:active::after {
    animation: none;
  }
}

/* ---------------------------------------------------------------- CPU budget */

/* Chat avatars and crests keep their rank colours but stand still: a long chat full of high ranks
   used to run dozens of spinning, blurred layers at once. */
#chat-log .av-aura,
#chat-log .av::before,
#chat-log .av::after,
#chat-log .av-sparks,
#chat-log .av-sparks i,
#chat-log .av-orbit,
#chat-log .av-stars,
#chat-log .crest,
#chat-log .crest::before,
#chat-log .rank,
#chat-log .rank span,
#chat-log .rank::after,
#chat-log .chat-author {
  animation: none;
}

/* Nobody is looking at the room (another window has focus, or it is hidden): freeze every loop. */
body.is-unwatched *,
body.is-unwatched *::before,
body.is-unwatched *::after {
  animation-play-state: paused !important;
}

/* One-shot entrances start invisible: paused, they would leave new chat lines and level-up toasts hidden. */
body.is-unwatched :is(.room-bar, .player-stage, .col-side, .grid-2, .room-menu, .user-dropdown, .player-stage.queue-motion > .queue-card, .queue-row, .pending-bar, .item-row, .chat-entry, .commands, .modal-card, .install-card, .game-panel, .rank-toast, .newrank .crest, .newrank .nr-text) {
  animation-play-state: running !important;
}

/* ---------------------------------------------------------------- guess-the-song game */

/* The game windows wear the modal shell (class .modal-card on the panel, .modal-head / .modal-icon / .modal-titles /
   .modal-close in its header, .modal-body on the body): same surface, header and padding as every modal. What is
   theirs is where they sit. Anchored to a corner, no backdrop: the room stays usable around them. */
.game-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.game-panel[hidden] { display: none; }

/* Minimized, it stays rendered (the clip keeps playing) but out of the way. */
.game-panel.minimized {
  visibility: hidden;
  transform: translateY(calc(100% + 40px));
  pointer-events: none;
}

.game-head-copy { min-width: 0; }

/* The compare games swap the tile's glyph (listen.html carries both): arrows instead of a note. */
.game-panel .gi-compare { display: none; }
.game-panel.compare .gi-song { display: none; }
.game-panel.compare .gi-compare { display: block; }

.game-sub {
  overflow-wrap: anywhere;
}

/* What the room player is doing for the game; the clip itself plays in the (covered) room player. */
.game-audio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--raised);
  flex-shrink: 0;
}

.game-audio[hidden] { display: none; }

.game-audio strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
}

.game-audio .eq i {
  animation: none;
  transform: scaleY(0.3);
}

.game-audio.playing .eq i {
  animation: o-eq 900ms ease-in-out infinite;
  transform: none;
}

/* A game holds the room player: cover it (the placeholder is opaque) but keep it laid out and at least
   200x200, the smallest player YouTube agrees to play in. */
body.game-mode .video-shell {
  min-width: 200px;
  min-height: 200px;
}

body.game-mode .video-shell.stream-mode #youtube-player {
  visibility: visible;
}

body.game-mode .player-placeholder {
  display: flex !important;
}

body.game-mode .audio-gate {
  display: none;
}

/* The shell's .modal-body, except that it does not scroll on its own: the whole panel does (overflow-y on .game-panel),
   so the turn glow of the player cards and the focus outlines are not clipped at the body's edge. */
.game-body {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: auto;
  overflow: visible;
}

.game-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.game-row.end { justify-content: flex-end; }

.game-text {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

.game-countdown {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--lav);
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--raised);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.game-list li.me { outline: 1px solid var(--violet); }

.game-tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.game-tag.ok { color: #6ee7b7; }
.game-tag.bad { color: var(--danger); }

.game-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.game-option {
  min-height: 58px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}

.game-option.picked { border-color: var(--violet); background: var(--violet-deep); }
.game-option.correct { border-color: #6ee7b7; background: rgba(110, 231, 183, 0.16); }
.game-option.wrong { border-color: var(--danger-line); background: rgba(243, 163, 184, 0.12); }

.game-bet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.game-bet input {
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font: inherit;
}

.game-reveal {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
}

.game-reveal strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 17px;
  overflow-wrap: anywhere;
}

/* While a round is on: a much larger panel, text and tap targets. The compact layout stays for lobby and results. */
.game-panel.playing {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  height: fit-content;
  width: min(820px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  gap: 16px;
  padding: 24px;
}

.game-panel.playing .modal-icon { width: 52px; height: 52px; border-radius: 14px; }
.game-panel.playing .game-head h3 { font-size: 26px; }
.game-panel.playing .game-sub { font-size: 15px; }
.game-panel.playing .game-audio { padding: 14px 16px; gap: 12px; }
.game-panel.playing .game-audio strong { font-size: 18px; }
.game-panel.playing .game-body { gap: 18px; }
.game-panel.playing .game-text { font-size: 18px; }
.game-panel.playing .game-muted { font-size: 15px; }
.game-panel.playing .game-countdown { font-size: 26px; font-weight: 700; }
.game-panel.playing .game-options { gap: 12px; }

.game-panel.playing .game-option {
  min-height: 84px;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 18px;
}

.game-panel.playing .game-list li { min-height: 48px; padding: 8px 16px; font-size: 16px; }
.game-panel.playing .game-tag { font-size: 13px; }
.game-panel.playing .game-reveal { padding: 16px; }
.game-panel.playing .game-reveal strong { font-size: 24px; }

.game-panel.playing .chip,
.game-panel.playing .icon-btn {
  min-height: 48px;
  min-width: 48px;
  padding-inline: 18px;
  font-size: 15px;
}

.game-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--violet);
  background: var(--violet-deep);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 26px rgba(132, 75, 241, 0.65);
}

.game-pill[hidden] { display: none; }

@media (max-width: 760px) {
  /* A full-width sheet glued to the tab bar, as tall as its content (the question screen below fills the height). The
     impostor / número / monto panels override this with their own top sheet: their players talk in the chat. */
  .game-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: calc(100dvh - var(--tabbar-h) - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 16px;
  }
  .game-pill {
    bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
  }
  /* Other tabs hide the room player, but a game plays its clips in it: keep it laid out, off screen. */
  body.game-mode:not([data-view="now"]) .now-card {
    display: flex;
    position: fixed;
    top: 0;
    left: -10000px;
    width: 360px;
  }
  body.game-mode[data-view="chat"] .col-main {
    display: flex;
    position: fixed;
    top: 0;
    left: -10000px;
    width: 360px;
  }
  .game-options { grid-template-columns: minmax(0, 1fr); }
  .game-option { min-height: 48px; }
  /* Full-height sheet above the tab bar and inside the safe areas; its body scrolls when content is taller. */
  .game-panel.playing {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    margin: 0;
    height: auto;
    width: auto;
    max-height: none;
    gap: 14px;
    padding: 18px 16px;
    overscroll-behavior: contain;
  }
  .game-panel.playing .modal-icon { width: 44px; height: 44px; border-radius: 12px; }
  .game-panel.playing .game-head h3 { font-size: 22px; }
  .game-panel.playing .game-sub { font-size: 14px; }
  .game-panel.playing .game-audio strong { font-size: 16px; }
  .game-panel.playing .game-text { font-size: 16px; }
  .game-panel.playing .game-countdown { font-size: 24px; }
  .game-panel.playing .game-option { min-height: 64px; font-size: 17px; }
  .game-panel.playing .game-list li { font-size: 15px; }
  .game-panel.playing .game-reveal strong { font-size: 20px; }
}

/* ---- guests (invite link, no Discord): the server enforces the limits, this only hides what they cannot use */
body.is-guest [data-member-only] { display: none !important; }
body.is-guest .seek-bar { pointer-events: none; cursor: default; }
body.is-guest .room-switch-btn { pointer-events: none; }
.guest-tag,
.item-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.invites-box .invite-create { flex-wrap: wrap; align-items: center; }
.invites-box .invite-expiry {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent);
  background: transparent;
  color: inherit;
  font: inherit;
}
.invites-box .mod-block.fresh { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }

/* The /join/<code> page styles live with the home page rules above. */
