/* ==========================================================
   Design tokens
   ========================================================== */
:root {
  --bg: #d9e2ff;
  --bg-deep: #c7d3ff;
  --surface: #ffffff;
  --ink: #161a44;
  --ink-soft: #4d5390;
  --grape: #5a3cf2;
  --grape-ink: #ffffff;
  --sun: #ffcf33;
  --coral: #ff5470;
  --mint: #19c496;
  --line: rgba(22, 26, 68, 0.12);

  --tile: 104px;
  --gap: 12px;
  --r-tile: 18px;
  --r-big: 26px;
  --r-pill: 999px;
  --lift: 0 4px 0 var(--ink);

  --font-display: 'Fredoka', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161a44; --bg-deep: #10133a; --surface: #242a66; --ink: #eef0ff; --ink-soft: #a9b0ea;
    --grape: #7c63ff; --line: rgba(238, 240, 255, 0.14); --lift: 0 4px 0 #0a0c2a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161a44; --bg-deep: #10133a; --surface: #242a66; --ink: #eef0ff; --ink-soft: #a9b0ea;
  --grape: #7c63ff; --line: rgba(238, 240, 255, 0.14); --lift: 0 4px 0 #0a0c2a; color-scheme: dark;
}
@media (min-width: 900px) { :root { --tile: 118px; --gap: 14px; } }

*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 500 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: 0.005em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================
   Top bar
   ========================================================== */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px clamp(12px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--surface); padding: 6px 16px 6px 8px; border-radius: var(--r-pill); box-shadow: var(--lift);
}
.logo-mark svg { width: 36px; height: 36px; display: block; }
.logo-text { font: 700 1.35rem/1 var(--font-display); letter-spacing: 0.01em; }

.search { position: relative; max-width: 520px; width: 100%; justify-self: center; }
.search input {
  width: 100%; height: 46px; border: 0; border-radius: var(--r-pill);
  padding: 0 18px 0 46px; font: 600 1rem var(--font-body); color: var(--ink);
  background: var(--surface); box-shadow: inset 0 0 0 2px transparent;
}
.search input:focus { outline: none; box-shadow: inset 0 0 0 3px var(--grape); }
.search input::placeholder { color: var(--ink-soft); }
.search-icon { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border-radius: 20px; padding: 8px; box-shadow: 0 18px 40px rgba(10, 12, 42, 0.22);
  max-height: 70vh; overflow-y: auto;
}
.suggest a { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 12px; text-decoration: none; font-weight: 600; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--bg); }
.suggest img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--bg-deep); }
.suggest .suggest-all { justify-content: center; color: var(--grape); padding: 10px; }
.suggest .suggest-empty { padding: 12px; color: var(--ink-soft); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); color: var(--ink); border: 0; text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { color: var(--grape); }
.account-btn {
  height: 46px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  background: var(--grape); color: var(--grape-ink); font-weight: 700; box-shadow: var(--lift);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* Category bar */
.catbar {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 2px clamp(12px, 3vw, 28px) 14px;
}
.catbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px 0 12px;
  border-radius: var(--r-pill); background: var(--surface); text-decoration: none;
  font: 600 0.95rem var(--font-display); white-space: nowrap; border: 0;
}
.chip .ico { font-size: 1.1rem; }
.chip:hover { background: var(--sun); color: #161a44; }
.chip[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ==========================================================
   Main + generic
   ========================================================== */
main { flex: 1; width: 100%; max-width: 1760px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 28px) 48px; }
main:focus { outline: none; }
.loading { display: flex; justify-content: center; gap: 8px; padding: 80px 0; }
.loading .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grape); animation: bob 0.9s infinite ease-in-out; }
.loading .dot:nth-child(2) { animation-delay: 0.15s; background: var(--sun); }
.loading .dot:nth-child(3) { animation-delay: 0.3s; background: var(--coral); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border: 0; border-radius: var(--r-pill); font-weight: 700; text-decoration: none;
  background: var(--surface); color: var(--ink);
}
.btn-primary { background: var(--grape); color: var(--grape-ink); box-shadow: var(--lift); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.link-btn { background: none; border: 0; padding: 0; color: var(--grape); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); }
.sort { display: inline-flex; background: var(--surface); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.sort a { padding: 7px 14px; border-radius: var(--r-pill); text-decoration: none; font-weight: 700; font-size: 0.92rem; color: var(--ink-soft); }
.sort a[aria-current="true"] { background: var(--ink); color: var(--bg); }

.empty {
  background: var(--surface); border-radius: var(--r-big); padding: 48px 24px; text-align: center; max-width: 560px; margin: 24px auto;
}
.empty h2 { font-size: 1.6rem; margin-bottom: 6px; }
.empty p { color: var(--ink-soft); margin: 0 0 18px; }

/* ==========================================================
   Game tiles + mosaic
   ========================================================== */
.mosaic {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
  grid-auto-rows: auto; grid-auto-flow: dense;
}
.tile {
  position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-tile); overflow: hidden;
  background: var(--bg-deep); text-decoration: none; isolation: isolate;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile.big { grid-column: span 2; grid-row: span 2; border-radius: var(--r-big); }
.tile .tile-title {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2;
  padding: 5px 10px; border-radius: 12px; background: var(--surface); color: var(--ink);
  font: 600 0.85rem/1.2 var(--font-display); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(6px); transition: opacity 0.14s, transform 0.14s;
}
.tile.big .tile-title { font-size: 1.05rem; padding: 8px 12px; }
.tile .badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 9px; border-radius: var(--r-pill);
  font: 700 0.72rem/1.6 var(--font-body); background: var(--sun); color: #161a44;
}
.tile .badge.hot { background: var(--coral); color: #fff; }
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: 0 6px 0 var(--ink); }
.tile:hover .tile-title, .tile:focus-visible .tile-title { opacity: 1; transform: none; }
@media (hover: none) { .tile .tile-title { opacity: 1; transform: none; font-size: 0.75rem; padding: 3px 6px; } }
.tile-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; padding: 10px; text-align: center;
  font: 700 1rem/1.1 var(--font-display); color: #161a44;
}

