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

:root {
  --black:    #0f1f3d;
  --white:    #ffffff;
  --bg:       #ffffff;
  --gray-1:   #F5F5F5;
  --gray-2:   #D8D8D8;
  --gray-3:   #858585;
  --accent:   #c9a84c;
  --success:  #1a6b3a;
  --danger:   #b91c1c;
  --info:     #2563eb;
  --font:     'DM Sans', system-ui, sans-serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: #ffffff;
  color: #1c1c1b;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--black); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--gray-3); }

img { display: block; max-width: 100%; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Contact nav ── */
.contact-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .5rem 1.5rem;
  border-bottom: 1px solid var(--gray-2);
  font-size: .8rem;
}
.contact-nav a { color: var(--gray-3); text-decoration: none; }
.contact-nav a:hover { color: var(--black); }
.nav-avatar { margin-right: auto; display: flex; align-items: center; gap: .5rem; }
.nav-avatar-label { font-size: .8rem; color: var(--gray-3); }
.nav-avatar-circle { width: 32px; height: 32px; font-size: .75rem; cursor: pointer; flex-shrink: 0; }
.guest-avatar-placeholder.nav-avatar-circle { background: var(--accent); color: var(--white); }
.guest-avatar-placeholder.nav-avatar-circle:hover { opacity: .85; }

/* ── Alerts ── */
.error   { color: var(--danger);  border-bottom: 1px solid var(--danger);  padding: .6rem 0; margin: 1rem 0; font-size: .9rem; }
.success { color: var(--success); border-bottom: 1px solid var(--gray-2);  padding: .6rem 0; margin: 1rem 0; font-size: .9rem; }
.info    { color: var(--info);    border-bottom: 1px solid var(--gray-2);  padding: .6rem 0; margin: 1rem 0; font-size: .9rem; }
.preview-banner { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: 4px; padding: .6rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .55rem 1.5rem;
  border: 1px solid var(--black);
  background: transparent;
  color: var(--black);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .15s, color .15s;
  border-radius: 0;
}
.btn:hover { background: var(--black); color: var(--white); }
.btn-primary  { background: var(--black); color: var(--white); }
.btn-primary:hover { background: #3a3a39; color: var(--white); }
.btn-secondary { border-color: var(--gray-2); color: var(--gray-3); }
.btn-secondary:hover { background: var(--gray-1); color: var(--black); border-color: var(--black); }
.btn-accept  { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-accept:hover { background: #145c30; color: var(--white); }
.btn-decline { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-decline:hover { background: var(--danger); color: var(--white); }
.btn.active  { outline: 2px solid var(--black); outline-offset: 2px; }

/* ── Forms ── */
label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.25rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--black);
}
input[type=text], input[type=password], input[type=datetime-local],
input[type=email], input[type=file], textarea, select {
  padding: .65rem 0;
  border: none;
  border-bottom: 1px solid var(--gray-2);
  border-radius: 0;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 300;
  width: 100%;
  background: transparent;
  color: var(--black);
  transition: border-color .15s;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-bottom-color: var(--black); }
textarea { resize: vertical; padding: .65rem 0; }
.checkbox-label { flex-direction: row; align-items: center; gap: .6rem; text-transform: none; font-size: .9rem; letter-spacing: 0; font-weight: 400; }
.form-row { display: flex; gap: 2rem; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 160px; }
.form-actions { display: flex; gap: 1rem; margin-top: 2.5rem; align-items: center; }

/* ── Auth pages ── */
.auth-box {
  max-width: 420px;
  margin: 6rem auto;
  padding: 0 1.5rem;
}
.auth-box h1 { font-size: 2rem; font-weight: 300; margin-bottom: .5rem; line-height: 1.2; }
.auth-box > p { color: var(--gray-3); margin-bottom: 2rem; font-size: .95rem; font-weight: 300; }
.auth-box input[type=text], .auth-box input[type=password], .auth-box input[type=email] {
  border: 1px solid var(--gray-2);
  border-radius: 4px;
  padding: .65rem .85rem;
  background: var(--white);
}
.auth-box input[type=text]:focus, .auth-box input[type=password]:focus, .auth-box input[type=email]:focus {
  border-color: var(--black);
}
.auth-alt { margin-top: 1.5rem; font-size: .85rem; color: var(--gray-3); }
.auth-alt a { color: var(--gray-3); }
.auth-alt a:hover { color: var(--black); }

/* ── Event banner ── */
.event-banner {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
  margin-bottom: 3rem;
}

/* ── Event article ── */
.event-article { padding-bottom: 2.5rem; border-bottom: 1px solid var(--gray-2); margin-bottom: 2.5rem; }
.event-article h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 300; line-height: 1.15; margin-bottom: 1.25rem; letter-spacing: -.01em; }

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 2rem;
  color: var(--gray-3);
  font-size: .875rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}
.event-date { color: var(--black); font-weight: 400; }
.event-date-sep { color: var(--gray-2); }
.event-location a, .event-location { color: var(--black); text-decoration: none; }
.event-location a:hover { text-decoration: underline; text-underline-offset: 3px; }
.event-location::before { content: '↗  '; font-size: .8em; }

.event-short-desc { font-size: 1.35rem; font-weight: 300; color: var(--black); margin-bottom: 2rem; line-height: 1.65; padding-bottom: 2rem; border-bottom: 1px solid var(--gray-2); }
.event-content { font-size: 1rem; font-weight: 300; line-height: 1.85; }
.event-content p + p { margin-top: .75rem; }
.event-content strong { font-weight: 600; }
.event-content em { font-style: italic; }
.event-content u { text-decoration: underline; }
.event-content h1, .event-content h2, .event-content h3 { font-weight: 400; margin: 1.5rem 0 .5rem; }
.event-content ul, .event-content ol { padding-left: 1.5rem; margin: .75rem 0; }
.event-content li { margin-bottom: .25rem; }
.event-content a { color: var(--black); }

/* ── RSVP ── */
.rsvp-section { padding-bottom: 2.5rem; border-bottom: 1px solid var(--gray-2); margin-bottom: 2.5rem; }
.rsvp-section h2 { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-3); margin-bottom: .75rem; }
.rsvp-status-line { font-size: .95rem; font-weight: 300; margin-bottom: 1.25rem; color: var(--black); }
.rsvp-form { display: flex; gap: .75rem; flex-wrap: wrap; }
.rsvp-accepted { color: var(--success); }
.rsvp-declined { color: var(--danger); }
.rsvp-pending  { color: var(--gray-3); }

