/* ==========================================================================
   NAKALITE — Home / Dashboard
   Black base · purple brand · lime action
   ========================================================================== */

/* ---------- theme tokens ----------
   Colours are channel triplets so every rule keeps its own alpha:
   rgb(var(--fg-rgb) / .06) is a white hairline in dark mode and an ink hairline in light mode.
   .dark-scope pins the dark values for UI that sits on game art (hero, event, launch…). */
:root, .dark-scope {
  --fg-rgb: 255 255 255;
  --bg-rgb: 8 7 12;
  --lime-rgb: 200 255 61;
  --surf-hi-rgb: 26 22 37;
  --surf-lo-rgb: 18 15 26;
  --shadow-rgb: 0 0 0;
  --shadow-k: 1;

  /* surfaces */
  --bg: #08070c;
  --bg-elev: #0d0b13;
  --surface: #14111c;
  --surface-2: #1a1625;
  --surface-3: #241f33;
  --line: rgb(var(--fg-rgb) / .06);
  --line-2: rgb(var(--fg-rgb) / .1);
  --line-3: rgb(var(--fg-rgb) / .16);

  /* text */
  --text: #f4f2f8;
  --text-2: #aaa3bd;
  --text-3: #857e98;
  --lime-text: #c8ff3d;
  --accent-text: #a98bff;
  --accent-icon: #c8ff3d;
  --surface-ring: #15121e;
  --on-muted: #fff;
  --danger-text: #ff8098;
  --lime-glow: rgb(var(--lime-rgb) / .35);
  --grain: .055;
}

:root[data-theme="light"] {
  --fg-rgb: 46 26 100;
  --bg-rgb: 244 241 250;
  --lime-rgb: 101 163 13;
  --surf-hi-rgb: 255 255 255;
  --surf-lo-rgb: 251 250 255;
  --shadow-rgb: 64 34 130;
  --shadow-k: .32;

  --bg: #f4f1fa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f3fc;
  --surface-3: #ece6f8;

  --text: #17131f;
  --text-2: #575069;
  --text-3: #6c6582;
  --lime-text: #43680f;
  --accent-text: #6d28d9;
  --accent-icon: #7c3aed;
  --surface-ring: #ffffff;
  --on-muted: #be123c;
  --danger-text: #be123c;
  --lime-glow: rgb(200 255 61 / .55);
  --grain: .03;
  color-scheme: light;
}

.dark-scope { color: var(--text); color-scheme: dark; }

:root {
  /* brand (same in both themes) */
  --purple: #8b5cf6;
  --purple-hi: #a98bff;
  --purple-lo: #6d28d9;
  --purple-deep: #3b1680;
  --purple-glow: rgba(139, 92, 246, .38);
  --lime: #c8ff3d;
  --lime-hi: #ddff7a;
  --lime-ink: #0a0b06;

  /* type */
  --font-display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* shape + motion */
  --r-xl: 22px;
  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  --side-w: 256px;
  --top-h: 76px;
  --gutter: 28px;
  --parties-w: 360px;

  color-scheme: dark;
}

/* cross-page fade between Home and the lobby */
@view-transition { navigation: auto; }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 72% -12%, rgba(139, 92, 246, .16), transparent 62%),
    radial-gradient(900px 520px at 105% 108%, rgb(var(--lime-rgb) / .045), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[hidden] { display: none !important; }
img, svg { display: block; }
img { max-width: 100%; }
img[src*="assets/avatars/"] { object-fit: cover; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 300;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--lime); color: var(--lime-ink); font-weight: 700;
  transition: top .2s var(--ease-out);
}
.skip:focus { top: 16px; }

/* ---------- primitives ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot--lime { background: var(--lime); box-shadow: 0 0 10px var(--lime-glow); }
.dot--pulse { position: relative; }
.dot--pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: inherit; animation: ping 1.8s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px;
  border-radius: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .02em;
  white-space: nowrap;
  transition: transform .16s var(--ease-out), background-color .2s, box-shadow .25s var(--ease-out), color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.97); }
.btn--lime {
  background: var(--lime); color: var(--lime-ink);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .25) inset, 0 8px 24px -10px var(--lime-glow);
}
.btn--lime:hover { background: var(--lime-hi); box-shadow: 0 0 0 1px rgb(255 255 255 / .35) inset, 0 10px 32px -8px var(--lime-glow); }
/* Create Party: the plus spins a half turn on hover, springing back when the pointer leaves */
.top__cta svg { transition: rotate .5s var(--ease-spring); }
.top__cta:hover svg, .top__cta:focus-visible svg { rotate: 180deg; }
.btn--glass {
  background: rgb(var(--fg-rgb) / .08); color: var(--text);
  border: 1px solid rgb(var(--fg-rgb) / .16);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.btn--glass:hover { background: rgb(var(--fg-rgb) / .14); border-color: rgb(var(--fg-rgb) / .26); }
.btn--lg { --h: 52px; font-size: 16px; }
.btn--sm { --h: 40px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--block { width: 100%; }
.btn[disabled] { cursor: default; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  transition: color .2s, background-color .2s, border-color .2s, transform .16s var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-3); }
.icon-btn:active { transform: scale(.94); }
.theme-toggle svg { transition: transform .5s var(--ease-spring); }
.theme-toggle:hover svg { transform: rotate(-24deg) scale(1.06); }
.theme-toggle__moon, :root[data-theme="light"] .theme-toggle__sun { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: block; }
.icon-btn--sm { width: 36px; height: 36px; border-radius: 10px; background: transparent; border-color: transparent; }
.icon-btn--sm svg { width: 18px; height: 18px; }
.icon-btn__dot {
  position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 0 2px var(--surface), 0 0 10px var(--lime-glow);
}

.glass-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: #fff; background: rgb(var(--bg-rgb) / .42);
  border: 1px solid rgb(var(--fg-rgb) / .14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background-color .2s, border-color .2s, transform .16s var(--ease-out);
}
.glass-btn svg { width: 20px; height: 20px; }
.glass-btn:hover { background: rgb(var(--bg-rgb) / .66); border-color: rgb(var(--fg-rgb) / .28); }
.glass-btn:active { transform: scale(.94); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); background: rgb(var(--fg-rgb) / .1);
  border-radius: 6px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tag svg { width: 14px; height: 14px; }
.tag--lime { background: var(--lime); color: var(--lime-ink); }
.tag--purple { background: rgba(139, 92, 246, .2); color: var(--accent-text); }
/* soft rounded label — matches the rounded Solar icon set */
.tag--cut { border-radius: 8px; padding: 0 11px; }

.link {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: color .2s;
  min-height: 32px;
}
.link svg { width: 16px; height: 16px; transition: transform .2s var(--ease-out); }
.link:hover { color: var(--text); }
.link:hover svg { transform: translateX(2px); }

.avatar { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; }
.avatar[data-status]::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2.5px solid var(--bg-elev);
  background: var(--text-3);
}
.avatar[data-status="game"]::after, .avatar[data-status="online"]::after { background: var(--lime); }
.avatar[data-status="party"]::after { background: var(--purple-hi); }
.avatar[data-status="away"]::after { background: #5d566e; }

.stack { display: flex; align-items: center; }
.stack img, .stack .slot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -7px; flex: none;
}
.stack > :first-child { margin-left: 0; }
.stack .slot { border: 1.5px dashed rgb(var(--fg-rgb) / .26); background: transparent; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }

