:root {
  --bg: #0c0b11;
  --bg-raised: #121118;
  --surface: #18161f;
  --surface-2: #201d28;
  --surface-3: #292532;
  --line: #302c39;
  --line-bright: #464050;
  --text: #f6f2f7;
  --muted: #a8a0b0;
  --muted-2: #756d7c;
  --purple: #a78bfa;
  --purple-bright: #c4b5fd;
  --blue: #7dd3fc;
  --green: #64e7a7;
  --danger: #ff665c;
  --tier-s: #ff665c;
  --tier-a: #ffaf45;
  --tier-b: #ffd65b;
  --tier-c: #64d8a4;
  --tier-d: #67bdf3;
  --tier-f: #9b91a7;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --font:
    "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --display: "Arial Black", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 70% -20%, rgba(151, 105, 255, 0.13), transparent 34%),
    linear-gradient(180deg, #0d0c12 0%, #0b0a0f 100%);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.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;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: 20%;
  left: -320px;
  background: #ff4d7d;
}

.ambient-two {
  right: -300px;
  bottom: -120px;
  background: #6854ff;
}

.grid-noise {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.18;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1460px, calc(100% - 64px));
  height: 92px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 24px;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand strong {
  letter-spacing: 1.8px;
  font-family: var(--display);
  font-size: 17px;
}

.brand strong span {
  color: var(--purple);
}

.brand small {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.65px;
}

.topbar-actions {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
}

.privacy-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  font-weight: 600;
}

.privacy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(100, 231, 167, 0.8);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-bright);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
}

.profile-button {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 146px;
  height: 46px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.profile-button:hover {
  border-color: var(--line-bright);
}

.profile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  color: #17111e;
  background: linear-gradient(135deg, var(--purple-bright), var(--blue));
  font-size: 13px;
  font-weight: 900;
}

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

.profile-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.profile-copy strong {
  max-width: 100px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.profile-button > svg {
  width: 12px;
  fill: none;
  stroke: var(--muted-2);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.account-menu {
  position: absolute;
  top: 56px;
  right: 0;
  width: 180px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #191720;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

.account-menu a,
.account-menu button {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
  color: var(--text);
  background: var(--surface-2);
}

main {
  position: relative;
  z-index: 1;
}

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(500px, 0.98fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  width: min(1390px, calc(100% - 80px));
  min-height: calc(100vh - 92px);
  margin: 0 auto;
  padding: 80px 0 100px;
}

.landing-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--purple-bright);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.4px;
}

.eyebrow::before {
  width: 24px;
  height: 2px;
  background: var(--purple);
  content: "";
}

.landing h1 {
  max-width: 720px;
  margin: 26px 0 24px;
  font-family: var(--display);
  font-size: clamp(52px, 5.35vw, 82px);
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1.04;
}

.landing h1 span {
  color: transparent;
  background: linear-gradient(100deg, #f7f2ff 5%, #bfa5ff 42%, #77d8ff 95%);
  background-clip: text;
  -webkit-background-clip: text;
}

.landing-lead {
  max-width: 630px;
  margin: 0;
  color: #aaa3b1;
  font-size: 17px;
  line-height: 1.85;
}

.landing-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 35px;
}

.steam-button {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 56px;
  padding: 0 10px 0 19px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 12px;
  color: #0f131c;
  background: linear-gradient(135deg, #f4f7ff 0%, #b8d7ee 100%);
  box-shadow:
    0 14px 34px rgba(129, 176, 226, 0.14),
    inset 0 1px 0 white;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.steam-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 42px rgba(129, 176, 226, 0.22),
    inset 0 1px 0 white;
}

.steam-button > svg {
  width: 25px;
  fill: #111c2d;
}

.button-arrow {
  display: grid;
  width: 36px;
  height: 36px;
  margin-left: 5px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: #1c2331;
  font-size: 17px;
}

.login-note {
  display: flex;
  gap: 7px;
  align-items: center;
  max-width: 140px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

.login-note svg {
  width: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 630px;
  margin-top: 55px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-steps > div {
  display: flex;
  gap: 10px;
}

.landing-steps > div:not(:first-child) {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.landing-steps span {
  color: var(--purple);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.landing-steps p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.55;
}

.landing-steps strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 11px;
}

.hero-board {
  position: relative;
  width: 100%;
  max-width: 620px;
  justify-self: end;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 28%),
    #14121a;
  box-shadow:
    0 45px 100px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: perspective(1500px) rotateY(-5deg) rotateX(1.5deg);
}

.hero-board::before {
  position: absolute;
  z-index: -1;
  inset: 10% 4% -8%;
  border-radius: 26px;
  background: linear-gradient(110deg, #864dff, #22b5d8);
  filter: blur(55px);
  opacity: 0.13;
  content: "";
}

.hero-board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hero-board-top > div:first-child {
  display: flex;
  flex-direction: column;
}

.mini-kicker {
  margin-bottom: 5px;
  color: var(--purple);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.hero-board-top strong {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.5px;
}

.fake-avatars {
  display: flex;
}

.fake-avatars span {
  width: 25px;
  height: 25px;
  margin-left: -6px;
  border: 2px solid #14121a;
  border-radius: 50%;
  background: linear-gradient(135deg, #b9a3f7, #4b386c);
}

.fake-avatars span:nth-child(2) {
  background: linear-gradient(135deg, #ff986c, #7f3b4b);
}

.fake-avatars span:nth-child(3) {
  background: linear-gradient(135deg, #7edcbd, #234e52);
}

.hero-tier {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 74px;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 10px;
  background: #1d1a24;
}

.hero-tier > b {
  display: grid;
  place-items: center;
  color: #18131b;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 900;
}

.hero-tier-s > b {
  background: var(--tier-s);
}

.hero-tier-a > b {
  background: var(--tier-a);
}

.hero-tier-b > b {
  background: var(--tier-b);
}

.hero-tier-c > b {
  background: var(--tier-c);
}

.hero-tier-f > b {
  background: var(--tier-f);
}

.hero-cards {
  display: flex;
  gap: 7px;
  padding: 9px;
}

.hero-cards span {
  position: relative;
  width: 19%;
  min-width: 62px;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.72)),
    linear-gradient(135deg, #533c74, #272344 60%, #1a2736);
}

.hero-cards span::before {
  position: absolute;
  top: 16%;
  left: 14%;
  width: 22%;
  height: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  content: "";
}

.hero-cards span::after {
  position: absolute;
  right: 10%;
  bottom: 14%;
  width: 34%;
  height: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  content: "";
}

.hero-tier-s .hero-cards span:nth-child(2) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.78)),
    linear-gradient(135deg, #654321, #482819 60%, #1e1b22);
}

.hero-tier-s .hero-cards span:nth-child(3) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.7)),
    linear-gradient(135deg, #1c655f, #1d3f41 60%, #1a2631);
}

.hero-tier-a .hero-cards span:nth-child(2) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.7)),
    linear-gradient(135deg, #793e4b, #35243b 60%, #1e2736);
}

.hero-tier-a .hero-cards span:nth-child(3) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.7)),
    linear-gradient(135deg, #584f2c, #35382a 60%, #162b2d);
}

