:root {
  --navy: #002147;
  --navy-deep: #00172f;
  --navy-soft: #eaf0f7;
  --gold: #fbc02d;
  --gold-deep: #e3a900;
  --page: #f8fafc;
  --white: #ffffff;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 24px 70px rgba(0, 33, 71, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--slate-800);
}
button, input, select { font: inherit; }
a { color: inherit; }

/* Public portal */
.public-page {
  background:
    radial-gradient(circle at 88% 7%, rgba(0,33,71,.055), transparent 26rem),
    linear-gradient(180deg, #fbfdff 0%, var(--page) 100%);
}

.public-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 26px;
}

.notice-shell {
  width: min(780px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.notice-brand { margin-bottom: 24px; }

.notice-page-card {
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid #edf1f6;
  border-radius: 28px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow);
}

.notice-page-card h2 {
  margin: 8px 0 18px;
  color: var(--navy);
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.15;
}

.notice-copy {
  display: grid;
  gap: 13px;
  color: var(--slate-600);
  font-size: .94rem;
  line-height: 1.65;
}

.notice-copy p { margin: 0; }

.notice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.notice-actions.single-action { grid-template-columns: minmax(0, 360px); justify-content: center; }
.inline-secondary { margin-top: 0; border: 0; cursor: pointer; }

.school-brand {
  text-align: center;
  margin-bottom: 42px;
}

.school-logo {
  width: 118px;
  max-height: 130px;
  object-fit: contain;
  display: block;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 16px rgba(15, 23, 42, .10));
}

.logo-placeholder {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--navy), var(--navy-deep));
  border: 5px solid var(--gold);
  color: white;
  font-size: 2.6rem;
  font-weight: 800;
  box-shadow: 0 18px 35px rgba(0,33,71,.18);
}

.school-brand h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-style: italic;
}
.school-brand h1 span { color: var(--slate-400); }
.gold-rule {
  width: 128px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
  margin: 15px auto 0;
  box-shadow: 0 3px 10px rgba(251,192,45,.25);
}
.school-brand p,
.result-brand p {
  margin: 15px 0 0;
  color: var(--slate-400);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .92fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: start;
}

.info-panel,
.verify-panel,
.result-card,
.draw-live-card,
.admin-card,
.stat {
  background: rgba(255,255,255,.96);
  border: 1px solid #edf1f6;
}

.portal-closed-card { grid-column: 1 / -1; max-width: 620px; margin: 0 auto; }

.info-panel {
  padding: clamp(26px, 4vw, 42px);
  border-radius: 40px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .035);
}
.info-panel h2 {
  margin: 0 0 31px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--slate-800);
}
.info-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 15px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: var(--navy);
  box-shadow: 0 5px 15px rgba(0,33,71,.06);
  font-weight: 800;
}
.steps { display: grid; gap: 28px; }
.step { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: start; }
.step-number {
  font-size: 2.3rem;
  line-height: 1;
  font-weight: 800;
  color: #eef2f7;
  transition: color .18s ease;
}
.step:hover .step-number { color: var(--gold); }
.step h3 { margin: 0 0 6px; font-size: 1.04rem; color: var(--slate-800); letter-spacing: 0; }
.step p { margin: 0; color: var(--slate-500); font-size: .91rem; line-height: 1.65; }

