:root {
  color-scheme: light;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #1d342a;
  background: #f8f5ec;
  --ink: #1d342a;
  --muted: #515d54;
  --green: #174235;
  --dark-green: #103329;
  --red: #ac382b;
  --paper: #fffdf7;
  --line: #dcd9cd;
  --serif: Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
p { line-height: 1.55; }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.shell { width: min(100% - 64px, 1120px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; display: flex; align-items: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 750;
  letter-spacing: -.022em;
}
.brand-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: var(--red);
  color: #fff8e8;
}
.brand-icon::before, .brand-icon::after {
  content: '';
  position: absolute;
  top: 7px;
  width: 7px;
  height: 5px;
  border: 1.5px solid currentColor;
}
.brand-icon::before { left: calc(50% - 7px); border-radius: 90% 90% 0 90%; }
.brand-icon::after { left: 50%; border-radius: 90% 90% 90% 0; }
.brand-icon i {
  width: 16px;
  height: 14px;
  margin-top: 5px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) center 3px / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
}

.home { padding-block: clamp(36px, 6vw, 76px) 45px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6.5vw, 90px);
}
.hero h1 {
  font: 500 clamp(3.7rem, 7.35vw, 6.6rem)/.94 var(--serif);
  letter-spacing: -.077em;
}
.hero h1 em { color: var(--red); font-weight: inherit; }
.intro {
  margin-top: 26px;
  max-width: 29ch;
  color: var(--muted);
  font-size: clamp(1.13rem, 2vw, 1.3125rem);
}
.hero-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: var(--dark-green);
}
.create-form { display: grid; justify-items: start; gap: 10px; margin-top: 30px; max-width: 360px; }
.create-form .button { margin-top: 3px; }
.optional { color: var(--muted); font-weight: 450; font-size: .875rem; }