/* sidebar */
.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px 16px;
  background: linear-gradient(180deg, rgb(var(--surf-hi-rgb) / .9), rgb(var(--surf-lo-rgb) / .96));
  border-right: 1px solid var(--line);
  overflow: hidden auto;
  scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }

/* logo: the full badge, or the square mark where there is no room (icon rail) */
.brand { display: inline-flex; align-items: center; padding: 4px 8px; min-height: 44px; border-radius: 12px; }
.brand__logo, .brand__mark { display: block; flex: none; }
/* the wordmark follows the theme: "NAKA" = currentColor, "Lite" = --logo-lite */
.brand__logo { width: 184px; height: auto; aspect-ratio: 573 / 103; color: var(--text); --logo-lite: var(--lime-text); }
.brand__mark { display: none; width: 44px; height: 44px; filter: drop-shadow(0 6px 16px rgba(139, 92, 246, .4)); }
:root[data-theme="light"] .brand__mark { filter: drop-shadow(0 4px 12px rgba(109, 40, 217, .24)); }
.brand--compact { display: none; }
.brand--small .brand__logo { width: 136px; }

.nav { display: grid; gap: 4px; }
.nav__item {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  height: 46px; padding: 0 14px;
  border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: 15px;
  transition: color .2s, background-color .2s;
}
.nav__item svg { width: 20px; height: 20px; flex: none; }
.nav__item:hover { color: var(--text); background: var(--surface-2); }
.nav__item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139, 92, 246, .26), rgba(139, 92, 246, .05) 85%);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .22);
}
.nav__item.is-active svg { color: var(--accent-icon); }
.nav__item.is-active::before {
  content: ""; position: absolute; left: -16px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--lime); box-shadow: 0 0 14px var(--lime);
}
.nav__badge {
  margin-left: auto; font-style: normal;
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  color: var(--lime-text); background: rgb(var(--lime-rgb) / .1);
  font-variant-numeric: tabular-nums;
}
.nav__dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime-glow); }

/* the padding/margin pair leaves room above the head so the request badge isn't clipped */
.friends { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; padding-top: 6px; margin-top: -6px; }
.friends__head { display: flex; align-items: center; gap: 10px; padding: 0 4px 0 14px; margin-bottom: 6px; }
.friends__head h2 { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.friends__count { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.friends__count .dot { width: 6px; height: 6px; }
.friends__head .icon-btn { margin-left: auto; }
.friends__list { display: grid; align-content: start; gap: 2px; min-height: 0; overflow-y: auto; scrollbar-width: none; mask-image: linear-gradient(180deg, #000 calc(100% - 24px), transparent); }
.friends__list::-webkit-scrollbar { display: none; }
.friend {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px;
  transition: background-color .2s;
}
.friend:hover, .friend:focus-within { background: var(--surface-2); }
.friend:hover .friend__txt, .friend:focus-within .friend__txt { padding-right: 36px; }
.friend__txt { min-width: 0; display: grid; }
.friend__txt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend__txt span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend[data-status="game"] .friend__txt span { color: var(--text-2); }
.friend[data-status="party"] .friend__txt span { color: var(--accent-text); }
.friend__invite {
  position: absolute; right: 8px; top: 50%; margin-top: -16px;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  color: var(--lime-text); background: rgb(var(--lime-rgb) / .1);
  opacity: 0; transform: scale(.85);
  transition: opacity .18s, transform .18s var(--ease-out), background-color .2s, color .2s;
}
.friend__invite svg { width: 16px; height: 16px; }
.friend:hover .friend__invite, .friend__invite:focus-visible { opacity: 1; transform: none; }
.friend__invite:hover { background: var(--lime); color: var(--lime-ink); }
.friend__invite.is-sent { opacity: 1; transform: none; background: transparent; color: var(--text-3); }

.me {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.me__avatar { position: relative; flex: none; width: 48px; height: 48px; padding: 2px; border-radius: 50%;
  background: conic-gradient(var(--lime) 0 78%, rgb(var(--fg-rgb) / .12) 0); }
.me__avatar img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--surface); }
.me__lvl {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  padding: 0 6px; border-radius: 6px;
  font-family: var(--font-display); font-size: 11px; font-weight: 700; line-height: 16px;
  color: var(--lime-ink); background: var(--lime);
}
.me__info { min-width: 0; flex: 1; display: grid; gap: 4px; }
.me__info b { font-size: 14.5px; font-weight: 800; }
.me__info small { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.me .icon-btn { width: 32px; height: 32px; }
.xp { height: 5px; border-radius: 9px; background: rgb(var(--fg-rgb) / .08); overflow: hidden; }
.xp i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--lime)); }

/* main column */
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: var(--top-h); padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgb(var(--bg-rgb) / .9), rgb(var(--bg-rgb) / .72));
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 520px; }
.search__icon { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 19px; height: 19px; color: var(--text-3); pointer-events: none; transition: color .2s; }
.search:focus-within .search__icon { color: var(--accent-icon); }
.search input {
  width: 100%; height: 46px; padding: 0 44px 0 46px;
  border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 500;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:hover { border-color: var(--line-3); }
.search input:focus { outline: none; border-color: rgba(139, 92, 246, .7); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); }
.search kbd {
  position: absolute; right: 12px; top: 50%; translate: 0 -50%;
  min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--line-3);
  font-family: var(--font-display); font-size: 12px; color: var(--text-3);
}
.search input:focus ~ kbd { opacity: 0; }
.search__pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  padding: 8px; border-radius: 16px;
  background: rgb(var(--surf-hi-rgb) / .96); border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px -20px rgb(var(--shadow-rgb) / calc(.8 * var(--shadow-k))), 0 0 0 1px rgba(139, 92, 246, .08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transform-origin: top center;
  animation: pop .18s var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.search__label { padding: 8px 10px 4px; font-family: var(--font-display); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.search__opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 10px; border-radius: 11px; text-align: left; cursor: pointer;
}
.search__opt img { width: 54px; height: 32px; border-radius: 7px; object-fit: cover; flex: none; }
.search__opt .avatar { width: 32px; height: 32px; }
.search__opt span { display: grid; min-width: 0; }
.search__opt b { font-size: 14px; }
.search__opt small { font-size: 12.5px; color: var(--text-3); }
.search__opt em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--lime-text); opacity: 0; }
.search__opt[aria-selected="true"], .search__opt:hover { background: var(--surface-3); }
.search__opt[aria-selected="true"] em { opacity: 1; }
.search__empty { padding: 18px 12px; color: var(--text-2); font-size: 14px; }

