/* CLAUDE 2026-11-01 — Lobby. A living hub map (Owner 2026-11-02): each game mode is a landmark in the
   picture, the animated logo above them. Sizes in em follow the window height (body font). */
:root {
  --lb-gold: #ffe08a;
  --lb-ink: #3a2412;
  --lb-text: #fff;
  --lb-dim: #cbbfe6;
  --lb-panel: linear-gradient(180deg, rgba(42, 31, 78, 0.94), rgba(17, 12, 36, 0.96));
  --lb-rim: #e8c36a;
  /* One plate pixel on screen: the 1672x941 plate covers the window whatever its shape. */
  --lb-u: calc(max(100vw, 177.7vh) / 1672);
}
html,
body.lb-body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #2c2150;
  color: var(--lb-text);
  font-family: var(--a-sans);
}
body.lb-body {
  font-size: clamp(13px, 1.85vh, 36px);
}
/* The first screen: the logo and a bar until the scene has arrived (Owner 2026-11-02). */
#lb-boot { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 18px; background: #120c28; transition: opacity 0.45s ease, visibility 0.45s; animation: lb-boot-out 0.4s ease 12s forwards; }
#lb-boot img { width: min(46vh, 70vw); height: auto; }
.lb-boot-bar { width: min(320px, 60vw); height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 224, 138, 0.16); }
.lb-boot-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b07f2c, #ffe08a); transform: scaleX(0.06); transform-origin: left; transition: transform 0.35s ease; }
#lb-boot.done { opacity: 0; visibility: hidden; }
@keyframes lb-boot-out { to { opacity: 0; visibility: hidden; } }
/* ---------- the scene ---------- */
.lb-scene {
  position: fixed;
  left: 50%;
  top: 50%;
  width: calc(var(--lb-u) * 1672);
  height: calc(var(--lb-u) * 941);
  transform: translate(-50%, -50%);
  overflow: hidden;
}
.lb-plate,
.lb-ambient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lb-ambient {
  pointer-events: none;
}
/* Clouds and high wisps: mirrored crops of the plate scrolling behind a soft window, so they never
   cross the islands. Numbers match tools/lobby-art/build_lobby_hub.py. */
