:root {
  color-scheme: dark;
  --background: #12131c;
  --surface: #1a1c28;
  --surface-elevated: #232636;
  --surface-hover: #2b2f42;
  --border: #2e3242;
  --border-strong: #3c4155;
  --text: #f4f5fa;
  --text-secondary: #aeb3c2;
  --text-muted: #7e8496;
  --primary: #e94560;
  --primary-hover: #f25c74;
  --primary-active: #c8324b;
  --primary-surface: rgba(233, 69, 96, 0.14);
  --success: #3bc47e;
  --success-surface: rgba(59, 196, 126, 0.14);
  --warning: #f0a93b;
  --warning-surface: rgba(240, 169, 59, 0.14);
  --error: #f0524b;
  --error-surface: rgba(240, 82, 75, 0.14);
  --info: #3da9fc;
  --info-surface: rgba(61, 169, 252, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img,
svg {
  display: block;
}

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

:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 3px;
}

.public-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.public-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.public-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.btn {
  display: inline-flex;
  min-width: 64px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-tonal {
  background: var(--primary-surface);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  background: var(--surface-hover);
  border-color: transparent;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-icon,
.store-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.store-icon {
  width: 24px;
  height: 24px;
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
  }

  .btn-primary:active:not(:disabled) {
    background: var(--primary-active);
  }

  .btn-outline:hover:not(:disabled) {
    background: var(--surface-elevated);
    border-color: var(--text-muted);
  }

  .btn-tonal:hover:not(:disabled) {
    background: rgba(233, 69, 96, 0.22);
  }

  .public-brand:hover {
    color: var(--primary-hover);
  }
}

.muted {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.divider {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.section-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.msg {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.msg.success {
  display: block;
  background: var(--success-surface);
  color: var(--success);
}

.msg.error {
  display: block;
  background: var(--error-surface);
  color: var(--error);
}

.status-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

.status-accepted {
  background: var(--success-surface);
  border-color: rgba(59, 196, 126, 0.3);
  color: var(--success);
}

.status-pending {
  background: var(--info-surface);
  border-color: rgba(61, 169, 252, 0.3);
  color: var(--info);
}

.status-rejected {
  background: var(--error-surface);
  border-color: rgba(240, 82, 75, 0.3);
  color: var(--error);
}

.closed {
  padding: 16px;
  background: var(--surface-elevated);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.store-links--stacked {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
}

.store-links--stacked .btn {
  width: 100%;
}

.sport-svg {
  display: block;
  width: 24px;
  height: 24px;
  background: var(--primary);
  -webkit-mask-image: var(--sport-icon);
  mask-image: var(--sport-icon);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.sport-fallback {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.landing-header {
  padding: 20px 0;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero {
  padding: 48px 0 56px;
  text-align: center;
}

.hero-app-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  object-fit: contain;
}

.hero h1 {
  max-width: 760px;
  margin: 0 auto 16px;
  color: var(--text);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
}

.hero-subtitle {
  max-width: 600px;
  margin: 0 auto 32px;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 28px;
}

.intro-section {
  padding-bottom: 24px;
}

.intro-card {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}

.intro-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.intro-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 24px;
}

.landing-section {
  padding: 48px 0;
}

.landing-section-heading {
  margin-bottom: 24px;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 34px;
  text-align: center;
}

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

.feature-card {
  padding: 20px;
}

.feature-icon {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--primary-surface);
  border-radius: 12px;
  color: var(--primary);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.sport-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.sport-card {
  display: flex;
  min-height: 156px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}

.sport-card-icon {
  width: 56px;
  height: 56px;
}

.sport-card h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.download-card {
  padding: 40px 24px;
  background: var(--surface-elevated);
  text-align: center;
}

.download-card .landing-section-heading {
  margin-bottom: 8px;
}

.download-card > p {
  max-width: 560px;
  margin: 0 auto 24px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 24px;
}

.download-card > p.download-note {
  margin: 16px auto 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
}

.landing-footer {
  margin-top: 24px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

.landing-footer p + p {
  margin-top: 4px;
}

.landing-footer a {
  color: var(--text-secondary);
}

.landing-footer a:hover {
  color: var(--primary-hover);
}

.invite-page {
  display: flex;
  justify-content: center;
  padding: 24px 16px 40px;
}

.invite-card {
  width: 100%;
  max-width: 420px;
  height: fit-content;
  padding: 24px;
}

.invite-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.invite-brand .public-brand {
  font-size: 18px;
  line-height: 24px;
}

.invite-brand .public-brand img {
  width: 36px;
  height: 36px;
}

.invite-sport {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.invite-sport-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: var(--primary-surface);
  border-radius: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 16px;
  text-transform: uppercase;
}

.invite-title {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  overflow-wrap: anywhere;
}

.event-facts {
  margin-top: 16px;
}

.info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.info:last-child {
  border-bottom: 0;
}

.info svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: var(--text-muted);
}

.info span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.invite-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.invite-section .section-title {
  margin-bottom: 8px;
}

.section-copy {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.participants-list {
  list-style: none;
}

.participant-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
}

.participant-item:last-child {
  border-bottom: 0;
}

.form-title {
  margin-bottom: 16px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.app-promo {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.app-promo .section-title {
  margin-bottom: 4px;
}

.app-promo-copy {
  margin-bottom: 16px;
}

.open-app-button {
  display: none;
  margin-bottom: 16px;
}

.comments-panel {
  margin-top: 12px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
}

.comment-input {
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  transition: border-color 160ms ease;
}

.comment-input::placeholder {
  color: var(--text-muted);
}

.comment-input:focus {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.comment-send {
  margin-top: 8px;
}

.comments-list {
  margin-top: 12px;
}

.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: 0;
}

.comment-author {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.comment-text {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-time {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
}

.stacked-action {
  margin-top: 8px;
}

.group-header {
  margin-top: 16px;
  text-align: center;
}

.group-avatar,
.group-avatar-initial {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
}

.group-avatar {
  border: 1px solid var(--border);
  object-fit: cover;
}

.group-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 28px;
  font-weight: 700;
}

.group-meta {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
}

.group-creator {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 16px;
}

.group-invite-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.group-invite-note svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--primary);
  fill: currentColor;
}

.member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
}

.member-avatar,
.member-initial {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
}

.member-avatar {
  object-fit: cover;
}

.member-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.members-remaining {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .public-container {
    padding: 0 16px;
  }

  .hero {
    padding: 32px 0 40px;
  }

  .hero-app-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 34px;
    line-height: 40px;
    letter-spacing: -0.5px;
  }

  .hero-subtitle {
    font-size: 16px;
    line-height: 24px;
  }

  .landing-section {
    padding: 32px 0;
  }

  .landing-section-heading {
    font-size: 24px;
    line-height: 30px;
  }

  .intro-card {
    padding: 20px;
  }

  .download-card {
    padding: 32px 20px;
  }

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

  .invite-page {
    padding: 16px 12px 32px;
  }

  .invite-card {
    padding: 20px;
  }
}

@media (max-width: 440px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .store-links:not(.store-links--stacked) {
    flex-direction: column;
  }

  .store-links:not(.store-links--stacked) .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .hero h1 {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: 0;
  }

  .sport-list {
    gap: 12px;
  }

  .sport-card {
    min-height: 140px;
    padding: 20px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .comment-input {
    transition: none;
  }
}