.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.online-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px; border-radius: 12px;
  font-size: 13px; color: var(--text-2);
}
.online-pill b { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.wallet { display: flex; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.wallet__item { display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; }
.wallet__item + .wallet__item { border-left: 1px solid var(--line-2); }
.wallet__item svg { width: 20px; height: 20px; }
.wallet__item b { font-family: var(--font-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.wallet__item.is-bump b { animation: bump .5s var(--ease-spring); color: var(--lime-text); }
@keyframes bump { 40% { transform: scale(1.18); } }

.main { padding: 22px var(--gutter) 40px; display: grid; gap: 40px; max-width: 1720px; width: 100%; }

/* ---------- reveal ---------- */
[data-reveal] { animation: rise .8s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 70ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- hero ---------- */
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--parties-w); gap: 18px; }
.hero {
  position: relative; isolation: isolate;
  min-height: clamp(440px, 36vw, 540px);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -40px rgba(139, 92, 246, .45);
  touch-action: pan-y;
}
.hero:focus { outline: none; }
.hero__slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .9s var(--ease-io), visibility 0s .9s;
}
.slide.is-active { opacity: 1; visibility: visible; transition: opacity .9s var(--ease-io), visibility 0s; z-index: 1; }
.slide__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--focal, 60% 40%);
  transform: scale(1.08);
  transition: transform 8s linear;
}
.slide.is-active .slide__bg { transform: scale(1); }
/* bright daylight art (Bomber Now): a heavier shade so the text and the top controls stay readable */
.slide--bright .tag:not(.tag--lime) { color: #fff; background: rgb(8 7 12 / .66); }
@media (min-width: 861px) {
  .slide--bright .slide__shade {
    background:
      linear-gradient(90deg, rgb(var(--bg-rgb) / .96) 0%, rgb(var(--bg-rgb) / .88) 32%, rgb(var(--bg-rgb) / .34) 56%, rgb(var(--bg-rgb) / 0) 72%),
      linear-gradient(0deg, rgb(var(--bg-rgb) / .9) 0%, rgb(var(--bg-rgb) / 0) 40%),
      linear-gradient(180deg, rgb(var(--bg-rgb) / .6) 0%, rgb(var(--bg-rgb) / 0) 24%),
      radial-gradient(70% 90% at 0% 100%, rgba(109, 40, 217, .42), transparent 70%);
  }
}
@media (max-width: 860px) {
  .slide--bright .slide__shade {
    background:
      linear-gradient(0deg, rgb(var(--bg-rgb) / .97) 0%, rgb(var(--bg-rgb) / .86) 42%, rgb(var(--bg-rgb) / .5) 58%, rgb(var(--bg-rgb) / 0) 76%),
      radial-gradient(90% 60% at 0% 100%, rgba(109, 40, 217, .4), transparent 70%);
  }
}
.slide__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgb(var(--bg-rgb) / .94) 0%, rgb(var(--bg-rgb) / .72) 30%, rgb(var(--bg-rgb) / .18) 58%, rgb(var(--bg-rgb) / 0) 75%),
    linear-gradient(0deg, rgb(var(--bg-rgb) / .9) 0%, rgb(var(--bg-rgb) / 0) 46%),
    radial-gradient(70% 90% at 0% 100%, rgba(109, 40, 217, .42), transparent 70%);
}
.slide__body {
  position: absolute; left: 44px; bottom: 40px; z-index: 2;
  width: min(460px, calc(100% - 88px));
  display: grid; gap: 16px; justify-items: start;
}
.slide__body > * { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); }
.slide.is-active .slide__body > * { opacity: 1; transform: none; }
.slide.is-active .slide__body > :nth-child(1) { transition-delay: .25s; }
.slide.is-active .slide__body > :nth-child(2) { transition-delay: .32s; }
.slide.is-active .slide__body > :nth-child(3) { transition-delay: .39s; }
.slide.is-active .slide__body > :nth-child(4) { transition-delay: .46s; }
.slide.is-active .slide__body > :nth-child(5) { transition-delay: .53s; }
.slide__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.slide__logo-link { display: block; border-radius: 10px; transition: translate .3s var(--ease-out); }
.slide__logo-link:hover { translate: 0 -3px; }
.slide__logo {
  height: clamp(84px, 9vw, 128px); width: auto; max-width: min(400px, 100%);
  object-fit: contain; object-position: left bottom;
  filter: drop-shadow(0 8px 24px rgb(var(--shadow-rgb) / calc(.6 * var(--shadow-k))));
}
.slide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13.5px; font-weight: 600; color: rgb(var(--fg-rgb) / .86); }
.slide__meta span { display: inline-flex; align-items: center; gap: 7px; }
.slide__meta svg { width: 16px; height: 16px; color: var(--lime-text); }
.slide__desc { font-size: 15px; line-height: 1.55; color: rgb(var(--fg-rgb) / .76); max-width: 42ch; text-wrap: pretty; }
.slide__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.slide__actions .btn { --h: 50px; padding: 0 22px; }
.slide__actions .btn--lime { font-size: 16px; }