/* Rows (horizontal scrollers) */
.row { margin-top: 34px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row-head h2 { font-size: 1.45rem; display: flex; align-items: center; gap: 10px; }
.row-head h2 .ico { font-size: 1.4rem; }
.row-head a { font-weight: 700; color: var(--grape); text-decoration: none; white-space: nowrap; }
.row-head a:hover { text-decoration: underline; }
.row-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc(var(--tile) * 1.35); gap: var(--gap);
  overflow-x: auto; scroll-snap-type: x proximity; padding: 6px 2px 10px; scrollbar-width: thin;
}
.row-scroll .tile { scroll-snap-align: start; }

/* Home hero strip: first row of the mosaic sits inside a panel */
.home-intro { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin: 4px 0 16px; }
.home-intro h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.home-intro p { margin: 0; color: var(--ink-soft); font-weight: 600; }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }

/* ==========================================================
   Game page
   ========================================================== */
.play-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .play-layout { grid-template-columns: minmax(0, 1fr) 336px; } }

.player-card { background: var(--surface); border-radius: var(--r-big); overflow: hidden; box-shadow: var(--lift); }
.stage { position: relative; aspect-ratio: 16 / 9; background: #0c0e2b; max-height: calc(100vh - 220px); width: 100%; }
@media (max-width: 700px) { .stage { aspect-ratio: 4 / 5; max-height: calc(100vh - 170px); } }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.stage:fullscreen { max-height: none; aspect-ratio: auto; }
.cover { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.cover-bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(26px) saturate(1.3) brightness(0.7); }
.cover-inner { position: relative; display: grid; justify-items: center; gap: 16px; padding: 20px; text-align: center; color: #fff; }
.cover-thumb { width: clamp(110px, 18vw, 170px); aspect-ratio: 1; border-radius: var(--r-big); object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,0.35); background: var(--bg-deep); }
.cover h1 { font-size: clamp(1.4rem, 3vw, 2.2rem); color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.play-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 60px; padding: 0 36px; border: 0; border-radius: var(--r-pill);
  background: var(--sun); color: #161a44; font: 700 1.35rem var(--font-display); box-shadow: 0 5px 0 #161a44;
}
.play-btn svg { width: 22px; height: 22px; }
.play-btn:hover { background: #ffd95c; }
.play-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #161a44; }
.cover-note { font-size: 0.9rem; opacity: 0.85; margin: 0; }
.preroll { position: absolute; inset: 0; display: grid; place-items: center; background: #0c0e2b; color: #fff; z-index: 3; }
.preroll-inner { display: grid; gap: 12px; justify-items: center; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; }
.toolbar-title { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.toolbar-title img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.toolbar-title h2 { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-title .dev { display: block; font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }
.tool {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; min-width: 42px; padding: 0 14px; justify-content: center;
  border-radius: var(--r-pill); border: 0; background: var(--bg); color: var(--ink); font-weight: 700; font-size: 0.92rem;
}
.tool svg { width: 20px; height: 20px; flex: none; }
.tool:hover { background: var(--bg-deep); }
.tool[aria-pressed="true"].like { background: var(--mint); color: #08241b; }
.tool[aria-pressed="true"].dislike { background: var(--ink); color: var(--bg); }
.tool[aria-pressed="true"].fav { background: var(--coral); color: #fff; }
.tool[aria-pressed="true"].fav svg path { fill: currentColor; }

.about { margin-top: 20px; background: var(--surface); border-radius: var(--r-big); padding: clamp(18px, 3vw, 28px); }
.about h2 { font-size: 1.5rem; margin-bottom: 10px; }
.about h3 { font-size: 1.1rem; margin: 18px 0 6px; }
.about p { margin: 0; max-width: 70ch; color: var(--ink); }
.about .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.about .chips .chip { background: var(--bg); }
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; }
.stats strong { color: var(--ink); }

.side { display: grid; gap: 16px; align-content: start; }
.side h2 { font-size: 1.2rem; }
.side-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 1099px) { .side-grid { grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); } }
.side-grid .tile .tile-title { font-size: 0.72rem; }

/* Ads */
.ad { display: grid; place-items: center; min-height: 90px; border-radius: 16px; overflow: hidden; }
.ad.placeholder { border: 2px dashed var(--line); color: var(--ink-soft); font-weight: 600; font-size: 0.85rem; background: color-mix(in srgb, var(--surface) 50%, transparent); }
.ad-side { min-height: 250px; }
.ad-banner { margin: 28px 0 0; }

/* ==========================================================
   Footer, dialogs, toast
   ========================================================== */
.footer { background: var(--ink); color: var(--bg); margin-top: 32px; }
.footer-inner { max-width: 1760px; margin: 0 auto; padding: 32px clamp(12px, 3vw, 28px); display: grid; gap: 10px; }
.footer-logo { font: 700 1.6rem var(--font-display); text-decoration: none; }
.footer-tag { margin: 0; opacity: 0.8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 700; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-small { margin: 8px 0 0; opacity: 0.6; font-size: 0.85rem; }
.lang-picker { position: relative; display: inline-flex; align-items: center; justify-self: start; margin-top: 6px; }
.lang-picker svg { position: absolute; left: 12px; width: 18px; height: 18px; pointer-events: none; }
.lang-picker select {
  appearance: none; -webkit-appearance: none; height: 40px; padding: 0 36px 0 38px; border-radius: var(--r-pill);
  border: 2px solid color-mix(in srgb, var(--bg) 35%, transparent); background: transparent; color: var(--bg);
  font: 700 0.95rem var(--font-body); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.lang-picker select option { color: #161a44; background: #fff; }

.auth {
  border: 0; border-radius: var(--r-big); padding: 28px; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(10, 12, 42, 0.4);
}
.auth::backdrop { background: rgba(14, 16, 50, 0.55); backdrop-filter: blur(3px); }
.auth h2 { font-size: 1.8rem; font-weight: 700; }
.auth-sub { color: var(--ink-soft); margin: 6px 0 18px; }
.auth-close-form { position: absolute; top: 12px; right: 12px; margin: 0; }
.auth-close { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg); font-size: 1.4rem; line-height: 1; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-weight: 700; font-size: 0.92rem; }
.auth-form input {
  height: 46px; border-radius: 14px; border: 2px solid var(--line); padding: 0 14px; font: 600 1rem var(--font-body);
  background: var(--bg); color: var(--ink);
}
.auth-form input:focus { outline: none; border-color: var(--grape); }
.auth-error { margin: 0; color: var(--coral); font-weight: 700; font-size: 0.92rem; }
.auth-switch { margin: 16px 0 0; text-align: center; color: var(--ink-soft); }
.auth-form [hidden] { display: none; }
.auth-forgot { margin: -6px 0 0; text-align: right; font-size: 0.9rem; }
.auth-info { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--mint) 22%, transparent); font-weight: 600; }

/* Account, reset and confirmation pages */
.narrow { max-width: 560px; margin: 8px auto 0; display: grid; gap: 16px; }
.card { background: var(--surface); border-radius: var(--r-big); padding: clamp(20px, 4vw, 28px); }
.card h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 700; margin-bottom: 6px; }
.card h2 { font-size: 1.25rem; margin-bottom: 12px; }
.card p { margin: 0 0 14px; color: var(--ink-soft); }
.card form { display: grid; gap: 12px; }
.card label { display: grid; gap: 6px; font-weight: 700; font-size: 0.92rem; }
.card input { height: 46px; border-radius: 14px; border: 2px solid var(--line); padding: 0 14px; font: 600 1rem var(--font-body); background: var(--bg); color: var(--ink); }
.card input:focus { outline: none; border-color: var(--grape); }
.card .btn { justify-self: start; }
.card .form-msg { margin: 0; font-weight: 700; }
.card .form-msg.ok { color: var(--mint); }
.card .form-msg.bad { color: var(--coral); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 14px 0 0; }
.facts dt { color: var(--ink-soft); font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.status { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 0.8rem; font-weight: 700; }
.status.ok { background: var(--mint); color: #08241b; }
.status.warn { background: var(--sun); color: #161a44; }

.menu {
  position: fixed; z-index: 50; min-width: 200px; padding: 8px; border-radius: 18px; background: var(--surface);
  box-shadow: 0 18px 40px rgba(10, 12, 42, 0.25); display: grid;
}
.menu a, .menu button { text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; text-decoration: none; font-weight: 600; }
.menu a:hover, .menu button:hover { background: var(--bg); }
.menu .menu-name { padding: 8px 12px 10px; font: 600 1.05rem var(--font-display); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: var(--r-pill); font-weight: 700;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================
   Small screens
   ========================================================== */
@media (max-width: 760px) {
  :root { --tile: 88px; --gap: 10px; }
  .topbar { grid-template-columns: 1fr auto; grid-template-areas: "logo actions" "search search"; gap: 10px; padding: 10px 12px; }
  .logo { grid-area: logo; justify-self: start; padding: 4px 14px 4px 6px; }
  .logo-mark svg { width: 32px; height: 32px; }
  .logo-text { font-size: 1.15rem; }
  .top-actions { grid-area: actions; gap: 6px; }
  .icon-btn { width: 42px; height: 42px; }
  .account-btn { height: 42px; padding: 0 14px; max-width: 120px; }
  .search { grid-area: search; max-width: none; }
  .search input { height: 44px; }
  .row-scroll { grid-auto-columns: 112px; }
  .tile .badge { top: 6px; left: 6px; padding: 0 7px; font-size: 0.64rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================
   Leaderboard
   ========================================================== */
.lb { background: var(--surface); border-radius: var(--r-big); padding: 16px; box-shadow: var(--lift); }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lb-head h2 { font-size: 1.25rem; }
.lb-name { font-weight: 700; color: var(--ink-soft); font-size: 0.9rem; }
.lb-head select { height: 34px; border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: 700 0.85rem var(--font-body); padding: 0 10px; max-width: 60%; }
.lb-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--r-pill); margin: 12px 0 8px; }
.lb-tabs button { flex: 1; border: 0; background: none; border-radius: var(--r-pill); padding: 7px 6px; font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }
.lb-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lb-body { min-height: 120px; transition: opacity 0.15s; }
.lb-body.busy { opacity: 0.5; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lb-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; font-weight: 600; }
.lb-list li.me { background: color-mix(in srgb, var(--grape) 16%, transparent); }
.lb-rank { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); font: 700 0.85rem var(--font-display); }
.lb-list li.top1 .lb-rank { background: var(--sun); color: #161a44; }
.lb-list li.top2 .lb-rank { background: #d9dcef; color: #161a44; }
.lb-list li.top3 .lb-rank { background: #f3b98c; color: #161a44; }
.lb-user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font: 700 1rem var(--font-display); font-variant-numeric: tabular-nums; }
.lb-mine { margin-top: 6px; padding-top: 6px; border-top: 2px dashed var(--line); }
.lb-meta { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; text-align: right; }
.lb-empty { margin: 18px 4px; color: var(--ink-soft); font-weight: 600; text-align: center; }
.lb-note { margin: 10px 0 0; text-align: center; font-size: 0.9rem; }
.lb-guest {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 14px 14px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--sun); color: #161a44; font-weight: 700;
}
.lb-guest[hidden] { display: none; }
.lb-guest .btn { height: 40px; }
