/* ── Back-to-School Supply Drop — composition notebook ──────────────
   Ruled paper, red margin line, hole-punch dots, marbled cover band,
   crayon-style headline with highlighter swipe, doodle accents. */

:root {
  --paper: #fdfdfa;
  --rule-blue: rgba(96, 150, 205, 0.35);
  --margin-red: rgba(224, 108, 108, 0.75);
  --ink: #23324a;
  --ink-soft: #71809b;
  --crayon-red: #e0524a;
  --crayon-blue: #2f6fce;
  --highlight: #ffe45c;
  --line: #dfe3ea;
  --err: #d03d34;
  --font-display: 'Chewy', cursive;
  --font-hand: 'Schoolbell', cursive;
  --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: #e8e4da;
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Cover band ───────────────────────────────────────────────────── */
.cover-band {
  background:
    radial-gradient(circle at 12% 40%, #1c1c1c 12%, transparent 13%),
    radial-gradient(circle at 34% 70%, #1c1c1c 14%, transparent 15%),
    radial-gradient(circle at 56% 30%, #1c1c1c 13%, transparent 14%),
    radial-gradient(circle at 78% 60%, #1c1c1c 12%, transparent 13%),
    radial-gradient(circle at 92% 25%, #1c1c1c 10%, transparent 11%),
    #f4f2ec;
  background-size: 90px 44px;
  padding: 14px 0;
  text-align: center;
}

.cover-label {
  font-family: var(--font-hand);
  font-size: 1rem;
  background: #fff;
  border: 2px solid #1c1c1c;
  border-radius: 4px;
  padding: 4px 22px;
  letter-spacing: 0.08em;
}

/* ── Ruled sheet ──────────────────────────────────────────────────── */
.sheet {
  position: relative;
  flex: 1 0 auto;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    transparent 0 31px,
    var(--rule-blue) 31px 32px
  );
  max-width: 760px;
  width: calc(100% - 32px);
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(35, 50, 74, 0.18);
  padding-bottom: 60px;
}

.margin-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 64px;
  width: 2px;
  background: var(--margin-red);
}

.holes { position: absolute; top: 80px; left: 18px; display: flex; flex-direction: column; gap: 130px; }

.holes span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8e4da;
  box-shadow: inset 0 2px 4px rgba(35, 50, 74, 0.25);
}

.content { padding: 40px 34px 0 96px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { padding-bottom: 14px; }

.doodle-line {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--crayon-blue);
  transform: rotate(-1.5deg);
  display: inline-block;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1.05;
  color: var(--ink);
  margin-top: 6px;
}

.hero h1 .hl {
  background: linear-gradient(104deg, transparent 1%, var(--highlight) 4%, var(--highlight) 96%, transparent 99%);
  padding: 0 10px;
  color: var(--crayon-red);
}

.hero .sub { max-width: 480px; margin-top: 12px; font-weight: 700; font-size: 1.05rem; }

.winners-line {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--crayon-red);
  margin-top: 8px;
  transform: rotate(-1deg);
  display: inline-block;
}

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 14px 18px;
  background: #fff;
  border: 2px dashed var(--crayon-blue);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 26px 24px 30px;
  max-width: 480px;
  box-shadow: 4px 6px 0 rgba(47, 111, 206, 0.15);
  margin-top: 10px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 18px;
  color: var(--crayon-blue);
}

/* Fields */
.field { margin-bottom: 15px; }

label {
  display: block;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

input:focus, select:focus { outline: none; border-color: var(--crayon-blue); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; font-weight: 400; }

.fine { margin-top: 12px; text-align: center; color: var(--ink-soft); font-size: 0.84rem; font-weight: 700; }

.rules-link {
  background: none;
  border: none;
  color: var(--crayon-blue);
  font-family: inherit;
  font-size: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.form-error { color: var(--err); font-weight: 800; text-align: center; margin-top: 12px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 13px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
}

.btn:hover:not(:disabled) { transform: translateY(-2px) rotate(-0.5deg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }

.btn-primary {
  background: var(--crayon-red);
  color: #fff;
  box-shadow: 0 5px 0 #a33630;
}

.btn-primary:hover:not(:disabled) { box-shadow: 0 7px 0 #a33630; }

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Done ─────────────────────────────────────────────────────────── */
.done-card { text-align: center; }

.grade-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 3px solid var(--crayon-red);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--crayon-red);
  transform: rotate(-8deg);
  margin-bottom: 12px;
}

.card-sub { color: var(--ink-soft); font-weight: 700; margin-top: 6px; }

/* ── Rules modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(35, 50, 74, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 2px solid var(--line);
}

.modal-head h3 { font-family: var(--font-display); font-size: 1.25rem; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  font-size: 0.92rem;
  white-space: pre-wrap;
  font-weight: 600;
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 14px 26px;
  border-radius: 10px;
  font-weight: 800;
  z-index: 400;
  max-width: 92vw;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: #6f6a5f;
  font-size: 0.85rem;
  font-weight: 700;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .content { padding: 34px 22px 0 58px; }
  .margin-line { left: 40px; }
  .holes { left: 9px; }
  .holes span { width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
