:root {
  color-scheme: dark;
  font-family: "Sour Gummy", sans-serif;
  background: #14532d;
  color: #fffaf0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #166534;
  --surface-raised: #15803d;
  --gold: #facc15;
  --muted: #d1e7d4;
  --border: rgb(255 250 240 / 22%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 2rem 1rem 4rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgb(34 197 94 / 24%), transparent 58%),
    #14532d;
}

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

.app-shell {
  width: min(100%, 54rem);
  margin: 0 auto;
}

.site-header {
  padding: 0.5rem 1rem 2rem;
  text-align: center;
}

body.participant-page .site-header {
  display: none;
}

.participant-music {
  display: grid;
  justify-items: center;
  margin-bottom: 0.75rem;
}

.participant-event-name {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: clamp(2rem, 8vw, 3.5rem);
  text-align: center;
  overflow-wrap: anywhere;
}

body.participant-page .music-toggle {
  width: 6rem;
  height: 6rem;
  padding: 0;
  border: 0;
  background: transparent;
}

body.participant-page .music-message:empty {
  display: none;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  min-height: 2rem;
}

.header-top .eyebrow {
  margin-right: auto;
}

.music-toggle {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.music-toggle:hover {
  transform: scale(1.06);
  background: var(--surface-raised);
}

.music-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.music-toggle.is-shaking {
  animation: shake 400ms ease-in-out;
}

.music-message {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: var(--gold);
  font-size: 0.85rem;
}

.language-toggle {
  min-width: 3rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gold);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0.65rem 0 0;
  font-family: "Sour Gummy", sans-serif;
  font-size: clamp(2.7rem, 11vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
}

h1 span {
  color: var(--gold);
  text-shadow: 0 0.15rem 0 rgb(0 0 0 / 12%);
}

.card {
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: rgb(22 101 52 / 90%);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 24%);
}

h2 {
  margin: 0;
  font-family: "Sour Gummy", sans-serif;
  font-size: clamp(1.7rem, 6vw, 2.25rem);
  font-weight: 700;
}

.intro {
  margin: 0.75rem 0 2rem;
  color: #e2e8dd;
  line-height: 1.6;
}

fieldset {
  min-width: 0;
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.75rem;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

#login-form {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #fffaf0;
  font-size: 0.9rem;
  font-weight: 600;
}

.field-wide {
  grid-column: 1 / -1;
}

.optional,
.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.field-hint {
  margin: 0 0 0.85rem;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: #14532d;
  color: #fffaf0;
}

input::placeholder {
  color: #9fb4a6;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.participant-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.participant-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.75rem;
}

.restriction-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.restriction-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.restriction-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.event-list li div {
  display: grid;
  gap: 0.3rem;
}

.event-list li span {
  color: var(--muted);
  font-size: 0.9rem;
}

