:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #f8f6f4;
  --muted: #a6a1aa;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(18, 18, 20, 0.76);
  --pink: #ff3b9d;
  --lime: #b8ff00;
  --cyan: #22c8ff;
  --violet: #a55cff;
  --orange: #ffb02e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 59, 157, 0.24), transparent 25rem),
    radial-gradient(circle at 90% 24%, rgba(184, 255, 0, 0.16), transparent 20rem),
    linear-gradient(180deg, #050505 0%, #09090a 58%, #040405 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 8px 96px;
}

.top-bar {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: 40px 1fr auto 38px;
  gap: 9px;
  align-items: center;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(32, 32, 35, 0.86), rgba(6, 6, 7, 0.76));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  aspect-ratio: 1;
  border: 2px solid var(--pink);
  border-radius: 13px;
  color: var(--pink);
  font-size: 18px;
  font-weight: 900;
  transform: rotate(-8deg);
  text-shadow: 0 0 18px rgba(255, 59, 157, 0.7);
}

.micro {
  margin: 0;
  color: var(--pink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}

.count-pill {
  min-width: 66px;
  padding: 4px 9px;
  border-left: 1px solid rgba(255, 59, 157, 0.58);
  text-align: right;
}

.count-pill strong {
  display: block;
  color: var(--pink);
  font-size: 28px;
  line-height: 0.9;
  text-shadow: 0 0 22px rgba(255, 59, 157, 0.54);
}

.count-pill span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  padding: 20px 9px 10px;
}

.hero-icons {
  position: absolute;
  inset: 7px 4px auto auto;
  display: grid;
  gap: 12px;
  color: var(--lime);
  font-size: 24px;
  text-align: center;
  text-shadow: 0 0 20px rgba(184, 255, 0, 0.5);
}

.script {
  margin: 0 0 -8px;
  color: var(--pink);
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(47px, 14vw, 62px);
  line-height: 0.8;
  transform: rotate(-4deg);
  text-shadow: 0 0 26px rgba(255, 59, 157, 0.34);
}

.hero h2 {
  margin: 0;
  max-width: 356px;
  font-size: clamp(43px, 12vw, 54px);
  font-weight: 1000;
  line-height: 0.84;
  white-space: nowrap;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.hero h2::first-line {
  color: var(--ink);
}

.tagline {
  width: fit-content;
  margin: 7px 0 0 38px;
  color: var(--ink);
  font-family: "Bradley Hand ITC", "Segoe Print", cursive;
  font-size: 20px;
  line-height: 1.1;
  transform: rotate(-2deg);
}

.tagline::after {
  display: block;
  width: 82%;
  height: 4px;
  margin-top: 3px;
  content: "";
  background: linear-gradient(90deg, var(--pink), var(--lime));
  transform: skewX(-18deg);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 10px;
  margin: 2px 8px 9px;
}

.search-box,
.icon-button,
.filter,
.spotlight,
.group-card,
.bottom-nav {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.search-box {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 49px;
  padding: 0 13px;
  border-radius: 18px;
  color: var(--pink);
  font-size: 28px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 18px;
  font-weight: 750;
}

.search-box input::placeholder {
  color: #807b84;
}

.icon-button {
  height: 49px;
  border-radius: 18px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 1000;
}

.filter-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 8px 9px;
  scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.filter.active {
  border-color: rgba(255, 59, 157, 0.65);
  color: var(--pink);
  box-shadow: 0 0 22px rgba(255, 59, 157, 0.18);
}

.spotlight {
  display: none;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-bottom: 22px;
  padding: 12px 15px;
  border-radius: 22px;
  border-color: rgba(34, 200, 255, 0.28);
}

.spotlight-label {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spotlight strong {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.groups {
  display: grid;
  gap: 14px;
  padding: 0 8px;
}

.group-head {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin: 0 0 7px;
}

.group-icon {
  color: var(--group-color);
  font-size: 22px;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--group-color), transparent 46%));
}

.group-title {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
}

.group-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--group-color);
  border-radius: 9px;
  color: var(--group-color);
  font-size: 14px;
  font-weight: 1000;
}

.group-note {
  margin-left: auto;
  color: #928d95;
  font-family: "Bradley Hand ITC", "Segoe Print", cursive;
  font-size: 16px;
  transform: rotate(-3deg);
}

.group-card {
  overflow: hidden;
  border-radius: 13px;
  border-color: rgba(255, 255, 255, 0.11);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 47px;
  padding: 5px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.row:first-child {
  border-top: 0;
}

.row::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--group-color);
  opacity: 0.9;
}

.num {
  color: var(--group-color);
  font-size: 20px;
  font-weight: 1000;
  text-align: center;
}

.person {
  min-width: 0;
}

.name {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.13;
}

.from {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: nowrap;
}

.tag {
  max-width: 78px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: nowrap;
}

.tag.legend {
  color: var(--lime);
}

.tag.pending {
  color: var(--violet);
}

.tag.retired {
  color: #8c8990;
}

.tag.icon {
  color: var(--pink);
}

.tag.crew {
  color: var(--cyan);
}

.tag.chaos {
  color: var(--orange);
}

.row.retired .name {
  color: #8d8991;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.65);
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 2px;
}

.stat {
  min-height: 78px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.stat strong {
  display: block;
  color: var(--lime);
  font-size: 28px;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empty {
  padding: 30px 14px;
  color: var(--muted);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 414px;
  min-height: 70px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
}

.nav-item {
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item span {
  display: block;
  color: currentColor;
  font-size: 26px;
  line-height: 1;
}

.nav-item.active {
  color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 59, 157, 0.2), rgba(255, 59, 157, 0.035));
  box-shadow: inset 0 0 0 1px rgba(255, 59, 157, 0.25);
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 700px) {
  body {
    display: grid;
    place-items: start center;
  }

  .phone-shell {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .brand-mark,
  .hero-icons span,
  .spotlight {
    animation: pulseGlow 3.8s ease-in-out infinite;
  }

  .hero-icons span:nth-child(2) {
    animation-delay: 0.8s;
  }

  .hero-icons span:nth-child(3) {
    animation-delay: 1.4s;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28);
  }
}
