:root {
  color-scheme: dark;
  --background: #080b0d;
  --surface: #151a1e;
  --surface-soft: #101417;
  --line: #292f34;
  --text: #f4f5f5;
  --muted: #979ea7;
  --faint: #737b84;
  --lime: #c8ff52;
  --lime-ink: #101407;
  --teal: #4fd8c8;
  --danger: #ff796f;
  --page-width: 680px;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #030506;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(200, 255, 82, 0.72);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--page-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  background: var(--background);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: calc(12px + env(safe-area-inset-top)) 24px 12px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.brand span {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.server-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.server-state.ready {
  color: var(--teal);
}

.server-state.failed {
  color: var(--danger);
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent);
}

.screen {
  display: none;
  padding: 0 24px 48px;
}

.screen.active {
  display: block;
  animation: screen-in 180ms ease-out;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  padding: 58px 0 52px;
}

.hero-support,
.profile-heading > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.hero h1,
.profile-heading h1 {
  max-width: 590px;
  margin: 0;
  font-size: clamp(38px, 8vw, 58px);
  line-height: 1.32;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.primary-button,
.secondary-button,
.logout-button {
  min-height: 56px;
  border: 0;
  border-radius: 13px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  margin-top: 42px;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 18px;
}

.primary-button:hover {
  background: #d4ff73;
}

.safety-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.member-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 38px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.member-summary > div {
  display: grid;
  gap: 4px;
}

.member-kicker {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.member-summary strong {
  font-size: 22px;
}

.member-summary div > span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.secondary-button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.recent-section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
}

.section-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.count {
  color: var(--muted);
  font-size: 18px;
}

.refresh-button {
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
}

.recent-list {
  display: grid;
}

.user-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  border-top: 1px solid var(--line);
}

.user-avatar,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1b2616;
  color: var(--lime);
  font-weight: 900;
}

.user-avatar {
  width: 52px;
  height: 52px;
}

.user-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.user-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.user-copy span,
.user-row time {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 420px;
  padding: 82px 16px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state img {
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  object-fit: cover;
}

.empty-state strong {
  font-size: 23px;
  letter-spacing: -0.035em;
}

.empty-state p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.empty-state.compact {
  min-height: 330px;
  padding-top: 80px;
}

.profile-heading {
  padding: 48px 0 34px;
}

.profile-heading h1 {
  font-size: clamp(34px, 7vw, 48px);
}

.profile-heading > span {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.profile-gate {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 52px 28px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.profile-gate[hidden] {
  display: none;
}

.profile-gate img {
  width: 76px;
  height: 76px;
  margin-bottom: 10px;
  border-radius: 18px;
  object-fit: cover;
}

.profile-gate strong {
  font-size: 22px;
}

.profile-gate p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.profile-gate .primary-button {
  margin-top: 18px;
}

.profile-form {
  display: grid;
  gap: 30px;
  padding: 28px 24px 32px;
  border-radius: 20px;
  background: var(--surface);
}

.profile-form[hidden] {
  display: none;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.profile-preview > div:last-child {
  display: grid;
  gap: 6px;
}

.profile-preview strong {
  font-size: 24px;
}

.profile-preview span {
  color: var(--muted);
}

.unavailable-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.unavailable-feature > div {
  display: grid;
  gap: 6px;
}

.unavailable-feature span {
  color: var(--muted);
  font-size: 14px;
}

.unavailable-feature em {
  color: var(--lime);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.field {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.field > span,
.field legend {
  color: #cbd0d5;
  font-size: 15px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 56px;
  border: 1px solid #343b41;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 15px 16px;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.6;
}

.field small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field textarea + small {
  justify-self: end;
}

.gender-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gender-options label {
  min-width: 0;
}

.gender-options input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.gender-options span {
  display: grid;
  min-height: 56px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-soft);
  font-weight: 800;
}

.gender-options input:checked + span {
  background: var(--lime);
  color: var(--lime-ink);
}

.gender-options input:focus-visible + span {
  outline: 3px solid rgba(200, 255, 82, 0.72);
  outline-offset: 3px;
}

.profile-form .primary-button {
  margin-top: 4px;
}

.logout-button {
  background: transparent;
  color: var(--danger);
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: max(0px, calc((100vw - var(--page-width)) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - var(--page-width)) / 2));
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(76px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(8, 11, 13, 0.97);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-weight: 800;
}

.bottom-nav button.active {
  color: var(--lime);
}

.nav-mark {
  justify-self: center;
  width: 28px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.58;
}

.bottom-nav button.active .nav-mark {
  width: 38px;
  opacity: 1;
}

.loading-layer {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: rgba(3, 5, 6, 0.8);
  backdrop-filter: blur(8px);
}

.loading-layer[hidden] {
  display: none;
}

.loading-layer p {
  margin: 0;
  color: var(--muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--line);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.notice {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 20px;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 18px;
  border: 1px solid #3b4349;
  border-radius: 12px;
  background: #1d2327;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  color: var(--text);
  line-height: 1.5;
}

.notice[hidden] {
  display: none;
}

noscript {
  display: block;
  padding: 20px;
  background: var(--danger);
  color: #140302;
  font-weight: 800;
  text-align: center;
}

@media (min-width: 760px) {
  body {
    background:
      linear-gradient(90deg, #030506, #090d0f 30%, #090d0f 70%, #030506);
  }

  .app-shell {
    border-right: 1px solid #161b1e;
    border-left: 1px solid #161b1e;
    box-shadow: 0 0 90px rgba(0, 0, 0, 0.42);
  }

  .screen {
    padding-right: 44px;
    padding-left: 44px;
  }

  .topbar {
    padding-right: 44px;
    padding-left: 44px;
  }
}

@media (max-width: 420px) {
  .screen {
    padding-right: 20px;
    padding-left: 20px;
  }

  .topbar {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .profile-form {
    margin-right: -4px;
    margin-left: -4px;
    padding-right: 18px;
    padding-left: 18px;
  }
}

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