:root {
  --bg: #313338;
  --bg-soft: #2b2d31;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --line: #3f4147;
  --card: #2b2d31;
  --card-alt: #232428;
  --accent: #5865f2;
  --accent-strong: #4752c4;
  --chip: #3a3f45;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  --font-ui: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: linear-gradient(180deg, #313338 0%, #2f3136 100%);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1120px;
  margin: 0 auto;
  padding:
    calc(28px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(56px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

.home-page {
  max-width: 1240px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  gap: 24px;
  padding: 18px 22px 24px;
  background:
    radial-gradient(1000px 320px at 15% 100%, rgba(255, 255, 255, 0.18), transparent 58%),
    linear-gradient(120deg, #49a8dd 0%, #5d97dd 44%, #8993e0 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.home-hero::before,
.home-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.home-hero::before {
  right: -150px;
  bottom: -210px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 34% 34%,
    rgba(255, 255, 255, 0.56) 0%,
    rgba(255, 255, 255, 0.3) 36%,
    rgba(255, 255, 255, 0.06) 66%,
    transparent 76%
  );
}

.home-hero::after {
  left: -90px;
  right: -90px;
  bottom: -120px;
  height: 280px;
  background:
    radial-gradient(220px 110px at 12% 54%, rgba(255, 255, 255, 0.42), transparent 75%),
    radial-gradient(260px 120px at 34% 55%, rgba(255, 255, 255, 0.38), transparent 75%),
    radial-gradient(210px 96px at 60% 48%, rgba(255, 255, 255, 0.34), transparent 75%),
    radial-gradient(260px 120px at 85% 58%, rgba(255, 255, 255, 0.36), transparent 75%);
  opacity: 0.88;
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero .brand-mark {
  background: transparent;
  box-shadow: none;
}

.home-hero .brand h1 {
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.home-hero .header-actions .add-server-btn.secondary {
  background: rgba(24, 38, 74, 0.22);
  border-color: rgba(255, 255, 255, 0.42);
}

.home-hero-content {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding-top: 18px;
}

.hero-kicker {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(1.6rem, 5vw, 3.15rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 8px 22px rgba(30, 54, 125, 0.28);
}

.hero-subline {
  margin: 0;
  color: rgba(244, 247, 255, 0.88);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 600;
}

.home-search-wrap {
  width: 100%;
  max-width: 560px;
  gap: 0;
}

.hero-filters {
  width: min(100%, 900px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.hero-filters select,
.hero-filters input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid rgba(17, 25, 44, 0.2);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 0.9rem;
  color: #1f2430;
  background: rgba(249, 250, 254, 0.95);
}

.hero-filters select:focus,
.hero-filters input:not([type="checkbox"]):focus {
  outline: 2px solid rgba(88, 101, 242, 0.3);
  border-color: rgba(63, 72, 160, 0.35);
}

.hero-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(17, 25, 44, 0.2);
  border-radius: 10px;
  background: rgba(249, 250, 254, 0.95);
  color: #1f2430;
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-filter-toggle input {
  width: 15px;
  height: 15px;
  accent-color: #5865f2;
}

.hero-filter-clear {
  border: 1px solid rgba(17, 25, 44, 0.2);
  border-radius: 10px;
  background: rgba(249, 250, 254, 0.95);
  color: #1f2430;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.hero-filter-clear:hover {
  background: rgba(237, 241, 253, 0.98);
}

.hero-search-field {
  position: relative;
}

.home-search-wrap .hero-search-field input {
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(17, 25, 44, 0.22);
  background: rgba(249, 250, 254, 0.96);
  color: #1f2430;
  font-size: 1.08rem;
  font-weight: 700;
  padding: 0 58px 0 20px;
}

.home-search-wrap .hero-search-field input::placeholder {
  color: #81889a;
}

.home-search-wrap .hero-search-field input:focus {
  outline: 2px solid rgba(88, 101, 242, 0.32);
  border-color: rgba(63, 72, 160, 0.34);
}

.hero-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-search-btn:hover {
  background: rgba(37, 42, 57, 0.08);
}

.hero-search-btn:focus-visible {
  outline: 2px solid rgba(88, 101, 242, 0.32);
}

.hero-search-icon {
  font-size: 1.2rem;
  color: #252a39;
  opacity: 0.86;
  line-height: 1;
  pointer-events: none;
}

.home-results {
  margin-top: 12px;
  margin-bottom: 26px;
}

.site-footer {
  margin-top: auto;
  padding-top: 30px;
}

.site-footer::before {
  content: "";
  display: block;
  border-top: 1px solid rgba(151, 162, 196, 0.28);
}

.site-footer-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.site-footer-links a {
  color: #d8def4;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.16s ease;
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
  color: #ffffff;
}

.header {
  display: grid;
  gap: 16px;
  background: linear-gradient(180deg, #2b2d31, #282a2e);
  border: 1px solid #3d4045;
  border-radius: 22px;
  padding: 20px;
  color: #fff;
  box-shadow: var(--shadow);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
  display: none;
}

.brand-mark.has-logo .brand-logo {
  display: block;
}

.brand-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(88, 101, 242, 0.95), rgba(88, 101, 242, 0.76));
}

.brand-mark.has-logo .brand-fallback {
  display: none;
}

.header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2.05rem);
  letter-spacing: 0.01em;
}

.server-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-counters {
  color: rgba(241, 243, 255, 0.88);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.header p {
  margin: 4px 0 0;
  color: rgba(242, 243, 245, 0.78);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-server-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #6070ff, #5865f2);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 18px rgba(88, 101, 242, 0.36);
}

.add-server-btn:hover {
  background: linear-gradient(180deg, #5d6af0, #4752c4);
  transform: translateY(-1px);
}

.add-server-btn.disabled {
  pointer-events: none;
  background: #99a4d7;
}

.add-server-btn.secondary {
  background: #3b3d44;
  border: 1px solid #484b52;
  box-shadow: none;
}

.add-server-btn.secondary:hover {
  background: #454850;
}

.controls {
  display: grid;
  gap: 6px;
}

.controls label {
  color: rgba(242, 243, 245, 0.82);
  font-size: 0.86rem;
  font-weight: 700;
}

.controls input,
.modal-card input,
.modal-card select,
.modal-card textarea {
  width: 100%;
  border: 1px solid #45484f;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: #1f2023;
}

.controls input {
  border: 1px solid #4b4f57;
  color: #fff;
  background: #25272b;
}

.controls input::placeholder {
  color: rgba(242, 243, 245, 0.48);
}

.controls input:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
  outline: 2px solid rgba(88, 101, 242, 0.28);
  border-color: var(--accent);
}

.result-count {
  margin: 14px 0 10px;
  color: #b5bac1;
  min-height: 1.2em;
}

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

.server-card {
  background: linear-gradient(180deg, #2b2d31, #282a2e);
  border: 1px solid #3d4046;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.server-card.clickable {
  cursor: pointer;
}

.server-card.clickable:focus-visible {
  outline: 2px solid rgba(88, 101, 242, 0.55);
  outline-offset: 2px;
}

.server-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  border-color: #4a4d55;
}

.home-results .server-grid {
  gap: 18px;
}

.home-server-card {
  overflow: hidden;
  border-radius: 20px;
  padding: 0 16px 16px;
  background: linear-gradient(180deg, #2a3046 0%, #24293b 100%);
  border: 1px solid #3a4468;
  box-shadow: 0 18px 34px rgba(8, 11, 28, 0.48);
}

.home-server-card:hover {
  border-color: #4b5787;
  box-shadow: 0 20px 38px rgba(8, 11, 28, 0.52);
}

.home-server-card .card-head {
  margin: 0 -16px;
  padding: 16px 16px 12px;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(92deg, #191f31 0%, #22283d 100%);
  border-bottom: 1px solid rgba(148, 166, 218, 0.2);
}

.home-server-card .avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: -8px;
  border: 0;
  box-shadow: none;
}

.home-server-card .title-wrap {
  display: grid;
  gap: 6px;
}

.home-server-card .home-card-activity {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9ca8c8;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
}

.home-server-card .home-card-membersline {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  color: #c7d2f2;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.home-card-members-text {
  display: inline-block;
}

.inline-verified-badge {
  flex-shrink: 0;
}

.home-inline-verified-badge {
  padding: 2px 7px;
  font-size: 0.62rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.home-card-presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #35d072;
  box-shadow: 0 0 0 4px rgba(53, 208, 114, 0.22);
}

.home-card-members {
  color: #f3f6ff;
  font-size: 1.22rem;
  font-weight: 900;
}

.home-card-age {
  color: #97a4c8;
  font-size: 0.86rem;
}

.home-server-card .name-row {
  align-items: flex-start;
  gap: 10px;
}

.home-server-card h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.85rem);
  line-height: 1.16;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.home-server-card .name-badge {
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.home-server-card .name-badges {
  margin-top: 2px;
}

.home-server-card .tags {
  margin-top: 14px;
  gap: 8px;
}

.home-server-card .tag {
  background: #242b43;
  border: 1px solid #3b466b;
  color: #f4f6ff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-server-card .description {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.58;
  color: #eff2ff;
}

.home-server-card .card-description-clamped {
  -webkit-line-clamp: 7;
}

.home-server-card .description-link {
  color: #d2dcff;
}

.home-server-card .description-link:hover {
  color: #eff2ff;
}

.home-server-card .description-toggle {
  margin-top: 8px;
  color: #c9d1ff;
}

.home-server-card .description-toggle:hover {
  color: #e5e9ff;
}

.home-server-card .card-footer {
  margin-top: 18px;
}

.home-server-card .home-join-link {
  min-width: 220px;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #6f82ff, #4e61e8);
  box-shadow: 0 12px 22px rgba(80, 98, 233, 0.45);
}

.home-server-card .home-join-link:hover {
  background: linear-gradient(180deg, #7c8dff, #5a6cf0);
}

.home-server-card .home-join-link.disabled {
  background: linear-gradient(180deg, #4a5576, #3c4560);
  box-shadow: none;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  --av-a: #5f78ff;
  --av-b: #3f56ea;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.avatar.fallback {
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--av-a), var(--av-b));
  box-shadow: 0 10px 22px rgba(24, 33, 88, 0.48);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
  display: block;
}

.title-wrap {
  min-width: 0;
  flex: 1;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.name-row h2 {
  flex: 1;
  min-width: 0;
}

.server-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-server-card .name-row h2 {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.home-server-card .name-row .name-badges {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 120px;
  row-gap: 4px;
}

.name-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0;
}

.name-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.name-badge.partnership {
  color: #9fe0ff;
  background: rgba(44, 137, 191, 0.3);
  border: 1px solid rgba(87, 173, 224, 0.45);
}

.name-badge.verified {
  color: #b9ffd8;
  background: rgba(55, 153, 96, 0.28);
  border: 1px solid rgba(89, 184, 129, 0.4);
}

.meta {
  margin: 4px 0 0;
  color: #b5bac1;
  font-size: 0.83rem;
}

.category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--chip);
  color: #d3d7de;
}

.state-active {
  color: #87f0b2;
  background: rgba(40, 122, 74, 0.28);
}

.state-pending {
  color: #f8d47a;
  background: rgba(131, 98, 20, 0.28);
}

.state-rejected {
  color: #ffc0cb;
  background: rgba(122, 38, 57, 0.32);
}

.description {
  margin: 11px 0 0;
  font-size: 0.9rem;
  color: #dbdee1;
}

.description-link {
  color: #aeb9ff;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  word-break: break-word;
}

.description-link:hover {
  color: #c5ceff;
}

.card-description {
  white-space: pre-wrap;
}

.card-description-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.description-toggle {
  margin-top: 6px;
  margin-right: auto;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #aeb9ff;
  background: transparent;
  cursor: pointer;
}

.description-toggle:hover {
  color: #c0c8ff;
}

.tags {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.invite-guide {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #b5bac1;
}

.tag {
  background: #3a3f45;
  color: #dbdee1;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 600;
}

.card-footer {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-footer.single-action {
  justify-content: flex-end;
}

.home-join-footer {
  justify-content: center !important;
}

.home-join-link {
  min-width: 146px;
  text-align: center;
}

.dashboard-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-analytics {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-analytics span {
  background: #333840;
  border: 1px solid #454b55;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  color: #d9dde2;
}

.link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(180deg, #5f6dff, #5865f2);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease;
}

.link:hover {
  background: linear-gradient(180deg, #5864e2, #4752c4);
}

.link.link-secondary {
  background: #3a3f45;
  color: #f2f3f5;
}

.link.link-secondary:hover {
  background: #444952;
}

.link.link-danger {
  background: linear-gradient(180deg, #db4f6b, #c13e59);
  color: #fff2f4;
}

.link.link-danger:hover {
  background: linear-gradient(180deg, #cf4560, #a9344c);
}

.link.disabled {
  color: #cbd0e6;
  background: #495272;
  pointer-events: none;
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-page {
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-card {
  background: linear-gradient(180deg, #2b2d31, #282a2e);
  border: 1px solid #3d4047;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.legal-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.legal-card h3 {
  margin: 16px 0 8px;
  font-size: 1rem;
  color: #f0f2fb;
}

.legal-card p,
.legal-card li {
  margin: 0;
  color: #d9deee;
  line-height: 1.55;
}

.legal-card p + p,
.legal-card p + ul,
.legal-card ul + p,
.legal-card ul + ul {
  margin-top: 10px;
}

.legal-card ul {
  margin: 0;
  padding-left: 18px;
}

.legal-card .legal-note {
  color: #b9c2de;
  font-size: 0.9rem;
}

.dashboard-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-user img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dashboard-user strong {
  display: block;
}

.dashboard-user p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: rgba(242, 243, 245, 0.8);
}

.dashboard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #2b2d31;
  border: 1px solid #3d4047;
  border-radius: 14px;
  padding: 12px;
}

.dashboard-controls p {
  margin: 0;
  color: #b5bac1;
}

.dashboard-controls code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.next-step {
  background: #2b2d31;
  border: 1px solid #3d4047;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.next-step h3 {
  margin: 0;
  font-family: var(--font-display);
}

.next-step p {
  margin: 0;
  color: #dbdee1;
}

.detail-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.detail-header,
.server-focus-card {
  width: min(100%, 980px);
}

.detail-header {
  padding: 8px 10px;
  border-radius: 16px;
}

.detail-header .brand h1 {
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-header .brand p {
  margin-top: 2px;
  font-size: 0.74rem;
  color: rgba(242, 243, 245, 0.66);
}

.detail-header .add-server-btn.secondary {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.92rem;
}

.server-focus-card {
  --server-focus-bg-image: none;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  border: 1px solid #3f434b;
  border-radius: 16px;
  padding: 10px;
  background:
    radial-gradient(640px 280px at 0% 100%, rgba(88, 101, 242, 0.16), transparent 68%),
    linear-gradient(180deg, #2b2d31 0%, #25272b 100%);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
}

.server-focus-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--server-focus-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.server-focus-card.has-custom-bg::before {
  opacity: 0.34;
}

.server-focus-card::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -220px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(88, 101, 242, 0.2), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.server-focus-card > * {
  position: relative;
  z-index: 1;
}

.server-focus-main {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.server-focus-avatar {
  --av-a: #5f78ff;
  --av-b: #3f56ea;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.server-focus-avatar.fallback {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--av-a), var(--av-b));
  box-shadow: 0 10px 28px rgba(51, 65, 166, 0.35);
}

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

.server-focus-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.server-focus-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-focus-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5865f2, #6d7cff);
  color: #ffffff;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(88, 101, 242, 0.32);
}

.counter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.counter-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.counter-status-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  font-size: 0.6rem;
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.server-focus-name {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.1vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: 0.005em;
}

.server-focus-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-name-badges {
  gap: 8px;
}

.detail-name-badges .name-badge {
  padding: 4px 10px;
  font-size: 0.76rem;
}

.server-focus-tags {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tag {
  border: 1px solid #4b5058;
  background: #2e3136;
  color: #f2f3f5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 10px;
}

.server-focus-description {
  margin: 2px 0 0;
  color: #dbdee1;
  font-size: 0.98rem;
  line-height: 1.52;
  white-space: pre-wrap;
}

.server-focus-join-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 360px);
  margin-inline: auto;
  text-align: center;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: clamp(0.96rem, 2vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(180deg, #6070ff, #5865f2);
  box-shadow: 0 12px 24px rgba(88, 101, 242, 0.34);
  transition: background 0.16s ease, transform 0.16s ease;
}

.server-focus-join-btn:hover {
  background: linear-gradient(180deg, #5d6af0, #4752c4);
  transform: translateY(-1px);
}

.server-focus-join-btn.disabled {
  pointer-events: none;
  background: #495272;
  box-shadow: none;
  color: #d0d6ef;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 9, 15, 0.72);
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    calc(16px + var(--safe-top))
    calc(16px + var(--safe-right))
    calc(16px + var(--safe-bottom))
    calc(16px + var(--safe-left));
}

.modal-card {
  width: min(560px, 96vw);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #2b2d31;
  border-radius: 16px;
  border: 1px solid #3d4047;
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
}

.modal-card form {
  display: grid;
  gap: 10px;
}

.modal-card label {
  color: #b5bac1;
  font-size: 0.86rem;
  font-weight: 700;
}

.modal-card textarea {
  min-height: 140px;
  resize: vertical;
}

.toggle-grid {
  margin-top: 2px;
  display: grid;
  gap: 8px;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #dbdee1;
}

.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #5865f2;
}

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: #ff8f8f;
  font-size: 0.86rem;
}

.modal-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.hidden {
  display: none;
}

@media (max-width: 1024px) {
  .page {
    max-width: 980px;
    padding:
      calc(24px + var(--safe-top))
      calc(18px + var(--safe-right))
      calc(52px + var(--safe-bottom))
      calc(18px + var(--safe-left));
  }

  .home-page {
    max-width: 1040px;
  }

  .header {
    padding: 18px;
  }

  .home-hero {
    min-height: 308px;
    padding: 16px 18px 22px;
  }

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

  .detail-header,
  .server-focus-card {
    width: min(100%, 940px);
  }
}

@media (max-width: 760px) {
  .page {
    padding:
      calc(16px + var(--safe-top))
      calc(12px + var(--safe-right))
      calc(44px + var(--safe-bottom))
      calc(12px + var(--safe-left));
  }

  .header {
    border-radius: 14px;
    padding: 14px;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .add-server-btn {
    flex: 1;
  }

  .dashboard-top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .dashboard-top-actions .add-server-btn {
    flex: 1 1 auto;
  }

  .dashboard-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-controls .add-server-btn {
    width: 100%;
  }

  .dashboard-controls p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .add-server-btn,
  .link {
    min-height: 44px;
  }

  .controls input,
  .modal-card input,
  .modal-card select,
  .modal-card textarea {
    font-size: 16px;
  }

  .modal {
    place-items: end center;
    padding:
      calc(10px + var(--safe-top))
      calc(8px + var(--safe-right))
      calc(8px + var(--safe-bottom))
      calc(8px + var(--safe-left));
  }

  .modal-card {
    width: min(680px, 100%);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-actions .add-server-btn {
    width: 100%;
  }

  .card-footer {
    flex-wrap: wrap;
  }

  .dashboard-card-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .dashboard-card-actions .link {
    flex: 1 1 calc(50% - 4px);
  }

  .home-hero {
    min-height: 280px;
    padding: 14px;
  }

  .home-hero-content {
    padding-top: 8px;
    gap: 8px;
  }

  .hero-kicker {
    line-height: 1.15;
  }

  .home-search-wrap .hero-search-field input {
    height: 52px;
    font-size: 1rem;
  }

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

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

  .home-server-card {
    border-radius: 18px;
    padding: 0 12px 14px;
  }

  .home-server-card .card-head {
    margin: 0 -12px;
    padding: 14px 12px 11px;
  }

  .home-server-card .avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    margin-top: -6px;
  }

  .home-card-members {
    font-size: 1.04rem;
  }

  .home-server-card h2 {
    font-size: clamp(1.1rem, 5.2vw, 1.46rem);
  }

  .home-server-card .home-join-link {
    min-width: 190px;
    padding: 10px 18px;
    font-size: 0.96rem;
  }

  .home-results {
    margin-bottom: 20px;
  }

  .detail-header .header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .server-focus-card {
    gap: 12px;
    border-radius: 16px;
    padding: 14px 14px 12px;
  }

  .server-focus-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .server-focus-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin: 0 auto;
  }

  .server-focus-top {
    justify-content: center;
  }

  .server-focus-pill {
    flex-wrap: wrap;
    justify-content: center;
  }

  .server-focus-name {
    font-size: clamp(1.45rem, 7vw, 2rem);
    text-align: center;
  }

  .server-focus-name-row {
    justify-content: center;
  }

  .detail-name-badges {
    justify-content: center;
  }

  .server-focus-tags {
    justify-content: center;
  }

  .server-focus-description {
    font-size: 1rem;
    line-height: 1.55;
  }

  .server-focus-join-btn {
    width: 100%;
    font-size: 1.02rem;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .hero-kicker {
    font-size: clamp(1.45rem, 9vw, 2.1rem);
  }

  .home-search-wrap .hero-search-field input {
    height: 50px;
    padding-left: 16px;
    padding-right: 52px;
  }

  .hero-filters {
    grid-template-columns: 1fr;
  }

  .home-server-card .tag {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .server-focus-pill {
    font-size: 0.84rem;
    gap: 8px;
    padding: 6px 10px;
  }

  .dashboard-card-actions .link {
    flex-basis: 100%;
  }
}

@media (hover: none) and (pointer: coarse) {
  .server-card:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    border-color: #3d4046;
  }

  .add-server-btn:hover,
  .link:hover,
  .server-focus-join-btn:hover {
    transform: none;
  }
}
