@media (max-height: 700px) {
  .lobby-rush { height: 44px; }
  .rush-prize.noted .rush-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lobby-rush,
  .rush-fill {
    transition: none;
  }
  .lobby-rush.flare,
  .lobby-rush.flare .rush-fill,
  .rush-fill.almost::before {
    animation: none;
  }
}


.lobby-floor {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 -16px;
}

.lobby-floor .game-list {
  position: relative;
  flex: 1 1 auto;
  margin: 0;
}

.lobby-start {
  position: absolute;
  z-index: 7;
  isolation: isolate;
  top: 50%;
  left: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 26px;
  height: 92px;
  margin-top: -46px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: none;
  box-shadow: none;
  color: var(--gold-light);
  font-family: var(--display);
  line-height: 1;
  text-shadow: 0 1px 0 #2a0650, 0 0 6px rgba(255, 220, 120, 0.6);
  transition: translate 220ms ease-out, opacity 220ms ease-out;
}

.lobby-start::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 44px;
}

.lobby-start::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  box-sizing: border-box;
  border: 2px solid var(--gold);
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(180deg, #5a2496, #2a0d52 70%, #1a0838);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 4px 10px rgba(0, 0, 0, 0.65), 0 0 12px rgba(190, 90, 255, 0.5);
  pointer-events: none;
  transition: translate 80ms ease-out, box-shadow 80ms ease-out, border-color 80ms ease-out;
}

.lobby-start-label,
.lobby-start-arrow {
  transition: translate 80ms ease-out;
}

.lobby-start-label {
  writing-mode: vertical-rl;
  rotate: 180deg;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.lobby-start-arrow {
  font-size: 1.3rem;
  margin-top: -2px;
}

.lobby-start:active:not(:disabled)::after {
  translate: 0 1px;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 2px 5px rgba(0, 0, 0, 0.7), 0 0 10px rgba(190, 90, 255, 0.45), inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.lobby-start:active:not(:disabled) > span {
  translate: 0 1px;
}

.lobby-start:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 1px;
}

.lobby-start.off {
  translate: -32px 0;
  opacity: 0;
  pointer-events: none;
}


.league-tab {
  --tab-w: 96px;
  position: absolute;
  z-index: 6;
  top: var(--league-tab-top, 116px);
  right: 0;
  display: flex;
  flex-direction: column;
  width: var(--tab-w);
  padding: 6px 4px 4px 6px;
  border: 2px solid var(--gold);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #5a2496, #2a0d52 70%, #1a0838);
  box-shadow: 0 0 0 1px var(--gold-deep), -3px 4px 10px rgba(0, 0, 0, 0.6);
}

.league-tab:not(.open) {
  --tab-w: 48px;
  padding: 0;
}

.league-tab:not(.open) .league-tab-body {
  padding: 4px 2px;
}

.league-tab-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
}

.league-tab-body:active {
  transform: translateY(1px);
}

.league-tab-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.league-tab-gem {
  flex: none;
  width: 24px;
  height: 24px;
}

.league-tab-gem .league-mark { width: 100%; height: 100%; }

.league-tab-name {
  color: var(--gold-light);
  font-family: var(--display);
  font-size: .75rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000;
}

.league-tab-place {
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.66rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-wrap: balance;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
}

.league-tab-division {
  white-space: nowrap;
}

.league-tab.short .league-tab-division {
  display: none;
}

.league-tab.compact.open .league-tab-place {
  display: none;
}

.league-tab.up .league-tab-place { color: #7affb0; }
.league-tab.down .league-tab-place { color: #ffabb5; }

.league-tab-rows {
  display: flex;
  flex-direction: column;
}

.league-tab-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-height: 20px;
  padding: 2px 2px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--display);
  font-size: .75rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.1;
}

.league-tab-row:last-child {
  border-bottom: 1px solid var(--hairline);
}

.league-tab-row-score {
  color: var(--gold-light);
  font: 600 .72rem / 1.1 var(--body);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}

