@charset "UTF-8";

:root {
  color-scheme: light;
  --background: #f3effc;
  --panel: #fff;
  --ink: #211846;
  --muted: #5e5576;
  --line: #ddd4ee;
  --purple: #5632bb;
  --deep: #3c1c91;
  --lavender: #e8dcff;
  --yellow: #ffdf62;
  --green: #14583c;
  --green-surface: #daf3df;
  --error: #a1274f;
  font-family: "Arial", "Helvetica Neue", sans-serif;
  background: var(--background);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
body, input, textarea, button { font-size: 1rem; }
body { line-height: 1.5; }
[hidden] { display: none !important; }
button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, p, ol, dl, dd { margin: 0; }
h1, h2 { line-height: 1.08; letter-spacing: -.04em; }
h1 { font-size: clamp(2.5rem, 7vw, 5rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 2rem); }
:focus-visible { outline: 3px solid #7752e5; outline-offset: 3px; }
input, textarea { width: 100%; padding: .65rem .8rem; border: 1px solid #a99cbf; border-radius: .6rem; background: white; }
input { min-height: 44px; }
textarea { resize: vertical; }
label { display: grid; gap: .35rem; font-weight: 700; }
summary { cursor: pointer; font-weight: 700; padding: .25rem 0; }
details[open] summary { margin-bottom: .65rem; }
.wrap { width: min(100% - 2.25rem, 1120px); margin-inline: auto; }
.site-header, .site-footer { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.site-header { min-height: 80px; padding-block: .75rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 2.4rem; padding-block: 1rem 1.5rem; font-size: .875rem; color: var(--muted); }
.site-footer a { text-underline-offset: .2em; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 900; font-size: 1.5rem; line-height: 1.05; }
.brand-mark { display: block; width: 44px; height: 44px; flex: none; border-radius: 50%; }
.brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; margin-top: .2rem; }

.hero {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  min-height: 415px;
  border: 1px solid #d7c6f6;
  border-radius: 30px;
  overflow: hidden;
  background: radial-gradient(ellipse at 75% 35%, #f8f3ff, transparent 48%), #e6d8ff;
  box-shadow: 0 6px 0 #d7c5f5;
}
.hero-copy { display: grid; align-content: center; justify-items: start; gap: 1.3rem; padding: clamp(1.55rem, 5vw, 4rem); z-index: 1; }
.event-tag { display: inline-block; padding: .4rem .85rem; background: var(--yellow); border-radius: 2rem; transform: rotate(-4deg); font-size: .8rem; font-weight: 900; letter-spacing: .085em; }
.hero h1 { font-size: clamp(3.45rem, 9vw, 7rem); line-height: .84; letter-spacing: -.079em; }
.hero h1 strong { color: var(--purple); }
.hero p { max-width: 24rem; color: #473565; font-size: clamp(1rem, 2vw, 1.2rem); }
.hero-art { position: relative; min-height: 220px; display: grid; place-items: center; isolation: isolate; }
.orbit-ring { position: absolute; width: min(90%, 390px); aspect-ratio: 1; border: 2px dashed #9a77dc91; border-radius: 50%; z-index: -1; transform: rotate(-20deg); }
.orbit-inner { width: min(72%, 310px); border-style: solid; border-color: #b496ec80; }
.hero-dial { display: block; width: min(72%, 312px); height: auto; aspect-ratio: 1; border: 4px solid #eee5ff; border-radius: 50%; box-shadow: 9px 12px 0 #a586e1; }
.art-star { position: absolute; top: 17%; right: 12%; font-size: clamp(2.2rem, 7vw, 5rem); line-height: 1; color: var(--yellow); text-shadow: 2px 4px 0 #aa7a22; transform: rotate(15deg); }
.art-star.small { top: unset; bottom: 17%; right: unset; left: 6%; font-size: clamp(2rem, 5vw, 4rem); color: #693ec5; text-shadow: none; }
.art-dot { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fa915f; right: 12%; bottom: 20%; box-shadow: 2px 3px 0 #ae542b; }

.section-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1rem; margin: 2.45rem 0 .9rem; }
.section-heading p, .muted { color: var(--muted); }
.activity-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.activity {
  position: relative;
  display: grid;
  gap: .28rem;
  align-content: start;
  text-align: left;
  text-decoration: none;
  min-width: 0;
  min-height: 180px;
  padding: 1.12rem;
  border: 1px solid #cfb9f2;
  border-radius: 20px;
  background: #ede4ff;
  color: var(--ink);
  box-shadow: 0 4px 0 #d8c4ef;
}
.activity.quiz { background: #ffe8d9; border-color: #edbc99; box-shadow: 0 4px 0 #f0c4a9; }
.activity.party { background: #ffefaa; border-color: #e9d682; box-shadow: 0 4px 0 #e9d682; }
.activity:disabled { background: #eae8ee; color: #504b5a; border-color: #d5d1dc; box-shadow: 0 4px 0 #d9d5df; opacity: 1; }
.activity:not(:disabled):hover { transform: translateY(-2px); }
.activity strong { font-size: clamp(1.45rem, 3vw, 2.25rem); letter-spacing: -.055em; line-height: 1.1; }
.activity-icon { width: 45px; height: 45px; border-radius: 11px; display: grid; place-items: center; font-size: 1.6rem; color: white; background: var(--purple); margin-bottom: .7rem; }
.activity-icon img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.bingo .activity-icon { background: transparent; }
.activity:disabled .activity-icon img { filter: grayscale(1); }
.quiz .activity-icon { background: #a53f29; }
.party .activity-icon { background: #735500; }
.activity:disabled .activity-icon { background: #6f6879; }
.activity-state { position: absolute; top: 1.15rem; right: 1.12rem; padding: .15rem .55rem; border-radius: 1rem; color: var(--deep); background: #fff9; font-size: .875rem; font-weight: 700; }
.activity:disabled .activity-state { color: #504b5a; }
.activity-type, .activity-info { color: inherit; }
.activity-type { font-size: .875rem; font-weight: 700; }

.page-heading { display: grid; justify-items: start; gap: .6rem; margin: .8rem 0 1.2rem; }
.page-heading a { margin-bottom: .5rem; }
.eyebrow { color: var(--purple); font-size: .8rem; text-transform: uppercase; letter-spacing: .11em; font-weight: 900; }
.intro { max-width: 65ch; margin-bottom: .85rem; color: var(--muted); }
.primary, .secondary, .quiet { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: .5rem .85rem; border: 1px solid transparent; border-radius: .7rem; text-decoration: none; font-weight: 700; text-align: center; line-height: 1.3; }
.primary { background: var(--purple); color: white; }
.primary:hover:not(:disabled) { background: var(--deep); }
.secondary { background: var(--lavender); border-color: #cbb8ee; color: var(--deep); }
.quiet { background: transparent; border-color: #cbbfdd; color: var(--deep); }
.quiet:hover:not(:disabled), .secondary:hover:not(:disabled) { background: #ddccfa; }
.primary:disabled, .secondary:disabled, .quiet:disabled { opacity: .58; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.panel { padding: clamp(.85rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.stack { display: grid; gap: .85rem; align-content: start; }
.stack > .primary, .stack > .quiet, .stack > .secondary { justify-self: start; }
.error { color: var(--error); }
.complete { color: var(--green); }
.counter { font-weight: 800; margin: .55rem 0; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(3px, 1vw, 10px); }
.cell { display: grid; align-content: start; gap: .32rem; position: relative; min-width: 0; min-height: clamp(110px, 16vw, 130px); padding: clamp(.25rem, 1vw, .75rem); text-align: left; overflow-wrap: anywhere; color: var(--ink); background: white; border: 1px solid #c6b7df; border-radius: 12px; }
.cell strong, .cell small { font-size: clamp(.82rem, 1.45vw, 1rem); line-height: 1.18; }
.cell-number, .cell small { color: var(--muted); }
.cell-number { font-weight: 700; font-size: .8rem; }
.cell.marked { background: var(--green-surface); border-color: #60a178; color: var(--green); }
.cell.marked small, .cell.marked .cell-number { color: var(--green); }
.cell[aria-busy="true"] { opacity: .6; }
.cell .check { font-weight: 800; }
.card-meta { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.card-meta strong { color: var(--deep); background: var(--yellow); padding: .25rem .65rem; border-radius: .55rem; }
.card-meta span { color: var(--muted); }

.quiz-panel { display: grid; gap: 1rem; max-width: 720px; }
.quiz-panel > .quiet { justify-self: start; }
.quiz-panel h2:focus { outline: none; }
.quiz-progress { display: flex; align-items: center; gap: 1rem; font-weight: 800; color: var(--purple); }
progress { width: min(230px, 65%); accent-color: var(--purple); }
.quiz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.quiz-answers button { min-height: 54px; }
.result-list { display: grid; gap: .7rem; }
.element-result { display: grid; gap: .5rem; padding: 1rem; border-radius: 13px; background: var(--lavender); }
.element-result.fire { background: #ffdec9; }
.element-result.water { background: #dcecff; }
.element-result.earth { background: #e0f1d9; }
.element-result h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
.element-icon { font-size: 2rem; line-height: 1; color: var(--deep); }
.scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.scores div { padding: .45rem; background: var(--background); border-radius: .55rem; }
.scores dd { font-weight: 800; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin: 0 0 1rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.setting-row .muted { font-size: .9rem; }
.login { max-width: 420px; }
.login .error:empty { display: none; }
.verify-form input { width: 11rem; }
.verification { display: grid; gap: .4rem; }
.verification-board .cell { min-height: 70px; border-radius: 7px; }
.song-editor { display: grid; align-items: center; grid-template-columns: 2rem 1fr 1fr; gap: .45rem; }
.song-editor span { color: var(--muted); text-align: center; font-weight: 800; }
dialog { width: min(660px, 100% - 1.25rem); max-height: min(84dvh, 760px); border: 1px solid #cbbae4; border-radius: 17px; background: var(--background); color: var(--ink); padding: 0 1rem 1rem; }
dialog::backdrop { background: #1b10339c; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .65rem; }
.dialog-head, .sticky-save { position: sticky; background: var(--background); z-index: 1; }
.dialog-head { top: 0; padding: .6rem 0; }
.dialog-head button { font-size: 1.4rem; }
.sticky-save { bottom: 0; }
#notice { position: fixed; z-index: 20; bottom: max(.8rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1.5rem); padding: .7rem 1rem; border-radius: .7rem; color: white; background: var(--ink); box-shadow: 0 6px 14px #21184640; }

.draw-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.draw-column { display: grid; gap: .85rem; align-content: start; }
.draw-column > .primary { min-height: 58px; font-size: 1.25rem; box-shadow: 0 4px 0 var(--deep); }
.draw-result { border: 1px solid #cbbae4; border-radius: 18px; padding: 1rem 1.4rem; background: white; }
.draw-result.drawn { background: var(--yellow); border-color: #debb43; box-shadow: 0 4px 0 #e1be4b; }
.draw-result strong { display: block; font-size: clamp(3rem, 9vw, 7rem); line-height: 1.14; letter-spacing: -.07em; }
.draw-history { max-height: 230px; overflow: auto; display: grid; gap: .4rem; padding: 0; list-style: none; }
.draw-history li { display: flex; align-items: center; gap: .65rem; padding: .5rem; background: var(--background); border-radius: .55rem; }
.draw-history li > span { background: var(--lavender); color: var(--deep); border-radius: .4rem; padding: .25rem .4rem; font-weight: 900; }
.draw-history small { display: block; color: var(--muted); }
.manual-draw input { width: 5.2rem; }
.machine-stage { position: relative; min-height: 385px; display: grid; place-items: center; isolation: isolate; }
.machine-orbit { position: absolute; max-width: 380px; width: 90%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed #bd9de8; background: #e7d9fa; z-index: -1; }
.machine { width: 225px; display: grid; justify-items: center; filter: drop-shadow(8px 9px 0 #42238229); }
.machine-cap { width: 100px; height: 23px; border-radius: 24px 24px 8px 8px; background: linear-gradient(#9772e7, #5933b5); box-shadow: inset 0 3px 0 #c9b5eb; }
.machine-globe { position: relative; width: 225px; height: 170px; border: 4px solid #a98bd8; background: radial-gradient(ellipse at 35% 15%, #fff 3%, #fbf4ffd9 32%, #c8afea 100%); border-radius: 37% 37% 26% 26%; overflow: hidden; box-shadow: inset 8px 2px 12px #fff, inset -5px -5px 20px #9572cf4a; }
.machine-base { display: grid; justify-items: center; gap: .5rem; width: 184px; border-radius: 10px 10px 21px 21px; padding: .65rem 0 .7rem; background: linear-gradient(90deg, #5027ab, #8e60e1 18%, #7141cd 73%, #4a23a3); border-bottom: 8px solid #3e2287; }
.machine-label { background: white; color: var(--deep); padding: .1rem .55rem; border-radius: .3rem; font-weight: 900; font-size: .8rem; letter-spacing: .08em; }
.machine-handle { min-width: 49px; min-height: 49px; border: 4px solid #edc84b; border-radius: 50%; background: linear-gradient(145deg, #fff0a2, #d79d2e); display: grid; place-items: center; }
.machine-handle::after { content: ""; width: 27px; height: 9px; border: 1px solid #b68325; border-radius: 3px; background: var(--yellow); transform: rotate(-27deg); }
.machine-chute { display: grid; place-items: center; width: 69px; height: 30px; border-radius: .5rem; background: #2f185d; }
.machine-chute span { color: var(--ink); background: var(--yellow); width: 25px; height: 25px; border-radius: 50%; text-align: center; font-weight: 800; }
.capsule { position: absolute; left: var(--x); top: var(--y); display: grid; place-items: center; width: 51px; height: 51px; border-radius: 50%; background: radial-gradient(circle at 28% 19%, #fffa, transparent 35%), linear-gradient(var(--ball) 50%, #f3eafe 52%, #cbb8ef 100%); color: #26174d; border: 1px solid #65458a70; font-size: .86rem; font-weight: 900; transform: rotate(var(--rotation)); box-shadow: 2px 4px 6px #38235533; }
.capsule:nth-child(1) { --x: 11%; --y: 38%; --ball: #f68762; --rotation: -20deg; }
.capsule:nth-child(2) { --x: 34%; --y: 42%; --ball: #a68def; --rotation: 23deg; }
.capsule:nth-child(3) { --x: 55%; --y: 34%; --ball: #f5c449; --rotation: 4deg; }
.capsule:nth-child(4) { --x: 73%; --y: 45%; --ball: #ef96bb; --rotation: 27deg; }
.capsule:nth-child(5) { --x: 8%; --y: 65%; --ball: #f6db71; --rotation: 20deg; }
.capsule:nth-child(6) { --x: 29%; --y: 68%; --ball: #83c9a4; --rotation: -16deg; }
.capsule:nth-child(7) { --x: 51%; --y: 62%; --ball: #f18769; --rotation: 40deg; }
.capsule:nth-child(8) { --x: 71%; --y: 71%; --ball: #a58bea; --rotation: -27deg; }

@media (prefers-reduced-motion: no-preference) {
  .spinning .machine-handle::after { animation: turn .5s linear infinite; }
  .spinning .capsule, .reveal { animation: bounce .45s ease; }
  @keyframes turn { to { transform: rotate(360deg); } }
  @keyframes bounce { 0%, 100% { transform: translateY(0); } 48% { transform: translateY(-6px) scale(1.025); } }
}

@media (max-width: 690px) {
  .wrap { width: calc(100% - 1.25rem); }
  .site-header { min-height: 66px; }
  .site-footer { gap: .5rem; font-size: .8rem; }
  .hero { min-height: 320px; grid-template-columns: 1fr .7fr; border-radius: 22px; }
  .hero-art { min-height: 0; }
  .hero-dial { width: 87%; border-width: 2px; box-shadow: 4px 5px 0 #a586e1; }
  .art-star { top: 31%; right: 8%; }
  .art-star.small { bottom: 23%; }
  .art-dot { right: 10%; bottom: 28%; width: 12px; height: 12px; }
  .section-heading { margin-top: 1.65rem; }
  .section-heading p { font-size: .9rem; }
  .activity-list { grid-template-columns: 1fr; gap: .7rem; }
  .activity { min-height: 112px; padding: .85rem .85rem .85rem 4.25rem; }
  .activity-icon { position: absolute; top: .9rem; left: .85rem; width: 41px; height: 41px; }
  .activity-state { top: .77rem; right: .65rem; font-size: .74rem; padding-inline: .38rem; }
  .activity-type { padding-right: 3.75rem; }
  .activity-info { font-size: .88rem; }
  .admin-grid, .draw-layout { grid-template-columns: 1fr; }
  .cell { border-radius: 8px; }
  .machine-stage { min-height: 330px; }
}