/* ── Guest list ── */
.guestlist-section { margin-bottom: 2.5rem; }
.guestlist-section h2 { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-3); margin-bottom: 1.25rem; }
.guestlist { list-style: none; display: flex; flex-direction: column; }
.guest {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--gray-2);
}
.guest-name { flex: 1; font-size: .95rem; font-weight: 400; }
.guest-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.guest-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gray-1); color: var(--gray-3);
  font-weight: 600; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.guest-rsvp { font-size: .8rem; font-weight: 500; letter-spacing: .02em; color: var(--gray-3); }
.guest.rsvp-accepted .guest-rsvp { color: var(--success); }
.guest.rsvp-declined .guest-rsvp { color: var(--danger); }
.guest.rsvp-pending  .guest-rsvp { color: var(--gray-3); }

/* ── My events list ── */
.my-events-box { max-width: 620px; margin: 0 auto; }
.my-events-box h1 { font-size: 2rem; font-weight: 300; margin-bottom: 2rem; }
.event-list { list-style: none; }
.event-list-item { border-bottom: 1px solid var(--gray-2); }
.event-list-item:first-child { border-top: 1px solid var(--gray-2); }
.event-list-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--black);
  transition: opacity .15s;
}
.event-list-link:hover { opacity: .7; }
.event-list-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.event-list-info { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.event-list-title { font-size: 1rem; font-weight: 400; }
.event-list-date { font-size: .8rem; color: var(--gray-3); font-weight: 300; }
.event-list-location { font-size: .8rem; color: var(--gray-3); font-weight: 300; }
.event-list-rsvp { font-size: .8rem; font-weight: 500; flex-shrink: 0; }

/* ── Bet section ── */
.bet-section { padding-bottom: 2.5rem; border-bottom: 1px solid var(--gray-2); margin-bottom: 2.5rem; }
.bet-section h2 { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-3); margin-bottom: .75rem; }
.bet-description { font-size: 1rem; font-weight: 300; margin-bottom: 1.5rem; }
.bet-options-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.25rem; }
.bet-option-label { display: flex; flex-flow: row wrap; align-items: center; gap: .75rem; cursor: pointer; padding: .65rem .85rem; border: 1px solid var(--gray-2); border-radius: 4px; transition: border-color .15s; margin-bottom: 0; }
.bet-option-label:hover { border-color: var(--black); }
.bet-option-label input[type=radio] { accent-color: var(--black); }
.bet-options-list .bet-option-label:nth-child(1) { background: #eef2ff; border-color: #c7d2fe; }
.bet-options-list .bet-option-label:nth-child(2) { background: #fefce8; border-color: #fde68a; }
.bet-options-list .bet-option-label:nth-child(3) { background: #f0fdf4; border-color: #bbf7d0; }
.bet-options-list .bet-option-label:nth-child(1):hover { border-color: #818cf8; }
.bet-options-list .bet-option-label:nth-child(2):hover { border-color: #f59e0b; }
.bet-options-list .bet-option-label:nth-child(3):hover { border-color: #22c55e; }
.bet-option-text { flex: 1; font-size: .95rem; font-weight: 300; }
.bet-option-odds { font-size: .8rem; color: var(--gray-3); font-weight: 500; }
.bet-wager-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bet-wager-row input[type=number] { width: 140px; border: 1px solid var(--gray-2); border-radius: 4px; padding: .55rem .75rem; font-size: 1rem; font-family: var(--font); }
.bet-max { font-size: .8rem; color: var(--gray-3); }
.bet-limits { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; font-size: .85rem; }
.bet-limit-row { display: flex; align-items: center; gap: .75rem; color: var(--gray-3); }
.bet-limit-row span:first-child { width: 120px; flex-shrink: 0; }
.bet-progress-bar { flex: 1; height: 6px; background: var(--gray-2); border-radius: 3px; overflow: hidden; }
.bet-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.bet-placed { padding: 1rem; background: var(--gray-1); border-radius: 4px; font-size: .95rem; font-weight: 300; }
.bet-win { color: var(--success); font-weight: 500; margin-top: .5rem; }
.bet-loss { color: var(--danger); margin-top: .5rem; }

/* ── Add to calendar ── */
.add-to-cal-section { display: flex; gap: .75rem; flex-wrap: wrap; padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--gray-2); }

/* ── Comments ── */
.comments-section { padding-top: 1.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--gray-2); margin-bottom: 2.5rem; }
.comments-section h2 { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-3); margin-bottom: 1.25rem; }
.comments-list { list-style: none; margin-bottom: 2rem; }
.comment { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--gray-2); }
.comment-content { flex: 1; }
.comment-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.comment-name { font-size: .9rem; font-weight: 500; }
.comment-date { font-size: .75rem; color: var(--gray-3); }
.comment-body { font-size: .9rem; font-weight: 300; line-height: 1.65; color: var(--black); }
.comment-delete-form { align-self: flex-start; padding-top: .15rem; }
.comment-form { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.comment-form textarea { min-height: 80px; border: 1px solid var(--gray-2); border-radius: 4px; padding: .65rem .85rem; }
.comment-form textarea:focus { border-color: var(--black); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.btn-link { background: none; border: none; cursor: pointer; font-size: .85rem; padding: .25rem .5rem; font-family: var(--font); font-weight: 400; }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { text-decoration: underline; }

/* ── Profile page ── */
.profile-box { max-width: 860px; margin: 3rem auto; }
.profile-title { font-size: 2rem; font-weight: 300; margin-bottom: 2rem; }
.profile-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.profile-label {
  padding: .65rem 0;
  color: var(--gray-3);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  width: 160px;
  border-bottom: 1px solid var(--gray-2);
}
.profile-value { padding: .65rem 0; font-weight: 300; border-bottom: 1px solid var(--gray-2); }
.profile-th {
  padding: .5rem 0;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-3);
  border-bottom: 2px solid var(--gray-2);
  text-align: left;
}
.invitations-table .profile-value { font-size: .9rem; }
.invitations-table a { text-decoration: none; color: var(--info); }
.invitations-table a:hover { opacity: .7; }

.profile-comments { list-style: none; }
.profile-comment { border-bottom: 1px solid var(--gray-2); }
.profile-comment-link {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1rem;
  padding: .85rem 0;
  text-decoration: none;
  color: var(--black);
  transition: opacity .15s;
}
.profile-comment-link:hover { opacity: .6; }
.profile-comment-body { font-size: .95rem; font-weight: 300; width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-comment-meta { font-size: .75rem; color: var(--gray-3); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 600px) {
  .invitations-table .col-date { display: none; }
  .profile-comment-link { flex-direction: column; gap: .2rem; }
  .profile-comment-body { width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: unset; }
  .profile-comment-meta { margin-left: 0; white-space: normal; }
  .nav-avatar-circle { width: 22px; height: 22px; }
}

/* ── Event updates ── */
.event-updates { margin: 2.5rem 0; }
.event-update-item { padding: 1rem 0; border-bottom: 1px solid var(--gray-2); }
.event-update-item:first-of-type { border-top: 1px solid var(--gray-2); }
.event-update-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.event-update-title { font-size: 1rem; font-weight: 500; }
.event-update-date { font-size: .75rem; color: var(--gray-3); white-space: nowrap; }
.event-update-body { font-size: .9rem; font-weight: 300; color: var(--black); margin: 0; }

/* ── Misc ── */
.logout-link { margin-top: 1rem; font-size: .85rem; }
.logout-link a { color: var(--gray-3); text-decoration: none; }
.logout-link a:hover { color: var(--black); }
.muted { color: var(--gray-3); }
.empty-state { color: var(--gray-3); font-weight: 300; font-size: .9rem; }
