/* ── Design tokens from Stitch "Courtside Chic" system ── */
:root {
  --bg:              #fef9f1;
  --surface-low:     #f8f3eb;
  --surface:         #f2ede5;
  --surface-high:    #ece8e0;
  --surface-highest: #e7e2da;
  --surface-dim:     #ded9d2;
  --surface-white:   #ffffff;

  --primary:         #65449f;
  --primary-con:     #7e5db9;
  --secondary:       #522ee7;
  --secondary-light: #e5deff;
  --tertiary:        #4c5d00;
  --tertiary-bright: #d4ff00;

  --on-bg:           #1d1c17;
  --on-surface-var:  #474556;
  --outline:         #787587;
  --outline-var:     #c9c4d9;

  --radius-sm:  0.5rem;
  --radius-md:  1.5rem;
  --radius-xl:  3rem;
  --radius-full: 9999px;

  --font-serif: 'Noto Serif', Georgia, serif;
  --font-sans:  'Plus Jakarta Sans', system-ui, sans-serif;
  --font-script: 'Great Vibes', cursive;
}

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

body {
  background: #e0dbd3;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--on-bg);
}

/* ── App shell (phone frame) ── */
.app-shell {
  width: 100%;
  max-width: 390px;
  height: 100svh;
  max-height: 844px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  border-radius: 2rem;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--outline-var);
}

.header-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--on-bg);
  letter-spacing: 0.01em;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--on-bg);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface); }

.icon-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary);
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

/* ── Content ── */
.app-content {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ── Tab panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Hero ── */
.hero {
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  background: var(--bg);
}

.invite-badge {
  display: inline-block;
  border: 1.5px solid var(--secondary);
  color: var(--secondary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  font-family: var(--font-sans);
}

.hero-name {
  font-family: var(--font-script);
  font-size: 4rem;
  line-height: 1.05;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--on-surface-var);
  font-style: italic;
}

/* ── Card ── */
.card {
  background: var(--surface-white);
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.5rem;
  margin: 0 1.25rem 1.5rem;
}

/* ── Timeline ── */
.timeline-starts {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--outline);
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
}

.timeline-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.6rem 0;
}
.timeline-item + .timeline-item {
  border-top: 1px solid var(--outline-var);
}

.timeline-icon {
  color: var(--secondary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.timeline-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--on-bg);
  font-family: var(--font-sans);
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--on-surface-var);
  margin-top: 0.1rem;
  font-family: var(--font-sans);
}

/* ── Section ── */
.section {
  padding: 0 1.25rem 1.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--on-bg);
  margin-bottom: 0.75rem;
}

.section-body {
  font-size: 0.88rem;
  color: var(--on-surface-var);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
}

.chip {
  display: inline-block;
  background: var(--tertiary-bright);
  color: var(--tertiary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
}

/* ── Court photo ── */
.court-photo-wrap {
  margin-bottom: 1.5rem;
  padding: 0 1.25rem;
}

.court-photo-real {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.court-photo-real img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.court-photo-real::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(30,10,60,0.65) 100%);
}

.court-overlay {
  padding: 1rem 1.25rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.court-label {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  font-style: italic;
}

/* ── Venue photo strip ── */
.venue-photos {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.venue-photos::-webkit-scrollbar { display: none; }

.venue-photos img {
  width: 140px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.location-photos img {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-xl);
  margin-bottom: 0.6rem;
}

/* ── Venue ── */
.venue-section { background: var(--surface-low); padding-top: 1.5rem; }

.venue-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--outline);
  font-family: var(--font-sans);
  margin-bottom: 0.3rem;
}

.venue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.venue-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--on-bg);
}

.map-placeholder {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 50%, #81c784 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.map-placeholder.large { height: 240px; }

.map-placeholder::before {
  content: '';
  position: absolute;
  top: 40%; left: 20%;
  width: 60%; height: 20%;
  background: rgba(255,255,255,0.5);
  border-radius: 4px;
}
.map-placeholder::after {
  content: '';
  position: absolute;
  top: 20%; left: 10%;
  width: 30%; height: 12%;
  background: rgba(255,255,255,0.4);
  border-radius: 4px;
}

.map-pin-center {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(82,46,231,0.4);
  z-index: 1;
}

.map-brand {
  color: white;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.venue-address {
  font-size: 0.82rem;
  color: var(--on-surface-var);
  line-height: 1.6;
  font-family: var(--font-sans);
}

/* ── CTA ── */
.cta-section {
  padding: 1.5rem 1.25rem 1rem;
  text-align: center;
  background: var(--surface-low);
}

.cta-note {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--outline);
  font-family: var(--font-sans);
  font-weight: 600;
}

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-con) 100%);
  color: white;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 8px 24px rgba(101,68,159,0.35);
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: transparent;
  color: var(--secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1.5px solid var(--secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--secondary-light); }

/* ── Footer ── */
.invite-footer {
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  background: var(--bg);
}

.footer-script {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.footer-host, .footer-contact {
  font-size: 0.78rem;
  color: var(--outline);
  font-family: var(--font-sans);
  line-height: 1.7;
}

/* ── Bottom Nav ── */
.bottom-nav {
  display: flex;
  border-top: 1px solid var(--outline-var);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--outline);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.nav-tab.active {
  color: var(--secondary);
}
.nav-tab svg { transition: stroke 0.15s; }

/* ── Tab Hero ── */
.tab-hero {
  padding: 2rem 1.5rem 1rem;
  text-align: center;
}
.tab-heading {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--on-bg);
  line-height: 1.15;
}

/* ── RSVP Form ── */
.rsvp-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--on-bg);
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
}

.optional {
  font-weight: 400;
  color: var(--outline);
}

.form-input {
  background: var(--surface-highest);
  border: none;
  border-radius: var(--radius-xl);
  padding: 0.85rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--on-bg);
  outline: none;
  transition: box-shadow 0.15s;
  width: 100%;
}
.form-input:focus {
  box-shadow: 0 0 0 2px var(--secondary);
}
.form-input::placeholder { color: var(--outline); }

.form-textarea {
  border-radius: var(--radius-md);
  resize: none;
  min-height: 90px;
  padding-top: 0.85rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-select {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--outline-var);
  background: transparent;
  color: var(--on-surface-var);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chip-select.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

/* ── RSVP Success ── */
.rsvp-success {
  text-align: center;
  padding: 2rem 1rem;
}
.rsvp-success.hidden { display: none; }
.success-icon { font-size: 3rem; margin-bottom: 1rem; }
.success-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--on-bg);
  margin-bottom: 0.75rem;
}

/* ── Footer links & social ── */
.invite-footer a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.78rem;
  font-family: var(--font-sans);
}
.invite-footer a:hover { text-decoration: underline; }

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}
.footer-social a {
  color: var(--outline);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.footer-social a:hover { color: var(--secondary); text-decoration: none; }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Desktop: show phone frame ── */
@media (min-width: 500px) {
  body { background: #d8d3cb; }
  .app-shell { border-radius: 2.5rem; margin: 1rem auto; }
}

@media (max-width: 499px) {
  .app-shell {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    height: 100svh;
  }
}