.delivery-panel {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.delivery-panel h3 {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 1.1rem;
}

.delivery-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.delivery-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.delivery-status {
  color: var(--muted);
  font-size: 0.85rem;
}

.button {
  min-height: 2.85rem;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 140ms ease, transform 140ms ease;
}

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

.support-footer {
  margin-top: 1.5rem;
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
}

.support-footer summary {
  width: fit-content;
  margin: 0 auto;
  padding: 0.65rem;
  cursor: pointer;
}

.support-content {
  max-width: 40rem;
  margin: 0.5rem auto 0;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgb(5 42 23 / 25%);
}

.support-content h2 {
  margin: 0;
  color: #fffaf0;
  font-size: 1.1rem;
}

.support-note {
  font-size: 0.8rem;
}

.support-content a {
  display: inline-block;
  padding: 0.5rem 0;
  color: #fffaf0;
  text-underline-offset: 0.2rem;
}

.feedback-widget {
  margin-top: 1.5rem;
  text-align: right;
}

.feedback-trigger {
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.feedback-dialog {
  width: min(36rem, calc(100% - 2rem));
  max-height: calc(100svh - 2rem);
  padding: 1.5rem;
  overflow-y: auto;
  border: 1px solid #cbd6ce;
  border-radius: 1rem;
  background: #fffefa;
  color: #263832;
  color-scheme: light;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}

.feedback-dialog::backdrop {
  background: rgb(0 0 0 / 50%);
}

.feedback-dialog h2 {
  margin-top: 0;
}

.feedback-dialog p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.feedback-dialog textarea {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  border-color: #cbd6ce;
  background: #fbfcf9;
  color: #263832;
  resize: vertical;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feedback-actions .button {
  flex: 1;
  font-size: 0.9rem;
}

.feedback-dialog label,
.feedback-dialog .message {
  color: #263832;
}

.feedback-dialog :focus-visible {
  outline-color: #39765b;
}

.feedback-dialog .button-primary {
  background: #a63a3e;
}

.feedback-dialog .button-primary:hover:not(:disabled) {
  background: #862c31;
}

.feedback-dialog .button-secondary {
  border-color: #cbd6ce;
  background: #f4f8f3;
  color: #235d46;
}

.feedback-dialog .button-secondary:hover:not(:disabled) {
  background: #e4efe5;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.button-primary {
  border-color: #fffaf0;
  background: #dc2626;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #b91c1c;
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface-raised);
  color: #fffaf0;
}

.button-secondary:hover:not(:disabled) {
  background: #16a34a;
}

.button-remove {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.message {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--gold);
  line-height: 1.5;
}

body:not(.participant-page) {
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}

body:not(.participant-page) .site-header {
  padding-bottom: 1.75rem;
}

body:not(.participant-page) .site-header h1 {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
}

body:not(.participant-page) .site-header .eyebrow {
  color: #e5eee4;
  letter-spacing: 0.1em;
}

body:not(.participant-page) .language-toggle {
  border-color: rgb(255 255 255 / 25%);
  background: rgb(5 42 23 / 25%);
  color: #fffaf0;
}

body:not(.participant-page) .card {
  color-scheme: light;
  padding: clamp(1.3rem, 4vw, 2.5rem);
  border: 1px solid #e8e7df;
  border-radius: 1.15rem;
  background: #fffefa;
  color: #263832;
  box-shadow: 0 1rem 2.5rem rgb(4 28 17 / 18%);
}

body:not(.participant-page) #account-view {
  max-width: 35rem;
  margin: 0 auto;
}

body:not(.participant-page) #back-to-home {
  margin-bottom: 1.5rem;
}

body:not(.participant-page) .landing {
  padding: clamp(1.5rem, 5vw, 3rem);
}

body:not(.participant-page) .landing-hero {
  max-width: 43rem;
}

body:not(.participant-page) .landing-kicker {
  margin: 0 0 0.75rem;
  color: #a63a3e;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:not(.participant-page) .landing h2 {
  max-width: 18ch;
}

body:not(.participant-page) .landing .intro {
  max-width: 37rem;
  font-size: 1.05rem;
}

.landing-participant-hint {
  max-width: 36rem;
  margin: 1rem 0 0;
  color: #5e6d65;
  font-size: 0.9rem;
  line-height: 1.5;
}

.landing-access {
  margin: 1.5rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e3ebe3;
}

.landing-access form {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.landing-access form .button {
  justify-self: start;
}

.saved-participant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#participant-device-panel h4 {
  margin: 1.5rem 0 0.5rem;
}

#participant-device-panel .button {
  margin: 0.25rem 0.25rem 0.25rem 0;
}

.landing-benefits {
  margin-top: 2.5rem;
}

.landing-benefits h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.landing-benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.landing-benefits-grid article {
  padding: 1.2rem;
  border: 1px solid #e3ebe3;
  border-radius: 0.8rem;
  background: #f5f8f2;
}

.landing-feature-number {
  color: #a63a3e;
  font-size: 0.8rem;
  font-weight: 700;
}

.landing-benefits-grid h4 {
  margin: 0.7rem 0 0.45rem;
  color: #235d46;
  font-size: 1rem;
}

.landing-benefits-grid p {
  margin: 0;
  color: #5e6d65;
  font-size: 0.9rem;
  line-height: 1.5;
}