.league-tab-row:not(.you) .league-tab-row-rank { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.league-tab-row:not(.you) .league-tab-row-score { flex-shrink: 0; white-space: nowrap; overflow-wrap: normal; }

.league-tab-row.you {
  color: var(--gold);
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr) minmax(0, max-content);
  grid-template-rows: auto auto;
  gap: 0 2px;
  line-height: 1.1;
  padding-block: 0;
}

.league-tab-identity { display: contents; }
.league-tab-identity[hidden] { display: none; }
.league-tab-player-name {
  grid-column: 2 / -1;
  grid-row: 1;
  align-self: center;
  overflow: hidden;
  font-size: max(11px, .73rem);
  letter-spacing: 0;
}
.league-tab-player-name > span { display: block; width: max-content; transform-origin: left center; }
.league-tab-identity .league-face { grid-column: 1; grid-row: 1; align-self: center; width: 13px; height: 13px; }
.league-tab-row.you .league-tab-row-rank { grid-column: 1 / 3; grid-row: 2; align-self: center; }
.league-tab-row.you .league-tab-row-score { grid-column: 3; grid-row: 2; align-self: center; }

.league-tab-time {
  align-self: flex-start;
  padding: 2px 4px;
  border: 1px solid var(--gold-deep);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.league-tab-toggle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-light);
}