.lb-clouds,
.lb-sky {
  position: absolute;
  overflow: hidden;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.lb-clouds {
  left: calc(var(--lb-u) * 940);
  top: calc(var(--lb-u) * 700);
  width: calc(var(--lb-u) * 732);
  height: calc(var(--lb-u) * 240);
  -webkit-mask-image: url('/api/arena/lobby/hub-clouds-mask.png');
  mask-image: url('/api/arena/lobby/hub-clouds-mask.png');
}
.lb-sky {
  left: calc(var(--lb-u) * 340);
  top: 0;
  width: calc(var(--lb-u) * 890);
  height: calc(var(--lb-u) * 190);
  -webkit-mask-image: url('/api/arena/lobby/hub-sky-mask.png');
  mask-image: url('/api/arena/lobby/hub-sky-mask.png');
}
.lb-clouds i,
.lb-sky i {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  background-repeat: repeat-x;
  will-change: transform;
  animation: lb-drift linear infinite;
}
.lb-clouds i {
  --lb-tile: calc(var(--lb-u) * 860);
  width: calc(var(--lb-u) * 1600);
  height: calc(var(--lb-u) * 240);
  background-image: url('/api/arena/lobby/hub-clouds-tile.webp');
  background-size: var(--lb-tile) 100%;
  animation-duration: 220s;
}
.lb-sky i {
  --lb-tile: calc(var(--lb-u) * 1360);
  width: calc(var(--lb-u) * 2250);
  height: calc(var(--lb-u) * 190);
  background-image: url('/api/arena/lobby/hub-sky-tile.webp');
  background-size: var(--lb-tile) 100%;
  animation-duration: 780s;
}
@keyframes lb-drift {
  to { transform: translate3d(calc(var(--lb-tile) * -1), 0, 0); }
}
/* A landmark under the pointer: the picture itself brightens through its soft mask. */
.lb-glow {
  position: absolute;
  inset: 0;
  background: url('/api/arena/lobby/hub-1920.webp') center / 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lb-glow.on {
  opacity: 0.42;
}
/* ---------- the animated logo (the Loading emblem design) ---------- */
.lb-emblem {
  position: relative;
  width: min(54vh, 46vw);
  aspect-ratio: 1;
  visibility: hidden;
}
.lb-emblem.ready {
  visibility: visible;
  animation: lb-rise 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) both, lb-float 6s ease-in-out 1.3s infinite;
}
.lb-emblem img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lb-emblem-base {
  /* A tight dark edge keeps the gold letters readable over the bright clouds. */
  filter: drop-shadow(0 0.1em 0.18em rgba(30, 14, 60, 0.9)) drop-shadow(0 0.4em 1em rgba(30, 14, 60, 0.5));
}
/* A copy cut to the crystal's diamond beats like a heart, in the three life colours behind it. */
.lb-emblem-crystal {
  clip-path: polygon(49.9% 15.5%, 59.8% 34.3%, 49.9% 56.6%, 39.9% 34.3%);
  transform-origin: 49.9% 34.3%;
  animation: lb-beat 2.4s ease-in-out infinite;
}
.lb-emblem-glow {
  position: absolute;
  left: 49.9%;
  top: 34.3%;
  width: 22%;
  height: 34%;
  translate: -50% -50%;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(1em);
  animation: lb-hue 7.2s linear infinite, lb-pulse 2.4s ease-in-out infinite;
}
/* A gold sweep that lights only the logo's own pixels. */
.lb-emblem-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 248, 220, 0.9) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  -webkit-mask: url('/api/arena/brand/logo') center / contain no-repeat;
  mask: url('/api/arena/brand/logo') center / contain no-repeat;
  mix-blend-mode: overlay;
  animation: lb-sweep 4.2s ease-in-out 1s infinite;
}
.lb-emblem-burst {
  position: absolute;
  left: 49.9%;
  top: 34.3%;
  width: 10%;
  height: 10%;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6dc, rgba(255, 224, 138, 0.6) 40%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  animation: lb-burst 1.1s ease-out 0.7s;
}
@keyframes lb-rise { from { opacity: 0; transform: scale(0.86); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes lb-float { 50% { transform: translateY(-1.5%); } }
@keyframes lb-beat { 0%, 100% { transform: scale(1); filter: brightness(1); } 45% { transform: scale(1.035); filter: brightness(1.32) drop-shadow(0 0 0.8em rgba(255, 224, 138, 0.55)); } }
@keyframes lb-pulse { 0%, 100% { opacity: 0.3; } 45% { opacity: 0.8; } }
@keyframes lb-hue { 0% { background: #e7899a; } 33% { background: #ffe08a; } 66% { background: #b9b2e6; } 100% { background: #e7899a; } }
@keyframes lb-sweep { 0% { background-position: 130% 0; } 60%, 100% { background-position: -30% 0; } }
@keyframes lb-burst { 0% { opacity: 1; width: 10%; height: 10%; } 100% { opacity: 0; width: 150%; height: 150%; } }
/* ---------- the page above the scene ---------- */
.lb-root {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}
.lb-wait {
  color: #fff;
  font-size: 1.2em;
  text-shadow: 0 2px 6px rgba(30, 14, 60, 0.9);
}
.lb-home {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  padding: 1.3em 1.6em 1.6em;
  pointer-events: none; /* the map lies under this layer; only its own buttons take clicks */
}
.lb-home button {
  pointer-events: auto;
}
.lb-mid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  justify-items: center;
}
.lb-home .lb-emblem {
  width: min(22vh, 24vw); /* in the clear sky over the colosseum */
}
/* The map: the same box as the scene, so these line up with the picture at any window shape. */
.lb-map {
  position: fixed;
  left: 50%;
  top: 50%;
  width: calc(var(--lb-u) * 1672);
  height: calc(var(--lb-u) * 941);
  transform: translate(-50%, -50%);
}
.lb-spot-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none !important; /* the picture is the button: no shared button colours */
  box-shadow: none !important;
  outline: none;
  cursor: pointer;
}
/* A place's name: a slim dark plaque that fades out at both ends, so the picture stays the star. */
.lb-map .lb-spot-name,
.lb-map .lb-spot-name:hover {
  position: absolute;
  padding: 0.28em 2.4em;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(18, 12, 44, 0.8) 22%, rgba(18, 12, 44, 0.8) 78%, transparent);
  color: #fff;
  font: 600 1.05em/1.35 var(--a-sans);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  translate: -50% -50%;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}
.lb-spot-name::before,
.lb-spot-name::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 138, 0.75), transparent);
  transition: left 0.2s ease, right 0.2s ease;
}
.lb-spot-name::before {
  top: 0;
}
.lb-spot-name::after {
  bottom: 0;
}
.lb-map .lb-spot-name.main,
.lb-map .lb-spot-name.main:hover {
  font-size: 1.2em;
}
.lb-map .lb-spot-name.on {
  color: var(--lb-gold);
  transform: translateY(-0.15em);
}
.lb-spot-name.on::before,
.lb-spot-name.on::after {
  left: 0;
  right: 0;
}
.lb-map .lb-spot-name:active {
  transform: translateY(1px);
}
/* The bar along the bottom edge, melting up into the picture. */
.lb-body .lb-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  padding: 1.5em 1em 0.3em;
  background: linear-gradient(to top, rgba(14, 9, 36, 0.92), rgba(14, 9, 36, 0.62) 58%, transparent);
  pointer-events: none;
}
.lb-body .lb-bar-btn,
.lb-body .lb-bar-btn:hover {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1.7em;
  border: 0;
  border-radius: 0;
  background: none;
  color: #f1e9ff;
  font: 500 0.98em/1.2 var(--a-sans);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.15s ease;
}
.lb-bar-btn + .lb-bar-btn {
  border-left: 1px solid transparent;
  border-image: linear-gradient(to bottom, transparent, rgba(255, 224, 138, 0.4), transparent) 1;
}
.lb-body .lb-bar-btn:hover {
  color: var(--lb-gold);
}
.lb-bar-btn .lb-ico {
  width: 1.3em;
  height: 1.3em;
  color: var(--lb-gold);
}
/* Back to the website from the invite screen. */
.lb-body .lb-site,
.lb-body .lb-site:hover {
  position: fixed;
  left: 0.8em;
  top: 0.8em;
  padding: 0.45em 1.1em;
  border-radius: 0.3em;
  background: rgba(18, 12, 44, 0.66);
  backdrop-filter: blur(6px);
}
.lb-top {
  justify-self: stretch;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  position: relative;
  z-index: 1;
}
.lb-tools {
  display: flex;
  gap: 0.6em;
}
/* Player chip */
.lb-me {
  display: flex;
  align-items: center;
  gap: 0.7em;
  position: fixed; /* flush with the corner, fading out to the right */
  left: 0;
  top: 0;
  margin: 0;
  padding: 0.5em 4em 0.5em 0.7em;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(14, 9, 36, 0.85) 55%, transparent);
  box-shadow: none;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lb-body .lb-me:hover {
  background: linear-gradient(90deg, rgba(36, 25, 76, 0.9) 55%, transparent);
}
.lb-me-face {
  width: 3em;
  height: 3em;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.8);
}
.lb-me b {
  display: block;
  max-width: 14em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.15em;
  color: var(--lb-gold);
}
.lb-me small {
  display: flex;
  align-items: center;
  gap: 0.3em;
  color: var(--lb-dim);
  font-size: 0.85em;
}
/* Icons */
.lb-ico {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Buttons */
.lb-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  padding: 0.5em 1.7em;
  border: 1px solid #fff0bd;
  border-radius: 0.35em;
  background: linear-gradient(#f6d98a, #cf9a3e);
  color: #2c1a08;
  font: 700 1.12em var(--a-sans);
  box-shadow: 0 0.2em 0.7em rgba(14, 9, 36, 0.5);
  cursor: pointer;
}
.lb-body .lb-go:hover:not(:disabled) {
  background: linear-gradient(#fbe6a6, #dcab50);
  color: #2c1a08;
}
.lb-go:active:not(:disabled) {
  transform: translateY(1px);
}
.lb-go.small {
  padding: 0.5em 1.3em;
  font-size: 1.05em;
}
.lb-go:hover:not(:disabled),
.lb-ghost:hover {
  filter: brightness(1.12);
}
.lb-go:disabled {
  filter: grayscale(0.8) brightness(0.7);
  cursor: wait;
}
.lb-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 1em;
  border: 1px solid rgba(255, 224, 138, 0.5);
  border-radius: 0.35em;
  background: rgba(18, 12, 44, 0.66);
  color: #ffe7a6;
  font: 600 0.95em var(--a-sans);
  cursor: pointer;
}
button:focus-visible {
  outline: 3px solid #fff3c4;
  outline-offset: 2px;
}
.lb-foot {
  display: grid;
  justify-items: center;
  gap: 0.8em;
  margin-bottom: 2.6em; /* above the bar */
}
.lb-rejoin {
  animation: lb-pulse-ring 1.8s ease-in-out infinite;
}
@keyframes lb-pulse-ring { 50% { box-shadow: 0 0 1.6em rgba(255, 211, 106, 0.9); } }
/* Sign in */
.lb-enter {
  display: grid;
  justify-items: center;
  gap: 0.2em;
}
.lb-enter .lb-emblem {
  width: min(46vh, 60vw);
  margin-bottom: -2.6em;
}
.lb-signin {
  box-sizing: border-box;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.5em;
  width: min(25em, 92vw);
  padding: 1em 1.4em 1.3em;
  border: 3px solid var(--lb-rim);
  border-radius: 1.3em;
  background: var(--lb-panel);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), 0 1em 2.4em rgba(30, 14, 60, 0.7);
  text-align: center;
  animation: arena-result-pop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.lb-signin h1 {
  margin: 0;
  font: 400 1.6em/1.2 var(--a-display);
  color: var(--lb-gold);
  text-shadow: 0 3px 0 #000;
}
.lb-sub {
  margin: 0 0 0.2em;
  color: var(--lb-dim);
}
.lb-code {
  box-sizing: border-box;
  width: 100%;
  padding: 0.5em 0.7em;
  border-radius: 0.8em;
  border: 2px solid rgba(255, 224, 138, 0.55);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  text-align: center;
  letter-spacing: 0.25em;
  font: 800 1.45em var(--a-num);
  text-transform: uppercase;
  outline: none;
}
.lb-code:focus {
  border-color: #ffd36a;
  box-shadow: 0 0 0 3px rgba(255, 211, 106, 0.25);
}
.lb-error {
  min-height: 1.3em;
  margin: 0;
  color: #ff9b9b;
  font-size: 0.95em;
}
/* Windows opened from the menu reuse the profile window's frame. */
.lb-dialog {
  width: min(32em, 100%);
  gap: 0.75em;
  font-size: clamp(13px, 1.85vh, 36px);
  padding: 1.2em 1.5em 1.3em;
  overflow-y: auto;
}
.lb-dialog h2 {
  margin: 0;
  font: 400 1.75em var(--a-display);
  color: var(--lb-gold);
}
.lb-dlg-head {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.lb-dlg-head > .lb-ico {
  width: 2em;
  height: 2em;
  color: var(--lb-gold);
}
.lb-close {
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  margin-left: auto;
  border: 2px solid rgba(255, 224, 138, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #ffe7a6;
  cursor: pointer;
}
.lb-close:hover {
  filter: brightness(1.25);
}
.lb-label {
  font-size: 0.9em;
  font-weight: 700;
  color: var(--lb-gold);
}
.lb-seg {
  display: flex;
  gap: 0.4em;
}
.lb-seg-btn {
  flex: 1;
  padding: 0.55em 0;
  border-radius: 0.75em;
  border: 2px solid rgba(255, 224, 138, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 800 1.05em var(--a-sans);
  cursor: pointer;
}
.lb-seg-btn.on {
  border-color: #ffd36a;
  background: linear-gradient(#5b4296, #2c1f55);
  box-shadow: 0 0 0.9em rgba(255, 211, 106, 0.45);
}
/* Deck choice: game buttons, not a browser list. */
.lb-decks {
  display: grid;
  gap: 0.35em;
}
.lb-deck {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.8em;
  border-radius: 0.75em;
  border: 2px solid rgba(255, 224, 138, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: 600 1em var(--a-sans);
  text-align: left;
  cursor: pointer;
}
.lb-deck .lb-ico {
  color: var(--lb-gold);
}
.lb-deck:hover:not(:disabled) {
  filter: brightness(1.2);
}
.lb-deck.on {
  border-color: #ffd36a;
  background: linear-gradient(#5b4296, #2c1f55);
  box-shadow: 0 0 0.9em rgba(255, 211, 106, 0.45);
}
.lb-deck:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.lb-deck small {
  margin-left: auto;
  color: var(--lb-dim);
  font-weight: 500;
}
.lb-hist {
  display: grid;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lb-hist li {
  display: grid;
  grid-template-columns: 3.4em 1fr auto;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.65em;
  border-radius: 0.65em;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.95em;
}
.lb-hist b {
  text-align: center;
  border-radius: 0.5em;
  padding: 0.12em 0;
}
.lb-hist .r-win b { background: #2f7a4a; }
.lb-hist .r-loss b { background: #8a3434; }
.lb-hist .r-draw b { background: #5a5a6a; }
.lb-hist small {
  color: var(--lb-dim);
}
.lb-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 9em;
  padding: 0.75em;
  border-radius: 0.9em;
  border: 2px solid rgba(255, 224, 138, 0.45);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: 500 1em/1.5 var(--a-sans);
  resize: vertical;
}
.lb-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.6em;
}
/* PvP room */
.lb-join { display: flex; gap: 0.5em; }
.lb-room-code { font-size: 1.25em; padding: 0.4em 0.5em; letter-spacing: 0.2em; }
.lb-room { text-align: center; justify-items: center; align-items: center; }
.lb-room-show { display: block; margin: 0.15em 0; font: 800 3.2em var(--a-num); letter-spacing: 0.25em; color: var(--lb-gold); text-shadow: 0 3px 0 #000; }
.lb-join .lb-go { white-space: nowrap; flex: none; }
.lb-or { align-self: center; color: var(--lb-dim); font-size: 0.9em; }
@media (prefers-reduced-motion: reduce) {
  .lb-clouds i, .lb-sky i, .lb-emblem, .lb-emblem-crystal, .lb-emblem-glow, .lb-emblem-sweep, .lb-emblem-burst, .lb-rejoin, .lb-signin {
    animation: none;
  }
}