.hero-tier-a .hero-cards span:nth-child(4) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.7)),
    linear-gradient(135deg, #314d7a, #27364b 60%, #201f35);
}

.hero-tier-b .hero-cards span:nth-child(2) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.7)),
    linear-gradient(135deg, #6a5542, #3d3032 60%, #1e2938);
}

.hero-tier-c .hero-cards span:nth-child(3) {
  background:
    linear-gradient(155deg, transparent 25%, rgba(0, 0, 0, 0.7)),
    linear-gradient(135deg, #37456f, #2a3045 60%, #252131);
}

.hero-empty {
  display: flex;
  align-items: center;
  padding-left: 17px;
  color: var(--muted-2);
  font-size: 11px;
  font-style: italic;
}

.hero-float {
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(26, 23, 33, 0.9);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.hero-float span {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
}

.hero-float small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.hero-float-one {
  top: 45%;
  right: -45px;
  transform: rotate(2deg);
}

.hero-float-two {
  bottom: 8%;
  left: -38px;
  transform: rotate(-3deg);
}

.dashboard {
  width: min(1460px, calc(100% - 64px));
  margin: 0 auto;
  padding: 55px 0 45px;
}

.dashboard-heading {
  display: flex;
  gap: 30px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 29px;
}

.dashboard-heading h1 {
  margin: 11px 0 8px;
  font-family: var(--display);
  font-size: clamp(35px, 4vw, 52px);
  letter-spacing: -2px;
  line-height: 1;
}

.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  gap: 8px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.primary-button {
  border: 1px solid #bba5ff;
  color: #151020;
  background: linear-gradient(135deg, #d7cbff, #a88aed);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #e3d9ff, #b59cef);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.secondary-button:hover {
  border-color: var(--line-bright);
  color: var(--text);
  background: var(--surface-2);
}

.danger-button {
  border: 1px solid rgba(255, 102, 92, 0.45);
  color: #ffd3cf;
  background: rgba(255, 102, 92, 0.14);
}

.danger-button:hover {
  background: rgba(255, 102, 92, 0.22);
}

.primary-button svg,
.secondary-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.setup-warning {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 175, 69, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255, 175, 69, 0.1), transparent),
    var(--surface);
}

.warning-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 8px;
  color: #2e1b09;
  background: var(--tier-a);
  font-weight: 900;
}