body:not(.participant-page) .card h2 {
  color: #263832;
  font-family: inherit;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

body:not(.participant-page) .card .intro,
body:not(.participant-page) .card .field-hint,
body:not(.participant-page) .card .optional {
  color: #5e6d65;
}

body:not(.participant-page) .card .intro {
  margin: 0.65rem 0 1.6rem;
}

body:not(.participant-page) .card label {
  color: #263832;
}

body:not(.participant-page) .card input,
body:not(.participant-page) .card select,
body:not(.participant-page) .card textarea {
  border-color: #cbd6ce;
  background: #fbfcf9;
  color: #263832;
}

body:not(.participant-page) .card input::placeholder {
  color: #71877b;
}

body:not(.participant-page) .card input:focus-visible,
body:not(.participant-page) .card select:focus-visible,
body:not(.participant-page) .card textarea:focus-visible,
body:not(.participant-page) .card button:focus-visible,
body:not(.participant-page) .card a:focus-visible {
  outline-color: #39765b;
}

body:not(.participant-page) .card .button {
  min-height: 2.75rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
}

body:not(.participant-page) .card .button-primary {
  border-color: #a63a3e;
  background: #a63a3e;
  color: #fff;
}

body:not(.participant-page) .card .button-primary:hover:not(:disabled) {
  background: #862c31;
}

body:not(.participant-page) .card .button-secondary {
  border-color: #c6d6ca;
  background: #f4f8f3;
  color: #235d46;
}

body:not(.participant-page) .card .button-secondary:hover:not(:disabled) {
  background: #e4efe5;
}

body:not(.participant-page) .card .button-remove {
  border-color: #dcccca;
  background: #fffefa;
  color: #873c3e;
}

body:not(.participant-page) .card .button-remove:hover:not(:disabled) {
  background: #fff0ef;
}

body:not(.participant-page) .card .message:not(:empty) {
  min-height: 0;
  padding: 0.8rem 1rem;
  border-radius: 0.65rem;
  background: #f0f3f0;
  color: #354c40;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

body:not(.participant-page) .card .message:empty {
  display: none;
}

body:not(.participant-page) .card legend,
body:not(.participant-page) .delivery-panel h3 {
  color: #235d46;
}

body:not(.participant-page) .account-toolbar {
  color: #5e6d65;
}

body:not(.participant-page) #organizer-email,
body:not(.participant-page) .event-list strong,
body:not(.participant-page) .delivery-list li > span:first-child,
body:not(.participant-page) .restriction-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body:not(.participant-page) .event-list li,
body:not(.participant-page) .delivery-list li {
  border-color: #e3ebe3;
}

body:not(.participant-page) .event-list li span,
body:not(.participant-page) .delivery-status,
body:not(.participant-page) .restriction-list li {
  color: #5e6d65;
}

body:not(.participant-page) .delivery-panel {
  border-color: #e3ebe3;
}

body:not(.participant-page) #donation-details p {
  margin: 0.6rem 0;
  overflow-wrap: anywhere;
}

body:not(.participant-page) #donation-link {
  overflow-wrap: anywhere;
}

body:not(.participant-page) #donation-limit,
body:not(.participant-page) #refresh-donation,
body:not(.participant-page) #confirm-draw,
body:not(.participant-page) #cancel-draw-review {
  margin-top: 0.75rem;
}

body:not(.participant-page) #draw-review-list li {
  display: grid;
  gap: 0.25rem;
  overflow-wrap: anywhere;
}

body:not(.participant-page) #create-view > .button,
body:not(.participant-page) #organizer-view > .button:first-child {
  margin-bottom: 1.5rem;
}

body:not(.participant-page) #organizer-view .eyebrow {
  margin-bottom: 0.4rem;
  color: #5e6d65;
}

body:not(.participant-page) #login-confirm-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e3ebe3;
}

.letter-panel {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgb(20 83 45 / 65%);
}

.letter-panel h3 {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: 1.1rem;
}

