/* The Maker Club: bonus web app for "Pipe Cleaner Crafts for Kids". Plain CSS, no build step. */
@font-face { font-family: "Baloo 2"; src: url("../fonts/Baloo2-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #262c4a; --muted: #5d6280; --cream: #fffaf0; --card: #fff; --line: #ece4d4;
  --green: #6bbd45; --orange: #f68b1f; --sky: #29a8e0; --pink: #ec5a96; --purple: #8a5cb8; --teal: #1aa99a;
  --red: #e2373a; --gold: #f2b705;
  --radius: 20px; --shadow: 0 6px 18px rgba(38, 44, 74, .12), 0 2px 4px rgba(38, 44, 74, .08);
  --head: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--cream); line-height: 1.5; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.12; margin: .3em 0 .35em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 4.5vw, 1.8rem); }
h3 { font-size: 1.2rem; }
a { color: var(--ink); }
:focus-visible { outline: 4px solid #1d4ed8; outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -100px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 9; }
.skip:focus { top: 8px; }
.loading { text-align: center; padding: 3rem 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem;
  padding: .6rem 1rem; background: #fff; box-shadow: 0 2px 10px rgba(38,44,74,.08); position: sticky; top: 0; z-index: 5; }
.logo { text-decoration: none; font-family: var(--head); font-size: 1.7rem; line-height: 1; }
.rb { background: linear-gradient(90deg, var(--red), var(--orange), var(--gold), var(--green), var(--sky), var(--purple), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
#nav { display: flex; gap: .4rem; flex-wrap: wrap; }
#nav a { text-decoration: none; font-weight: 700; font-size: .9rem; padding: .55rem .9rem; border-radius: 999px; background: var(--cream); min-height: 44px; display: inline-flex; align-items: center; }
#nav a[aria-current="page"] { background: var(--ink); color: #fff; }
main { max-width: 1060px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2.5rem; }
.foot a { color: var(--muted); font-weight: 600; display: inline-block; padding: 10px 4px; }

/* elements */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 1rem 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 56px; padding: .7rem 1.4rem;
  border-radius: 999px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 700 1rem var(--body); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.big { font-size: 1.15rem; min-height: 64px; padding: .8rem 1.8rem; }
.btn.ghost { background: #fff; }
.btn.mini { min-height: 48px; min-width: 48px; padding: .3rem .8rem; }
.btn.star { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.label { display: block; font-weight: 700; margin: .6rem 0 .3rem; }
.big-input { width: 100%; max-width: 420px; min-height: 60px; font: 700 1.4rem var(--body); letter-spacing: .12em; text-transform: uppercase;
  padding: .5rem .9rem; border: 3px solid var(--ink); border-radius: 16px; }
.code-msg { font-weight: 600; min-height: 1.5em; color: #9a2e12; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--cream); margin: 0 .2rem .2rem 0; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .22; }
.dots i.on { opacity: 1; }

/* hero / welcome */
.welcome { text-align: center; padding: 1.5rem 1rem; }
.welcome h1 { font-size: clamp(2.4rem, 9vw, 4.2rem); margin: .2em 0; }
.welcome .lead { font-size: 1.1rem; max-width: 34rem; margin: 0 auto 1rem; }
.code-card { max-width: 520px; margin: 1rem auto; text-align: left; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1rem 0; }
.tile { display: block; text-decoration: none; color: #fff; border-radius: var(--radius); padding: 1.2rem 1.2rem 1.4rem; box-shadow: var(--shadow); min-height: 150px; }
.tile h2 { margin: 0 0 .3rem; font-size: 1.55rem; }
.tile p { margin: 0; font-weight: 600; opacity: .95; }
.tile .ic { font-size: 2rem; }

/* project grid */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.filters select, .filters input { min-height: 48px; border: 2px solid var(--line); border-radius: 12px; padding: .3rem .7rem; font: 600 .95rem var(--body); background: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.pc { position: relative; text-decoration: none; color: var(--ink); background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: block; }
.pc img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; background: #eee; }
.pc .meta { padding: .5rem .7rem .7rem; }
.pc .t { font-family: var(--head); font-size: 1.05rem; line-height: 1.15; display: block; }
.pc .num { position: absolute; top: 8px; left: 8px; background: #fff; border-radius: 999px; font-weight: 800; font-size: .8rem; padding: .15rem .5rem; }
.pc .done { position: absolute; top: 6px; right: 8px; font-size: 1.5rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.chap-h { display: flex; align-items: center; gap: .6rem; margin: 1.6rem 0 .6rem; }
.chap-h span { width: 18px; height: 18px; border-radius: 6px; }

/* project overview */
.ov { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.2rem; align-items: start; }
.ov img.hero { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.mats { list-style: none; padding: 0; margin: .3rem 0; }
.mats li { display: flex; gap: .6rem; align-items: flex-start; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.mats input { width: 26px; height: 26px; margin-top: 2px; flex: none; accent-color: var(--green); }
.note { background: #eef6ff; border-radius: 16px; padding: .8rem 1rem; }
.warn { background: #fff1e0; border-radius: 16px; padding: .7rem 1rem; font-weight: 600; }

/* craft mode */
.mk-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.prog { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.prog i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.step { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.2rem; align-items: center; }
.step img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.step .cap { font-size: clamp(1.25rem, 3.6vw, 1.7rem); font-weight: 600; line-height: 1.4; }
.step .no { font-family: var(--head); font-size: 1.1rem; color: var(--muted); }
.mk-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: 1.2rem; }
.mk-nav .btn { flex: 1; }
.timer { display: inline-flex; gap: .4rem; align-items: center; }
.timer output { font: 800 1.3rem var(--head); min-width: 3.5em; text-align: center; }
.finish img { max-width: 520px; margin: 0 auto; border-radius: var(--radius); box-shadow: var(--shadow); }

/* finder */
.sw { display: flex; flex-wrap: wrap; gap: .5rem; }
.sw button { min-width: 56px; min-height: 56px; border-radius: 16px; border: 3px solid transparent; cursor: pointer; font: 700 .8rem var(--body); padding: .3rem .6rem; background: #fff; box-shadow: var(--shadow); }
.sw button[aria-pressed="true"] { border-color: var(--ink); outline: 3px solid #fff; outline-offset: -6px; }
.sw .col { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.found { font-family: var(--head); font-size: 1.5rem; }
.missing { font-size: .8rem; color: #9a2e12; font-weight: 600; }

/* shopping */
.list { list-style: none; padding: 0; }
.list li { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--line); gap: 1rem; }
.picker { max-height: 340px; overflow: auto; border: 2px solid var(--line); border-radius: 14px; padding: .4rem .8rem; background: #fff; }
.picker label { display: flex; gap: .6rem; align-items: center; padding: .35rem 0; }
.picker input { width: 24px; height: 24px; accent-color: var(--green); }

/* collection */
.bar { height: 22px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--orange)); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.badge { text-align: center; border-radius: 18px; padding: .9rem .6rem; color: #fff; opacity: .35; font-weight: 700; }
.badge.won { opacity: 1; box-shadow: var(--shadow); }
.badge b { display: block; font-size: 2rem; }

/* certificate */
.cert { background: #fff; border: 10px solid var(--gold); border-radius: 28px; padding: 2rem 1.5rem; text-align: center; box-shadow: var(--shadow); }
.cert h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); }
.cert .name { font-family: var(--head); font-size: clamp(1.8rem, 7vw, 3rem); border-bottom: 3px solid var(--ink); display: inline-block; min-width: 60%; padding: 0 .5rem; }

/* moves */
.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.moves img { border-radius: 16px; aspect-ratio: 1/1; object-fit: cover; }

/* private area (shared with the counter module) */
.screen.narrow { max-width: 720px; margin: 0 auto; }
.pv-login .btn { width: 100%; margin-top: 8px; }
.pv-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-nav h2 { margin: 0; flex: 1; text-align: center; }
.pv-totals { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 14px 0; }
.pv-chart { width: 100%; height: auto; display: block; }
.pv-bar { fill: var(--teal); }
.pv-grid { stroke: var(--line); stroke-width: 1.5; }
.pv-axis { fill: var(--muted); font-family: var(--body); font-size: 13px; }
.pv-year { border-top: 2px solid var(--line); padding: 6px 0; }
.pv-year summary { display: flex; justify-content: space-between; cursor: pointer; font-family: var(--head); font-size: 1.1rem; padding: 6px 0; min-height: 44px; align-items: center; }
.pv-year ul { list-style: none; margin: 4px 0 0; padding: 0; }
.pv-month { display: flex; justify-content: space-between; width: 100%; min-height: 48px; background: none; border: 0; border-radius: 12px; padding: 8px 12px; font: inherit; color: inherit; cursor: pointer; }
.pv-month:hover, .pv-month.is-sel { background: #e8f6e4; }
.code-msg.show { background: #fff1e0; border-radius: 12px; padding: 8px 12px; }

@media (max-width: 760px) {
  .ov, .step { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .top, .foot, .noprint, .skip { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card, .cert { box-shadow: none; }
}

[tabindex="-1"]:focus { outline: none; }
