:root {
  --floor: #5a1d15; --floor2: #7b2b1f; --flour: #f4ecd8; --muted: #e2c6b0; --turmeric: #f0b429; --kumkuma: #ec5274;
  --rule: rgba(244, 236, 216, .16);
  --serif: Literata, Georgia, "Noto Serif", "Noto Serif Telugu", "Noto Serif Tamil", serif;
  --display: Amita, Georgia, "Noto Serif", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(ellipse at 30% 15%, var(--floor2), var(--floor) 65%) fixed, var(--floor); color: var(--flour); font: 17px/1.6 var(--serif); min-height: 100vh; }
a { color: var(--turmeric); }

/* Shell */
.bar { max-width: 1180px; margin: 0 auto; padding: 12px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.bar .name { margin: 0; font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin-right: auto; }
.bar nav { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .95rem; }
.bar nav a { color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.bar nav a[aria-current="page"] { color: var(--flour); border-bottom-color: var(--turmeric); }
.lang { display: inline-flex; align-items: center; gap: 6px; }
.lang select { font: inherit; font-size: .9rem; color: var(--flour); background: rgba(0, 0, 0, .25); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 6px; }
.lab { color: var(--muted); font-size: .9rem; }

@media (max-width: 599px) {
  .bar nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 18px; scrollbar-width: none; }
  .bar nav::-webkit-scrollbar { display: none; }
  .bar nav a { padding: 10px 0; flex: none; }
  .lang .lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Section layout */
.section { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; display: grid; gap: 24px 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .section { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } .section > header { grid-column: 1 / -1; } }
.kicker { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1 { font-family: var(--display); font-size: clamp(2.1rem, 6vw, 3.5rem); line-height: 1.1; margin: .15em 0 .25em; }
h2 { font-family: var(--display); font-size: 1.7rem; line-height: 1.2; margin: .2em 0 .4em; }
.lede { max-width: 42em; margin: 0; }
.lede b, .learn b { color: var(--turmeric); font-weight: 600; }

/* Sikku */
.floor { position: relative; aspect-ratio: 1; width: 100%; border-radius: 8px; background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 60px rgba(0, 0, 0, .35); touch-action: none; }
canvas { display: block; width: 100%; height: 100%; cursor: pointer; border-radius: 8px; }
canvas:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 3px; }
.status { min-height: 2.2em; margin: 12px 0 4px; font-size: 1.15rem; }
.status .one { font-family: var(--display); font-size: 1.5rem; color: var(--turmeric); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.grp { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.btn { font: inherit; font-size: .95rem; color: var(--flour); background: rgba(0, 0, 0, .18); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn:hover { border-color: rgba(244, 236, 216, .45); }
.btn:disabled { opacity: .4; cursor: not-allowed; border-color: var(--rule); }
.btn[aria-pressed="true"] { background: var(--flour); color: var(--floor); }
.btn.small { padding: 4px 10px; min-width: 2.2em; }
.num { min-width: 1.6em; text-align: center; font-weight: 600; }
.learn { border-top: 1px solid var(--rule); padding-top: 12px; }
@media (min-width: 900px) { .learn { border-top: 0; padding-top: 0; } }
.live { font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .16); border-left: 3px solid var(--turmeric); padding: 10px 14px; margin: 14px 0; border-radius: 0 6px 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .9rem; color: var(--muted); }
.chip::before { content: ""; display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: -.05em; }
ol.rules { padding-left: 1.3em; margin: 12px 0; }
ol.rules li { margin: 6px 0; }
.src { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 18px; }
.toast { color: var(--turmeric); font-size: .9rem; margin-left: 6px; }

/* Draw a kolam */
.draw canvas { touch-action: none; cursor: crosshair; position: relative; }
.draw canvas.guides { position: absolute; inset: 0; pointer-events: none; }
.draw .floor[data-tool="eraser"] canvas { cursor: cell; }
.draw h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.draw .status { min-height: 2.2rem; margin: 0 0 6px; display: flex; align-items: flex-end; }
.draw .row { margin: 12px 0; }
.draw .lab { min-width: 2.6em; }
@media (min-width: 900px) { .draw { grid-template-rows: auto auto 1fr; } .draw .stage { grid-row: 2 / span 2; } }

/* Studio */
@media (min-width: 900px) { .studio { grid-template-rows: auto auto 1fr; } .studio .stage { grid-row: 2 / span 2; } }
.studio .learn { border-top: 1px solid var(--rule); padding-top: 12px; }
.row[hidden] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.studio h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.studio .status { min-height: 2.6rem; margin: 0 0 6px; display: flex; align-items: flex-end; }
.studio .row { margin: 12px 0; }
.studio .lab { min-width: 2.6em; }
.btn.check { background: none; border-color: transparent; padding-left: 4px; }
.btn.check::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .5em; vertical-align: -.12em; border: 1.5px solid var(--muted); border-radius: 3px; }
.btn.check[aria-pressed="true"] { background: none; color: var(--flour); }
.btn.check[aria-pressed="true"]::before { background: var(--turmeric); border-color: var(--turmeric); box-shadow: inset 0 0 0 2px var(--floor); }
@media (hover: none) { .keys { display: none; } }
@media (max-width: 899px) {
  .section .btn { min-height: 44px; min-width: 44px; font-size: 1rem; }
  .section .swatch { width: 44px; height: 44px; }
  .section .lab, .section .chips { font-size: 1rem; }
  .studio > header .kicker { display: none; }
  .studio > header h1 { margin-top: 0; }
}
.swatch { width: 2.2em; height: 2.2em; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid var(--rule); }
.swatch[aria-pressed="true"] { background: var(--c); border-color: var(--flour); box-shadow: 0 0 0 2px var(--floor), 0 0 0 4px var(--flour); }
.studio canvas { touch-action: none; cursor: crosshair; }

/* My kolams */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.section[hidden], .section > [hidden], .row > [hidden] { display: none; }
.mine { grid-template-columns: minmax(0, 1fr); }
.mine .cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.mine .cards:empty { display: none; }
.card { min-width: 0; }
.card .pic { display: block; aspect-ratio: 1; border-radius: 8px; background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 40px rgba(0, 0, 0, .35); }
.card .pic:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 3px; }
.card input { display: block; width: 100%; margin: 10px 0 2px; font: inherit; font-family: var(--display); font-size: 1.25rem; color: var(--flour); background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 4px 0; }
.card input:focus { outline: 0; border-bottom-color: var(--turmeric); }
.card .about { margin: 0; font-size: .92rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .row { margin: 8px 0 0; gap: 6px; }
.empty p { margin: 0 0 12px; max-width: 34em; font-size: 1.1rem; }
.btn.go { background: var(--flour); color: var(--floor); }
.safe { border-top: 1px solid var(--rule); padding-top: 12px; max-width: 46em; }
.safe .toast { margin: 8px 0 0; min-height: 1.6em; }

/* Player */
.play .floor { touch-action: auto; }
.play canvas { cursor: default; }
.play .status { min-height: 2.2rem; margin: 0 0 6px; }
.play .steps { justify-content: center; margin-bottom: 4px; }
.play .btn.main { min-width: 7em; background: var(--turmeric); border-color: var(--turmeric); color: var(--floor); font-weight: 600; }
.scrub { display: block; width: 100%; height: 44px; margin: 0; accent-color: var(--turmeric); border-radius: 6px; }
.scrub:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 2px; }
@media (max-width: 899px) {
  .play .steps { gap: 6px; flex-wrap: nowrap; }
  .play .btn.main { min-width: 0; flex: 1; }
  .play .steps .btn { padding-left: 8px; padding-right: 8px; }
}

/* Puzzles */
.puzzles { grid-template-columns: minmax(0, 1fr); }
.today { background: rgba(0, 0, 0, .16); border-left: 3px solid var(--turmeric); border-radius: 0 8px 8px 0; padding: 12px 16px 16px; max-width: 46em; }
.today h2 { margin-top: 0; }
.today p { margin: 0 0 6px; }
.today .streak { color: var(--turmeric); }
.today .btn { margin-top: 8px; }
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.level { display: grid; grid-template-columns: 2em 3.2em minmax(0, 1fr) auto; gap: 0 8px; align-items: center; min-height: 48px; padding: 6px 4px; color: var(--flour); text-decoration: none; border-bottom: 1px solid var(--rule); }
.level:hover { border-bottom-color: var(--turmeric); }
.level .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.level .what { font-weight: 600; font-variant-numeric: tabular-nums; }
.level .rule { font-size: .92rem; line-height: 1.3; }
.level .stars { color: var(--turmeric); font-size: .85rem; white-space: nowrap; letter-spacing: .05em; }
.level .tick { grid-column: 3 / -1; color: var(--turmeric); font-size: .85rem; }
.level[data-solved="true"] .n { color: var(--turmeric); }
.puzzle canvas, .trace canvas { touch-action: none; cursor: crosshair; }
.puzzle .status, .trace .status { min-height: 2.6rem; margin: 0 0 6px; display: flex; align-items: flex-end; }
.puzzle h1, .trace h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.puzzle .toast { min-height: 1.6em; margin: 4px 0; }
.trace .about { color: var(--muted); font-size: .95rem; }
@media (min-width: 900px) { .puzzle, .trace { grid-template-rows: auto auto 1fr; } .puzzle .stage, .trace .stage { grid-row: 2 / span 2; } }

/* Floor kit */
.field { font: inherit; width: 5.5em; min-height: 44px; color: var(--flour); background: rgba(0, 0, 0, .25); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 8px; }
.field:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 2px; }
.kit h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.kit .sizer { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 6px; }
.kit .sheets { display: grid; gap: 16px; justify-items: center; }
.sheet { display: block; width: 100%; max-width: 560px; height: auto; background: #fff; box-shadow: 0 4px 22px rgba(0, 0, 0, .4); }
@media (min-width: 900px) { .kit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kit .sheets { grid-column: 2; grid-row: 2; } .kit .tools { grid-column: 1; grid-row: 2; } }
@media print {
  html, body { background: #fff !important; }
  .bar, .kit > header, .kit > .tools, .kit > .empty { display: none !important; }
  .kit { display: block; padding: 0; margin: 0; max-width: none; }
  .kit .sheets { display: block; }
  .sheet { width: var(--w); height: var(--h); max-width: none; box-shadow: none; break-after: page; }
  .sheet:last-child { break-after: auto; }
}

/* Library */
.library { grid-template-columns: minmax(0, 1fr); }
.library .cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.library .cards:empty { display: none; }
.library .tools .row { margin: 8px 0; }
.library .tools .live { margin: 10px 0 4px; max-width: 46em; }
.library .toast { min-height: 1.4em; margin: 4px 0 0; }
.library .heading { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.library .stars { color: var(--turmeric); letter-spacing: .05em; }
.library .tick { font-size: .9rem; color: var(--muted); }
.library .card[data-collected="true"] .tick { color: var(--turmeric); }
.library .about { margin: 4px 0 0; }
.library .album h2 { margin-top: 24px; }
.library .more { justify-content: center; }
.library .ways summary { display: inline-flex; align-items: center; justify-content: center; list-style: none; margin-top: 6px; }
.library .ways summary::-webkit-details-marker { display: none; }
.library .ways .row { margin: 6px 0 0; }
.library .album .cards { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 12px; }
.library .album .card .tick { display: block; margin-top: 2px; font-size: .85rem; }

/* Series and wish card */
.series, .wish { grid-template-columns: minmax(0, 1fr); }
.series .new, .series .toast { max-width: 46em; }
.series .toast { min-height: 1.4em; margin: 8px 0 0; }
.series-list { list-style: none; margin: 0; padding: 0; max-width: 46em; }
.series-list .level { grid-template-columns: minmax(0, 1fr) auto; }
.slots { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 720px; }
.slot { min-width: 0; }
.slot[data-filled="false"] { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--rule); border-radius: 8px; color: var(--muted); }
.slot .thumb, .pickable .thumb { display: block; width: 100%; height: auto; aspect-ratio: 1; background: rgba(0, 0, 0, .14); border-radius: 8px; cursor: default; }
.slot .row { margin: 6px 0 0; gap: 4px; }
.pickables { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pickable .about { margin: 6px 0; font-size: .92rem; overflow-wrap: anywhere; }
.field.wide { width: min(100%, 22em); }
.wish .preview canvas { display: block; width: 100%; max-width: 460px; height: auto; border-radius: 8px; cursor: default; box-shadow: 0 4px 22px rgba(0, 0, 0, .4); }
@media (min-width: 900px) { .wish { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Picture */
.picture h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.picture .status { min-height: 2.2rem; margin: 0 0 6px; display: flex; align-items: flex-end; }
.picture canvas { height: auto; cursor: default; box-shadow: 0 4px 22px rgba(0, 0, 0, .4); }
.picture .tools h2 { margin: 18px 0 0; font-size: 1.3rem; }

/* About, footer */
h1:focus { outline: 0; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 16px 24px; font-size: .95rem; }
.foot a { display: inline-block; padding: 12px 0; color: var(--muted); }
.about-page h2 { margin-top: 22px; }
.about-page table { border-collapse: collapse; width: 100%; max-width: 34em; }
.about-page th, .about-page td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }
.about-page th { color: var(--muted); font-weight: 400; font-size: .92rem; }
.about-page .plain { padding-left: 1.2em; }
.about-page .plain b { color: var(--turmeric); font-weight: 600; }
@media print { .foot { display: none !important; } }

/* Daily practice */
.practice { grid-template-columns: minmax(0, 1fr); max-width: 640px; gap: 12px; padding-bottom: 32px; }
.practice > header .kicker { min-height: 1.2em; }
.practice h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-top: 0; }
.practice .lede { min-height: 1.6em; }
.practice .floor { width: min(100%, calc(100vh - 340px), 560px); min-width: min(100%, 280px); margin: 0 auto; touch-action: none; }
.practice .floor.still { touch-action: auto; }
.practice .floor[hidden] { display: none; }
.practice canvas { cursor: crosshair; touch-action: none; }
.practice .floor.still canvas, .practice .thumb { cursor: default; touch-action: auto; }
.practice .status { min-height: 2.6rem; margin: 0 0 8px; }
.practice .status .one { font-size: 1.25rem; }
.practice .actions { justify-content: center; margin-top: 12px; }
.practice .hand .row { justify-content: center; flex-wrap: nowrap; gap: 0; margin: 12px 0 0; }
.practice .hand .btn { min-height: 44px; }
.practice .hand .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-width: 0; }
.practice .hand .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.practice .hand .about { margin-top: 6px; }
.practice .btn.go { font-weight: 600; }
.practice .actions .btn.go, .practice .btn.main { min-height: 52px; min-width: min(100%, 300px); font-size: 1.1rem; padding: 10px 18px; }
.practice .btn.main { display: flex; width: 100%; margin: 12px 0 4px; }
.practice .about { color: var(--muted); font-size: .95rem; margin: 10px 0 0; text-align: center; }
.practice .src { text-align: center; border-top: 0; padding-top: 0; margin-top: 6px; }
.linkish { display: block; margin: 10px auto 0; min-height: 44px; font: inherit; font-size: .95rem; color: var(--muted); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.tally { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 12px; }
.tally p { margin: 0 0 6px; }
.tally b, .journal .lede b { color: var(--turmeric); }
.week { display: flex; align-items: center; gap: 8px; margin: 0; }
.week .lab { margin-right: 4px; }
.week .day { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); }
.week .day.on { background: var(--turmeric); border-color: var(--turmeric); }
.week[hidden] { display: none; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 auto; width: 100%; }
.compare[hidden] { display: none; }
.compare figure { margin: 0; min-width: 0; }
.compare figcaption { text-align: center; color: var(--muted); font-size: .95rem; margin-top: 4px; }
.compare canvas { aspect-ratio: 1; height: auto; background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 40px rgba(0, 0, 0, .35); }
.done .more { justify-content: center; }
.done .more .btn { flex: 1 1 40%; min-height: 48px; }
.family h2 { margin-bottom: 0; }
.family .about { text-align: left; margin: 0 0 8px; }
.members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.members canvas { width: 100%; height: auto; aspect-ratio: 1; background: rgba(0, 0, 0, .14); border-radius: 6px; }
.members li[data-met="false"] canvas { opacity: .55; }
#app[data-fresh="true"] .bar nav, #app[data-fresh="true"] .foot { display: none; }
.kept { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.kept-one { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
.kept-one canvas { width: 100%; height: auto; aspect-ratio: 1; background: rgba(0, 0, 0, .14); border-radius: 6px; }
.kept-one p { margin: 0; text-align: left; }
.kept-one .word { font-family: var(--display); font-size: 1.25rem; color: var(--turmeric); }
.kept-one .btn { margin: 8px 8px 0 0; }
.tools-list { list-style: none; margin: 0; padding: 0; }
.tool { display: block; padding: 12px 4px; min-height: 48px; color: var(--flour); text-decoration: none; border-bottom: 1px solid var(--rule); }
.tool:hover { border-bottom-color: var(--turmeric); }
.tool .what { display: block; font-weight: 600; }
.tool .about { display: block; text-align: left; margin: 0; }
.floor-mode .btn.main { margin-top: 16px; }
.floor-mode .big { font-family: var(--display); font-size: 1.5rem; text-align: center; margin: 8px 0 0; }
/* The status holds three lines from the start, so new words never move the floor under a finger. */
.practice .step .status, .practice.step .status { font-size: 1.02rem; line-height: 1.45; min-height: calc(3 * 1.45em); display: flex; align-items: flex-end; }
.practice.step .status .one { line-height: 1.3; }
.done .floor-offer[hidden] { display: none; }
.done .floor-offer { display: flex; width: fit-content; margin: 12px auto 0; }
.done .stage > h2, .done .family { margin-top: 20px; }
.done .week { margin-bottom: 4px; }
.practice .btn.main { justify-content: center; text-align: center; }
.floor-mode .floor { margin-top: 12px; }

/* The demo with the practice: below the floor on a phone, beside it on a wide screen */
.practice .demo { margin-top: 20px; }
.practice .demo[hidden] { display: none; }
.practice .demo .about { margin: 0 0 8px; font-size: 1rem; }
.practice .demo .floor { width: min(100%, 280px); min-width: 0; background: none; box-shadow: none; outline: 1px solid rgba(255, 255, 255, .16); } /* a picture to look at; only the practice floor looks like a floor */
.demo-slider { display: block; width: min(100%, 360px); min-height: 44px; margin: 4px auto 0; accent-color: #f0b429; }
.demo-controls { justify-content: center; }
@media (min-width: 900px) {
  .practice.step.with-demo { max-width: 1180px; }
  .practice.step.with-demo .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .practice.step.with-demo .stage > * { grid-column: 1; }
  .practice.step.with-demo .stage > .demo { grid-column: 2; grid-row: 1 / span 6; margin-top: 0; }
  .practice .demo .floor { width: min(100%, calc(100vh - 340px), 560px); }
  .practice .demo .about { min-height: calc(3 * 1.45 * 1.02rem); display: flex; align-items: flex-end; justify-content: center; } /* floors level: the status above the practice floor is this tall */
}