.setup-warning strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.setup-warning p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.warning-button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 175, 69, 0.4);
  border-radius: 8px;
  color: #ffd299;
  background: rgba(255, 175, 69, 0.08);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  gap: 13px;
  min-height: 82px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.032), transparent 52%),
    var(--surface);
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--purple-bright);
  background: rgba(167, 139, 250, 0.08);
  font-size: 15px;
}

.stat-card > div:not(.progress-copy) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-card small {
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat-card strong {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
}

.stat-card-progress {
  display: block;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-copy strong {
  color: var(--purple-bright);
  font-size: 16px;
}

.progress-track {
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 99px;
  background: #26222e;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.4);
  transition: width 380ms ease;
}

.board-shell,
.library-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(21, 19, 27, 0.88);
  box-shadow: var(--shadow);
}

.board-toolbar {
  display: flex;
  gap: 25px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.board-toolbar > div:first-child {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.board-toolbar h2,
.library-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.board-subtitle {
  color: var(--muted-2);
  font-size: 10px;
}

.board-tools {
  display: flex;
  gap: 4px;
  align-items: center;
}

.text-button {
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

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

.text-button span {
  margin-right: 3px;
  color: var(--purple-bright);
  font-size: 13px;
}

.danger-text:hover {
  color: #ffaaa4;
}

.tool-divider {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--line);
}

.tier-count-control {
  display: flex;
  gap: 7px;
  height: 30px;
  align-items: center;
  padding: 0 4px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
  font-weight: 700;
}

.playtime-toggle {
  display: flex;
  gap: 7px;
  height: 30px;
  align-items: center;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.playtime-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.playtime-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 27px;
  height: 16px;
  flex: 0 0 27px;
  border: 1px solid #4a4353;
  border-radius: 99px;
  background: #24202b;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.toggle-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #756d7c;
  transition:
    transform 150ms ease,
    background 150ms ease;
}

.playtime-toggle input:checked + .toggle-track {
  border-color: #8e75c8;
  background: rgba(167, 139, 250, 0.28);
}

.playtime-toggle input:checked + .toggle-track span {
  background: var(--purple-bright);
  transform: translateX(11px);
}

.playtime-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--purple-bright);
  outline-offset: 2px;
}

.year-filter-button {
  display: inline-flex;
  gap: 6px;
  height: 30px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.year-filter-button:hover,
.year-filter-button.is-active {
  border-color: rgba(167, 139, 250, 0.5);
  color: var(--purple-bright);
  background: rgba(167, 139, 250, 0.07);
}

.year-filter-button svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.tier-count-control select {
  height: 22px;
  padding: 0 18px 0 4px;
  border: 0;
  outline: none;
  color: var(--purple-bright);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.empty-board {
  display: flex;
  min-height: 265px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.empty-icon {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 42px;
  margin-bottom: 17px;
}

.empty-icon span {
  width: 8px;
  border-radius: 3px;
  background: linear-gradient(to top, var(--purple), #504462);
}

.empty-icon span:nth-child(1) {
  height: 18px;
}

.empty-icon span:nth-child(2) {
  height: 31px;
}

.empty-icon span:nth-child(3) {
  height: 42px;
}

.empty-board h3 {
  margin: 0 0 7px;
  font-size: 17px;
}

.empty-board p {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 11px;
}

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
}

.tier-row {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  min-height: 88px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tier-color) 22%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--tier-color) 5%, transparent),
      transparent 30%
    ),
    #1c1922;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 5px 16px rgba(0, 0, 0, 0.1);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.tier-row:hover {
  border-color: color-mix(in srgb, var(--tier-color) 42%, var(--line));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 7px 20px rgba(0, 0, 0, 0.15);
}

.tier-label {
  position: relative;
  display: flex;
  min-height: 88px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px 9px;
  border: 0;
  color: #17131a;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--tier-color) 72%, white),
      var(--tier-color) 64%,
      color-mix(in srgb, var(--tier-color) 90%, #1a1420)
    );
  box-shadow: inset -8px 0 18px rgba(20, 14, 24, 0.08);
}

.tier-label::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(90deg, transparent 60%, rgba(24, 16, 28, 0.08));
  content: "";
  pointer-events: none;
}

