/* ============================================================================
   Velocity Game Launcher
   ========================================================================== */

:root {
  --bg: #0a0814;
  --surface: #131024;
  --surface-2: #1b1633;
  --text: #f5f2ff;
  --muted: #a79fc6;
  --accent: #9d92f5;
  --accent-2: #e6e0ff;
  --line: color-mix(in srgb, var(--text) 11%, transparent);
  --line-strong: color-mix(in srgb, var(--text) 20%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
  --glow: color-mix(in srgb, var(--accent) 42%, transparent);
  --ok: #3ddc84;
  --warn: #fbbf24;
  --danger: #ff6b6b;
  --radius: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 8% -12%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%),
    radial-gradient(800px 600px at 100% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 14%, transparent);
  border-radius: 99px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------------------------------------------------ shell */

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding-left: 12px;
  background: transparent;
  border-bottom: 0;
  -webkit-app-region: drag;
  user-select: none;
  flex: 0 0 auto;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--text) 85%, transparent);
}

.titlebar-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 55%, transparent));
}

.titlebar-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
}

.titlebar-btn:hover {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--text);
}

.titlebar-btn.is-close:hover {
  background: #e81123;
  color: #fff;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
}

.auth-gate {
  position: fixed;
  inset: 36px 0 0 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 50;
}

.auth-gate:not([hidden]) {
  display: flex;
}

.auth-card {
  width: min(420px, calc(100vw - 40px));
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.auth-card p {
  color: var(--muted);
  margin: 0 0 18px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-text strong {
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  opacity: 0.9;
}

.nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.nav a.is-active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.nav a.is-active svg {
  color: var(--accent);
  opacity: 1;
}

.nav-plus {
  margin-left: auto;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 15px;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    color-mix(in srgb, var(--surface) 90%, transparent);
}

.plan-card h4 {
  margin: 0 0 2px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.plan-card p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.plan-card .btn {
  width: 100%;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  flex: 0 0 auto;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.profile-text strong {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-text span {
  color: var(--muted);
  font-size: 0.68rem;
}

.settings-link {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 2px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-link svg {
  width: 19px;
  height: 19px;
}

.settings-link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.settings-link.is-active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.settings-link.is-active svg {
  color: var(--accent);
}

/* ------------------------------------------------------------------- main */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 66px;
  padding: 0 clamp(16px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  z-index: 5;
  flex: 0 0 auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 120px;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  max-width: 440px;
  height: 38px;
  padding: 0 10px 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.86rem;
  color: var(--text);
}

.search input::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

kbd {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
}

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

.plan-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-pill.is-plus {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(16px, 2.6vw, 30px) clamp(16px, 3vw, 34px) 70px;
  scroll-behavior: smooth;
}

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: clamp(330px, 44vh, 430px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 7, 11, 0.95) 0%, rgba(6, 7, 11, 0.78) 42%, rgba(6, 7, 11, 0.18) 100%),
    linear-gradient(0deg, var(--bg) 1%, transparent 55%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  min-height: inherit;
  padding: clamp(22px, 3vw, 40px);
  max-width: 640px;
}

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

.chip {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: color-mix(in srgb, var(--text) 85%, transparent);
  font-size: 0.7rem;
  font-weight: 600;
}

.chip.accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero-desc {
  color: color-mix(in srgb, var(--text) 72%, transparent);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 56ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-poster {
  position: absolute;
  z-index: 2;
  right: clamp(24px, 4vw, 60px);
  bottom: 44px;
  width: clamp(150px, 14vw, 196px);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 60px -24px #000;
  transform: rotate(1.5deg);
}

.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1150px) {
  .hero-poster {
    display: none;
  }
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 12px;
}

@media (min-width: 1200px) {
  .home-grid {
    grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  }
}

.shelf-link {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

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

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  background: color-mix(in srgb, var(--text) 13%, transparent);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white 12%), var(--accent));
  color: #08070f;
  box-shadow: 0 10px 26px -12px var(--glow);
}

.btn.primary:hover {
  filter: brightness(1.07);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
}

.btn.ghost:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.btn.quiet {
  background: transparent;
  color: var(--muted);
}

.btn.quiet:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 0.76rem;
  border-radius: 8px;
}

.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

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

/* ------------------------------------------------------------------- rows */

.shelves {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 36px);
  margin-top: clamp(24px, 3vw, 36px);
}

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

.shelf-head h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.shelf-head .muted {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.shelf-tools {
  display: flex;
  gap: 6px;
}

.icon-small {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--muted);
}

.icon-small svg {
  width: 16px;
  height: 16px;
}

.icon-small:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.track {
  display: flex;
  gap: clamp(10px, 1.2vw, 16px);
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.track::-webkit-scrollbar {
  height: 6px;
}

.track > .game-card {
  flex: 0 0 clamp(142px, 12.6vw, 176px);
  scroll-snap-align: start;
}

/* ------------------------------------------------------------------- cards */

.game-card {
  position: relative;
  min-width: 0;
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.95);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card-cover img.is-broken {
  opacity: 0;
}

.card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 20, 0) 42%, rgba(10, 8, 20, 0.55) 68%, rgba(10, 8, 20, 0.96) 100%);
}

