:root {
  color-scheme: dark;
  --bg: #101012;
  --bg-2: #171719;
  --surface: #1d1d21;
  --surface-2: #25252b;
  --surface-3: #32323a;
  --text: #fbf7f9;
  --muted: #c7bec4;
  --muted-2: #948b91;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --heart: #ef3d73;
  --heart-2: #ff85a7;
  --heart-deep: #a90f42;
  --mint: #58d9a3;
  --blue: #79a8ff;
  --yellow: #f2c45c;
  --danger: #ff647c;
  --radius: 9px;
  --container: 1180px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #18181b 0%, var(--bg) 42%, #0d0d0f 100%);
  background-size: 76px 76px, auto;
}

body::selection {
  color: #fff;
  background: var(--heart);
}

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

code {
  padding: 2px 6px;
  border: 1px solid rgba(240, 63, 116, 0.22);
  border-radius: 6px;
  color: #ffd7e1;
  background: rgba(240, 63, 116, 0.12);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92em;
}

.shell {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(16, 16, 18, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-inner,
.footer-row,
.brand,
.nav,
.top-actions,
.actions {
  display: flex;
  align-items: center;
}

.topbar-inner {
  min-height: 72px;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  gap: 11px;
  font-weight: 900;
  font-size: 1.08rem;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--heart-2), var(--heart) 58%, var(--heart-deep));
  box-shadow:
    0 0 0 4px rgba(240, 63, 116, 0.14),
    0 0 24px rgba(240, 63, 116, 0.32);
  transform: rotate(45deg);
}

.nav {
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line);
}

.top-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffd7e1;
  padding: 9px 11px;
  border: 1px solid rgba(240, 63, 116, 0.28);
  border-radius: 8px;
  background: rgba(240, 63, 116, 0.12);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(255, 133, 167, 0.34);
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--heart), #d91f5c);
  box-shadow: 0 14px 30px rgba(240, 63, 116, 0.28);
}

.button-primary:hover {
  box-shadow: 0 18px 38px rgba(240, 63, 116, 0.36);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.095);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.intro {
  padding: 64px 0 36px;
}

.intro-compact {
  max-width: 860px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--heart-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 900;
}

.kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--heart);
  box-shadow: 0 0 18px rgba(240, 63, 116, 0.5);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  font-size: clamp(2.65rem, 5.8vw, 5.65rem);
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
  line-height: 1.08;
}

h3 {
  font-size: 1.15rem;
}

.lead {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.section {
  padding: 36px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.grid-3,
.grid-2,
.dashboard-layout,
.form-grid,
.stat-row {
  display: grid;
  gap: 14px;
}

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

.grid-2,
.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-layout {
  grid-template-columns: 300px 1fr;
  align-items: start;
}

.stat-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}

.card,
.panel,
.notice,
.guild-link,
.stat {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032)),
    rgba(29, 29, 33, 0.92);
}

.card,
.panel,
.notice,
.stat {
  padding: 20px;
}

.panel {
  box-shadow: var(--shadow);
}

.card,
.guild-link,
.stat {
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.card:hover,
.guild-link:hover,
.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 133, 167, 0.34);
}

.card {
  min-height: 174px;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 34px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--heart), var(--mint));
  opacity: 0.72;
}

.card small {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--heart-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.card p,
.panel p,
.empty-state {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.compact-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.58;
}

.compact-list li {
  position: relative;
  padding-left: 19px;
}

.compact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--mint);
}

.compact-list li + li {
  margin-top: 9px;
}

.stat {
  min-height: 108px;
  background:
    linear-gradient(180deg, rgba(240, 63, 116, 0.12), rgba(255, 255, 255, 0.032)),
    rgba(29, 29, 33, 0.92);
}

.stat strong,
.stat span {
  display: block;
}

.stat strong {
  font-size: 1.28rem;
}

.stat span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.price {
  display: inline-flex;
  margin-top: 14px;
  padding: 9px 12px;
  color: #fff;
  font-weight: 900;
  border-radius: 8px;
  background: rgba(240, 63, 116, 0.18);
  border: 1px solid rgba(240, 63, 116, 0.32);
}

.notice {
  margin: 18px 0;
}

.notice.success {
  border-color: rgba(88, 217, 163, 0.38);
}

.notice.warn {
  border-color: rgba(242, 196, 92, 0.46);
}

.notice.error {
  border-color: rgba(240, 63, 116, 0.48);
}

.guild-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.guild-link {
  display: block;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.guild-link.is-active {
  border-color: rgba(240, 63, 116, 0.55);
  background: rgba(240, 63, 116, 0.13);
}

.guild-link p {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 0.9rem;
}

.field {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #fdf7f9;
  font-weight: 900;
  font-size: 0.92rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #111113;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

input[readonly] {
  color: #ffd7e1;
  border-color: rgba(240, 63, 116, 0.34);
  background: rgba(240, 63, 116, 0.09);
}

.debug-stack {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

textarea {
  min-height: 106px;
  resize: vertical;
}

select[multiple] {
  min-height: 134px;
}

.switches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 140ms ease, background 140ms ease;
}

.check:hover {
  border-color: rgba(255, 133, 167, 0.3);
  background: rgba(255, 255, 255, 0.075);
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--heart);
}

.hint {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.footer {
  margin-top: 50px;
  padding: 28px 0 38px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.1);
}

.footer-row {
  justify-content: space-between;
  gap: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  .intro-compact,
  .stat,
  .card,
  .panel {
    animation: rise-in 420ms ease both;
  }

  .stat:nth-child(2),
  .card:nth-child(2) {
    animation-delay: 60ms;
  }

  .stat:nth-child(3),
  .card:nth-child(3) {
    animation-delay: 120ms;
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 940px) {
  .grid-3,
  .grid-2,
  .dashboard-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stat-row,
  .switches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout > .panel:first-child {
    position: static;
  }
}

@media (min-width: 941px) {
  .dashboard-layout > .panel:first-child {
    position: sticky;
    top: 92px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(calc(100% - 24px), var(--container));
  }

  .topbar-inner,
  .footer-row,
  .section-head {
    align-items: flex-start;
  }

  .topbar-inner {
    flex-direction: column;
    padding: 14px 0;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .top-actions {
    width: 100%;
  }

  .button {
    flex: 1 1 auto;
  }

  .intro {
    padding-top: 42px;
  }

  .stat-row,
  .switches {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.7rem;
  }

  .card,
  .panel,
  .notice,
  .stat {
    padding: 17px;
  }
}
