:root {
  color-scheme: dark;
  --bg: #101312;
  --surface: #171b1a;
  --surface-2: #202624;
  --line: #2c3431;
  --text: #f3f7f4;
  --muted: #9ca8a1;
  --green: #9cff2e;
  --green-2: #58ff82;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 50% -12%, rgba(156, 255, 46, 0.18), transparent 34%), linear-gradient(180deg, #151917 0%, var(--bg) 42%);
  color: var(--text);
  font-family: Inter, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px 104px;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow, .hero-kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 8vw, 2.15rem); line-height: 1.08; }
h2 { font-size: 1.25rem; line-height: 1.35; }
h3 { margin-bottom: 0; font-size: 1rem; }

.profile-chip {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(156, 255, 46, 0.4);
  border-radius: 18px;
  background: rgba(156, 255, 46, 0.1);
  box-shadow: 0 0 24px rgba(156, 255, 46, 0.12);
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 800;
}

.screen { display: none; }
.screen.is-active { display: block; }

.hero-panel, .match-summary, .profile-form, .auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(32, 38, 36, 0.96), rgba(19, 23, 22, 0.96));
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  min-height: 168px;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -24px -36px 38%;
  height: 92px;
  background: linear-gradient(90deg, rgba(156, 255, 46, 0.6), transparent 72%), repeating-linear-gradient(135deg, rgba(156, 255, 46, 0.24) 0 2px, transparent 2px 12px);
  transform: skewY(-8deg);
}

.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h2 { max-width: 14rem; margin-bottom: 0; }

.hero-stat { display: grid; gap: 2px; justify-items: end; text-align: right; }
.hero-stat strong { color: var(--green); font-size: 1.7rem; line-height: 1; }
.hero-stat span { max-width: 5.5rem; color: var(--muted); font-size: 0.76rem; line-height: 1.3; }

.filter-row {
  display: flex;
  gap: 8px;
  margin: 18px -18px 16px;
  padding: 0 18px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-button {
  flex: 0 0 auto;
  min-width: 66px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}
.filter-button.is-active { border-color: transparent; background: var(--green); color: #101312; }

.club-list, .match-list { display: grid; gap: 12px; }

.club-card, .member-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 26, 0.9);
  padding: 16px;
}

.club-top, .member-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.club-card h3, .member-card h3 { margin: 0 0 6px; }
.club-meta, .member-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

.pill {
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.pill.hot, .score-badge { background: rgba(156, 255, 46, 0.14); color: var(--green); }

.club-description, .member-description, .match-summary p { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.match-summary { padding: 20px; margin-bottom: 20px; }
.match-summary h2 { margin-bottom: 8px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 10px;
}
.section-head span { color: var(--muted); font-size: 0.8rem; font-weight: 800; }

.auth-panel { display: grid; gap: 16px; margin-bottom: 18px; padding: 18px; }
.auth-panel[hidden] { display: none; }
.auth-form { display: grid; gap: 14px; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.header-actions { display: grid; justify-items: end; gap: 8px; }
.ghost-button, .secondary-button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 0.8rem; font-weight: 800; }
.secondary-button { min-height: 52px; }
.profile-form { display: grid; gap: 18px; padding: 18px; }
.field-group { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.field-group > span, legend { color: var(--text); font-size: 0.9rem; font-weight: 800; }

input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111514;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(156, 255, 46, 0.12); }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111514;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}
.choice-card input:checked + span { border-color: var(--green); background: rgba(156, 255, 46, 0.14); color: var(--green); }

.save-button { min-height: 52px; border-radius: 8px; background: var(--green); color: #101312; font-weight: 900; }
.save-status { min-height: 22px; margin: -4px 0 0; color: var(--green-2); font-size: 0.86rem; font-weight: 700; line-height: 1.45; }
.save-status.is-error { color: #ff8a8a; }
.empty-state { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); margin: 0; padding: 16px; line-height: 1.5; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(calc(100% - 28px), 448px);
  min-height: 72px;
  padding: 8px;
  border: 1px solid rgba(156, 255, 46, 0.18);
  border-radius: 18px;
  background: rgba(16, 19, 18, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.nav-button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}
.nav-button.is-active { background: rgba(156, 255, 46, 0.14); color: var(--green); }

.nav-icon { position: relative; display: block; width: 20px; height: 20px; }
.nav-icon-home::before { content: ""; position: absolute; inset: 5px 3px 3px; border: 2px solid currentColor; border-top: 0; }
.nav-icon-home::after { content: ""; position: absolute; left: 4px; top: 2px; width: 12px; height: 12px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.nav-icon-match::before, .nav-icon-match::after { content: ""; position: absolute; top: 3px; width: 9px; height: 14px; border: 2px solid currentColor; border-radius: 999px; }
.nav-icon-match::before { left: 1px; transform: rotate(-20deg); }
.nav-icon-match::after { right: 1px; transform: rotate(20deg); }
.nav-icon-profile::before { content: ""; position: absolute; left: 6px; top: 2px; width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }
.nav-icon-profile::after { content: ""; position: absolute; left: 3px; bottom: 2px; width: 14px; height: 8px; border: 2px solid currentColor; border-radius: 999px 999px 0 0; }

@media (max-width: 360px) {
  .app-shell { padding-inline: 14px; }
  .choice-grid { grid-template-columns: 1fr; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-stat { justify-items: start; text-align: left; }
}