.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px 11px;
  z-index: 2;
}

.card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.card-meta {
  margin-top: 3px;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.66);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
}

.card-rank {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(10, 8, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}

.card-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent);
  color: #0b0814;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-badge.free {
  background: var(--ok);
  color: #05130b;
}

.card-add {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(10, 8, 20, 0.72);
  color: #fff;
  opacity: 0;
  backdrop-filter: blur(6px);
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.card-add svg {
  width: 13px;
  height: 13px;
}

.card-add:hover {
  background: var(--accent);
  color: #0b0814;
  transform: scale(1.08);
}

.card-add.is-added {
  opacity: 1;
  background: var(--accent);
  border-color: transparent;
  color: #0b0814;
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
}

.game-card:hover .card-cover,
.game-card:focus-within .card-cover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  box-shadow: 0 24px 44px -22px #000, 0 0 0 1px var(--accent-soft);
}

.game-card:hover .card-cover img {
  transform: scale(1.05);
}

.game-card:hover .card-add,
.card-add:focus-visible {
  opacity: 1;
}

.card-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 14px;
}

@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

/* ------------------------------------------------------------------ views */

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.view-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.view-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 60ch;
}

.kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: clamp(34px, 7vw, 70px) 20px;
  margin: 18px 0;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty h2 {
  font-size: 1.12rem;
}

.empty p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.85rem;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  margin-bottom: 18px;
}

.notice.error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.notice strong {
  font-size: 0.9rem;
}

.notice p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

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

.library-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
}

.library-actions .grow {
  flex: 1 1 auto;
  min-width: 0;
}

.btn.icon-only {
  width: 32px;
  padding: 0;
  flex: 0 0 32px;
}

.library-item {
  display: flex;
  flex-direction: column;
}

.library-stats {
  color: var(--muted);
  font-size: 0.7rem;
}

/* ------------------------------------------------------------------ clips */

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.clip-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.clip-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.clip-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05060a center / cover no-repeat;
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  width: 100%;
  cursor: pointer;
}

.clip-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 55%);
}

.play-dot svg {
  width: 17px;
  height: 17px;
}

.play-dot {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.clip-body {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clip-name {
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

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

/* ---------------------------------------------------------------- friends */

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.friend-row .avatar {
  position: relative;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.status-dot.online {
  background: var(--ok);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 70%, transparent);
}

.friend-info {
  min-width: 0;
  flex: 1;
}

.friend-info strong {
  display: block;
  font-size: 0.88rem;
}

.friend-info span {
  color: var(--muted);
  font-size: 0.72rem;
}

/* ----------------------------------------------------------------- cheats */

.cheat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  padding: 16px;
}

.panel h3 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.panel .hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.file-row:first-of-type {
  border-top: 0;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-info strong {
  display: block;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info span {
  color: var(--muted);
  font-size: 0.7rem;
}

.locked-overlay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  margin-bottom: 14px;
}

/* ----------------------------------------------------------------- themes */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.theme-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.theme-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 30px -18px var(--glow);
}

.theme-card.is-locked {
  cursor: pointer;
}

.theme-preview {
  height: 64px;
  border-radius: 9px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 45%, rgba(255, 255, 255, 0.08));
}

.theme-preview .dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  right: 10px;
  bottom: 10px;
}