.tier-name {
  position: relative;
  z-index: 1;
  max-width: 140px;
  min-width: 28px;
  padding: 2px 5px;
  outline: none;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.tier-name.is-long {
  font-size: 19px;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tier-name.is-very-long {
  font-size: 15px;
}

.tier-name:focus {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.35);
}

.tier-description {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  max-width: 142px;
  max-height: 2.8em;
  margin-top: 5px;
  overflow: hidden;
  padding: 1px 3px;
  outline: none;
  color: rgba(23, 19, 26, 0.7);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tier-description:empty::before {
  color: rgba(23, 19, 26, 0.38);
  content: attr(data-placeholder);
  font-style: italic;
  font-weight: 600;
}

.tier-description:focus {
  max-height: 7em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.3);
  -webkit-line-clamp: unset;
}

.tier-count {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  opacity: 0.58;
}

.tier-drop {
  position: relative;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
  align-content: center;
  padding: 8px;
  transition: background 130ms ease;
}

.tier-row.is-crowded .game-card {
  grid-template-columns: 70px minmax(0, 1fr);
  width: 178px;
}

.tier-row.is-crowded .game-art-wrap {
  min-height: 56px;
}

.tier-row.is-dense .game-card {
  grid-template-columns: 58px minmax(0, 1fr);
  width: 148px;
  min-height: 52px;
}

.tier-row.is-dense .game-art-wrap {
  min-height: 52px;
}

.tier-row.is-dense .game-meta {
  padding: 5px 20px 5px 7px;
}

.tier-row.is-dense .game-meta h3 {
  font-size: 9px;
}

.tier-row.is-dense .game-meta p {
  margin-top: 3px;
  font-size: 7px;
}

.tier-drop::after {
  display: none;
  width: 100%;
  padding: 20px;
  border: 1px dashed var(--tier-color);
  border-radius: 7px;
  color: var(--muted);
  background: color-mix(in srgb, var(--tier-color) 7%, transparent);
  font-size: 10px;
  text-align: center;
  content: "拖到这里";
}

.tier-row.is-empty .tier-drop::after {
  display: block;
}

.tier-drop.drag-over {
  background: color-mix(in srgb, var(--tier-color) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-color) 35%, transparent);
  border-radius: 0 10px 10px 0;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  width: 224px;
  min-height: 62px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #35313e;
  border-radius: 7px;
  background: #24202b;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  cursor: grab;
  user-select: none;
  transition:
    border-color 140ms ease,
    transform 140ms ease,
    opacity 140ms ease;
}

.game-card:hover {
  z-index: 2;
  border-color: #5b5268;
  transform: translateY(-2px);
}

.game-card:active {
  cursor: grabbing;
}

.game-card.dragging {
  opacity: 0.35;
}

.game-card.pulse {
  animation: card-pulse 1.1s ease 2;
}

@keyframes card-pulse {
  0%,
  100% {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  }
  50% {
    border-color: var(--purple-bright);
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
  }
}

.game-art-wrap {
  position: relative;
  min-height: 62px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(167, 139, 250, 0.28), rgba(30, 42, 53, 0.1)),
    #282333;
}

.game-art-wrap::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 55%, rgba(36, 32, 43, 0.55));
  content: "";
  pointer-events: none;
}

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

.game-art.is-broken {
  visibility: hidden;
}

.custom-card-badge {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 5px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  color: #f1eaff;
  background: rgba(64, 45, 88, 0.84);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.4px;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.game-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 8px 24px 8px 9px;
}

.game-meta h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-meta p {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
}

.card-menu {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 5px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #c6bdcf;
  background: rgba(10, 9, 13, 0.62);
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease;
}

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

.card-menu svg {
  width: 11px;
  fill: currentColor;
}

.library-shell {
  margin-top: 18px;
  box-shadow: none;
}

.library-heading {
  display: flex;
  gap: 25px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 21px 20px 18px;
}

.section-label {
  margin-bottom: 5px;
  color: var(--purple);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.library-heading p {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 10px;
}

.library-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-custom-button {
  display: inline-flex;
  gap: 5px;
  height: 37px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(167, 139, 250, 0.42);
  border-radius: 9px;
  color: #d8c9ff;
  background:
    linear-gradient(135deg, rgba(167, 139, 250, 0.13), transparent),
    #17141e;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.add-custom-button span {
  color: var(--purple-bright);
  font-size: 16px;
  line-height: 1;
}

.add-custom-button:hover {
  border-color: rgba(196, 181, 253, 0.72);
  background:
    linear-gradient(135deg, rgba(167, 139, 250, 0.2), transparent),
    #1d1926;
  transform: translateY(-1px);
}

.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 230px;
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #14121a;
  transition: border-color 150ms ease;
}

.search-box:focus-within {
  border-color: #65557b;
}

.search-box svg {
  width: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: var(--muted-2);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 11px;
}

.search-box input::placeholder {
  color: #655e6d;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--muted-2);
  font-size: 9px;
  content: "▾";
  pointer-events: none;
  transform: translateY(-50%);
}