.notice-box {
  margin-top: 31px;
  padding: 20px 22px;
  border-left: 7px solid var(--navy);
  background: var(--slate-100);
  border-radius: 18px;
}
.notice-box strong {
  display: block;
  color: var(--navy);
  font-size: .69rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.notice-box p { margin: 0; color: var(--slate-600); font-size: .86rem; line-height: 1.6; }

.verify-panel {
  position: sticky;
  top: 32px;
  padding: clamp(34px, 5vw, 56px);
  border-radius: 50px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
}
.decor-circle {
  position: absolute;
  top: -70px;
  right: -65px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--navy);
  opacity: .045;
}
.verify-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--navy);
  background: #f4f7fb;
  border: 1px solid #e7edf5;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  margin-bottom: 20px;
}
.verify-panel h2 {
  position: relative;
  margin: 0;
  color: var(--slate-800);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.08;
  font-weight: 800;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: 0;
}
.verify-subtitle {
  margin: 10px 0 32px;
  color: var(--slate-400);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.verify-form { display: grid; gap: 22px; }
.field-group { text-align: left; }
.field-group label {
  display: block;
  margin: 0 0 10px 7px;
  color: var(--slate-400);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.field-group input {
  width: 100%;
  padding: 20px 22px;
  border-radius: 24px;
  border: 2px solid #edf1f5;
  background: #f8fafc;
  color: var(--navy);
  outline: 0;
  text-align: center;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field-group input::placeholder { color: #cbd5e1; font-weight: 600; letter-spacing: 0; text-transform: none; }
.field-group input:focus {
  background: white;
  border-color: var(--navy);
  box-shadow: 0 0 0 7px rgba(0,33,71,.07);
}
.primary-button {
  width: 100%;
  border: 0;
  padding: 19px 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: white;
  cursor: pointer;
  font-size: .79rem;
  line-height: 1;
  font-weight: 800;
  font-style: italic;
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: 0 16px 30px rgba(0,33,71,.18);
  transition: transform .16s ease, box-shadow .16s ease;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 20px 38px rgba(0,33,71,.24); }
.primary-button:disabled { cursor: wait; opacity: .78; transform: none; }
.primary-button:active { transform: scale(.985); }
.help-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--slate-400);
  font-size: .76rem;
  line-height: 1.5;
}
.help-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--navy);
  font-size: .7rem;
  font-weight: 800;
}
.public-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 32px 10px 0;
  color: var(--slate-300);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.public-footer a { margin-left: 9px; text-decoration: none; color: var(--slate-400); }
.public-footer a:hover { color: var(--navy); }

