:root {
  --ink: #19231d;
  --muted: #657169;
  --cream: #f7f3e8;
  --paper: #fffdf8;
  --green: #164f3b;
  --green-light: #dce9df;
  --gold: #dfad4c;
  --line: #d8ded8;
  --danger: #9e332d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 17px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--green); }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; background: white; padding: .75rem; }
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem max(5vw, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); font-weight: 800; text-decoration: none; font-size: 1.1rem; }
.site-header span { color: var(--muted); font-size: .9rem; }
main { overflow: hidden; }
.hero, .story, .tickets-section, .rules, .confirmation, .admin-section, .winners {
  max-width: 1180px; margin: auto; padding: 5rem 5vw;
}
.hero {
  display: grid; grid-template-columns: 1.5fr .7fr; align-items: center; gap: 5rem;
  min-height: 650px;
}
.hero h1 { max-width: 760px; margin: .3rem 0 1.4rem; font: 800 clamp(2.8rem, 7vw, 5.7rem)/.98 Georgia, serif; }
.lead { max-width: 720px; color: #455149; font-size: 1.2rem; }
.eyebrow { margin: 0; color: var(--green); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .78rem; }
.button {
  display: inline-block; padding: .9rem 1.35rem; border: 0; border-radius: .4rem;
  color: white; background: var(--green); font-weight: 750; text-decoration: none;
}
.button:hover { background: #0e3d2d; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.prize-card {
  background: var(--green); color: white; padding: 2.5rem; border-radius: 1rem;
  box-shadow: 25px 25px 0 var(--gold); display: grid;
}
.prize-card span { color: #cde1d5; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; }
.prize-card strong { font: 800 4.5rem/1 Georgia, serif; margin: .3rem 0 1.4rem; }
.prize-card small { border-top: 1px solid #ffffff44; padding-top: 1rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--cream); padding: 2rem max(5vw, calc((100vw - 1180px) / 2)); }
.facts div { padding: 1rem 2rem; border-right: 1px solid #d6cfbd; display: flex; flex-direction: column; }
.facts div:last-child { border: 0; }
.facts strong { font: 700 2.2rem Georgia, serif; }
.facts span { color: var(--muted); }
.countdown-section {
  padding: 4rem 5vw; text-align: center; color: white; background: var(--green);
}
.countdown-section h2 { margin: .5rem 0 2rem; font: 750 clamp(1.8rem, 4vw, 3rem)/1.1 Georgia, serif; }
.countdown-section .eyebrow { color: #cde1d5; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(100px, 150px)); justify-content: center; gap: 1rem; }
.countdown div { padding: 1rem; border: 1px solid #ffffff44; border-radius: .6rem; background: #ffffff0d; }
.countdown strong { display: block; font: 800 2.5rem Georgia, serif; }
.countdown span { color: #cde1d5; font-size: .85rem; }
.winners { text-align: center; }
.winners h2 { font: 750 clamp(2rem, 4vw, 3.4rem)/1.05 Georgia, serif; }
.winner-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.winner-grid article { background: var(--green); color: white; padding: 2rem; border-radius: .7rem; }
.winner-grid span { color: #cde1d5; }
.winner-grid strong { display: block; font: 800 4rem Georgia, serif; }
.draw-transparency {
  max-width: 760px; margin: 1.5rem auto 0; padding: 1.2rem;
  border: 1px solid var(--line); border-radius: .6rem; background: white;
}
.draw-transparency p { margin: .5rem 0; }
.draw-transparency small { color: var(--muted); }
.story { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4rem; align-items: start; }
.story h2, .tickets-section h2, .rules h2 { margin: .4rem 0; font: 750 clamp(2rem, 4vw, 3.4rem)/1.05 Georgia, serif; }
.story > p { margin: 0; font-size: 1.25rem; color: #455149; }
.tickets-section { max-width: none; background: #f1f5f1; padding-left: max(5vw, calc((100vw - 1180px) / 2)); padding-right: max(5vw, calc((100vw - 1180px) / 2)); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.progress-copy { display: flex; flex-direction: column; text-align: right; }
.progress-copy span { color: var(--muted); }
.notice { background: #fff5d8; border-left: 4px solid var(--gold); padding: 1rem; margin-bottom: 1.5rem; }
fieldset { padding: 0; margin: 0; border: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; color: var(--muted); font-size: .9rem; }
.legend span { display: flex; align-items: center; gap: .35rem; }
.legend i { width: 1rem; height: 1rem; border-radius: .2rem; display: inline-block; border: 1px solid var(--line); }
.legend .available { background: white; }
.legend .selected { background: var(--green); }
.legend .reserved { background: #dcd9cf; }
.legend .paid { background: var(--green-light); }
.ticket-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: .55rem; }
.ticket {
  display: grid; place-items: center; min-height: 3rem; border: 1px solid var(--line);
  border-radius: .35rem; background: white; font-weight: 700; font-size: .9rem;
}
label.ticket { cursor: pointer; position: relative; }
.ticket input { position: absolute; opacity: 0; }
.ticket:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.ticket:has(input:checked) { background: var(--green); color: white; border-color: var(--green); }
.ticket.reserved { color: #777; background: #dcd9cf; }
.ticket.paid { color: #28513d; background: var(--green-light); border-color: #b8cfbe; }
.checkout { margin-top: 2rem; padding: 2rem; background: white; border-radius: .75rem; box-shadow: 0 8px 35px #1c372314; }
.checkout > div:first-child { display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-weight: 700; }
input, select { width: 100%; margin-top: .35rem; padding: .75rem; border: 1px solid #aeb8b0; border-radius: .35rem; background: white; }
input:focus, select:focus { outline: 3px solid #dfad4c66; border-color: var(--green); }
.phone-fields { display: grid; grid-template-columns: .8fr 1.2fr; gap: .7rem; }
.checkout .button { margin-top: 1.2rem; }
.checkout small { display: block; color: var(--muted); margin-top: .6rem; }
.rules { max-width: 850px; }
.rules li { margin-bottom: .8rem; }
details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; margin-top: 2rem; }
summary { cursor: pointer; font-weight: 800; }
footer { padding: 2rem 5vw; text-align: center; background: var(--ink); color: #d8e0da; font-size: .88rem; }
footer p { margin: .2rem; }
.flash-wrap { position: fixed; z-index: 10; right: 1rem; top: 5rem; max-width: 420px; }
.flash { padding: 1rem; color: white; background: var(--green); border-radius: .4rem; box-shadow: 0 4px 25px #0003; }
.flash.error { background: var(--danger); }
.confirmation, .login-card { max-width: 620px; margin: 5rem auto; text-align: center; }
.confirmation h1 { font: 750 3rem Georgia, serif; }
.reserved-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 2rem 0; }
.reserved-numbers span { padding: .6rem; background: var(--green-light); border-radius: .3rem; font-weight: 800; }
dl div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .7rem; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; }
.status { display: inline-block; padding: .25rem .6rem; border-radius: 1rem; font-weight: 800; font-size: .78rem; }
.status.success, .status.paid { color: #174c34; background: #d6ecdf; }
.status.pending, .status.reserved { color: #725513; background: #fff1bf; }
.status.error, .status.cancelled { color: #7c2622; background: #f8d8d6; }
.whatsapp { margin: 1rem; }
.text-link { display: block; margin-top: 1rem; }
.login-card { padding: 2rem; border: 1px solid var(--line); border-radius: .7rem; }
.login-card form { text-align: left; }
.login-card .button { margin-top: 1rem; width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.actions button, .secondary-button { border: 1px solid var(--green); color: var(--green); background: white; padding: .4rem .6rem; border-radius: .3rem; }
.actions .danger { color: var(--danger); border-color: var(--danger); }
.draw-card { margin-top: 3rem; padding: 2rem; background: var(--cream); border-radius: .7rem; }
.draw-options { display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; }
.draw-options > div { padding: 1.5rem; background: white; border-radius: .6rem; }
.draw-options h3 { margin-top: 0; }
.draw-options label { display: block; margin-top: 1rem; }
.draw-options textarea {
  width: 100%; min-height: 7rem; margin-top: .35rem; padding: .75rem;
  border: 1px solid #aeb8b0; border-radius: .35rem; resize: vertical; font: inherit;
}
.draw-options .button { margin-top: 1rem; }
.automatic-option { border: 1px dashed #b9b09b; }
.manual-card {
  display: grid; grid-template-columns: .65fr 1.35fr; gap: 2rem;
  margin-bottom: 3rem; padding: 2rem; background: var(--cream); border-radius: .7rem;
}
.settings-card {
  display: grid; grid-template-columns: .65fr 1.35fr; gap: 2rem;
  margin-bottom: 2rem; padding: 2rem; border: 1px solid var(--line); border-radius: .7rem;
}
.settings-card h2 { margin-top: .4rem; font: 750 2rem/1.1 Georgia, serif; }
.settings-card .button { margin-top: 1rem; }
.expand-form { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.expand-form small { display: block; margin: .4rem 0 1rem; color: var(--muted); }
.image-action { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.download-button { display: inline-block; text-decoration: none; }
.manual-card h2 { margin-top: .4rem; font: 750 2rem/1.1 Georgia, serif; }
.manual-card fieldset { margin-top: 1.5rem; }
.manual-card legend { margin-bottom: .7rem; font-weight: 800; }
.admin-ticket-grid {
  display: grid; grid-template-columns: repeat(10, 1fr);
  max-height: 20rem; overflow-y: auto; gap: .4rem; padding: .25rem;
}
.admin-ticket-grid .ticket { min-height: 2.5rem; }
.paid-option {
  display: flex; align-items: center; gap: .6rem; margin-top: 1.2rem;
}
.paid-option input { width: auto; margin: 0; }
.manual-total { margin: 1rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 760px) {
  .site-header span { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 3rem; padding-top: 4rem; }
  .hero h1 { font-size: 3.2rem; }
  .prize-card { margin-right: 20px; }
  .facts { grid-template-columns: 1fr; }
  .facts div { border-right: 0; border-bottom: 1px solid #d6cfbd; padding-left: 0; }
  .story { grid-template-columns: 1fr; gap: 1rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .progress-copy { text-align: left; }
  .ticket-grid { grid-template-columns: repeat(5, 1fr); }
  .fields { grid-template-columns: 1fr; }
  .phone-fields { grid-template-columns: 1fr; }
  .winner-grid { grid-template-columns: 1fr; }
  .manual-card, .settings-card { grid-template-columns: 1fr; padding: 1.2rem; }
  .admin-ticket-grid { grid-template-columns: repeat(5, 1fr); }
  .countdown { grid-template-columns: repeat(2, minmax(100px, 150px)); }
  .draw-options { grid-template-columns: 1fr; }
  .checkout { padding: 1.2rem; }
}