.letter-panel h3 label {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

body.participant-page .letter-panel {
  color-scheme: light;
  margin: 1.25rem 0 0;
  padding: clamp(1.25rem, 3.5vw, 2rem);
  border: 1px solid #e8e7df;
  border-radius: 1.15rem;
  background: #fffefa;
  color: #263832;
  box-shadow: 0 0.5rem 1.5rem rgb(4 28 17 / 8%);
}

body.participant-page .letter-panel h3 {
  margin-bottom: 0.5rem;
  color: #8e3438;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

body.participant-page .received-letter-panel h3 {
  color: #235d46;
}

body.participant-page .letter-panel .field-hint {
  color: #5e6d65;
  font-size: 0.875rem;
}

body.participant-page .letter-editor {
  border-color: #cbd6ce;
  background: #fbfcf9;
  color: #263832;
}

body.participant-page .letter-editor:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

body.participant-page .letter-editor[aria-readonly="true"]:empty::before {
  color: #374151;
}

body.participant-page .letter-editor:focus-visible {
  outline-color: #39765b;
}

body.participant-page .letter-content {
  border: 1px solid #dce5dc;
  background: #f7faf6;
  color: #263832;
}

body.participant-page .letter-panel .message {
  padding: 0.8rem 1rem;
  border-radius: 0.65rem;
  background: #eef4ed;
  color: #315b43;
  font-size: 0.9rem;
}

body.participant-page .letter-panel .message[data-state="error"] {
  background: #fff0ef;
  color: #932f32;
}

body.participant-page .letter-panel .message:focus-visible {
  outline: 2px solid #39765b;
  outline-offset: 2px;
}

.letter-unsaved {
  margin: 0.9rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 0.65rem;
  background: #fff6e3;
  color: #71531c;
  font-size: 0.875rem;
  line-height: 1.5;
}

.letter-panel .message:empty {
  display: none;
}

.discard-letter-changes {
  margin: 0;
}

body.participant-page .letter-panel .button {
  min-height: 2.75rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
}

body.participant-page .letter-panel .button-primary {
  border-color: #a63a3e;
  background: #a63a3e;
  color: #fff;
}

body.participant-page .letter-panel .button-primary:hover:not(:disabled) {
  background: #862c31;
}

body.participant-page .letter-panel .button-secondary {
  border-color: #c6d6ca;
  background: #f4f8f3;
  color: #235d46;
}

body.participant-page .letter-panel .button-secondary:hover:not(:disabled) {
  background: #e4efe5;
}

body.participant-page .letter-panel .button:focus-visible,
body.participant-page .gift-link-row input:focus-visible {
  outline-color: #39765b;
}

.gift-links {
  margin: 1.5rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e4ebe3;
}

.gift-links h4 {
  margin: 0 0 0.35rem;
  color: #263832;
  font-size: 1rem;
}

.gift-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto;
  align-items: end;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

body.participant-page .gift-link-row label,
body.participant-page .gift-link-form label {
  color: #1f2937;
}

body.participant-page .gift-link-row input,
body.participant-page .gift-link-form input {
  background: #fbfcf9;
  border-color: #cbd6ce;
  color: #263832;
}

.gift-link-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.gift-link-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  grid-column: 1 / -1;
}

body.participant-page #gift-link-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #932f32;
}

.remove-gift-link {
  justify-self: start;
}

.gift-links-display {
  padding-left: 1.5rem;
  overflow-wrap: anywhere;
}

.gift-links-display li + li {
  margin-top: 0.5rem;
}

body.participant-page .letter-content a,
body.participant-page .gift-links-display a {
  color: #216949;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.letter-count {
  text-align: right;
}

body.participant-page .letter-count-invalid {
  color: #991b1b;
  font-weight: 700;
}

.letter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

body.participant-page {
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}

body.participant-page .participant-event-name {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
}

body.participant-page .participant-details {
  margin: 1.4rem 0 1.75rem;
  text-align: center;
}

body.participant-page .participant-details p {
  color: #e1ebe1;
}

body.participant-page #participant-deadline {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 0.75rem;
  background: rgb(5 42 23 / 25%);
  font-size: 0.9rem;
}

