:root {
  color-scheme: light;
  --cream: #f7f1e8;
  --paper: #fffcf7;
  --maroon: #8a1538;
  --maroon-dark: #6d102c;
  --ink: #1f2a44;
  --muted: #5a5260;
  --gold: #c9a24b;
  --line: #e3d7c8;
  --green: #17613d;
  --radius: 14px;
  font-family: Tajawal, Tahoma, sans-serif;
  font-synthesis: none;
  font-variant-numeric: lining-nums tabular-nums;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.55;
  border-block-start: 4px solid var(--maroon);
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--maroon); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--maroon); line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.3rem, 7vw, 3.65rem); font-weight: 800; }
h2 { font-size: 1.65rem; font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 800; }
p, li, address { overflow-wrap: anywhere; }

.shell { width: min(100% - 2rem, 50rem); margin: 0 auto; }
.admin-shell { width: min(100% - 2rem, 76rem); }
.hero { position: relative; padding: 1.75rem 0 1.25rem; display: grid; gap: .45rem; }
.brand {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  min-height: 48px;
  margin-block-end: .4rem;
  color: var(--maroon);
  font-weight: 800;
  text-decoration: none;
}
.brand img {
  width: 76px;
  height: 76px;
  padding: 5px;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.event { color: var(--maroon); font-size: 1.125rem; font-weight: 700; }
.gold-rule {
  display: flex; align-items: center; gap: .45rem; margin-block: .45rem .2rem;
  width: 5.5rem; height: .5rem;
}
.gold-rule::before { content: ''; background: var(--gold); height: 1px; flex: 1; }
.gold-rule::after { content: ''; background: var(--gold); width: .35rem; height: .35rem; rotate: 45deg; }
.contact { font-style: normal; }
.contact p { margin-block: 0 .35rem; }
.contact-actions, .actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.centered { justify-items: center; text-align: center; }
.home { max-width: 33rem; padding-block-start: clamp(1.25rem, 8vh, 5rem); }
.home .hero {
  padding: clamp(1.5rem, 6vw, 3rem) 1rem 1.1rem;
  background: linear-gradient(180deg, var(--paper), var(--cream));
  border: 1px solid var(--line);
  border-block-end: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.home h1 { font-size: clamp(2rem, 8vw, 3.1rem); }
.home-links { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .25rem auto; max-width: 26rem; }
.site-footer {
  margin: 2rem auto 0;
  padding: .95rem 1rem 1.2rem;
  width: min(100% - 2rem, 50rem);
  border-block-start: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .93rem;
  overflow-wrap: anywhere;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 3.6vw, 1.8rem);
  box-shadow: 0 2px 10px #38224509;
  min-width: 0;
}
.card + .card, .public-shell > .card:not(:last-child) { margin-block-end: .9rem; }
.card h2 { margin-block-end: .8rem; }
.notice {
  border-inline-start: 3px solid var(--gold);
  background: var(--paper);
  padding: .8rem 1rem;
  margin-block-end: .9rem;
  border-radius: 6px;
}
.workshop-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: .8rem;
  margin-block-end: .9rem;
}
.workshop-card { display: grid; align-content: start; gap: .4rem; }
.workshop-card h2, .workshop-card p { margin: 0; }
.workshop-card .button { width: fit-content; }
.workshop-time { color: var(--muted); }
.workshop-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-block-start: .35rem; }
.price, .total { font-weight: 800; color: var(--maroon); }
.success { border-block-start: 3px solid var(--gold); }
.success p + p { margin-block-start: .45rem; }
.payment-steps { margin: .8rem 0 1rem; padding-inline-start: 1.35rem; }
.payment-steps li + li { margin-block-start: .35rem; }
.registration-code { display: inline-block; color: var(--maroon); font-weight: 800; letter-spacing: .03em; }
form { display: grid; gap: .85rem; }
form > .button { justify-self: start; }
label, legend { font-weight: 700; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
label:not(.check) > :is(input:not([type=checkbox], [type=radio]), textarea, select) {
  display: block;
  width: 100%;
  margin-block-start: .22rem;
}
input:not([type=checkbox], [type=radio]), select, textarea {
  min-height: 48px;
  min-width: 0;
  border: 1px solid #b9a9a2;
  border-radius: 8px;
  background: #fff;
  padding: .48rem .65rem;
  color: var(--ink);
  font-weight: 500;
}
textarea { resize: vertical; }
input:is([type=checkbox], [type=radio]) {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--maroon);
  margin: 0;
  flex: none;
}
.check, .choices label {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  cursor: pointer;
}
.choices { display: flex; gap: .45rem; flex-wrap: wrap; }
.choices label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .15rem .5rem;
  background: #fff;
}
.choices label:has(input:checked) { border-color: var(--maroon); }
.optional, .hint { color: var(--muted); font-size: .94rem; font-weight: 500; }
.hint { margin-block-start: -.6rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.form-message { color: var(--maroon-dark); font-weight: 700; }
.form-message[data-tone="success"] { color: var(--green); }
.button, #admin-tabs button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  max-width: 100%;
  padding: .48rem .9rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--maroon);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background-color .16s ease, color .16s ease;
}
.button:hover { background: var(--maroon-dark); }
.button.outline { background: transparent; color: var(--maroon); border-color: var(--maroon); }
.button.outline:hover, #admin-tabs button:hover { background: #f1e3e7; }
.button.whatsapp { background: var(--green); }
.button.whatsapp:hover { background: #104d30; }
.button:disabled { color: #5a5254; background: #ebe3dc; cursor: default; }
.skip-link {
  position: absolute; left: .5rem; top: .5rem; padding: .7rem;
  background: var(--paper); z-index: 1; transform: translateY(-160%);
}
.skip-link:focus-visible { transform: translateY(0); }

.login-card { max-width: 30rem; }
.dashboard-nav { display: flex; align-items: flex-start; gap: .65rem; justify-content: space-between; flex-wrap: wrap; margin-block-end: .8rem; }
#admin-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
#admin-tabs button { background: var(--paper); border-color: var(--line); color: var(--maroon); }
#admin-tabs button[aria-current="true"] { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.dashboard-panel { padding: clamp(.8rem, 3vw, 1.5rem); }
.panel-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .8rem; margin-block-end: .75rem; }
.panel-toolbar > label { flex: 1 1 12rem; max-width: 24rem; }
.panel-toolbar p { align-self: center; }
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; text-align: start; }
th, td { padding: .6rem .7rem; text-align: start; vertical-align: middle; border-block-end: 1px solid var(--line); }
th { background: #f3e9de; color: var(--maroon-dark); }
td { min-width: 5rem; }
td .actions { flex-wrap: nowrap; }
td .button, .nowrap { white-space: nowrap; }
tr:last-child td { border-block-end: 0; }
.draw-form, .settings-form { max-width: 44rem; }
.draw-results, .draw-history, .workshop-editor { margin-block-start: 1rem; }
.draw-results { border-block-start: 1px solid var(--line); padding-block-start: .85rem; }
.draw-preview { min-height: 2rem; font-weight: 800; color: var(--maroon); animation: fade-in .16s ease both; }
@keyframes fade-in { from { opacity: .45; } to { opacity: 1; } }
.winners { padding-inline-start: 1.5rem; margin-block: .55rem; }
.winners li { padding-block: .25rem; }
.winners li > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .55rem; }
.winner-digits { display: block; color: var(--muted); font-size: .94rem; }
.round { padding: .8rem 0; border-block-end: 1px solid var(--line); }
.round time { color: var(--muted); }
.workshop-editor form { margin-block-start: .8rem; }
.workshop-editor summary { cursor: pointer; font-weight: 800; min-height: 48px; padding-block: .55rem; }

@media (max-width: 32rem) {
  .public-shell form > .button, .login-card form > .button { width: 100%; }
  .settings-form .form-grid, .workshop-editor .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 23rem) {
  .home-links, .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
