@font-face { font-family: Manjari; src: url('/manjari.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Manjari; src: url('/manjari-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Bricolage; src: url('/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #1f1a3d;
  --ink-soft: #4a4566;
  --paper: #fff7e8;
  --card: #fff;
  --line: #1f1a3d;
  --field: #fffdf8;
  --orange: #ff6b2c;
  --sun: #ffc530;
  --error: #c2213b;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--ink);
  --display: Bricolage, 'Arial Black', system-ui, sans-serif;
  font: 17px/1.5 Manjari, 'Noto Sans Malayalam', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; overflow-y: scroll; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(#1f1a3d14 1.2px, transparent 1.4px);
  background-size: 22px 22px;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Activity colors */
.c-story { --c: #2e8ff0; --tint: #e3f0ff; --on: #fff; }
.c-dialogue { --c: #ef4f8b; --tint: #ffe6f0; --on: #fff; }
.c-poem { --c: #7a5af8; --tint: #efeaff; --on: #fff; }
.c-song { --c: #ff6b2c; --tint: #ffece2; --on: #fff; }
.c-speech { --c: #1f9d64; --tint: #e0f6ea; --on: #fff; }
.c-action-song { --c: #ffc530; --tint: #fff4d1; --on: var(--ink); }
.c-calligraphy { --c: #0fa3a3; --tint: #dcf6f4; --on: #fff; }
.c-other { --c: #e2483d; --tint: #ffe5e2; --on: #fff; }

.shell { width: min(1140px, calc(100% - 32px)); margin-inline: auto; }

/* Header */
.masthead { background: var(--card); border-bottom: 2px solid var(--ink); }
.mast-inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 16px; }
.parent-brand, .related-app { display: inline-flex; align-items: center; }
.parent-brand img { display: block; width: 110px; height: 56px; object-fit: contain; }
.related-app {
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  text-decoration: none;
  font: 700 .82rem/1 system-ui, sans-serif;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.related-app img { border-radius: 7px; }
.related-app:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }

/* Layout */
.layout { display: grid; gap: 28px; padding-block: 28px 56px; align-items: start; }

/* Hero */
.hero { position: relative; min-width: 0; }
.event-brand { display: inline-flex; align-items: center; gap: 10px; margin: 0; font: 600 .9rem/1.25 system-ui, sans-serif; color: var(--ink-soft); }
.event-brand img { border-radius: 10px; border: 2px solid var(--ink); }
.event-brand p { margin: 0; }
.event-brand strong { display: block; color: var(--ink); font-size: 1rem; }
h1 {
  margin: 18px 0 14px;
  font: 800 clamp(3.4rem, 15vw, 6.6rem)/.9 var(--display);
  letter-spacing: -.045em;
}
h1 span { display: inline-block; }
.t-1 { color: var(--ink); }
.t-2 { position: relative; color: var(--orange); }
.squiggle {
  position: absolute;
  left: 2%;
  bottom: -.24em;
  width: 96%;
  height: .26em;
  stroke: var(--sun);
  stroke-width: 7;
}
.ticket {
  display: inline-flex;
  align-items: stretch;
  margin: 30px 0 0;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--sun);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  overflow: hidden;
}
.ticket-label {
  display: grid;
  place-content: center;
  padding: 6px 12px 4px;
  border-right: 2px dashed var(--ink);
  background: var(--card);
  font: 800 .72rem/1 var(--display);
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}
.ticket-label b { display: block; font-size: 1.5rem; letter-spacing: -.02em; }
.ticket time { align-self: center; white-space: nowrap; padding: 10px 16px 7px; font-weight: 700; font-size: 1.02rem; }
.hero-badges { display: flex; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; }
.hero-badges li {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--c);
  color: var(--on);
  box-shadow: 3px 3px 0 var(--ink);
}
.hero-badges li:nth-child(odd) { transform: rotate(-6deg); }
.hero-badges li:nth-child(even) { transform: rotate(5deg) translateY(4px); }
.hero-badges svg { width: 24px; height: 24px; stroke-width: 2.2; }

/* Card */
.card {
  min-width: 0;
  padding: 22px 18px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--ink);
}
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 6px; }
h2 { margin: 0; font-size: 1.75rem; line-height: 1.3; font-weight: 700; }
.card-head p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* Form */
fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.wide { grid-column: 1 / -1; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 18px;
  border-top: 2px dashed #1f1a3d33;
  font-weight: 700;
  font-size: 1.05rem;
}
.step:first-child { margin-top: 4px; }
.step-no {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sun);
  font: 800 .95rem/1 var(--display);
}
.step:nth-of-type(2) .step-no { background: #ffb3cf; }
.step:nth-of-type(3) .step-no { background: #a8e6c8; }
.fields > label, legend { font-weight: 700; line-height: 1.4; }
.fields > label input, .fields > label select {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 52px;
  padding: 13px 14px 9px;
  background: var(--field);
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 400;
  transition: box-shadow .15s, background .15s;
}
.fields > label input:hover, .fields > label select:hover { background-color: #fff; }
.fields > label select {
  appearance: none;
  padding-right: 40px;
  color: var(--ink);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 20px center, right 14px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.fields > label select:has(option[value=""]:checked) { color: #7a7690; }
.fields > label select option { color: var(--ink); }
.fields > label select:focus, .fields > label input:focus { outline: none; background-color: #fff; box-shadow: 0 0 0 4px #ff6b2c55; border-color: var(--orange); }
input::placeholder { color: #7a7690; opacity: 1; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-hint { margin: 2px 0 10px; color: var(--ink-soft); font-size: .92rem; }
.field-error { display: block; margin: 8px 0 0; color: var(--error); font-weight: 700; font-size: .95rem; }
.fields > label select[aria-invalid="true"], .fields > label input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 4px #c2213b33; }
.required-mark { margin-inline-start: .2em; color: var(--error); font: 700 .9em system-ui, sans-serif; }

/* Activity choices */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid label { display: grid; min-width: 0; position: relative; cursor: pointer; }
.choice-grid input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  line-height: 1.3;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s, background .15s;
  user-select: none;
}
.choice-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 11px;
  background: var(--tint);
  color: var(--c);
  stroke-width: 2.2;
  transition: background .15s, color .15s;
}
.c-action-song .choice-icon { color: #9a6b00; }
.choice-name { flex: 1; min-width: 0; padding-top: 3px; }
.tick {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 3px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  stroke: transparent;
  stroke-width: 3.2;
  background: var(--card);
  transition: background .15s, stroke .15s, transform .2s;
}
@media (hover: hover) { .choice-grid label:hover .choice { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); } }
.choice-grid input:checked + .choice { background: var(--tint); box-shadow: var(--shadow); transform: translate(-2px, -2px); }
.choice-grid input:checked + .choice .choice-icon { background: var(--c); color: var(--on); }
.choice-grid input:checked + .choice .tick { background: var(--ink); stroke: #fff; transform: scale(1.08); }
.choice-grid input:focus-visible + .choice { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Submit */
#challenge { max-width: 100%; min-height: 0; }
.submit {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  margin-top: 6px;
  padding: 12px 20px 8px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--orange);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.submit-arrow { width: 24px; height: 24px; margin-top: -3px; stroke-width: 2.6; transition: transform .15s; }
.submit:hover:not(:disabled) { background: #f25a18; }
.submit:hover:not(:disabled) .submit-arrow { transform: translateX(4px); }
.submit:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.submit:disabled { background: #d9d5cc; color: var(--ink-soft); box-shadow: 2px 2px 0 #1f1a3d55; cursor: default; }
.submit:disabled .submit-arrow { display: none; }

.secondary-button {
  min-height: 48px;
  margin-top: 14px;
  padding: 10px 18px 7px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  transition: transform .12s, box-shadow .12s;
}
.secondary-button:hover { background: #fff4d1; }
.secondary-button:active { transform: translate(3px, 3px); box-shadow: none; }

.notice {
  margin: 0;
  padding: 12px 14px 9px;
  border: 2px solid var(--error);
  border-radius: 14px;
  background: #fff0f1;
  color: var(--error);
  font-weight: 700;
  scroll-margin-block: 24px;
}

/* Result */
.result { position: relative; padding: 8px 0; text-align: center; }
.result h2 { margin: 0; font-size: clamp(1.45rem, 5vw, 1.9rem); }
.result p { margin: 6px 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.result-check { display: none; }
.result[data-kind="success"] { padding: 28px 0 8px; }
.result[data-kind="success"] .result-check {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #a8e6c8;
  box-shadow: var(--shadow);
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
.result-check svg { width: 40px; height: 40px; stroke-width: 3.2; }
.result[data-kind="closed"], .result[data-kind="error"] {
  padding: 22px 18px 18px;
  border: 2px dashed #1f1a3d55;
  border-radius: 18px;
  background: var(--paper);
}
#result-activities { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
#result-activities li {
  padding: 6px 13px 3px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--tint, #fff);
  font-weight: 700;
}
.confetti { display: none; }
.result[data-kind="success"] .confetti { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: 70px;
  left: 50%;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  background: var(--orange);
  opacity: 0;
  animation: burst 1.1s cubic-bezier(.1, .7, .3, 1) .1s forwards;
}
.confetti i:nth-child(4n+2) { background: var(--sun); }
.confetti i:nth-child(4n+3) { background: #2e8ff0; border-radius: 50%; width: 10px; height: 10px; }
.confetti i:nth-child(4n+4) { background: #ef4f8b; }
.confetti i:nth-child(1) { --x: -150px; --y: -40px; --r: 200deg; }
.confetti i:nth-child(2) { --x: -110px; --y: -70px; --r: -120deg; }
.confetti i:nth-child(3) { --x: -70px; --y: -60px; --r: 90deg; }
.confetti i:nth-child(4) { --x: -30px; --y: -80px; --r: 260deg; }
.confetti i:nth-child(5) { --x: 30px; --y: -78px; --r: -200deg; }
.confetti i:nth-child(6) { --x: 70px; --y: -62px; --r: 140deg; }
.confetti i:nth-child(7) { --x: 110px; --y: -72px; --r: -90deg; }
.confetti i:nth-child(8) { --x: 150px; --y: -36px; --r: 300deg; }
.confetti i:nth-child(9) { --x: -130px; --y: 20px; --r: 160deg; }
.confetti i:nth-child(10) { --x: 130px; --y: 24px; --r: -160deg; }
.confetti i:nth-child(11) { --x: -90px; --y: 40px; --r: 60deg; }
.confetti i:nth-child(12) { --x: 90px; --y: 44px; --r: -60deg; }
@keyframes burst {
  0% { opacity: 1; transform: translate(-50%, 0) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)); }
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Larger screens */
@media (min-width: 880px) {
  .shell { width: min(1140px, calc(100% - 64px)); }
  .layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 5vw, 72px); padding-block: 56px 80px; }
  .hero { position: sticky; top: 40px; padding-top: 12px; }
  .card { padding: 32px; }
  .fields { gap: 18px 16px; }
}
@media (max-width: 879px) {
  .hero { padding-top: 4px; }
    .hero-badges { position: absolute; top: 4px; right: 0; margin: 0; gap: 6px; }
  .hero-badges li { width: 38px; height: 38px; border-radius: 11px; }
  .hero-badges li:nth-child(n+4) { display: none; }
  .hero-badges svg { width: 19px; height: 19px; }
}
@media (max-width: 419px) {
  .shell { width: calc(100% - 24px); }
  .card { padding: 20px 14px; border-radius: 20px; box-shadow: 4px 4px 0 var(--ink); }
  .parent-brand img { width: 96px; height: 50px; }
  .hero-badges li:nth-child(n+3) { display: none; }
  .choice-grid { gap: 8px; }
  .choice { gap: 7px; padding: 8px; font-size: .95rem; }
  .choice-icon { flex-basis: 32px; width: 32px; height: 32px; padding: 6px; }
  .tick { flex-basis: 20px; width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .result[data-kind="success"] .confetti { display: none; }
}