.select-wrap select {
  height: 37px;
  padding: 0 29px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--muted);
  background: #14121a;
  font-size: 10px;
  cursor: pointer;
  appearance: none;
}

.select-wrap select:focus {
  border-color: #65557b;
}

.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 11px;
  padding: 0 20px 20px;
}

.pool-grid .game-card {
  display: flex;
  width: auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.pool-grid .game-art-wrap {
  width: 100%;
  min-height: 0;
  aspect-ratio: 460 / 215;
}

.pool-grid .game-art-wrap::after {
  background: linear-gradient(to top, rgba(24, 21, 29, 0.2), transparent 40%);
}

.pool-grid .game-meta {
  min-height: 57px;
  padding: 10px 11px;
}

.pool-grid .game-meta h3 {
  padding-right: 9px;
  font-size: 11px;
  -webkit-line-clamp: 1;
}

.pool-grid .game-meta p {
  margin-top: 5px;
}

.pool-grid .card-menu {
  top: 6px;
  right: 6px;
  width: 23px;
  height: 23px;
  opacity: 1;
}

.pool-empty {
  padding: 70px 25px 85px;
  color: var(--muted);
  text-align: center;
}

.pool-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 14px;
}

.pool-empty p {
  margin: 0;
  font-size: 10px;
}

.load-more {
  display: block;
  width: calc(100% - 40px);
  height: 40px;
  margin: 0 20px 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.load-more:hover {
  border-color: var(--line-bright);
  color: var(--text);
  background: var(--surface-2);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 31px 2px 0;
  color: #5c5662;
  font-family: var(--display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}

.fatal-view {
  display: grid;
  min-height: calc(100vh - 92px);
  padding: 40px 20px;
  place-items: center;
}

.fatal-card {
  max-width: 450px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}

.fatal-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 13px;
  color: #2b1907;
  background: var(--tier-a);
  font-size: 24px;
  font-weight: 900;
}

.fatal-card h1 {
  margin: 0 0 10px;
  font-size: 24px;
}

.fatal-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.browser-check-card {
  width: min(760px, 100%);
}

.browser-check-output {
  max-height: 55vh;
  overflow: auto;
  margin: 0 0 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #cfc5d8;
  background: #100f14;
  font:
    11px/1.55 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 0;
  border: 1px solid #3c3747;
  border-radius: 16px;
  color: var(--text);
  background: #17151e;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.68);
}

.modal[open] {
  animation: modal-in 180ms ease both;
}

.modal::backdrop {
  background: rgba(7, 6, 9, 0.74);
  backdrop-filter: blur(5px);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.modal-close {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.game-modal-hero {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: linear-gradient(135deg, #302540, #19262e);
}

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

.game-modal-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #17151e 0%, rgba(23, 21, 30, 0.2) 78%);
}

.game-modal-hero > div:last-child {
  position: absolute;
  right: 21px;
  bottom: 19px;
  left: 21px;
}

.game-modal-hero span {
  color: var(--purple-bright);
  font-size: 9px;
  font-weight: 700;
}

.game-modal-hero h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.6px;
  line-height: 1.2;
}

.modal-body {
  padding: 20px;
}

.modal-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.tier-choices {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.tier-choice {
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #17131a;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--tier-color) 70%, white),
    var(--tier-color)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 140ms ease,
    filter 140ms ease;
}

.tier-choice:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.tier-choice.current {
  outline: 2px solid white;
  outline-offset: 2px;
}

.remove-ranking-button {
  width: 100%;
  height: 38px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.remove-ranking-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.delete-custom-game-button {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  border: 1px solid rgba(255, 102, 92, 0.34);
  border-radius: 8px;
  color: #ffaaa4;
  background: rgba(255, 102, 92, 0.055);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.delete-custom-game-button:hover {
  border-color: rgba(255, 102, 92, 0.55);
  background: rgba(255, 102, 92, 0.11);
}

.setup-modal {
  width: min(570px, calc(100vw - 28px));
}

.custom-game-modal {
  width: min(680px, calc(100vw - 28px));
}

.year-filter-modal {
  width: min(560px, calc(100vw - 28px));
}

.year-filter-body {
  padding: 24px;
}

.year-filter-body h2 {
  margin: 0 0 7px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.5px;
}

.year-filter-intro {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.year-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 18px;
}

.year-mode-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.year-mode-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.year-mode-card > span {
  display: flex;
  min-height: 66px;
  flex-direction: column;
  justify-content: center;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #15131a;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}

.year-mode-card strong {
  margin-bottom: 5px;
  color: #d7cedd;
  font-size: 11px;
}

.year-mode-card small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.45;
}

.year-mode-card input:checked + span {
  border-color: rgba(167, 139, 250, 0.62);
  background:
    linear-gradient(135deg, rgba(167, 139, 250, 0.1), transparent),
    #17141e;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.1);
}

.year-mode-card input:focus-visible + span {
  outline: 2px solid var(--purple-bright);
  outline-offset: 2px;
}

.year-range-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.year-range-field select,
.year-range-field input {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #100f14;
  font-size: 10px;
}

.year-range-field select:focus,
.year-range-field input:focus {
  border-color: #705e84;
}

.year-range-detail {
  margin-top: 11px;
}

.custom-year-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 9px;
  align-items: end;
}

.custom-year-range > span {
  padding-bottom: 13px;
  color: var(--muted-2);
  font-size: 9px;
}

.year-data-status {
  margin-top: 14px;
  padding: 10px 11px;
  border-radius: 7px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.025);
  font-size: 8.5px;
  line-height: 1.55;
}

.year-data-status.is-loading {
  color: var(--purple-bright);
}

.year-data-status.is-error {
  color: #ffaaa4;
}

.year-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
}

.custom-game-body {
  padding: 23px 25px 25px;
}

.custom-game-intro {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 22px;
}

.custom-game-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #493e5d;
  border-radius: 12px;
  color: var(--purple-bright);
  background: rgba(167, 139, 250, 0.09);
  font-size: 22px;
}

.custom-game-intro h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: -0.5px;
}