.league-tab-toggle svg {
  width: 26px;
  height: 26px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(180deg, #8d5fff, #5a2fd6);
  box-shadow: 0 0 0 1px var(--gold-deep);
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.league-tab.open .league-tab-body {
  padding-bottom: 44px;
}

.league-tab.open .league-tab-time {
  position: absolute;
  left: 6px;
  bottom: 15px;
}

.league-tab:not(.open) .league-tab-name,
.league-tab:not(.open) .league-tab-rows,
.league-tab:not(.open) .league-tab-toggle {
  display: none;
}

.league-tab:not(.open) .league-tab-body {
  align-items: center;
  text-align: center;
}

.league-tab:not(.open) .league-tab-head {
  justify-content: center;
}

.league-tab:not(.open) .league-tab-gem {
  width: 28px;
  height: 28px;
}

.league-tab:not(.open) .league-tab-place,
.league-tab:not(.open) .league-tab-time {
  align-self: center;
}

@media (max-height: 700px) {
  .league-tab { top: var(--league-tab-top, 112px); }
}


.lobby.enter .game-list > .game-card {
  animation: lobby-card-in 320ms cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

.lobby.enter .game-list > .game-card:nth-child(2) { animation-delay: 60ms; }
.lobby.enter .game-list > .game-card:nth-child(3) { animation-delay: 120ms; }
.lobby.enter .game-list > .game-card:nth-child(4) { animation-delay: 180ms; }
.lobby.enter .game-list > .game-card:nth-child(5) { animation-delay: 240ms; }
.lobby.enter .game-list > .game-card:nth-child(n + 6) { animation-delay: 300ms; }

.lobby.enter .lobby-sign-title {
  background-image:
    linear-gradient(105deg, transparent 44%, rgba(255, 255, 240, 0.95) 50%, transparent 56%),
    var(--gold-bevel);
  background-size: 300% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 0, 0 0;
  animation: lobby-sign-shimmer 800ms ease-in-out 160ms backwards;
}

.lobby.enter .lobby-tiles .tile {
  animation: lobby-tile-pop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) 160ms backwards;
}

.lobby.enter .lobby-tiles .tile:nth-child(2) { animation-delay: 205ms; }
.lobby.enter .lobby-tiles .tile:nth-child(3) { animation-delay: 250ms; }
.lobby.enter .lobby-tiles .tile:nth-child(4) { animation-delay: 295ms; }

@keyframes lobby-card-in {
  from { opacity: 0; transform: translateX(56px); }
}

@keyframes lobby-sign-shimmer {
  from { background-position: 100% 0, 0 0; }
  to { background-position: 0 0, 0 0; }
}

@keyframes lobby-tile-pop {
  from { opacity: 0; transform: translateY(22px) scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .lobby.enter .game-list > .game-card,
  .lobby.enter .lobby-sign-title,
  .lobby.enter .lobby-tiles .tile {
    animation: none;
  }
  .lobby-start,
  .lobby-start::after,
  .lobby-start-label,
  .lobby-start-arrow {
    transition: none;
  }
  .lobby-start:active:not(:disabled)::after,
  .lobby-start:active:not(:disabled) > span {
    translate: none;
  }
  .lobby-start:active:not(:disabled)::after {
    box-shadow: 0 0 0 1px var(--gold-deep), 0 4px 10px rgba(0, 0, 0, 0.65), 0 0 10px rgba(190, 90, 255, 0.45), inset 0 2px 3px rgba(0, 0, 0, 0.45);
  }
}

/* Once the entrance has played (endEntrance() in js/lobby.js adds
   .entered), its animations keep their names but take no time and hold
   no frame: reduced motion takes the names off, so turning it off again
   starts them over, and that must change nothing (a card slide moves the
   row's snap points, and WebKit's re-snap seconds later is a card-row
   scroll that cancels the idle attract). */
.lobby.enter.entered,
.lobby.enter.entered .game-list > .game-card,
.lobby.enter.entered .lobby-sign-title,
.lobby.enter.entered .lobby-tiles .tile,
.lobby.enter.entered .lobby-bonus .bonus-pod,
.lobby.enter.entered .lobby-bonus .bonus-wheel {
  animation-duration: 0s;
  animation-delay: 0s;
  animation-fill-mode: none;
}


.lobby.lobby-motion-active.idle .game-card.card-motion-in-view.attract:not(.soon, :active, :focus-visible)::after {
  border-image: none;
  box-shadow: inset 0 0 0 1px var(--cabinet-light), inset 0 0 12px var(--cabinet-glow);
  animation: fb-card-breathe 5s ease-in-out infinite alternate, lobby-idle-tube 900ms ease-out;
}

.lobby.lobby-motion-active.idle .game-card.sapphire.card-motion-in-view.attract:not(.soon, :active, :focus-visible)::after {
  animation-delay: -2.5s, 0s;
}

.lobby .tile.nudge .tile-ring > .lobby-art {
  animation: lobby-idle-rock 640ms ease-in-out;
}

.lobby .tile.nudge .tile-state {
  animation: lobby-idle-bump 520ms ease-out 80ms;
}

.lobby .lobby-inbox-count.nudge {
  transform-origin: 50% 100%;
  animation: lobby-idle-wobble 720ms ease-in-out;
}

@keyframes lobby-idle-tube {
  22% {
    opacity: 1;
    box-shadow: inset 0 0 0 2px rgba(255, 244, 205, 0.95), inset 0 0 0 4px rgba(255, 214, 240, 0.85),
      inset 0 0 22px rgba(255, 200, 240, 0.75);
  }
}

@keyframes lobby-idle-rock {
  20% { rotate: -8deg; }
  50% { rotate: 8deg; }
  78% { rotate: -3deg; }
}

@keyframes lobby-idle-bump {
  35% { scale: 1.1; }
  70% { scale: 0.98; }
}

@keyframes lobby-idle-wobble {
  15% { rotate: -14deg; scale: 1.12; }
  40% { rotate: 12deg; }
  62% { rotate: -7deg; }
  82% { rotate: 3deg; }
}

@media (prefers-reduced-motion: reduce) {
  .lobby.lobby-motion-active.idle .game-card.card-motion-in-view.attract:not(.soon)::after,
  .lobby .tile.nudge .tile-ring > .lobby-art,
  .lobby .tile.nudge .tile-state,
  .lobby .lobby-inbox-count.nudge {
    animation: none;
  }
}
