:root {
  --pool: #dff7ff;
  --pool-deep: #2089a6;
  --coral: #ff6b6b;
  --lemon: #ffd166;
  --mint: #4ecdc4;
  --ink: #17324d;
  --paper: #fffdf8;
  --line: #c7dbe3;
  --shadow: 0 24px 70px rgba(23, 50, 77, 0.18);
  --radius: 8px;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--pool);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    var(--pool);
}

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

button,
a,
input,
select,
textarea {
  outline-color: var(--pool-deep);
}

.party-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
  display: grid;
  gap: 18px;
}

.invite-banner {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(760px, 100%);
  overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(23, 50, 77, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.invite-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.party-hero,
.form-panel,
.success-panel {
  background: rgba(255, 253, 248, 0.94);
  border: 2px solid rgba(23, 50, 77, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.party-hero {
  position: relative;
  overflow: hidden;
  padding: 26px 20px 22px;
}

.bounce-banner {
  position: absolute;
  inset: 0 0 auto;
  height: 76px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  opacity: 0.95;
}

.bounce-banner span {
  border-radius: 0 0 999px 999px;
}

.bounce-banner span:nth-child(1) {
  background: var(--coral);
}

.bounce-banner span:nth-child(2) {
  background: var(--lemon);
}

.bounce-banner span:nth-child(3) {
  background: var(--mint);
}

.bounce-banner span:nth-child(4) {
  background: #7b61ff;
}

.hero-copy {
  position: relative;
  padding-top: 72px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pool-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.25rem, 10vw, 4.9rem);
}

h2 {
  font-size: clamp(1.45rem, 6vw, 2.15rem);
}

.event-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 22px 0 14px;
}

.event-details div {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

dt {
  color: var(--pool-deep);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.host-line,
.fine-print {
  margin: 0;
  color: #466274;
  line-height: 1.45;
}

.venue-note {
  margin: 0;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff7d6;
  border: 1px solid rgba(255, 209, 102, 0.75);
  border-left: 6px solid var(--lemon);
  border-radius: var(--radius);
  font-weight: 700;
  line-height: 1.45;
}

.form-panel {
  padding: 20px;
}

.form-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.field em {
  color: #6c7f8e;
  font-style: normal;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

.choice-field legend {
  margin-bottom: 8px;
  font-weight: 900;
}

.choice-field label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 800;
}

.choice-field input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--coral);
}

.turnstile-wrap {
  min-height: 70px;
  display: flex;
  align-items: center;
}

.status-message {
  min-height: 22px;
  font-weight: 800;
}

.status-message[data-state="error"] {
  color: #b42318;
}

.status-message[data-state="ok"] {
  color: #146c43;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 900;
}

.primary-action {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 0 #bf4147;
}

.secondary-action {
  background: var(--ink);
  color: #fff;
}

.danger-action {
  background: #b42318;
  color: #fff;
}

.success-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  background: #f1fffb;
}

.success-panel[hidden],
[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  .party-shell {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
    padding-top: 42px;
  }

  .party-hero {
    position: sticky;
    top: 24px;
  }

  .event-details,
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-panel {
    padding: 26px;
  }
}

.admin-page {
  background: #f5f8fb;
}

.admin-shell {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-login,
.admin-dashboard {
  background: var(--paper);
  border: 2px solid rgba(23, 50, 77, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-login {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  padding: 24px;
}

.admin-login form {
  margin-top: 20px;
}

.admin-dashboard {
  display: grid;
  gap: 22px;
  padding: 18px;
}

.admin-header,
.table-toolbar,
.toolbar-actions,
.dialog-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-header,
.table-toolbar,
.dialog-header {
  justify-content: space-between;
}

.admin-header {
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.stat-card span {
  color: #536b7d;
  font-weight: 800;
}

.stat-card strong {
  font-size: 2rem;
  line-height: 1;
}

.stat-card.total {
  border-color: var(--mint);
  background: #f0fffc;
}

.stat-card.warning {
  border-color: var(--lemon);
  background: #fff8df;
}

.admin-table-section {
  display: grid;
  gap: 12px;
}

.table-toolbar {
  flex-wrap: wrap;
}

.toolbar-actions {
  flex-wrap: wrap;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #536b7d;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.92rem;
  line-height: 1.35;
}

.duplicate-row {
  background: #fff8df;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 900;
}

.badge.yes {
  background: #e7fff4;
  color: #146c43;
}

.badge.no {
  background: #fff0f0;
  color: #b42318;
}

.badge.warn {
  background: var(--lemon);
  color: var(--ink);
}

.small-button {
  min-height: 36px;
  padding: 0 10px;
  box-shadow: none;
}

td .small-button + .small-button {
  margin-left: 6px;
}

dialog {
  width: min(760px, calc(100% - 24px));
  max-height: min(760px, calc(100vh - 24px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 50, 77, 0.55);
}

.dialog-form {
  padding: 18px;
  overflow: auto;
}

@media (max-width: 520px) {
  .admin-header,
  .table-toolbar,
  .toolbar-actions,
  .dialog-header {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions > *,
  .admin-header > button {
    width: 100%;
  }
}