.hero__ctrl {
  position: absolute; top: 22px; right: 22px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
}
.hero__count { margin-right: 6px; font-family: var(--font-display); font-size: 13px; color: rgb(var(--fg-rgb) / .62); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.hero__count b { color: #fff; font-weight: 600; }

.hero__thumbs { position: absolute; right: 22px; bottom: 22px; z-index: 3; display: grid; gap: 8px; }
.thumb {
  position: relative; width: 104px; height: 58px; border-radius: 10px; overflow: hidden;
  border: 1px solid rgb(var(--fg-rgb) / .16);
  opacity: .58;
  transition: opacity .25s, transform .25s var(--ease-out), border-color .25s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .9; transform: translateX(-3px); }
.thumb[aria-selected="true"] { opacity: 1; border-color: rgb(var(--lime-rgb) / .8); box-shadow: 0 8px 24px -8px rgb(var(--shadow-rgb) / calc(.8 * var(--shadow-k))); }
.thumb__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(var(--shadow-rgb) / calc(.45 * var(--shadow-k))); }
.thumb__bar i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--lime); }
.thumb[aria-selected="true"] .thumb__bar i { animation: fill var(--dur, 7s) linear forwards; }
.hero.is-paused .thumb__bar i { animation-play-state: paused; }
.hero.is-static .thumb__bar { display: none; }
@keyframes fill { to { transform: scaleX(1); } }

/* ---------- difficulty stepper (lobby + game page) ---------- */
.diff { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 10px; }
.diff__btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: rgb(var(--fg-rgb) / .05); border: 1px solid var(--line-2); color: var(--text); transition: background-color .2s, border-color .2s, transform .15s var(--ease-out); }
.diff__btn svg { width: 18px; height: 18px; }
.diff__btn:hover:not(:disabled) { background: rgb(var(--fg-rgb) / .1); border-color: var(--line-3); }
.diff__btn:active:not(:disabled) { transform: scale(.92); }
.diff__btn:disabled { opacity: .35; cursor: default; }
.diff__mid { display: grid; gap: 8px; text-align: center; min-width: 0; }
.diff__mid b { font-family: var(--font-display); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pips { display: flex; gap: 3px; }
.pips i { flex: 1; height: 6px; border-radius: 2px; background: rgb(var(--fg-rgb) / .1); transition: background-color .25s; }
.pips i.is-on { background: linear-gradient(90deg, var(--purple-hi), var(--lime)); background-size: var(--n, 1000%) 100%; background-position: var(--x, 0) 0; }


/* ---------- panels ---------- */
.panel {
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgb(var(--surf-hi-rgb) / .92), rgb(var(--surf-lo-rgb) / .92));
  border: 1px solid var(--line);
}
.panel__head { display: flex; align-items: center; gap: 10px; }
.panel__head h2, .sec__head h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: .01em; line-height: 1.2; }
.panel__head .link { margin-left: auto; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; font-family: var(--font-display); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; color: var(--lime-text); background: rgb(var(--lime-rgb) / .1); }
.live-tag .dot { width: 6px; height: 6px; }