label { display: block; font-size: .9375rem; font-weight: 650; }
input, select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b7bfb3;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
}
input::placeholder { color: #606861; opacity: 1; }
select {
  appearance: none;
  padding-inline-end: 34px;
  background:
    linear-gradient(45deg, transparent 47%, var(--ink) 48% 65%, transparent 66%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, transparent 35%, var(--ink) 36% 52%, transparent 53%) right 10px center / 6px 6px no-repeat,
    var(--paper);
}
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
fieldset:disabled label { color: var(--muted); }
select:disabled { background-color: #f1efe8; color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 650;
  font-size: .9375rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.primary { background: var(--green); color: #fffdf7; }
.primary:hover:not(:disabled) { background: var(--dark-green); }
.secondary { border-color: #a9b6ab; color: var(--green); background: var(--paper); }
.secondary:hover:not(:disabled), .text-button:hover:not(:disabled) { background: #e9eee5; }
.text-button { background: transparent; color: var(--green); }
.button:disabled { opacity: .68; cursor: default; }
.button.small { min-height: 42px; padding-inline: 11px; }

.how {
  margin-top: clamp(38px, 5vw, 62px);
  border-top: 1px solid var(--line);
  padding-top: 27px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}
.how > div { display: grid; align-content: start; gap: 7px 12px; grid-template-columns: auto 1fr; }
.step-icon {
  --icon-background: #f2e3d8;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--icon-background);
  color: #9e3024;
  grid-row: span 2;
}
.step-icon::before, .step-icon::after { content: ''; grid-area: 1 / 1; }
.step-icon-add::before, .step-icon-exclude::before {
  width: 12px;
  height: 2px;
  background: currentColor;
}
.step-icon-add::after { width: 2px; height: 12px; background: currentColor; }
.step-icon-exclude::after {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}
.step-icon-share::before, .step-icon-share::after {
  clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
}
.step-icon-share::before { width: 16px; height: 16px; background: currentColor; }
.step-icon-share::after { width: 11px; height: 11px; background: var(--icon-background); }
.how h2 { font-size: 1rem; line-height: 1.35; padding-top: 2px; }
.how p, .note { color: var(--muted); }
.how p { font-size: .9375rem; max-width: 30ch; }

.admin { padding-block: 44px 56px; }
.event-heading { margin-bottom: 22px; }
.event-heading h1, .claim h1, .centered h1 {
  font: 500 clamp(2.15rem, 5vw, 3.9rem)/1.08 var(--serif);
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.eyebrow {
  color: var(--red);
  font-size: .875rem;
  font-weight: 750;
  margin-bottom: 7px;
}
.admin-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid #d1d9cc;
  background: #e9eee5;
  border-radius: 12px;
}
.admin-link .button { flex-shrink: 0; }
.admin-link p { font-size: .9375rem; color: #2e473e; }
.admin-link strong { display: inline-block; }
.editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.editor-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; }
.event-name-form { margin-bottom: 18px; }
.event-name-form .form-row { max-width: 600px; }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  padding: clamp(18px, 3vw, 30px);
}
.panel h2, .draw-panel h2, .editor-header h2 { font: 500 1.72rem/1.15 var(--serif); letter-spacing: -.035em; }
.panel-title { display: flex; align-items: center; gap: 12px; }
.count {
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 99px;
  background: #e9eee5;
  text-align: center;
  font-weight: 700;
  font-size: .875rem;
}
.panel .note { margin-top: 7px; margin-bottom: 19px; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.form-row input { flex: 1 1 170px; }
.rule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 9px; }
.rule-fields label { margin-bottom: 6px; }
.empty {
  border-top: 1px solid var(--line);
  margin-top: 17px;
  padding-top: 12px;
  color: var(--muted);
  font-size: .9375rem;
}
.list { margin: 14px 0 0; padding: 0; list-style: none; }
.list:empty { display: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.saved-events { margin-bottom: clamp(26px, 5vw, 48px); }
.saved-events .list li { padding: 0; }
.saved-event-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 18px;
  width: 100%;
  padding: 12px 2px;
  text-decoration: none;
}
.saved-event-link strong { overflow-wrap: anywhere; }
.saved-event-link:hover strong { text-decoration: underline; }
.saved-event-link time { color: var(--muted); font-size: .875rem; }
.row-label { overflow-wrap: anywhere; }
.row-actions { display: flex; align-items: center; flex: 0 0 auto; }
.results-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.results-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.results .row-actions { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.test-preview { margin-top: 20px; padding: clamp(14px, 3vw, 22px); border: 1px solid #d1d9cc; border-radius: 12px; background: #e9eee5; }
.test-preview h3 { margin: 0; font-size: 1.125rem; }
.test-preview .test-pairs li { display: block; padding-block: 9px; overflow-wrap: anywhere; }
.used { color: var(--muted); font-size: .9375rem; padding-inline: 11px; }
.message { color: #9e3024; margin-top: 9px; font-size: .9375rem; }
.draw-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 25px;
  margin-top: 18px;
  padding: clamp(20px, 3vw, 29px);
  background: var(--green);
  color: var(--paper);
  border-radius: 15px;
}
.draw-panel p { color: #e3eae1; margin-top: 5px; }
.draw-panel .message { color: #ffdfd5; }
.draw-button { flex-shrink: 0; min-width: 118px; background: #fff8e8; color: var(--dark-green); }
.draw-button:hover:not(:disabled) { background: #f5e6d5; }
.draw-button:focus-visible { outline-color: #ffdbbb; }

dialog {
  width: min(100% - 32px, 460px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: #172d23a6; }
dialog form { display: grid; gap: 10px; }
dialog button { justify-self: start; }

.claim { padding-block: clamp(40px, 10vw, 110px); }
.centered { max-width: 650px; margin-inline: auto; text-align: center; }
.centered p + .button { margin-top: 16px; }
.centered > p { margin-top: 12px; }
.claim-card { padding: clamp(28px, 6vw, 62px) clamp(18px, 5vw, 48px); }
.claim-icon { transform: scale(1.25); margin-bottom: 12px; }
.claim-card .eyebrow { overflow-wrap: anywhere; }
.claim-giver { overflow-wrap: anywhere; }
.claim-card #claim-recipient { color: var(--red); margin-block: 4px 22px; }
.claim-note {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .rule-fields { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .shell { width: min(100% - 36px, 510px); }
  .header-inner { min-height: 63px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: clamp(3.25rem, 12.8vw, 5.95rem); }
  .intro { margin-top: 17px; }
  .create-form { margin-top: 23px; max-width: none; }
  .create-form .button { width: 100%; }
  .hero-image { aspect-ratio: 1.2; object-fit: cover; }
  .how { grid-template-columns: 1fr; gap: 19px; }
  .editor { grid-template-columns: 1fr; }
  .admin { padding-block: 30px 40px; }
  .admin-link { align-items: flex-start; flex-direction: column; }
  .rule-fields { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .draw-panel { align-items: flex-start; flex-direction: column; }
  .results .list li { flex-wrap: wrap; }
}
