/* Tutor journal. Materials: the planner's white ruled paper, the planner's printed blue for writing,
   the house colour for the student's own marks, and one colour for each group of strengths.
   Shape rule: buttons and chips are pills, cards, tiles and inputs are 14px. */

:root {
  --paper: #f7f9fb;
  --rule: #dfe7ef;
  --ink: #1f347f;
  --ink-soft: #4a5a86;
  --pencil: #5d6b80;
  --house: #469d63;
  --house-btn: #2e7547;
  --house-deep: #22573a;
  --house-tint: #e3f1e7;
  --danger: #a3262f;
  --serif: "Literata", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 18px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* Literata is the journal's own voice: names, headings, the strength word and the breath.
   Source Sans 3 is for everything students read and tap. */
.house-name, .house-badge, .panel h2, .term-name, .took, .breath-count, .breath-phase, .week,
.burst-word, .burst-line { font-family: var(--serif); }
.breath-phase, .burst-line { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; min-height: 100dvh; }
/* during a check in the panel gets the room and the map steps back, so cards sit three across instead of in a long list */
.app { transition: grid-template-columns 450ms var(--ease-out); }
body.focus .app { grid-template-columns: minmax(420px, 1.15fr) minmax(0, 1fr); }
.panel { container-type: inline-size; }
@container (min-width: 600px) {
  .panel .cards { grid-template-columns: repeat(3, 1fr); }
  .panel .pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .panel .others { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
  .others h3, .others > .muted { grid-column: 1 / -1; }
}

/* ---------- panel ---------- */
.panel { padding: 16px 28px 16px; border-right: 1.5px solid var(--rule); display: flex; flex-direction: column; gap: 12px; max-height: 100dvh; overflow-y: auto; }
.loading { color: var(--pencil); margin-top: 40px; }
.house { display: flex; align-items: center; gap: 12px; }
.house img, .house-badge { width: 52px; height: 52px; display: block; flex: none; }
.house-badge { border-radius: 50%; background: var(--house); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 24px; }
.house p { margin: 0; }
.house-name { font-size: 25px; line-height: 1.1; font-weight: 760; color: var(--house-deep); }
.house-meta { font-size: 14.5px; color: var(--pencil); }

.panel h2 { margin: 4px 0 2px; font-size: 22.5px; line-height: 1.2; font-weight: 700; }
.panel h2:focus { outline: none; }
.panel h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.lede { margin: 0 0 4px; color: var(--ink-soft); max-width: 38ch; }
.muted { margin: 0 0 6px; color: var(--pencil); font-size: 15.5px; }
.error { margin: 0; min-height: 1.3em; color: var(--danger); font-weight: 600; font-size: 15.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }

.term { margin: 0; padding: 7px 14px; border-radius: 12px; background: var(--house-tint); line-height: 1.35; }
.term-name { font-weight: 700; color: var(--house-deep); }
.term-q { font-size: 15px; color: var(--ink-soft); }

.btn {
  font: inherit; font-weight: 640; font-size: 17px; border-radius: 999px; padding: 10px 22px; min-height: 46px;
  cursor: pointer; border: 1.5px solid transparent; transition: transform 220ms var(--spring), background-color 160ms, border-color 160ms;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.97); }
.btn-primary { background: var(--house-btn); color: #fff; }
.btn-primary:hover { background: var(--house-deep); }
.btn-quiet { background: #fff; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-small { min-height: 38px; padding: 6px 16px; font-size: 15px; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* home */
.week-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  font: inherit; color: var(--ink); text-align: left; position: relative; cursor: pointer;
  background: #fff; border: 1.5px solid color-mix(in srgb, var(--ink) 20%, transparent); border-radius: 14px;
  padding: 9px 14px; min-height: 62px; display: flex; flex-direction: column; gap: 1px;
  transition: transform 260ms var(--spring), border-color 180ms, box-shadow 220ms;
}
.tile:hover { transform: translateY(-3px); border-color: var(--house); box-shadow: 0 10px 22px -16px var(--house); }
.tile.done { background: var(--house-tint); border-color: var(--house); cursor: default; transform: none; box-shadow: none; }
.tile-name { font-weight: 720; font-size: 18px; }
.tile-sub { font-size: 14.5px; color: var(--ink-soft); }
.tile-tick { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--house-btn); color: #fff; display: grid; place-items: center; }
.tile-tick svg { width: 14px; height: 14px; }
.block { border-top: 1.5px solid var(--rule); padding-top: 10px; }
.goal-sentence { margin: 0 0 6px; font-size: 16.5px; line-height: 1.45; }
.goal-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.goal-kept { color: var(--house-deep); font-weight: 640; font-size: 15.5px; }
.block .actions { margin-top: 0; gap: 8px; }
.block .actions .btn-small { padding: 6px 13px; }
.h3-note { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.club-list { margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.club-list li { border: 1.5px solid var(--rule); background: #fff; border-radius: 999px; padding: 3px 12px; font-size: 15px; }
.club-list.editable { flex-direction: column; }
.club-list.editable li { border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; }
.note-card { background: #fff; border-left: 4px solid var(--house); border-radius: 0 14px 14px 0; padding: 10px 14px; }
.note-card p { margin: 0; }
.notice { margin-top: 30px; }
.join { display: grid; gap: 12px; max-width: 30rem; }
.join h2, .join .lede, .join .muted { margin: 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 16.5px; color: var(--ink); background: #fff; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 999px; padding: 7px 14px; min-height: 40px;
  transition: transform 240ms var(--spring), background-color 160ms, border-color 160ms;
}
.chip:hover { transform: translateY(-2px); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
/* Something else: dashed, because it is the student's own words rather than one of ours */
.chip-own, .card-own { border-style: dashed; }
.chip-own[aria-pressed="true"] { background: #fff; color: var(--ink); border-style: solid; }
.chips-own { display: flex; flex-direction: column; gap: 8px; }
.own-field { margin-top: 2px; }
.own-card { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; background: #fff; border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 14px; }
.own-card .actions { margin-top: 4px; }

/* tell us about one */
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-card {
  --c: var(--ink); --tint: #fff;
  font: inherit; font-size: 16.5px; line-height: 1.3; color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px;
  background: #fff; border: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent); border-left: 5px solid var(--c); border-radius: 14px; padding: 8px 12px;
  transition: transform 220ms var(--spring), background-color 200ms, border-color 200ms;
}
.pick-card:hover { transform: translateY(-2px); }
.pick-card[aria-checked="true"] { background: var(--tint); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.pick-word { font-size: 14px; font-weight: 700; color: var(--c); }
.story { margin-top: 2px; }
.others { display: flex; flex-direction: column; gap: 10px; }
.others h3 { margin: 8px 0 0; }
.others .muted { margin: 0; }
.other-card { border-top: 1.5px solid var(--rule); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.other-words { margin: 0; font-size: 16.5px; font-weight: 600; line-height: 1.35; }
.other-card .chips { gap: 6px; }
.other-card .chip { font-size: 15px; min-height: 36px; padding: 5px 12px; }
.other-card .field { width: 100%; }
.link-btn { font: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink); background: none; border: 0; padding: 2px 0; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 4px; }
.link-btn:hover { text-decoration-color: var(--ink); }

/* what the student picked earlier, shown again when they write about it */
.recap-label { margin: 8px 0 2px; font-weight: 650; font-size: 16.5px; }
.mini-target { margin: 10px 0 0; padding: 10px 14px; border-left: 4px solid var(--house); background: #fff; border-radius: 0 14px 14px 0; }
.tags { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 16px; padding: 4px 12px; border-radius: 999px; background: var(--house-tint); color: var(--house-deep); }

/* breath */
.breath-count { margin: 6px 0 0; font-size: 96px; line-height: 1; font-weight: 800; height: 96px; color: var(--house); }
.breath-phase { margin: 4px 0 0; font-size: 26px; font-weight: 680; min-height: 1.4em; }

/* cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card {
  --c: var(--ink); --tint: #fff;
  font: inherit; text-align: left; font-size: 16.5px; line-height: 1.3; color: var(--ink); background: #fff;
  border: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 14px; padding: 8px 26px 8px 12px; min-height: 54px;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform 260ms var(--spring), border-color 180ms, background-color 220ms, box-shadow 220ms;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); transform: scaleY(0); transform-origin: bottom; transition: transform 320ms var(--ease-out); }
.card:hover { transform: translateY(-2px); border-color: var(--c); }
.card:hover::before { transform: scaleY(1); }
.card:active { transform: scale(0.96); }
.card[aria-pressed="true"] { background: var(--tint); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.card[aria-pressed="true"]::before { transform: scaleY(1); }
.card .tick { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; transform: scale(0) rotate(-90deg); transition: transform 380ms var(--spring); }
.card[aria-pressed="true"] .tick { transform: scale(1) rotate(0); }
.card .tick svg { width: 12px; height: 12px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 4px; }
.line-label { display: block; font-weight: 650; font-size: 16.5px; margin: 6px 0 0; }
.line {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 14px; padding: 9px 12px;
  resize: none; field-sizing: content; min-height: 44px; max-height: 140px; transition: border-color 180ms, box-shadow 180ms;
}
select.line { field-sizing: fixed; }
.line:focus { outline: none; border-color: var(--house-btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--house) 30%, transparent); }
.examples { font-size: 15px; color: var(--ink-soft); }
.examples summary { cursor: pointer; font-weight: 620; }
.examples ul { margin: 6px 0 0; padding-left: 20px; }

/* goal builder */
.strength-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.strength-pick {
  --c: var(--ink); --tint: #fff;
  font: inherit; text-align: left; cursor: pointer; background: #fff; color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--c) 40%, transparent); border-left: 6px solid var(--c); border-radius: 14px;
  padding: 6px 10px; min-height: 44px; display: flex; flex-direction: column; justify-content: center;
  transition: transform 240ms var(--spring), background-color 180ms;
}
.strength-pick:hover { transform: translateY(-2px); }
.strength-pick[aria-pressed="true"] { background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--c); }
.sp-word { font-weight: 680; font-size: 15.5px; }
.sp-hint { font-size: 12.5px; color: var(--pencil); }
.strength-desc { min-height: 1.5em; font-style: italic; }

/* saved screens */
.took { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--house-deep); }
.added { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.added li { --c: var(--ink); --tint: #fff; border: 1.5px solid var(--c); background: var(--tint); border-radius: 999px; padding: 4px 14px; font-weight: 640; }
.wrote { margin: 6px 0; padding: 10px 14px; border-left: 4px solid var(--house); background: #fff; border-radius: 0 14px 14px 0; font-style: italic; }
.club-row { padding: 6px 0 10px; border-bottom: 1.5px solid var(--rule); }
.club-name { margin: 0 0 6px; font-weight: 680; }
.evidence { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.evidence li { display: flex; flex-direction: column; }
.ev-when { font-size: 13.5px; color: var(--pencil); }

/* ---------- the stage ---------- */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 20px 12px; min-width: 0; overflow: hidden;
  background-image: repeating-linear-gradient(to bottom, transparent 0 29px, var(--rule) 29px 30px); }
.rose { flex: 1; width: 100%; min-height: 0; max-height: calc(100dvh - 70px); display: block; overflow: visible; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.legend { margin: 0; font-size: 14.5px; color: var(--pencil); background: var(--paper); }
.btn-play { flex: none; }
.week { position: absolute; top: 14px; left: 0; right: 0; margin: 0; text-align: center; pointer-events: none; font-size: 40px; font-weight: 800; opacity: 0; transition: opacity 300ms; }

.sb-label { font-family: var(--sans); font-size: 21px; fill: var(--pencil); font-weight: 430; dominant-baseline: middle; transition: fill 400ms; }
.sb-label.found { font-weight: 700; }
.sb-corner { font-family: var(--sans); font-size: 25px; font-weight: 760; }
.sb-initial { font-family: var(--sans); font-size: 64px; font-weight: 800; }
.sb-ray:hover .sb-lane { stroke-opacity: 0.8; }

/* ---------- the word burst ---------- */
.burst { position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 40; pointer-events: none; display: grid; place-content: center; text-align: center; visibility: hidden; }
.burst.on { visibility: visible; }
.veil { position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 78%, transparent); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; }
.burst-word { position: relative; margin: 0; line-height: 1.05; white-space: nowrap; font-size: clamp(56px, 9.5vw, 136px); font-weight: 700; color: var(--deep, var(--ink)); }
.burst-word span { display: inline-block; will-change: transform; }
.burst-line { position: relative; margin: 10px auto 0; font-size: clamp(18px, 2vw, 26px); max-width: 26ch; color: var(--ink); opacity: 0; font-weight: 560; }
.spark { position: fixed; left: 0; top: 0; z-index: 45; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px #fff; pointer-events: none; }
.trail { position: fixed; left: 0; top: 0; z-index: 44; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--c); pointer-events: none; animation: trail 650ms linear forwards; }
@keyframes trail { to { opacity: 0; transform: var(--at) scale(0.2); } }

/* ---------- the report only exists on paper ---------- */
.report { display: none; }
/* ---------- take a minute ---------- */
.calm-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.calm-tile {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; text-align: center;
  background: #fff; border: 1.5px solid color-mix(in srgb, var(--ink) 20%, transparent); border-radius: 14px; padding: 7px 6px 6px; min-height: 62px;
  transition: transform 260ms var(--spring), border-color 180ms, box-shadow 220ms;
}
.calm-tile:hover { transform: translateY(-2px); border-color: var(--house); box-shadow: 0 10px 22px -16px var(--house); }
.calm-thumb { flex: none; width: 28px; height: 28px; }
.calm-tile .tile-name { font-size: 14.5px; font-weight: 680; line-height: 1.2; }
.calm-thumb svg { width: 100%; height: 100%; display: block; }

body.calm-open { overflow: hidden; }
.calm { position: fixed; inset: 0; z-index: 60; background: var(--paper); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; opacity: 0; transition: opacity 280ms var(--ease-out); }
.calm.in { opacity: 1; }
.calm-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding: 14px 28px; background: #fff; border-bottom: 1.5px solid var(--rule); }
.calm-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.2; color: var(--house-deep); }
.calm-head h2:focus { outline: none; }
.calm-line { margin: 2px 0 0; color: var(--ink-soft); font-size: 16.5px; }
.calm-actions, .calm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calm-select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 15px; }
.calm-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 20px 28px 8px; }
.calm-status { min-height: 64px; padding: 6px 28px 16px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 16px; }
.calm-status p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--house-deep); }

/* maze */
.maze { width: 100%; height: 100%; max-width: 760px; display: block; outline: none; touch-action: none; cursor: grab; }
.maze:active { cursor: grabbing; }
.maze:focus-visible .maze-floor { stroke: var(--ink); stroke-width: 0.8; }
.maze-floor { fill: #fff; stroke: var(--rule); stroke-width: 0.5; }
.maze-walls { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke 700ms var(--ease-out); }
.maze-door { fill: var(--house-tint); stroke: var(--house); stroke-width: 0.8; }
.maze-trail { fill: none; stroke: var(--house); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.35; }
.maze-hint { fill: none; stroke: var(--house); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1.5 2.5; opacity: 0; }
.maze-hint.show { animation: maze-hint 2800ms ease-in-out; }
@keyframes maze-hint { 0%, 100% { opacity: 0; } 15%, 70% { opacity: 1; } }
.maze-ball { transition: transform 70ms linear; }
.ball-body { fill: var(--house); }
.ball-shine { fill: #fff; opacity: 0.55; }
.maze-door.locked { fill: #eef1f6; stroke: var(--pencil); stroke-dasharray: 1.2 1; }
.maze-door { transition: fill 400ms, stroke 400ms; }
.maze-key { fill: none; stroke: #c96f0a; stroke-width: 1.1; stroke-linecap: round; transition: transform 600ms var(--ease-out), opacity 400ms 500ms; }
.maze-key circle { fill: #fcf0e1; }
.maze-key.got { opacity: 0; }
.maze-shadow { pointer-events: none; }
.shadow-body { fill: var(--ink); opacity: 0.88; }
.shadow-eyes circle { fill: #fff; }
.maze-shadow.asleep .shadow-body { animation: shadow-sleep 2.4s ease-in-out infinite; }
.maze-shadow.asleep .shadow-eyes { opacity: 0.25; }
@keyframes shadow-sleep { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.7; } }
.maze.caught .ball-body { fill: var(--pencil); transition: fill 300ms; }
.maze.caught .maze-trail { opacity: 0.12; }
.maze.solved .maze-walls { stroke: var(--house); }
.maze.solved .maze-trail { opacity: 0.6; transition: opacity 700ms; }

/* light it up */
.loops { width: 100%; height: 100%; max-width: 760px; display: block; }
.loops .piece { cursor: pointer; outline: none; }
.loops .tile-bg { fill: #fff; stroke: var(--rule); stroke-width: 2; transition: fill 500ms var(--ease-out); transition-delay: var(--d, 0ms); }
.loops .piece:hover .tile-bg { fill: #f3f6fa; }
.loops .piece:focus-visible .tile-bg { stroke: var(--ink); stroke-width: 5; }
.loops .arm { stroke: #a3adc6; stroke-width: 15; stroke-linecap: butt; transition: stroke 260ms; }
.loops .nub { fill: #a3adc6; transition: fill 260ms; }
.loops .arm.on { stroke: var(--house); }
.loops .arm.loose { stroke: #c96f0a; }
.loops .piece.lit .tile-bg { fill: #eef7f1; stroke: color-mix(in srgb, var(--house) 28%, transparent); }
.loops .source circle { fill: var(--house-deep); }
.loops .source .source-dot { fill: #fff; }
.loops .is-source .tile-bg { fill: var(--house-tint); }
.loops .nub.on { fill: var(--house); }
.loops.solved .tile-bg { fill: var(--house-tint); stroke: color-mix(in srgb, var(--house) 30%, transparent); }
.loops.solved .arm.on { stroke: var(--house-deep); transition: stroke 500ms; transition-delay: var(--d, 0ms); }
.loops.solved .nub.on { fill: var(--house-deep); transition: fill 500ms; transition-delay: var(--d, 0ms); }

/* spot the difference */
.calm-spot { place-items: stretch; }
/* Colour in */
.calm-colour { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.colour-wrap { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; }
.colour-svg { width: auto; height: 100%; max-width: 100%; max-height: 100%; aspect-ratio: 1; display: block; }
.c-shape { stroke: #2a3557; stroke-width: 0.7; stroke-linejoin: round; cursor: pointer; transition: fill 260ms var(--ease-out); }
.c-shape:hover { stroke-width: 1.4; }
.c-shape:focus { outline: none; stroke: var(--house); stroke-width: 2.2; }
.swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); background: var(--sw); cursor: pointer; transition: transform 160ms var(--ease-out); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); }
.colour-match { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; min-height: 38px; }
.colour-match input { width: 18px; height: 18px; accent-color: var(--house-btn); }
/* Breathe */
.breathe-box { position: relative; width: min(100%, 62dvh, 520px); aspect-ratio: 1; }
.breathe-svg { width: 100%; height: 100%; display: block; }
.breathe-track { fill: none; stroke: var(--rule); stroke-width: 2; }
.breathe-ring { fill: color-mix(in srgb, var(--house) 22%, #fff); stroke: var(--house); stroke-width: 2.5; }
.breathe-words { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.breathe-words p { margin: 0; }
.breathe-count { font-family: var(--serif); font-size: clamp(56px, 12dvh, 110px); font-weight: 800; line-height: 1; color: var(--house-deep); min-height: 1em; font-variant-numeric: tabular-nums; }
.breathe-phase { font-family: var(--serif); font-style: italic; font-size: 24px; font-weight: 680; color: var(--house-deep); min-height: 1.3em; }
.breathe-which { font-size: 15.5px; color: var(--ink-soft); min-height: 1.3em; }
.breathe-ring.tight { fill: color-mix(in srgb, var(--house) 45%, #fff); stroke-width: 4; }
.calm-new { position: absolute; top: 5px; right: 5px; display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--house); color: #fff; font-size: 12.5px; font-weight: 700; vertical-align: 2px; }
/* 5, 4, 3, 2, 1 */
.ground { display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 34rem; }
.ground p { margin: 0; }
.ground-num { font-family: var(--serif); font-size: clamp(72px, 14dvh, 130px); font-weight: 800; line-height: 1; color: var(--house-deep); }
.ground-what { font-family: var(--serif); font-size: clamp(26px, 4dvh, 36px); font-weight: 700; color: var(--house-deep); }
.ground-hint { color: var(--ink-soft); font-size: 17px; max-width: 30ch; }
.ground-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 18px; }
.ground-dot { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--house); background: #fff; cursor: pointer; transition: background 300ms var(--ease-out), transform 300ms var(--ease-out); }
.ground-dot:hover { transform: scale(1.06); }
.ground-dot[aria-pressed="true"] { background: var(--house); transform: scale(0.92); cursor: default; }
.spot-wrap { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.quilt { width: 100%; height: 100%; display: block; overflow: visible; }
.quilt .patch { cursor: pointer; outline: none; }
.quilt .patch:focus-visible > g > rect:first-child { stroke: var(--ink); stroke-width: 6; }
.quilt .marks { pointer-events: none; }
.quilt .found { fill: none; stroke: var(--house-deep); stroke-width: 6; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw-ring 520ms var(--ease-out) forwards; }
.quilt .miss { fill: none; stroke: var(--ink-soft); stroke-width: 4; opacity: 0; animation: soft-miss 700ms ease-out; }
.quilt .hint { fill: color-mix(in srgb, #fff 35%, transparent); stroke: var(--house); stroke-width: 7; stroke-dasharray: 6 5; animation: hint 1300ms ease-in-out 2; }
@keyframes draw-ring { to { stroke-dashoffset: 0; } }
@keyframes soft-miss { 0% { opacity: 0.6; transform-box: fill-box; transform-origin: center; scale: 0.7; } 100% { opacity: 0; transform-box: fill-box; transform-origin: center; scale: 1.1; } }
@keyframes hint { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (orientation: portrait) { .spot-wrap { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 14px; } }
@media (max-width: 700px) {
  .calm-bar { padding: 10px 16px; }
  .calm-head h2 { font-size: 22px; }
  .calm-line { font-size: 15px; }
  .calm-stage { padding: 12px 16px 6px; }
  .calm-status { padding: 4px 16px 12px; min-height: 52px; }
  .calm-status p { font-size: 18px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .app, .burst { display: none !important; }
  .report { display: block; color: #1f347f; font-size: 12pt; }
  .report-head h1 { margin: 0; font-size: 24pt; }
  .report-head p { margin: 2px 0 8px; color: #4a5a86; }
  .report-big { font-size: 13pt; font-weight: 700; color: #22573a; margin: 0 0 2mm; }
  .report-map { display: block; width: 125mm; height: 125mm; margin: 0 auto 6mm; }
  .report h2 { font-size: 14pt; margin: 6mm 0 2mm; color: #22573a; }
  .report ul { margin: 0; padding-left: 6mm; }
  .report-foot { margin-top: 8mm; font-size: 9pt; color: #5d6b80; }
}

/* ---------- phones: the map pins to the top ---------- */
@media (max-width: 860px) {
  .app, body.focus .app { grid-template-columns: 1fr; }
  .stage { order: -1; position: sticky; top: 0; z-index: 10; background-color: var(--paper); padding: 6px 8px; border-bottom: 1.5px solid var(--rule); }
  .rose { flex: none; height: 44dvh; max-height: none; }
  .legend { display: none; }
  .stage-foot { justify-content: flex-end; }
  .btn-play { min-height: 36px; padding: 5px 14px; font-size: 14px; }
  .panel { border-right: 0; padding: 14px 16px 28px; max-height: none; overflow: visible; }
  .sb-label { font-size: 26px; }
  .sb-corner { font-size: 30px; }
  .week { font-size: 26px; }
}
@media (max-width: 400px) { .cards, .week-tiles, .strength-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