.letter-editor {
  display: block;
  width: 100%;
  min-height: 10rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: #14532d;
  color: #fffaf0;
  font: inherit;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.letter-editor:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

body.participant-page .letter-editor a {
  color: #216949;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.letter-content {
  max-height: 18rem;
  overflow: auto;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: #14532d;
  color: #fffaf0;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.participant-details p {
  margin: 0 0 0.5rem;
  color: #e2e8dd;
  line-height: 1.5;
}

#participant-countdown {
  color: var(--gold);
  font-size: 1.1em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.participant-resource-link {
  display: inline-block;
  margin: 0.25rem 0 0;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.letter-game {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.letter-game-arena {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: rgb(5 26 15 / 22%);
  cursor: default;
  touch-action: none;
  user-select: none;
}

.letter-game-arena:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.letter-game-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  left: 0.75rem;
  display: grid;
  justify-items: end;
}

.letter-game-controls button {
  box-shadow: 0 0.35rem 1rem rgb(0 0 0 / 35%);
}

#letter-game-status:not(.visually-hidden) {
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: #14532d;
  color: #fffaf0;
  box-shadow: 0 0.35rem 1rem rgb(0 0 0 / 35%);
}

.game-envelope,
.game-mailbox {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: left, top;
}

.game-envelope {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  font-size: 2.6rem;
  cursor: grab;
  pointer-events: auto;
  filter: drop-shadow(0 0.2rem 0.3rem rgb(0 0 0 / 40%));
}

.game-envelope.is-dragging {
  cursor: grabbing;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-mailbox {
  display: grid;
  justify-items: center;
  line-height: 1;
  filter: drop-shadow(0 0.25rem 0.25rem rgb(0 0 0 / 40%));
}

.game-mailbox-icon {
  width: 3.75rem;
  height: 3.75rem;
}

.letter-game.is-delivered .game-envelope {
  visibility: hidden;
}

.letter-game.is-delivered .game-mailbox-icon {
  animation: mailbox-delivered 1s ease-in-out;
}

.snow-container {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.snowflake {
  position: absolute;
  top: -0.75rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
  opacity: 0.75;
  animation: fall linear infinite;
}

.santa,
.santa-reverse {
  position: fixed;
  top: 2rem;
  z-index: 30;
  width: min(7rem, 24vw);
  height: auto;
  pointer-events: none;
  animation: move-santa 3.5s linear forwards;
}

.santa {
  right: -8rem;
}

.santa-reverse {
  left: -8rem;
  animation-name: move-santa-reverse;
}

.laughing-santa {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  width: min(25rem, 80vw);
  height: auto;
  pointer-events: none;
  animation: laugh-santa 3.2s ease-in-out both;
}

@keyframes fall {
  to { transform: translateY(105vh); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-0.25rem); }
  75% { transform: translateX(0.25rem); }
}

@keyframes mailbox-delivered {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-12deg) scale(1.15); }
  40% { transform: rotate(12deg) scale(1.15); }
  60% { transform: rotate(-8deg) scale(1.1); }
  80% { transform: rotate(8deg) scale(1.05); }
}

@keyframes move-santa {
  to { right: 110vw; }
}

@keyframes move-santa-reverse {
  to { left: 110vw; }
}

@keyframes laugh-santa {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  35%, 85% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

[hidden] {
  display: none !important;
}

@media (max-width: 38rem) {
  body {
    padding: 1.25rem 0.75rem 2rem;
  }

  .site-header {
    padding-bottom: 1.5rem;
  }

  .header-top {
    gap: 0.5rem;
  }

  .music-toggle {
    width: 2.75rem;
    height: 2.75rem;
  }

  body.participant-page .music-toggle {
    width: 6rem;
    height: 6rem;
  }

  .letter-game-controls button {
    font-size: 0.8rem;
  }

  .field-grid,
  .participant-row,
  .restriction-controls,
  .gift-link-row,
  .gift-link-form,
  .landing-benefits-grid {
    grid-template-columns: 1fr;
  }

  body.participant-page .letter-panel {
    padding: 1.15rem;
  }

  .letter-actions .button-primary {
    flex-grow: 1;
  }

  .delivery-list li {
    flex-direction: column;
    align-items: stretch;
  }

  .delivery-status {
    grid-column: 1;
    grid-row: 2;
  }

  .delivery-list .button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .participant-row {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
  }

  body:not(.participant-page) .participant-row {
    border-color: #e3ebe3;
    background: #f7faf6;
  }

  body:not(.participant-page) .event-list li,
  body:not(.participant-page) .account-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .participant-row .button-remove {
    justify-self: start;
  }

  .restriction-controls .button {
    justify-self: start;
  }

  .copy-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