/* Check-in result */
.result-page { display: block; }
.result-shell {
  width: min(600px, calc(100% - 30px));
  margin: 0 auto;
  padding: 54px 0 32px;
}
.result-brand { text-align: center; margin-bottom: 29px; }
.result-school {
  color: var(--navy);
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-style: italic;
}
.result-school span { color: var(--slate-400); }
.result-brand .gold-rule { width: 95px; height: 5px; margin-top: 12px; }
.result-card {
  border-radius: 42px;
  padding: clamp(30px, 6vw, 52px);
  box-shadow: var(--shadow);
  text-align: center;
}
.result-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 21px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  font-size: 2rem;
  font-weight: 800;
}
.result-icon.success { color: var(--green); background: #f0fdf4; border: 1px solid #dcfce7; }
.result-icon.error { color: var(--red); background: #fef2f2; border: 1px solid #fee2e2; }
.result-eyebrow { color: var(--navy); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.result-card h1 { margin: 9px 0 9px; color: var(--slate-800); font-size: clamp(1.55rem, 5vw, 2.15rem); letter-spacing: 0; }
.result-copy { margin: 0 auto; color: var(--slate-500); line-height: 1.6; }
.raffle-box {
  margin: 28px 0 18px;
  padding: 23px 20px;
  border-radius: 25px;
  background: var(--navy);
  color: white;
  box-shadow: 0 18px 35px rgba(0,33,71,.16);
}
.raffle-box span { display: block; color: #a9bdd3; font-size: .67rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.raffle-box strong { display: block; color: var(--gold); font-size: clamp(2rem, 9vw, 3.2rem); line-height: 1; letter-spacing: .035em; }
.result-note { color: var(--slate-400) !important; font-size: .8rem; }
.save-slip-button { margin-top: 18px; }
.save-status {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--slate-400);
  font-size: .78rem;
}
.compact-notice { text-align: left; margin-top: 25px; }
.secondary-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--slate-200);
  background: white;
  color: var(--navy);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Admin dashboard */
.login-shell {
  width: min(460px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}
.login-card { width: 100%; }
.login-card input { text-transform: none; letter-spacing: 0; text-align: left; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 26px; }
.eyebrow { color: var(--gold-deep); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.admin-header h1 { margin: 5px 0 0; color: var(--navy); font-size: 2.2rem; letter-spacing: 0; }
.admin-actions { display: flex; align-items: center; gap: 10px; }
.admin-actions { flex-wrap: wrap; justify-content: flex-end; }
.admin-actions form { margin: 0; }
.admin-menu { position: relative; }
.admin-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--slate-200);
  border-radius: 15px;
  background: white;
  color: var(--navy);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}
.admin-menu summary::-webkit-details-marker { display: none; }
.hamburger-icon {
  display: inline-grid;
  gap: 4px;
  width: 18px;
}
.hamburger-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.admin-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: white;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}
.admin-menu-panel .button-secondary,
.admin-menu-panel form,
.admin-menu-panel button {
  width: 100%;
}
.data-menu {
  margin-bottom: 18px;
}
.data-menu > summary {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 12px;
  background: #fbfdff;
}
.button-secondary { display: inline-flex; justify-content: center; align-items: center; padding: 13px 16px; border-radius: 15px; background: white; border: 1px solid var(--slate-200); color: var(--navy); font-weight: 800; text-decoration: none; cursor: pointer; }
.compact-link { padding: 9px 11px; border-radius: 12px; font-size: .76rem; }
.status-open { border-color: #fecaca; color: #991b1b; }
.status-closed { border-color: #bbf7d0; color: #166534; }
.alert {
  margin: 0 0 14px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: .86rem;
  font-weight: 700;
}
.success-alert { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.error-alert { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 20px; border-radius: 20px; box-shadow: 0 8px 25px rgba(15,23,42,.035); }
.stat span { display: block; color: var(--slate-500); font-size: .81rem; margin-bottom: 8px; }
.stat strong { color: var(--navy); font-size: 2rem; }
.admin-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 0;
}
.tool-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 20px;
  border: 1px solid #edf1f6;
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 25px rgba(15,23,42,.03);
}
.tool-panel h2 { margin: 0 0 5px; color: var(--slate-800); font-size: 1.08rem; }
.tool-panel p { margin: 0; color: var(--slate-500); font-size: .84rem; line-height: 1.5; }
.wide-tool { grid-column: 1 / -1; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.tool-panel input,
.tool-panel select,
.tool-panel textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--slate-800);
  outline: 0;
}
.tool-panel input:focus,
.tool-panel select:focus,
.tool-panel textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(0,33,71,.07);
}
.tool-panel textarea { resize: vertical; min-height: 120px; }
.check-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--slate-600);
  font-size: .85rem;
  font-weight: 700;
}
.check-row label { display: inline-flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.clear-panel { border-color: #fed7aa; }
.full-clear-panel { border-color: #fecaca; }
.admin-card { border-radius: 24px; overflow: hidden; box-shadow: 0 8px 28px rgba(15,23,42,.04); }
.recent-card { margin-top: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 21px 22px; border-bottom: 1px solid var(--slate-100); }
.section-head h2 { margin: 0; color: var(--slate-800); }
.section-head span { color: var(--slate-400); font-size: .8rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px 22px; border-bottom: 1px solid var(--slate-100); white-space: nowrap; }
th { color: var(--slate-400); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--slate-700); font-size: .9rem; }
td form { margin-top: 8px; }
td small { display: inline-block; margin-top: 5px; color: var(--slate-500); font-size: .72rem; }
.empty { padding: 35px; text-align: center; color: var(--slate-400); }
.pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.pill.ok { color: #166534; background: #dcfce7; }
.pill.warn { color: #92400e; background: #fef3c7; }
.pill.muted { color: var(--slate-500); background: var(--slate-100); }
.danger-button {
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
  padding: 9px 11px;
  text-transform: uppercase;
}
.danger-wide { width: 100%; padding: 13px 14px; }
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px;
  background: #fbfdff;
}
.pagination a {
  min-width: 39px;
  padding: 10px 12px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: white;
  color: var(--navy);
  text-align: center;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 800;
}
.pagination a.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.draw-list { display: grid; gap: 8px; }
.draw-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  color: var(--slate-700);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 800;
}
.draw-list a.active { border-color: var(--navy); color: var(--navy); background: #f8fafc; }
.draw-list span { color: var(--slate-400); font-size: .72rem; }
.compact-empty { padding: 14px; }
.draw-share-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--slate-100);
}
.draw-share-row input {
  flex: 1 1 320px;
  min-width: min(100%, 260px);
  padding: 13px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--slate-700);
}
.draw-share-row form {
  flex: 0 1 155px;
  margin: 0;
}
.draw-share-row .button-secondary { width: 100%; }
.draw-share-row > .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 145px;
  text-decoration: none;
}
.winner-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 22px;
}
.winner-tile {
  padding: 20px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: white;
  text-align: center;
}
.winner-tile span { display: block; color: var(--gold-deep); font-size: .74rem; font-weight: 800; letter-spacing: .12em; }
.winner-tile strong { display: block; margin-top: 8px; color: var(--navy); font-size: 1.28rem; }
.winner-tile em { display: block; margin-top: 6px; color: var(--slate-500); font-style: normal; font-weight: 800; }
.winner-tile small { display: block; margin-top: 10px; color: var(--slate-600); font-weight: 700; }
.tile-redraw-form { margin-top: 14px; }
.tile-redraw-form .button-secondary {
  width: 100%;
  padding: 12px 14px;
}
.draw-public-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}
.draw-live-card {
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 5vw, 42px);
  text-align: center;
}
.draw-live-card h1 {
  margin: 9px 0;
  color: var(--navy);
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
}
.draw-waiting {
  margin-top: 30px;
  padding: 36px 20px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--gold);
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 800;
  text-transform: uppercase;
}
.public-winner-board { padding: 28px 0 0; }
.public-winner { box-shadow: 0 12px 30px rgba(15,23,42,.08); }
.draw-stage-page {
  min-height: 100vh;
  height: 100vh;
  background:
    linear-gradient(135deg, rgba(0, 33, 71, .96), rgba(9, 31, 56, .94)),
    radial-gradient(circle at 18% 12%, rgba(251, 192, 45, .22), transparent 30rem);
  color: white;
  overflow: hidden;
}
.draw-stage-shell {
  width: min(1180px, calc(100% - 36px));
  height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(14px, 2.4vh, 28px) 0 clamp(18px, 3vh, 34px);
  display: flex;
  flex-direction: column;
}
.draw-stage-header {
  display: grid;
  grid-template-columns: clamp(58px, 8vh, 92px) 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(14px, 3vh, 34px);
  transition: margin .45s ease, transform .45s ease;
}
.draw-stage-shell.is-results-full .draw-stage-header {
  margin-bottom: clamp(8px, 1.4vh, 14px);
}
.stage-logo {
  width: clamp(56px, 8vh, 86px);
  max-height: clamp(64px, 9vh, 96px);
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .28));
}
.stage-kicker {
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.draw-stage-header h1 {
  margin: 6px 0 0;
  color: white;
  font-size: clamp(1.35rem, 4vw, 3rem);
  line-height: 1;
  text-transform: uppercase;
}
.stage-exit {
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: white;
  text-decoration: none;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.draw-stage-hero {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: min(52dvh, 520px);
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .045)),
    rgba(255, 255, 255, .04);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .28);
  text-align: center;
  transform-origin: top center;
  transition: opacity .55s ease, transform .55s ease, max-height .55s ease, padding .55s ease, border-width .55s ease, margin .55s ease;
}
.draw-stage-hero.is-drawn {
  flex: 0 0 auto;
  max-height: 260px;
  min-height: 0;
  padding: clamp(18px, 3vh, 32px);
}
.draw-stage-hero.is-collapsed {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-42px) scale(.98);
}
.draw-stage-hero h2 {
  width: min(920px, 100%);
  margin: 16px auto;
  color: white;
  font-size: clamp(2rem, 7vw, 6.1rem);
  line-height: .94;
  text-transform: uppercase;
}
.draw-stage-hero p {
  margin: 0 0 30px;
  color: #c7d7eb;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
}
.stage-start-button {
  min-width: min(360px, 80vw);
  border: 0;
  border-radius: 999px;
  padding: 22px 34px;
  background: var(--gold);
  color: var(--navy);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 22px 45px rgba(251, 192, 45, .24);
}
.draw-countdown {
  display: grid;
  place-items: center;
  gap: 8px;
  width: min(230px, 42vh, 70vw);
  aspect-ratio: 1;
  margin-top: clamp(8px, 2vh, 22px);
  border: 3px solid rgba(251, 192, 45, .72);
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 45px rgba(251, 192, 45, .12), 0 18px 60px rgba(0, 0, 0, .24);
}
.countdown-label {
  align-self: end;
  color: #c7d7eb;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.draw-countdown strong {
  align-self: start;
  color: var(--gold);
  font-size: clamp(3.2rem, 10vw, 6rem);
  line-height: .85;
}
.draw-stage-hero.is-complete .countdown-label { color: var(--gold); }
.draw-stage-hero.is-complete .draw-countdown strong {
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 1;
}
.stage-winners {
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
  min-height: 0;
  margin-top: clamp(14px, 2.5vh, 26px);
  padding-bottom: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: gap .35s ease, margin .35s ease;
}
.stage-winners.is-expanded {
  grid-template-columns: repeat(var(--winner-cols, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--winner-rows, 3), minmax(0, 1fr));
  align-content: stretch;
  gap: clamp(7px, 1.25vh, 14px);
  margin-top: clamp(8px, 1.4vh, 14px);
  overflow: hidden;
}
.stage-winner-card {
  display: grid;
  grid-template-columns: minmax(130px, .3fr) minmax(0, .28fr) minmax(0, 1fr) minmax(150px, .28fr) minmax(112px, .18fr);
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(14px, 2.5vw, 24px);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--slate-800);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(22px) scale(.98);
  transition: opacity .55s ease, transform .55s ease;
}
.stage-winners.is-expanded .stage-winner-card {
  position: relative;
  grid-template-columns: 1fr;
  align-content: center;
  gap: clamp(4px, .75vh, 10px);
  min-height: 100%;
  padding: clamp(10px, 1.45vw, 22px);
  text-align: center;
}
.stage-winner-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.stage-winner-card.is-redrawing {
  outline: 3px solid var(--gold);
  box-shadow: 0 0 0 7px rgba(251, 192, 45, .2), 0 18px 60px rgba(0, 0, 0, .22);
}
.stage-winner-card.is-redrawn {
  animation: redrawnPulse 1.6s ease 2;
  outline: 3px solid var(--green);
}
@keyframes redrawnPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.015); }
}
.stage-winner-card:first-child { border-left: 8px solid var(--slate-400); }
.stage-winner-card:last-child {
  border-color: rgba(251, 192, 45, .65);
  border-left: 8px solid var(--gold);
  background: linear-gradient(90deg, #fff7d6, white 44%);
}
.stage-place {
  color: var(--gold-deep);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stage-winner-card em {
  color: var(--navy);
  font-style: normal;
  font-weight: 900;
}
.stage-winner-card strong {
  color: var(--navy);
  font-size: clamp(1.15rem, 2.6vw, 2.1rem);
  line-height: 1.08;
}
.stage-winner-card small {
  justify-self: end;
  color: var(--slate-500);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.stage-winners.is-expanded .stage-winner-card small,
.stage-winners.is-expanded .stage-redraw-form {
  justify-self: center;
}
.stage-winners.is-expanded .stage-redraw-form {
  position: absolute;
  top: 10px;
  right: 10px;
}
.stage-winners.is-expanded .stage-winner-card strong {
  font-size: clamp(1.05rem, min(2.45vw, 5.1vh), 2.5rem);
}
.stage-winners.is-expanded .stage-place,
.stage-winners.is-expanded .stage-winner-card em,
.stage-winners.is-expanded .stage-winner-card small {
  font-size: clamp(.68rem, min(1vw, 1.9vh), .98rem);
}
.stage-redraw-form {
  align-self: start;
  justify-self: end;
  margin: 0;
}
.stage-redraw-form button {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 33, 71, .16);
  border-radius: 50%;
  background: var(--gold);
  color: transparent;
  cursor: pointer;
  display: block;
  overflow: hidden;
  padding: 0;
  text-indent: -999px;
  box-shadow: 0 3px 10px rgba(251, 192, 45, .35);
}
.stage-redraw-form button[data-counting="1"] {
  width: auto;
  min-width: 112px;
  height: auto;
  border-radius: 999px;
  color: var(--navy);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 10px 12px;
  text-indent: 0;
  text-transform: uppercase;
}
.stage-redraw-form button:hover {
  border-color: white;
  transform: scale(1.16);
}
.stage-redraw-form button:disabled,
.tile-redraw-form button:disabled {
  opacity: .78;
  cursor: wait;
}
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 50;
}

@media (max-width: 860px) {
  .public-shell { padding-top: 28px; }
  .notice-actions { grid-template-columns: 1fr; }
  .school-brand { margin-bottom: 27px; }
  .school-logo { width: 98px; }
  .portal-grid { grid-template-columns: 1fr; gap: 22px; }
  .verify-panel { position: relative; top: auto; grid-row: 1; border-radius: 36px; }
  .info-panel { grid-row: 2; border-radius: 32px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-actions,
  .admin-actions form,
  .admin-header .button-secondary { width: 100%; }
  .admin-actions { flex-direction: column; }
  .admin-menu,
  .admin-menu summary { width: 100%; }
  .admin-menu-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
  .admin-tools { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .draw-stage-header { grid-template-columns: 70px 1fr; }
  .stage-exit { grid-column: 1 / -1; justify-self: start; }
  .stage-logo { width: 64px; }
  .draw-stage-hero { min-height: 44vh; }
  .stage-winner-card { grid-template-columns: 1fr; text-align: center; }
  .stage-winner-card small { justify-self: center; }
  .stage-redraw-form { justify-self: center; }
  .stage-winners.is-expanded {
    grid-template-columns: repeat(var(--winner-cols, 1), minmax(0, 1fr));
    grid-template-rows: repeat(var(--winner-rows, 1), minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .public-shell { width: min(94%, 1180px); padding-top: 21px; }
  .logo-placeholder { width: 76px; height: 76px; border-radius: 22px; font-size: 2rem; }
  .school-brand h1 { font-size: 1.88rem; }
  .school-brand p { letter-spacing: .19em; font-size: .62rem; }
  .verify-panel { padding: 31px 22px; }
  .info-panel { padding: 25px 22px; }
  .step { grid-template-columns: 48px 1fr; gap: 10px; }
  .step-number { font-size: 1.9rem; }
  .field-group input { padding: 18px 15px; border-radius: 21px; }
  .primary-button { border-radius: 21px; padding: 18px; }
  .public-footer { letter-spacing: .11em; }
  .public-footer a { flex-basis: 100%; text-align: center; margin-left: 0; margin-top: 5px; }
  .result-shell { padding-top: 33px; }
  .result-card { border-radius: 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 1.65rem; }
  .form-grid { grid-template-columns: 1fr; }
}