.theme-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.theme-name small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  background: rgba(5, 6, 10, 0.66);
  backdrop-filter: blur(2px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  z-index: 2;
}

.lock svg {
  width: 22px;
  height: 22px;
}

.lock span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------- settings */

.settings-wrap {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  padding: 18px;
}

.settings-section h2 {
  font-size: 0.98rem;
  margin-bottom: 3px;
}

.settings-section > p {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field > label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.select {
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--text);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.toggle:first-of-type {
  border-top: 0;
}

.toggle strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.toggle span {
  color: var(--muted);
  font-size: 0.74rem;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}

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

.switch[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
  background: var(--accent);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  font-size: 0.72rem;
}

/* ----------------------------------------------------------------- modals */

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  max-height: 92vh;
}

dialog::backdrop {
  background: rgba(3, 4, 7, 0.78);
  backdrop-filter: blur(8px);
}

dialog[open] {
  animation: modal-in 0.22s ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
}

.modal {
  width: min(880px, 94vw);
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 60px 120px -30px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}

.modal-scroll {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-close {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 7, 11, 0.7);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.game-hero {
  position: relative;
  height: 260px;
  background-size: cover;
  background-position: center;
}

.game-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--surface) 2%, rgba(15, 17, 24, 0.1) 70%);
}

.game-body {
  position: relative;
  z-index: 2;
  padding: 0 clamp(18px, 3vw, 28px) 26px;
  margin-top: -70px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
}

.game-poster {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 22px 44px -20px #000;
}

.game-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  align-items: center;
}

.game-meta .chip {
  background: transparent;
}

.game-about {
  margin-top: 16px;
  color: color-mix(in srgb, var(--text) 76%, transparent);
  font-size: 0.85rem;
  line-height: 1.65;
  white-space: pre-line;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

.shots {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 16px;
  padding-bottom: 6px;
}

.shots img {
  width: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.clip-modal {
  width: min(1000px, 94vw);
  background: #000;
}

.clip-modal video {
  width: 100%;
  max-height: 84vh;
  display: block;
  background: #000;
}

.plan-modal {
  width: min(520px, 92vw);
}

.plan-body {
  padding: 26px;
}

.plan-body h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.plan-body > p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.benefits {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.benefits li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 0.84rem;
  color: color-mix(in srgb, var(--text) 85%, transparent);
}

.benefits svg {
  width: 16px;
  height: 16px;
  color: var(--accent-2);
  flex: 0 0 auto;
  margin-top: 2px;
}

/* ----------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -16px #000;
  font-size: 0.82rem;
  animation: toast-in 0.2s ease both;
  max-width: 70vw;
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: #ffd9d9;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------------------------------------- skeletons */

.skeleton {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.sk-hero {
  height: clamp(330px, 44vh, 430px);
  border-radius: 20px;
}

.sk-line {
  height: 12px;
  margin: 8px 0;
}

.sk-card {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .brand-text,
  .nav a span,
  .nav-plus,
  .profile-text,
  .plan-card,
  .settings-link span {
    display: none;
  }

  .brand {
    justify-content: center;
    padding: 4px 0 10px;
  }

  .nav a {
    justify-content: center;
    padding: 11px 0;
  }

  .profile-chip {
    justify-content: center;
    padding: 6px;
  }

  .game-body {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .cheat-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-title {
    display: none;
  }

  .topbar {
    gap: 10px;
  }

  .hero-content {
    padding: 18px;
  }

  .hero-desc {
    -webkit-line-clamp: 4;
  }

  .game-body {
    grid-template-columns: 1fr;
    margin-top: -40px;
  }

  .game-poster {
    width: 110px;
  }

  .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .clip-grid {
    grid-template-columns: 1fr;
  }
}

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