.custom-game-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.custom-search-label {
  display: block;
  margin-bottom: 7px;
  color: #d0c8d7;
  font-size: 10px;
  font-weight: 750;
}

.custom-search-box {
  display: flex;
  gap: 9px;
  height: 44px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #3a3444;
  border-radius: 10px;
  background: #100f14;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.custom-search-box:focus-within {
  border-color: #796492;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.07);
}

.custom-search-box svg {
  width: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: var(--muted-2);
  stroke-linecap: round;
  stroke-width: 1.6;
}

.custom-search-box input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 12px;
}

.custom-search-box input::placeholder {
  color: #68606f;
}

.custom-search-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid #3b3545;
  border-top-color: var(--purple-bright);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.custom-search-status {
  min-height: 15px;
  margin: 6px 1px 8px;
  color: var(--muted-2);
  font-size: 9px;
}

.custom-search-status.error {
  color: #ff9891;
}

.custom-search-results {
  display: flex;
  max-height: 205px;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.custom-search-results:empty {
  display: none;
}

.custom-result {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 7px;
  border: 1px solid #332e3b;
  border-radius: 8px;
  color: var(--text);
  background: #1a171f;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 130ms ease,
    background 130ms ease;
}

.custom-result:hover {
  border-color: #655773;
  background: #211d28;
}

.custom-result > img {
  width: 84px;
  height: 47px;
  border-radius: 5px;
  background: linear-gradient(135deg, #443653, #24343a);
  object-fit: cover;
}

.custom-result-copy {
  min-width: 0;
}

.custom-result-copy strong {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-result-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.custom-result-action {
  padding: 5px 8px;
  border: 1px solid #4c405b;
  border-radius: 6px;
  color: var(--purple-bright);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.custom-divider {
  display: flex;
  gap: 11px;
  align-items: center;
  margin: 18px 0 14px;
  color: #655e6d;
  font-size: 8px;
  font-weight: 700;
}

.custom-divider::before,
.custom-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.custom-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.custom-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.custom-field-wide {
  grid-column: 1 / -1;
}

.custom-field input {
  width: 100%;
  height: 39px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #100f14;
  font-size: 10px;
}

.custom-field input:focus {
  border-color: #705e84;
}

.custom-field input[type="file"] {
  height: auto;
  padding: 8px;
  color: var(--muted-2);
  font-size: 9px;
}

.custom-field input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-2);
  font: inherit;
  cursor: pointer;
}

.custom-preview {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid #483c58;
  border-radius: 9px;
  background: rgba(167, 139, 250, 0.055);
}

.custom-preview img {
  width: 112px;
  height: 63px;
  border-radius: 6px;
  background: linear-gradient(135deg, #493957, #26393d);
  object-fit: cover;
}

.custom-preview div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.custom-preview span {
  margin-bottom: 4px;
  color: var(--purple-bright);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.custom-preview strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-source-note {
  margin: 13px 0 0;
  color: #625b69;
  font-size: 8px;
  line-height: 1.5;
}

.setup-modal-body {
  padding: 29px 30px 27px;
}

.setup-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  place-items: center;
  border: 1px solid #4b415c;
  border-radius: 13px;
  color: var(--purple-bright);
  background: rgba(167, 139, 250, 0.08);
}

.setup-icon svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.setup-modal-body h2 {
  margin: 0 0 9px;
  font-family: var(--display);
  font-size: 25px;
  letter-spacing: -0.6px;
}

.setup-modal-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.setup-steps {
  margin: 21px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.setup-steps li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 10px 0;
  color: #c5bdcb;
  counter-increment: step;
  font-size: 10.5px;
  line-height: 1.6;
}

.setup-steps li::before {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  color: #241b2e;
  background: #cbbaff;
  content: counter(step);
  font-size: 8px;
  font-weight: 900;
}

.setup-steps a {
  color: var(--purple-bright);
}

.setup-steps code {
  padding: 1px 5px;
  border: 1px solid #42394d;
  border-radius: 4px;
  color: #ded3e9;
  background: #211d28;
  font-size: 9px;
}

#apiKeyForm label {
  display: block;
  margin-bottom: 7px;
  color: #c7c0ce;
  font-size: 10px;
  font-weight: 700;
}

.key-input-wrap {
  position: relative;
}

.key-input-wrap input {
  width: 100%;
  height: 45px;
  padding: 0 65px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: #100f14;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.key-input-wrap input:focus {
  border-color: #73628c;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.08);
}

.show-key-button {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 9px;
  cursor: pointer;
}

.form-error {
  min-height: 16px;
  margin: 5px 0 3px;
  color: #ff8b83;
  font-size: 9px;
}

.full-button {
  width: 100%;
}

.privacy-note {
  display: flex;
  gap: 8px;
  margin-top: 17px;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.privacy-note span {
  color: var(--green);
  font-size: 16px;
  line-height: 1;
}

.privacy-note p {
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
}

.confirm-modal {
  width: min(400px, calc(100vw - 28px));
  padding: 30px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 12px;
  color: #ffb0aa;
  background: rgba(255, 102, 92, 0.12);
  font-size: 22px;
}

.confirm-modal h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 22px;
}

.image-modal {
  width: min(980px, calc(100vw - 28px));
}

.image-preview-wrap {
  display: grid;
  min-height: 260px;
  padding: 18px;
  place-items: center;
  background: #100f14;
}

#shareImagePreview {
  max-height: 64vh;
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.image-loading {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #3b3545;
  border-top-color: var(--purple-bright);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.image-modal-actions {
  display: flex;
  justify-content: flex-end;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 9px;
  align-items: center;
  max-width: calc(100vw - 48px);
  padding: 12px 15px;
  border: 1px solid #45403d;
  border-radius: 10px;
  color: #e8e1e9;
  background: #211f25;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast > span:first-child {
  color: var(--green);
  font-weight: 900;
}

.toast.error > span:first-child {
  color: var(--danger);
}

body.is-loading .tier-list,
body.is-loading .pool-grid {
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 1120px) {
  .landing {
    grid-template-columns: minmax(0, 1fr) minmax(430px, 0.85fr);
    gap: 38px;
    width: min(100% - 50px, 1100px);
  }

  .landing h1 {
    font-size: clamp(48px, 5.8vw, 68px);
  }

  .hero-float-one {
    right: -20px;
  }

  .hero-float-two {
    left: -20px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .topbar,
  .dashboard {
    width: min(100% - 32px, 720px);
  }

  .topbar {
    height: 76px;
  }

  .landing {
    grid-template-columns: 1fr;
    width: min(100% - 40px, 680px);
    padding-top: 62px;
  }

  .landing-copy {
    text-align: center;
  }

  .eyebrow {
    justify-content: center;
  }

  .landing h1 {
    margin-right: auto;
    margin-left: auto;
  }

  .landing-lead {
    margin-right: auto;
    margin-left: auto;
  }

  .landing-actions,
  .landing-steps {
    justify-content: center;
  }

  .hero-board {
    max-width: 610px;
    justify-self: center;
    transform: none;
  }

  .dashboard {
    padding-top: 40px;
  }

  .dashboard-heading {
    align-items: flex-start;
  }

  .board-toolbar,
  .library-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .board-toolbar {
    gap: 10px;
  }

  .library-filters {
    width: 100%;
  }

  .search-box {
    flex: 1;
  }

  .tier-row {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .tier-name {
    font-size: 24px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .dashboard {
    width: calc(100% - 24px);
  }

  .brand small,
  .privacy-pill,
  .profile-copy,
  .profile-button > svg {
    display: none;
  }

  .profile-button {
    min-width: 0;
    width: 42px;
    height: 42px;
    padding: 3px;
    border-radius: 10px;
  }

  .profile-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .landing {
    width: calc(100% - 30px);
    padding: 46px 0 64px;
  }

  .landing h1 {
    margin-top: 19px;
    font-size: clamp(39px, 12.2vw, 56px);
    letter-spacing: -2.7px;
  }

  .landing-lead {
    font-size: 13px;
  }

  .landing-actions {
    flex-direction: column;
  }

  .login-note {
    max-width: none;
  }

  .landing-steps {
    gap: 12px;
    margin-top: 39px;
    text-align: left;
  }

  .landing-steps > div {
    display: block;
  }

  .landing-steps > div:not(:first-child) {
    padding-left: 10px;
  }

  .landing-steps p {
    margin-top: 4px;
    font-size: 9px;
  }

  .hero-board {
    padding: 15px;
    border-radius: 14px;
  }

  .hero-tier {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 59px;
  }

  .hero-tier > b {
    font-size: 19px;
  }

  .hero-cards {
    gap: 5px;
    padding: 7px;
  }

  .hero-cards span {
    width: 22%;
    min-width: 42px;
  }

  .hero-empty {
    font-size: 9px;
  }

  .hero-float {
    display: none;
  }

  .dashboard-heading {
    flex-direction: column;
    margin-bottom: 20px;
  }

  .dashboard-heading h1 {
    font-size: 37px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions button {
    flex: 1;
  }

  .setup-warning {
    grid-template-columns: auto 1fr;
  }

  .warning-button {
    grid-column: 1 / -1;
  }

  .stats-row {
    gap: 8px;
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 72px;
    padding: 12px;
  }

  .stat-icon {
    display: none;
  }

  .board-toolbar > div:first-child {
    display: block;
  }

  .board-subtitle {
    display: block;
    margin-top: 4px;
  }

  .board-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .tier-count-control {
    order: -1;
  }

  .playtime-toggle {
    order: -1;
  }

  .year-filter-button {
    order: -1;
  }

  .text-button {
    padding: 0 7px;
  }

  .tier-list {
    gap: 6px;
    padding: 6px;
  }

  .tier-row {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 75px;
    border-radius: 8px;
  }

  .tier-label {
    min-height: 75px;
  }

  .tier-name {
    max-width: 70px;
    font-size: 18px;
  }

  .tier-name.is-long {
    font-size: 13px;
  }

  .tier-name.is-very-long {
    font-size: 11px;
  }

  .tier-description {
    max-width: 70px;
    font-size: 7px;
  }

  .tier-count {
    font-size: 7px;
  }

  .tier-drop {
    gap: 5px;
    padding: 5px;
  }

  .tier-drop::after {
    padding: 15px 8px;
    font-size: 9px;
  }

  .game-card {
    grid-template-columns: 70px minmax(0, 1fr);
    width: 190px;
    min-height: 54px;
  }

  .tier-row.is-crowded .game-card {
    grid-template-columns: 62px minmax(0, 1fr);
    width: 158px;
  }

  .tier-row.is-dense .game-card {
    grid-template-columns: 54px minmax(0, 1fr);
    width: 142px;
  }

  .game-art-wrap {
    min-height: 54px;
  }

  .game-meta {
    padding: 6px 21px 6px 7px;
  }

  .game-meta h3 {
    font-size: 9.5px;
  }

  .card-menu {
    opacity: 1;
  }

  .library-heading {
    padding: 17px 13px 14px;
  }

  .library-filters {
    flex-wrap: wrap;
  }

  .add-custom-button {
    width: 100%;
    justify-content: center;
  }

  .search-box {
    width: 100%;
    flex-basis: 100%;
  }

  .select-wrap {
    flex: 1;
  }

  .select-wrap select {
    width: 100%;
  }

  .pool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 0 13px 13px;
  }

  .pool-grid .game-meta {
    min-height: 50px;
    padding: 8px;
  }

  .pool-grid .game-meta h3 {
    font-size: 9.5px;
  }

  .load-more {
    width: calc(100% - 26px);
    margin: 0 13px 13px;
  }

  .app-footer {
    gap: 8px;
    align-items: flex-start;
    flex-direction: column;
  }

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .custom-game-body {
    padding: 19px 16px 20px;
  }

  .year-filter-body {
    padding: 20px 16px;
  }

  .year-mode-grid {
    grid-template-columns: 1fr;
  }

  .custom-year-range {
    grid-template-columns: 1fr;
  }

  .custom-year-range > span {
    padding: 0;
    text-align: center;
  }

  .custom-form-grid {
    grid-template-columns: 1fr;
  }

  .custom-field-wide {
    grid-column: auto;
  }

  .custom-result {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .custom-result > img {
    width: 68px;
    height: 42px;
  }

  .custom-result-action {
    display: none;
  }

  .game-modal-hero {
    height: 155px;
  }

  .game-modal-hero h2 {
    font-size: 20px;
  }

  .tier-choices {
    grid-template-columns: repeat(3, 1fr);
  }

  .tier-choice {
    height: 55px;
  }

  .setup-modal-body {
    padding: 23px 20px 21px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

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