.parties { display: flex; flex-direction: column; gap: 14px; padding: 20px 18px 18px; min-width: 0; }
.parties__list { display: grid; gap: 4px; margin: 0 -6px; }
.party {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px; border-radius: 14px;
  transition: background-color .2s;
}
.party:hover { background: rgb(var(--fg-rgb) / .04); }
.party__art { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.party__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.party__info { display: grid; gap: 4px; min-width: 0; }
.party__info b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party__info > span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party__row { display: flex; align-items: center; gap: 8px; }
.party__row .stack img, .party__row .stack .slot { width: 22px; height: 22px; border-color: var(--surface-2); }
.party__count { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.party__mic { width: 14px; height: 14px; color: var(--text-3); }
.join {
  height: 36px; padding: 0 14px; border-radius: 10px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--lime-text); background: rgb(var(--lime-rgb) / .08);
  border: 1px solid rgb(var(--lime-rgb) / .32);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .2s, color .2s, border-color .2s, transform .16s var(--ease-out);
}
.join:hover { background: var(--lime); color: var(--lime-ink); border-color: var(--lime-text); }
.join:active { transform: scale(.95); }
.join svg { width: 15px; height: 15px; }
.join[aria-busy="true"] { color: var(--text-2); border-color: var(--line-3); background: transparent; }
.join.is-joined { background: var(--lime); color: var(--lime-ink); border-color: var(--lime-text); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Quick Match: AI radar art (assets/ui/quick-match.jpg) + live pings from the bolt; the sweep spins while searching */
.quick {
  --qx: 37px; /* centre of the bolt icon = radar centre */
  margin-top: auto;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 16px; text-align: left;
  background: #060129; /* the art's own right-edge colour, so wide buttons extend it seamlessly */
  box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / .14), 0 18px 40px -18px rgba(124, 58, 237, .8);
  transition: transform .2s var(--ease-out), box-shadow .3s var(--ease-out);
}
/* fixed size, radar core (13.7% / 48.7% of the art) pinned on the bolt whatever the button width */
.quick__bg {
  position: absolute; z-index: -2; left: calc(var(--qx) - 71px); top: calc(50% - 108px); width: 520px; max-width: none; height: auto;
  -webkit-mask: linear-gradient(90deg, #000 72%, transparent); mask: linear-gradient(90deg, #000 72%, transparent);
  transform-origin: 71px 108px;
  transition: transform .8s var(--ease-out);
}
.quick::before { /* calm the right side for the arrow, lift the left */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, transparent 30%, rgb(10 6 30 / .35) 100%);
}
.quick::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgb(var(--fg-rgb) / .14) 45%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .8s var(--ease-out);
  pointer-events: none;
}
.quick:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / .22), 0 24px 50px -16px rgba(124, 58, 237, .95); }
.quick:hover .quick__bg { transform: scale(1.05); }
.quick:hover::after { transform: translateX(100%); }
.quick:active { transform: scale(.98); }
.quick__icon { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--lime); color: var(--lime-ink); flex: none; box-shadow: 0 0 24px var(--lime-glow); }
.quick__icon::before, .quick__icon::after {
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: 50%;
  border: 1.5px solid rgb(var(--lime-rgb) / .7);
  animation: q-ping 2.8s var(--ease-out) infinite;
}
.quick__icon::after { animation-delay: -1.4s; }
@keyframes q-ping { from { transform: scale(.9); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }
.quick__icon svg { width: 22px; height: 22px; }
.quick__sweep {
  position: absolute; z-index: -1; left: var(--qx); top: 50%; width: 360px; aspect-ratio: 1; margin: -180px 0 0 -180px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(var(--lime-rgb) / .38), rgb(var(--lime-rgb) / .08) 50deg, transparent 70deg);
  -webkit-mask: radial-gradient(closest-side, #000 30%, transparent); mask: radial-gradient(closest-side, #000 30%, transparent);
  opacity: 0; transition: opacity .3s;
}
.quick__text { display: grid; gap: 1px; text-shadow: 0 2px 12px rgb(10 6 30 / .85), 0 0 2px rgb(10 6 30 / .5); }
.quick__text b { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: .03em; text-transform: uppercase; }
.quick__text small { font-size: 13px; font-weight: 600; color: rgb(var(--fg-rgb) / .8); }
.quick.is-searching .quick__sweep { opacity: 1; animation: spin 1.6s linear infinite; }
.quick.is-searching .quick__icon::before, .quick.is-searching .quick__icon::after { animation-duration: 1.2s; }
.quick.is-searching .quick__icon::after { animation-delay: -.6s; }

/* ---------- sections ---------- */
.sec { display: grid; gap: 18px; min-width: 0; }
.sec__head { display: flex; align-items: center; gap: 16px; }
.sec__head .link { margin-left: auto; }
.sec__head--wrap { flex-wrap: wrap; }

/* resume */
.resume-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.resume {
  position: relative; isolation: isolate; overflow: hidden;
  height: 210px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px;
  box-shadow: 0 0 0 1px var(--line-2);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.resume__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: var(--focal, 60% 40%); transition: transform .6s var(--ease-out); }
.resume::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgb(var(--bg-rgb) / .96) 8%, rgb(var(--bg-rgb) / .5) 55%, rgb(var(--bg-rgb) / .15)); }
.resume:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(139, 92, 246, .5), 0 26px 50px -24px rgba(139, 92, 246, .6); }
.resume:hover .resume__bg { transform: scale(1.05); }
.resume__logo { height: 46px; width: auto; max-width: 62%; object-fit: contain; object-position: left top; filter: drop-shadow(0 4px 14px rgb(var(--shadow-rgb) / calc(.7 * var(--shadow-k)))); }
.resume__ago { position: absolute; top: 18px; right: 18px; font-size: 12px; font-weight: 600; color: rgb(var(--fg-rgb) / .78); padding: 3px 8px; border-radius: 6px; background: rgb(var(--bg-rgb) / .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.resume__body { display: grid; gap: 10px; }
/* the whole card opens the game page; the play button sits above the link and goes straight to a lobby */
.resume__link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.resume__link:focus-visible { outline: 2px solid var(--lime); outline-offset: -2px; }
.resume__play { position: relative; z-index: 1; }
.resume__prog { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; color: rgb(var(--fg-rgb) / .86); }
.resume__prog span:last-child { font-family: var(--font-display); color: var(--lime-text); font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 4px; background: rgb(var(--fg-rgb) / .14); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: var(--lime); box-shadow: 0 0 12px var(--lime-glow); }
.resume__foot { display: flex; align-items: center; gap: 10px; }
.resume__foot .stack img { border-color: rgb(var(--bg-rgb) / .9); }
.resume__foot small { font-size: 12.5px; color: rgb(var(--fg-rgb) / .72); }
.resume__play {
  margin-left: auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--lime); color: var(--lime-ink);
  box-shadow: 0 0 0 6px rgb(var(--lime-rgb) / .12);
  transition: transform .2s var(--ease-spring), box-shadow .25s;
}
.resume__play svg { width: 18px; height: 18px; margin-left: 2px; }
.resume__play:hover { transform: scale(1.08); box-shadow: 0 0 0 8px rgb(var(--lime-rgb) / .18), 0 0 30px var(--lime-glow); }

/* chips */
.chips { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip[aria-selected="true"] { color: var(--lime-ink); background: var(--lime); }

/* game grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 24px 18px; }
.card { display: grid; gap: 12px; min-width: 0; border-radius: var(--r); }
.card:focus-visible { outline-offset: 4px; }
.card__art {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line-2);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.card__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.card__art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgb(var(--bg-rgb) / .85), rgb(var(--bg-rgb) / 0) 55%);
  opacity: 0; transition: opacity .3s;
}
.card__badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 8px; border-radius: 7px;
  font-family: var(--font-display); font-size: 12.5px; font-weight: 600;
  color: #fff; background: rgb(var(--bg-rgb) / .62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card__badge svg { width: 14px; height: 14px; color: var(--lime-text); }
.card__new { position: absolute; top: 10px; right: 10px; z-index: 1; }
.card__go {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 11px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--lime-ink); background: var(--lime);
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .35s var(--ease-out);
}
.card__go svg { width: 16px; height: 16px; }
.card:hover .card__art, .card:focus-visible .card__art {
  transform: translateY(-5px);
  box-shadow: 0 0 0 2px var(--lime), 0 26px 48px -18px rgba(139, 92, 246, .75);
}
.card:hover .card__art img { transform: scale(1.06); }
.card:hover .card__art::after, .card:focus-visible .card__art::after { opacity: 1; }
.card:hover .card__go, .card:focus-visible .card__go { opacity: 1; transform: none; }
.card__meta { display: grid; gap: 3px; padding: 0 2px; }
.card__meta b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.card__sub .dot { width: 6px; height: 6px; }
.card__sub span:last-child { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.grid.is-swapping .card { animation: card-in .45s var(--ease-out) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.grid__empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-3); border-radius: var(--r-lg); }

/* ---------- promo row ---------- */
.promo-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }

.event {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 330px; border-radius: var(--r-xl);
  box-shadow: 0 0 0 1px var(--line-2);
  display: flex;
}
.event__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 62% 35%; filter: saturate(.8); }
.event__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    repeating-linear-gradient(135deg, rgb(var(--fg-rgb) / .03) 0 1px, transparent 1px 14px),
    linear-gradient(90deg, rgba(14, 8, 30, .97) 0%, rgba(30, 14, 70, .86) 42%, rgba(91, 33, 182, .28) 75%, rgba(139, 92, 246, .1) 100%),
    linear-gradient(0deg, rgb(var(--bg-rgb) / .7), transparent 50%);
}
.event__body { padding: 30px 32px; display: grid; align-content: start; justify-items: start; gap: 14px; max-width: 620px; }
.event__title { font-family: var(--font-display); font-size: clamp(28px, 2.6vw, 38px); font-weight: 700; line-height: 1.05; letter-spacing: .005em; text-transform: uppercase; }
.event__sub { color: rgb(var(--fg-rgb) / .74); max-width: 44ch; }
.event__stats { display: flex; gap: 28px; margin-top: 4px; }
.event__stats div { display: grid; gap: 2px; }
.event__stats dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--fg-rgb) / .55); }
.event__stats dd { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.event__stats dd svg { width: 18px; height: 18px; }
.event__foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.countdown { display: flex; gap: 6px; }
.countdown span {
  display: grid; justify-items: center; width: 56px; padding: 7px 0 6px;
  border-radius: 10px; background: rgb(var(--bg-rgb) / .55); border: 1px solid rgb(var(--fg-rgb) / .1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.countdown b { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown small { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--fg-rgb) / .55); }

/* Daily Drop: AI crate art (assets/ui/daily-drop.jpg), floating tokens, 7-day trail */
.drop {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 360px; padding: 24px; border-radius: var(--r-xl);
  background: radial-gradient(110% 90% at 100% 0%, #2a1563, #160d2e 55%, #0e0920);
  box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -30px rgba(91, 33, 182, .9);
}
/* the art (and the tokens around its crate) is pinned top-right at a fixed share of the card height,
   so the crate keeps clear of the text whatever the card width; its left and bottom edges fade into the card */
.drop__bg, .drop__tokens { position: absolute; top: 0; right: 0; height: var(--art-h, 78%); aspect-ratio: 3 / 2; }
.drop__bg {
  z-index: -2; width: auto; max-width: none; object-fit: cover;
  -webkit-mask: linear-gradient(90deg, transparent, #000 28%), linear-gradient(#000 62%, transparent);
  -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 28%), linear-gradient(#000 62%, transparent); mask-composite: intersect;
}
.drop::before { /* keep the text side and the trail readable */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(12 7 26 / .7) 0%, rgb(12 7 26 / .15) 55%, transparent 75%),
    linear-gradient(0deg, rgb(10 6 22 / .92) 0%, rgb(10 6 22 / .55) 42%, transparent 64%);
}
.drop__tokens { z-index: -1; pointer-events: none; }
.drop__tokens svg {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  rotate: var(--r); filter: drop-shadow(0 6px 14px rgb(0 0 0 / .45)) drop-shadow(0 0 10px rgb(var(--lime-rgb) / .35));
  animation: token-float 5s var(--ease-io) infinite var(--t);
}
@keyframes token-float { 50% { translate: 0 -8px; rotate: calc(var(--r) + 10deg); } }
.drop__intro { display: grid; justify-items: start; gap: 10px; margin-bottom: auto; max-width: 52%; }
.drop__title { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; text-shadow: 0 2px 16px rgb(0 0 0 / .5); }
.drop__sub { font-size: 14px; color: var(--text-2); max-width: 28ch; text-wrap: pretty; }

.trail { --p: 0; position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding-top: 2px; }
.trail::before, .trail::after { /* track runs between the first and last dot centres */
  content: ""; position: absolute; top: 24px; left: calc(100% / 14); height: 4px; margin-top: -2px; border-radius: 4px;
}
.trail::before { right: calc(100% / 14); background: rgb(var(--fg-rgb) / .14); }
.trail::after {
  width: calc((100% - 100% / 7) * var(--p));
  background: linear-gradient(90deg, rgb(var(--lime-rgb) / .55), var(--lime));
  box-shadow: 0 0 14px rgb(var(--lime-rgb) / .6);
  transition: width .9s var(--ease-out);
}
.trail li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; }
.trail__dot {
  display: grid; place-items: center; width: 34px; height: 34px; margin: 7px 0; border-radius: 50%;
  background: rgb(20 14 38 / .9); border: 1.5px solid rgb(var(--fg-rgb) / .2);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background-color .3s, border-color .3s, color .3s, transform .4s var(--ease-spring);
}
.trail__dot svg { width: 16px; height: 16px; }
.trail__lbl { font-family: var(--font-display); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--text-3); }
.trail .is-done .trail__dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.trail .is-done .trail__lbl { color: var(--text-2); }
.trail .is-today .trail__dot { width: 40px; height: 40px; margin: 4px 0; border: 2px solid var(--lime); background: rgb(20 14 38 / .95); box-shadow: 0 0 0 4px rgb(var(--lime-rgb) / .14), 0 0 22px rgb(var(--lime-rgb) / .45); animation: today-pulse 2s var(--ease-io) infinite; }
.trail .is-today .trail__dot svg { width: 26px; height: 26px; }
.trail .is-today .trail__lbl { color: var(--lime-text); font-weight: 700; }
@keyframes today-pulse { 50% { box-shadow: 0 0 0 8px rgb(var(--lime-rgb) / .06), 0 0 30px rgb(var(--lime-rgb) / .6); } }
.trail .is-legend .trail__dot {
  width: 48px; height: 48px; margin: 0; border: 0; color: #fff;
  background: radial-gradient(circle at 35% 30%, #b69cff, #7c3aed 55%, #3b1680);
  box-shadow: 0 0 0 1.5px rgba(214, 200, 255, .55) inset, 0 0 24px rgba(139, 92, 246, .8);
}
.trail .is-legend .trail__dot svg { width: 22px; height: 22px; }
.trail .is-legend .trail__lbl { color: var(--accent-text); }
.trail .is-done.is-new .trail__dot { animation: dot-pop .6s var(--ease-spring); }
@keyframes dot-pop { 40% { transform: scale(1.3); } }

.drop__claim .drop__coin { display: grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; background: var(--lime-ink); }
.drop__claim .drop__coin svg { width: 22px; height: 22px; }
.drop__next { font-size: 12.5px; color: var(--text-3); text-align: center; }
.drop__next b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.fly-token { position: fixed; z-index: 300; width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none; filter: drop-shadow(0 4px 10px rgb(0 0 0 / .4)); }
.fly-token svg { width: 100%; height: 100%; }
.btn.is-claimed { background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.foot__links { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--text-2); }
.foot__links a { min-height: 32px; display: inline-flex; align-items: center; transition: color .2s; }
.foot__links a:hover { color: var(--text); }
.foot__note { margin-left: auto; font-size: 12.5px; color: var(--text-3); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px;
  max-width: 380px; padding: 12px 16px 12px 12px; border-radius: 14px;
  background: rgb(var(--surf-hi-rgb) / .96); border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px -18px rgb(var(--shadow-rgb) / calc(.9 * var(--shadow-k))), 0 0 0 1px rgba(139, 92, 246, .1);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-size: 14px; font-weight: 600;
  animation: toast-in .35s var(--ease-out) both;
  pointer-events: auto;
}
.toast__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none; background: var(--lime); color: var(--lime-ink); }
.toast__icon svg { width: 17px; height: 17px; }
.toast.is-out { animation: toast-out .22s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- dialogs (Create Party, Add friends, profile card, shop) ---------- */
.modal {
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(880px, calc(100dvh - 40px));
  padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible;
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in .3s var(--ease-out); }
.modal::backdrop { background: rgb(8 7 12 / .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
:root[data-theme="light"] .modal::backdrop { background: rgb(46 26 100 / .26); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal__box {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  border-radius: 24px; overflow: hidden;
  background: linear-gradient(180deg, rgb(var(--surf-hi-rgb)), rgb(var(--surf-lo-rgb)));
  border: 1px solid var(--line-2);
  box-shadow: 0 50px 120px -40px rgb(var(--shadow-rgb) / var(--shadow-k)), 0 0 0 1px rgba(139, 92, 246, .14);
}
.modal__head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 18px 16px 22px; }
.modal__icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px;
  color: #fff; background: linear-gradient(135deg, var(--purple-hi), var(--purple-lo));
  box-shadow: 0 10px 26px -10px var(--purple-glow), inset 0 1px 0 rgb(255 255 255 / .25);
}
.modal__icon svg { width: 23px; height: 23px; }
.modal__title { flex: 1; min-width: 0; }
.modal__title h2 { font-family: var(--font-display); font-size: 23px; font-weight: 600; line-height: 1.2; }
.modal__title p { margin-top: 3px; font-size: 13.5px; color: var(--text-2); }
.modal__close { margin-top: -2px; }
.modal__close:hover { background: rgb(var(--fg-rgb) / .06); }
.modal__body { display: grid; gap: 20px; align-content: start; min-height: 0; overflow-y: auto; padding: 0 22px 20px; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); background: rgb(var(--surf-lo-rgb) / .6); }


@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (max-width: 600px) {
  .modal { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; }
  .modal[open] { animation: sheet-in .32s var(--ease-out); }
  .modal__box { border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal__head { padding: 18px 12px 14px 16px; gap: 12px; }
  .modal__icon { width: 40px; height: 40px; border-radius: 12px; }
  .modal__title h2 { font-size: 20px; }
  .modal__body { padding: 0 16px 16px; gap: 18px; }
  .modal__foot { flex-wrap: wrap; padding: 12px 16px 14px; }
}

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1380px) {
  :root { --side-w: 236px; --parties-w: 340px; --gutter: 24px; }
  .online-pill span { display: none; }
}

@media (max-width: 1240px) {
  .hero-row { grid-template-columns: minmax(0, 1fr); }
  .parties { padding: 18px; }
  .parties__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .quick { margin-top: 2px; }
  .promo-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .event__stats { gap: 20px; }
}

/* icon rail */
@media (max-width: 1100px) {
  :root { --side-w: 84px; }
  .side { padding: 20px 12px; align-items: center; }
  .side .brand { padding: 4px; }
  .side .brand__logo { display: none; }
  .side .brand__mark { display: block; }
  .nav__item span, .nav__badge, .friends__head h2, .friends__count, .friends__head .icon-btn,
  .friend__txt, .friend__invite, .me__info, .me .icon-btn { display: none; }
  .nav__item { width: 52px; height: 48px; padding: 0; justify-content: center; }
  .nav__item.is-active::before { left: -12px; }
  .nav__dot { position: absolute; top: 10px; right: 12px; }
  .friends__head { padding: 0; justify-content: center; }
  .friends__head::before { content: ""; width: 28px; height: 1px; background: var(--line-2); }
  .friend { padding: 6px; }
  .me { padding: 6px; background: none; border: 0; }
  .online-pill { display: none; }
  .resume-row { grid-template-columns: repeat(3, minmax(260px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 8px; scrollbar-width: none; }
  .resume-row::-webkit-scrollbar { display: none; }
  .resume { scroll-snap-align: start; }
  .promo-row { grid-template-columns: minmax(0, 1fr); }
  .drop { min-height: 340px; }
}

/* phone + small tablet */
@media (max-width: 860px) {
  :root { --gutter: 16px; --top-h: auto; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { flex-wrap: wrap; gap: 12px; padding: 12px var(--gutter); }
  .brand--compact { display: inline-flex; padding: 0; }
  .brand--compact .brand__logo { width: 152px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .search kbd { display: none; }
  .top__cta { display: none; }
  .wallet__item:nth-child(2) { display: none; }
  .wallet, .icon-btn { height: 40px; }
  .icon-btn { width: 40px; }
  .icon-btn__dot { top: 9px; right: 9px; }
  .main { padding: 16px var(--gutter) calc(110px + env(safe-area-inset-bottom)); gap: 32px; }

  .hero { min-height: 0; aspect-ratio: 4 / 5; max-height: 620px; border-radius: 20px; }
  .slide__bg { object-position: var(--mfocal, var(--focal, 60% 40%)); }
  .slide__shade {
    background:
      linear-gradient(0deg, rgb(var(--bg-rgb) / .97) 0%, rgb(var(--bg-rgb) / .78) 38%, rgb(var(--bg-rgb) / 0) 68%),
      radial-gradient(90% 60% at 0% 100%, rgba(109, 40, 217, .4), transparent 70%);
  }
  .slide__body { left: 18px; right: 18px; bottom: 54px; width: auto; gap: 12px; }
  .slide__logo { height: 72px; max-width: 78%; }
  .slide__desc { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .slide__meta { font-size: 12.5px; gap: 4px 12px; }
  .slide__actions { width: 100%; display: grid; grid-template-columns: 1fr auto; }
  .slide__actions .btn { --h: 48px; padding: 0 16px; }
  .slide__actions .btn--glass span { display: none; }
  .hero__ctrl { top: 14px; right: 14px; }
  .hero__ctrl .glass-btn { display: none; }
  .hero__count { padding: 4px 10px; border-radius: 8px; background: rgb(var(--bg-rgb) / .5); backdrop-filter: blur(8px); margin: 0; }
  .hero__thumbs { display: flex; left: 18px; right: auto; bottom: 22px; gap: 6px; }
  .thumb { width: 22px; height: 4px; border-radius: 4px; border: 0; opacity: 1; background: rgb(var(--fg-rgb) / .25); }
  .thumb[aria-selected="true"] { width: 44px; border: 0; box-shadow: none; }
  .thumb::before { content: ""; position: absolute; inset: -14px -4px; }
  .thumb img { display: none; }
  .thumb__bar { inset: 0; height: auto; background: none; }
  .thumb:hover { transform: none; }

  .parties { padding: 16px 0 16px 16px; border-radius: 20px; }
  .parties .panel__head { padding-right: 16px; }
  .parties__list { display: flex; gap: 10px; margin: 0; overflow-x: auto; scroll-snap-type: x mandatory; padding-right: 16px; scrollbar-width: none; }
  .parties__list::-webkit-scrollbar { display: none; }
  .party { flex: 0 0 min(300px, 84%); scroll-snap-align: start; background: rgb(var(--fg-rgb) / .035); border: 1px solid var(--line); }
  .quick { margin-right: 16px; }

  .sec__head--wrap { display: grid; grid-template-columns: 1fr auto; }
  .sec__head--wrap .chips { grid-column: 1 / -1; grid-row: 2; }
  .resume-row { grid-template-columns: repeat(3, 82%); }
  .resume { height: 196px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .card__go { opacity: 1; transform: none; height: 38px; font-size: 14px; display: none; }

  .event { min-height: 0; }
  .event__body { padding: 22px 20px; }
  .event__shade { background: repeating-linear-gradient(135deg, rgb(var(--fg-rgb) / .03) 0 1px, transparent 1px 14px), linear-gradient(0deg, rgba(14, 8, 30, .97) 0%, rgba(30, 14, 70, .85) 60%, rgba(91, 33, 182, .35) 100%); }
  .event__stats { gap: 18px; }
  .event__stats dd { font-size: 17px; }
  .event__foot { gap: 14px; }
  .event__foot .btn { width: 100%; }
  .countdown { width: 100%; }
  .countdown span { flex: 1; width: auto; }
  .drop { padding: 20px; }
  .drop { --art-h: 64%; }
  .drop__intro { max-width: 60%; }
  .trail__lbl { font-size: 10.5px; }
  .foot { padding-bottom: 8px; }
  .foot__note { margin-left: 0; }

  .tabbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: 68px; padding: 0 6px; border-radius: 22px;
    background: rgb(var(--surf-lo-rgb) / .88); border: 1px solid var(--line-2);
    box-shadow: 0 20px 50px -10px rgb(var(--shadow-rgb) / calc(.9 * var(--shadow-k)));
    backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  }
  .tabbar__item { display: grid; justify-items: center; gap: 3px; padding: 8px 0; font-size: 11.5px; font-weight: 600; color: var(--text-3); -webkit-tap-highlight-color: transparent; }
  .tabbar__item svg { width: 22px; height: 22px; }
  .tabbar__item.is-active { color: var(--text); }
  .tabbar__item.is-active svg { color: var(--accent-icon); }
  .tabbar__fab {
    justify-self: center; display: grid; place-items: center;
    width: 52px; height: 52px; border-radius: 16px;
    background: var(--lime); color: var(--lime-ink);
    box-shadow: 0 0 0 5px rgb(var(--lime-rgb) / .1), 0 10px 26px -6px var(--lime-glow);
    -webkit-tap-highlight-color: transparent;
    transition: transform .16s var(--ease-out);
  }
  .tabbar__fab:active { transform: scale(.94); }
  .tabbar__fab svg { width: 24px; height: 24px; }
  .toasts { left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); justify-items: stretch; }
  .toast { max-width: none; }
}

@media (max-width: 380px) {
  .brand--compact .brand__logo { width: 136px; }
  .wallet__item { padding: 0 10px; }
}

@media (hover: none) {
  .friend__invite { opacity: 1; transform: none; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .slide__bg { transform: none !important; }
  .dot--pulse::after { display: none; }
}
