/* Karatai micro page, version 0.3: neo-brutalist and made for children (spec section 20).
   Flat bright colour, 3px ink outlines, hard offset shadows with no blur, buttons that press into their shadow.
   Rules kept throughout: red and blue mean AKA and AO and nothing else; text on every coloured surface is ink;
   every bordered or coloured box keeps at least 12px between its text and its edge; no web fonts.
   Type scale (rem, base 16px, step 1.25): .75 / .875 / 1 / 1.25 / 1.5625 / 1.9375. */
:root {
  color-scheme: light;
  --bg: #E5DBFF; --surface: #FFFFFF; --ink: #111111; --muted: #4A4A4A;
  --main: #FFD23F; --aka: #FF5A5F; --ao: #4D8DFF; --win: #3DDC97; --pop: #9B7BFF; --warn: #FF9F1C;
  --dot: #CFC0F5; --line: #CBBDF0; --off: #EEE9FB;
  --hover: #F1ECFF; --main-hover: #FFE066; --pop-hover: #B79CFF;
  --silver: #DADADA; --bronze: #E0A06A;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.5625rem; --fs-2xl: 1.9375rem;
  --bw: 3px; --radius: 10px; --shadow: 4px 4px 0 var(--ink); --shadow-sm: 3px 3px 0 var(--ink);
  --safe-top: env(safe-area-inset-top, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px);
  --gutter: 16px; --nav-height: 76px; --tap-min: 44px;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1.5px, transparent 1.6px); background-size: 22px 22px; color: var(--ink); font-size: var(--fs-md); line-height: 1.5; overflow-x: hidden; }
h1, h2, h3, p, ul, ol, dl, dd { margin-top: 0; }
ul, ol { padding: 0; list-style: none; margin-bottom: 0; }
h1 { font-size: var(--fs-2xl); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 8px; }
h2 { font-size: var(--fs-xl); font-weight: 900; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 8px; }
h3 { font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; margin-bottom: 8px; }
a { color: inherit; }
button { font: inherit; color: var(--ink); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.boot { padding: 24px var(--gutter); color: var(--muted); font-weight: 700; }

.app-shell { min-height: 100dvh; max-width: 560px; margin: 0 auto; }
.content { padding: 16px max(var(--gutter), var(--safe-right)) calc(var(--nav-height) + 32px + var(--safe-bottom)) max(var(--gutter), var(--safe-left)); }
.content.in-flow { padding-top: calc(10px + var(--safe-top)); padding-bottom: calc(110px + var(--safe-bottom)); }
.content > section, .content > div > section, .content > div > article { margin-bottom: 20px; }
.content > div > section > h3 { margin-top: 6px; }
.eyebrow { margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; min-height: var(--tap-min); margin-bottom: 4px; font-weight: 900; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.lead { font-size: var(--fs-lg); line-height: 1.4; font-weight: 700; }
.where { font-weight: 800; }

/* header: name, chips and the menu at the top right */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(14px + var(--safe-top)) max(var(--gutter), var(--safe-right)) 8px max(var(--gutter), var(--safe-left)); }
.topbar-main { min-width: 0; flex: 1; padding-right: 112px; } /* room for the fixed Menu button */
.topbar h1 { margin: 4px 0; font-size: var(--fs-xl); line-height: 1.15; }
.draft { display: inline-block; margin: 0; font-size: var(--fs-xs); font-weight: 900; line-height: 1.3; letter-spacing: .02em; }
.draft::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid var(--ink); background: var(--warn); }
.sample { margin: 2px 0 0; font-size: var(--fs-sm); font-weight: 800; color: var(--muted); }
.sample::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid var(--ink); border-radius: 50%; background: var(--pop); }
.chips { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; padding: 0; list-style: none; }
.chip { color: var(--muted); font-size: var(--fs-sm); font-weight: 800; line-height: 1.4; }
.chip-kata { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.chip-kata::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--ink); background: var(--main); transform: rotate(45deg) scale(.9); }

/* The Menu button stays at the top right of the window, at every width and while scrolling, so it is never lost
   in the empty space beside the 560px column. The panel hangs from it and is capped to the window. */
.menu { position: fixed; z-index: 8; top: calc(12px + var(--safe-top)); right: max(var(--gutter), var(--safe-right)); }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--main); box-shadow: var(--shadow-sm); font-size: var(--fs-sm); font-weight: 900; }
.menu-btn svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 3; stroke-linecap: round; }
.menu-btn[aria-expanded="true"] { transform: translate(3px, 3px); box-shadow: none; }
.menu-panel { position: absolute; z-index: 10; top: calc(100% + 10px); right: 0; width: min(280px, calc(100vw - 32px)); max-height: calc(100dvh - 96px); overflow-y: auto; padding: 16px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }

/* cards and boxes */
.card { padding: 16px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.calm { background: var(--bg); }
.calm p { margin-bottom: 12px; font-weight: 700; }
.calm p:last-child { margin-bottom: 0; }
.callout { margin: 14px 0 0; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--bg); font-weight: 700; }
.callout.ok { background: var(--win); }
.callout-where { margin: 8px 0 0; font-weight: 800; }
.flow-body .callout { margin: 14px 0; }
.banner { margin-bottom: 16px; padding: 14px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--pop); box-shadow: var(--shadow); }
.banner p { margin: 0; }
.banner-title { font-weight: 900; font-size: var(--fs-lg); line-height: 1.3; margin-bottom: 4px !important; }
.notice { font-weight: 800; }
.note-line { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }

/* buttons: they press into their shadow */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); font-size: var(--fs-md); font-weight: 900; text-decoration: none; text-align: center; color: var(--ink); background: var(--surface); transition: transform .08s, box-shadow .08s; }
.button:active:not(:disabled), .button:active:not([aria-disabled]) { transform: translate(4px, 4px); box-shadow: none; }
.button:disabled { background: var(--off); border-style: dashed; box-shadow: none; color: var(--muted); cursor: default; }
.button-primary, .button-main { background: var(--main); }
.button-plain { background: var(--surface); }
.button-quiet { box-shadow: none; background: transparent; }
.button-quiet:active:not(:disabled) { transform: none; background: var(--off); }
.button.big { min-height: 60px; font-size: var(--fs-lg); width: 100%; }
.actions { display: grid; gap: 14px; margin-top: 16px; }
.actions .button { width: 100%; }
.quadro-link { margin-top: 10px; width: 100%; }

/* tags: a swatch beside a word. The swatch is never alone, and the shapes differ as well as the colours */
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 10px; font-size: var(--fs-sm); }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 800; color: var(--ink); white-space: nowrap; }
.tag::before { content: ""; flex: none; width: 14px; height: 14px; border: 2px solid var(--ink); background: var(--surface); }
.tag > [aria-hidden="true"] { display: none; }
.st-todo::before { border-radius: 50%; }
.st-partial::before { border-radius: 50%; background: linear-gradient(90deg, var(--main) 50%, var(--surface) 50%); }
.st-done::before { background: var(--win); }
.st-pain::before { background: var(--warn); transform: rotate(45deg) scale(.85); }
.tag-load::before { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; }
.tag-today::before { background: var(--main); border-radius: 50%; }
.tag-draw::before { background: var(--main); }
.tag-res::before { background: var(--pop); border-radius: 50%; }
.tag-club { display: inline-block; margin-top: 4px; font-size: var(--fs-sm); font-weight: 800; text-decoration: underline dotted 2px; text-underline-offset: 3px; }
.wait { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-sm); color: var(--ink); }
.wait::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--ink); background: var(--warn); transform: rotate(45deg) scale(.85); }

/* day card steps */
.steps { display: grid; gap: 0; margin-top: 8px; counter-reset: s; }
.step-li { position: relative; display: grid; gap: 0; padding: 10px 0 10px 40px; border-top: 2px solid var(--line); counter-increment: s; }
.step-li::before { content: counter(s); position: absolute; left: 0; top: 10px; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 50%; background: var(--main); font-size: var(--fs-sm); font-weight: 900; }
.step-name { font-weight: 800; }
.step-meta { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }

/* week */
.day-list { display: grid; gap: 12px; margin: 14px 0 20px; }
.day-link { display: grid; grid-template-columns: 64px 1fr 20px; gap: 12px; align-items: center; min-height: 72px; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.day-link:active { transform: translate(4px, 4px); box-shadow: none; }
.day-link.is-today { background: var(--main); }
.day-badge { display: grid; place-items: center; width: 64px; padding: 12px; border: 2px solid var(--ink); border-radius: 8px; background: var(--bg); line-height: 1.1; }
.dow { font-size: var(--fs-xs); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.dnum { font-size: var(--fs-lg); font-weight: 900; }
.day-body { display: grid; min-width: 0; }
.day-title { font-weight: 900; line-height: 1.25; }
.day-body .meta-row { margin: 4px 0 0; }
.chev { font-size: var(--fs-xl); font-weight: 900; line-height: 1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.facts dt { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; font-size: var(--fs-xl); font-weight: 900; }
.bars { display: grid; gap: 16px; }
.bar-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bar-name { font-weight: 900; }
.bar-val { font-size: var(--fs-sm); color: var(--muted); font-weight: 800; }
.bar-track { display: flex; height: 16px; margin-top: 6px; overflow: hidden; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); }
.bar-track span { display: block; height: 100%; background: var(--win); }
.bar-track .seg-win { background: var(--win); }
.bar-track .seg-loss { background: repeating-linear-gradient(45deg, var(--surface) 0 4px, var(--ink) 4px 6px); }

/* progress */
.progress-track { height: 18px; overflow: hidden; border: var(--bw) solid var(--ink); border-radius: 999px; background: var(--surface); }
.progress-track span { display: block; height: 100%; background: var(--win); transition: width .25s; }

/* lesson flow */
.flow-head { position: sticky; top: 0; z-index: 3; margin: 0 -2px 18px; padding: 4px 2px 12px; background: var(--bg); }
.flow-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.flow-top .button { min-height: var(--tap-min); padding: 12px 16px; }
.flow-count { margin: 0; font-weight: 900; color: var(--muted); }
.flow-body { margin-bottom: 18px; }
.flow-body h2 { font-size: var(--fs-2xl); line-height: 1.15; }
.block { margin: 18px 0; }
.block p { margin-bottom: 0; font-size: var(--fs-lg); line-height: 1.4; }
.block h3 { display: inline-block; margin-bottom: 4px; font-size: var(--fs-md); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; text-decoration: underline; text-decoration-color: var(--main); text-decoration-thickness: 6px; text-underline-offset: 3px; }
.key { margin: 18px 0; padding: 16px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--main); box-shadow: var(--shadow); }
.key .eyebrow { color: var(--ink); }
.key-text { margin: 0; font-size: var(--fs-xl); font-weight: 900; line-height: 1.25; }
.flow-foot { position: fixed; left: 50%; bottom: 0; z-index: 4; width: min(560px, 100%); transform: translateX(-50%); padding: 12px max(var(--gutter), var(--safe-right)) calc(12px + var(--safe-bottom)) max(var(--gutter), var(--safe-left)); border-top: var(--bw) solid var(--ink); background: var(--bg); }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-col { display: grid; gap: 12px; }
.big-num { font-size: var(--fs-2xl); font-weight: 900; margin-bottom: 4px; text-decoration: underline; text-decoration-color: var(--win); text-decoration-thickness: 8px; text-underline-offset: 2px; }
.answers { display: grid; gap: 0; }
.answers li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 2px solid var(--line); }
.timer { margin: 18px 0; padding: 16px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.clock { margin: 0 0 10px; font-size: var(--fs-2xl); font-weight: 900; font-variant-numeric: tabular-nums; }
.clock.up { text-decoration: underline; text-decoration-color: var(--win); text-decoration-thickness: 6px; }
.timer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* exercise drawings in the lesson (section 21): a white card per drawing, the drawing at the card's full width */
.drawings { display: grid; gap: 18px; margin: 18px 0; }
.drawing { padding: 16px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.drawing-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.drawing h3 { margin: 0; font-size: var(--fs-md); font-weight: 900; line-height: 1.25; }
.tag-draft::before { background: var(--warn); }
.tag-pic::before { background: var(--main); border-radius: 3px; }
.drawing-open { display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; cursor: zoom-in; }
.drawing-open img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.drawing-open:active img { transform: translate(3px, 3px); }
.drawing-hint { margin: 12px 0 0; }
/* a catalogue animation (section 22): a square frame, never wider than the card and never taller than about half the screen */
.anim-frame { position: relative; width: min(100%, 360px, 50vh); width: min(100%, 360px, 50dvh); aspect-ratio: 1 / 1; margin: 0 auto; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.anim-frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.anim-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 12px; text-align: center; }
.anim-frame.anim-still { display: grid; place-items: center; width: 100%; aspect-ratio: auto; padding: 16px; }
.anim-note { margin: 12px 0 0; font-weight: 700; }
.anim-credit { margin: 12px 0 0; }

/* the large view of a drawing: a dialog over the page, with "Fechar" always in reach */
html.modal-open, html.modal-open body { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 8px; background: rgba(17, 17, 17, .65); }
.viewer-panel { width: min(100%, 640px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow: auto; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.viewer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 2px solid var(--line); background: var(--surface); }
.viewer-title { margin: 0; font-size: var(--fs-md); font-weight: 900; line-height: 1.25; }
.viewer-head .button { flex: none; min-height: var(--tap-min); padding: 8px 18px; }
.viewer-body { padding: 8px 8px 16px; }
@media (min-width: 600px) { .viewer { padding: 16px; } .viewer-panel { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); } .viewer-body { padding: 16px; } }
.viewer-body img { display: block; width: 100%; height: auto; }

/* picker */
.picker { display: grid; gap: 14px; margin-top: 14px; }

/* pain: where does it hurt */
.area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.area-btn { display: flex; align-items: center; min-height: 72px; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); font-size: var(--fs-md); font-weight: 900; line-height: 1.25; text-align: left; }
.area-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.area-btn[aria-pressed="true"] { transform: translate(3px, 3px); box-shadow: inset 0 0 0 2px var(--ink); background: var(--main); }
.area-btn[aria-pressed="true"]::before { content: '✓'; flex: none; margin-right: 8px; font-size: var(--fs-lg); }
.back-q { width: 100%; }

/* competitions */
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-head h2 { margin: 0; }
.seg { display: inline-flex; border: var(--bw) solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg-btn { min-height: var(--tap-min); padding: 12px; border: 0; background: var(--surface); font-size: var(--fs-sm); font-weight: 900; }
.seg-btn + .seg-btn { border-left: var(--bw) solid var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--main); box-shadow: inset 0 0 0 2px var(--ink); }
.seg-btn:focus-visible { outline-width: 3px; outline-offset: -6px; } /* inside the button: .seg clips anything outside it */
.seg-btn[aria-pressed="true"]::before { content: '✓ '; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; margin-top: 8px; }
.sum-col h3 { font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.sum-col dl { margin: 0; }
.sum-col dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 2px solid var(--line); font-size: var(--fs-sm); }
.sum-col dt { color: var(--muted); font-weight: 700; }
.sum-col dd { margin: 0; font-weight: 900; font-size: var(--fs-md); }
.col-link { display: inline-flex; align-items: center; min-height: var(--tap-min); margin-top: 4px; font-size: var(--fs-sm); font-weight: 900; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.ev-card .up-entries { display: grid; gap: 0; margin-top: 10px; }
.up-entries > li { display: grid; gap: 2px; padding: 12px 0; border-top: 2px solid var(--line); }
.up-disc { font-size: var(--fs-xs); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.up-cat { font-weight: 900; }
.up-draw { font-size: var(--fs-sm); font-weight: 600; }
.up-draw.pending { color: var(--muted); font-style: italic; }
.period-line { margin: -4px 0 10px; }

/* the athlete's side on an upcoming card */
.side-block { display: grid; gap: 6px; margin-top: 10px; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--bg); }
.side-block p { margin: 0; }
.side-first { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-md); }
.later-h { margin-top: 4px !important; font-weight: 800; }
.later { display: grid; gap: 4px; margin-top: 4px; font-size: var(--fs-sm); font-weight: 700; }
.later li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.confirm { font-weight: 700; color: var(--muted); }
.side { display: inline-flex; align-items: center; min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); font-size: var(--fs-md); font-weight: 900; line-height: 1.2; color: var(--ink); }
.side-aka.side, .comp.side-aka { background: var(--aka); }
.side-ao.side, .comp.side-ao { background: var(--ao); }
.side-lite { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; }
.side-sw { flex: none; width: 16px; height: 16px; border: 2px solid var(--ink); }
.side-aka .side-sw { background: var(--aka); }
.side-ao .side-sw { background: var(--ao); border-radius: 50%; }
.bout-opp { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 2px; font-size: var(--fs-sm); }
.bout-opp-txt { font-weight: 700; }

/* history: filters, count, seasons */
.filters { display: grid; gap: 12px; margin: 4px 0 12px; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.f-row { display: grid; gap: 6px; }
.f-label { font-size: var(--fs-xs); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.f-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.f-scroll { flex-wrap: nowrap; overflow-x: auto; padding: 10px 10px 12px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.f-scroll .chip-btn { flex: none; }
.chip-btn { min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); font-size: var(--fs-sm); font-weight: 900; white-space: nowrap; }
.chip-btn[aria-pressed="true"] { background: var(--main); transform: translate(2px, 2px); box-shadow: inset 0 0 0 2px var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.chip-switch[aria-pressed="true"]::before { content: '✓ '; }
.chip-switch { justify-self: start; }
.hist-count { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 0 0 8px; font-weight: 900; }
.link-btn { min-height: var(--tap-min); padding: 12px 0; border: 0; background: transparent; font-size: var(--fs-sm); font-weight: 900; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.year-group + .year-group { margin-top: 4px; }
.year { margin: 0 0 8px; font-size: var(--fs-lg); }
.season-toggle { display: grid; grid-template-columns: 1fr auto 20px; gap: 12px; align-items: center; width: 100%; min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--pop); box-shadow: var(--shadow-sm); text-align: left; font-size: var(--fs-md); font-weight: 900; }
.season-toggle[aria-expanded="false"]:active { transform: translate(3px, 3px); box-shadow: none; }
.season-count { font-size: var(--fs-sm); font-weight: 800; }
.season-toggle .chev { font-size: var(--fs-md); }
.ev-list { display: grid; gap: 12px; margin-top: 12px; margin-bottom: 8px; }
.ev-row { display: grid; grid-template-columns: 52px 1fr 16px; gap: 12px; align-items: start; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; }
.ev-row:active { transform: translate(3px, 3px); box-shadow: none; }
.ev-date { display: grid; justify-items: center; line-height: 1.05; padding-top: 2px; }
.ev-date .mon { font-size: var(--fs-xs); font-weight: 900; text-transform: uppercase; color: var(--muted); }
.ev-main { display: grid; gap: 2px; min-width: 0; }
.ev-name { font-weight: 900; line-height: 1.25; }
.ev-entry { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center; padding-top: 8px; margin-top: 8px; border-top: 2px solid var(--line); }
.ev-mark { display: grid; place-items: center; }
.ev-txt { display: grid; min-width: 0; }
.ev-cat { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; font-weight: 600; }
.ev-res { font-weight: 800; font-size: var(--fs-sm); line-height: 1.3; }
.ev-top { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.medal { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: var(--bw) solid var(--ink); font-size: var(--fs-sm); font-weight: 900; color: var(--ink); }
.m1 { background: var(--main); } .m2 { background: var(--silver); } .m3 { background: var(--bronze); }
.place-plain { display: grid; place-items: center; width: 48px; font-size: var(--fs-sm); font-weight: 800; color: var(--muted); }
.bouts { display: grid; gap: 0; margin-top: 10px; }
.bout { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-top: 2px solid var(--line); }
.bout-txt { display: grid; gap: 1px; min-width: 0; }
.bout-detail { font-size: var(--fs-md); }
.bout-word { font-size: var(--fs-sm); font-weight: 800; color: var(--muted); }
.res { display: grid; place-items: center; width: 44px; height: 44px; border: var(--bw) solid var(--ink); font-weight: 900; border-radius: 10px; }
.res-win { background: var(--win); }
.res-loss { background: var(--surface); border-radius: 50%; }
.res-none { border-style: dashed; color: var(--muted); }
.foot-notes { margin-top: 8px; }

/* medals, form guide, highlights, drill-downs */
.medal-row { display: flex; gap: 8px; margin: 10px 0 14px; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--pop); }
.medal-row li { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.season .medal-row { flex-wrap: wrap; margin: 4px 0 0; gap: 8px 14px; justify-content: flex-start; }
.season .medal-row li { flex: 0 0 auto; flex-direction: row; gap: 8px; }
.medal-word { font-weight: 900; font-size: var(--fs-sm); }
.form-guide { margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--line); }
.mini-h { margin-bottom: 6px; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .06em; }
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 0; }
.form-disc { flex: none; width: 64px; font-size: var(--fs-sm); font-weight: 900; }
.form-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.form-guide > p { margin: 6px 0 0; }
.hl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hl { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--pop); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.hl-val { font-size: var(--fs-xl); font-weight: 900; line-height: 1.15; }
.hl-label { font-size: var(--fs-sm); font-weight: 900; line-height: 1.3; }
.hl-detail { font-size: var(--fs-xs); line-height: 1.35; font-weight: 600; }
.kata-list, .season-list { display: grid; gap: 12px; }
.kata-row { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; }
a.kata-row { grid-template-columns: 1fr 16px; }
a.kata-row:active { transform: translate(3px, 3px); box-shadow: none; }
.kata-main { display: grid; min-width: 0; }
.kata-main .bar-head { display: flex; }
.season { display: grid; min-width: 0; gap: 6px; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.season-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.season-line { font-size: var(--fs-sm); font-weight: 600; }
.facts-3 { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); margin-bottom: 18px; }
.facts-3 dd { font-size: var(--fs-lg); }
dl.facts { margin-bottom: 18px; }
.bout-list { display: grid; gap: 12px; margin: 10px 0 18px; }
.bout-link { display: grid; grid-template-columns: 44px 1fr 16px; gap: 12px; align-items: start; min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; }
a.bout-link:active { transform: translate(3px, 3px); box-shadow: none; }
div.bout-link { grid-template-columns: 44px 1fr; }
.bout-link .bout-txt { display: grid; gap: 1px; }
.bout-where { font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); font-weight: 600; }

/* bracket screen: round by round, never a wide tree */
.bracket-head { margin-bottom: 8px; }
.bracket-head h2 { margin-bottom: 4px; }
.side-note { margin-bottom: 14px; }
.tabs-box { display: grid; gap: 10px; margin: 14px 0 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap-min); padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); font-size: var(--fs-sm); font-weight: 900; }
.tab[aria-pressed="true"] { background: var(--main); transform: translate(2px, 2px); box-shadow: inset 0 0 0 2px var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tab-star { font-size: var(--fs-md); line-height: 1; }
.path { margin: 12px 0; background: var(--main); }
.path h3 { margin-bottom: 4px; }
.path-status { margin-bottom: 12px; font-weight: 800; }
.path-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.path .button-plain { background: var(--surface); }
.path .button-main { background: var(--surface); }
.round-panel h3 { margin-bottom: 2px; }
.bout-cards { display: grid; gap: 16px; margin-top: 12px; }
.bout-card { border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.bout-card:focus { outline: none; }
.bout-card:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
.bout-card.is-mine { border-width: 4px; box-shadow: var(--shadow); }
.bout-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0; padding: 12px; border-bottom: var(--bw) solid var(--ink); background: var(--bg); font-size: var(--fs-sm); font-weight: 900; }
.is-mine .bout-head { background: var(--main); }
.mine-flag { font-weight: 900; }
.comp { padding: 12px; border-bottom: var(--bw) solid var(--ink); background: var(--surface); }
.comp:last-of-type { border-bottom: 0; }
.comp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 2px; font-size: var(--fs-sm); font-weight: 900; }
.side-label { letter-spacing: .02em; text-transform: uppercase; font-size: var(--fs-xs); }
.me-flag { margin-left: 8px; font-size: var(--fs-xs); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; }
.comp-top .me-flag { margin-left: 0; }
.comp-main { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.comp-name { font-weight: 900; font-size: var(--fs-lg); line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.comp-score { flex: none; font-size: var(--fs-xl); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.comp-sub { margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.comp.is-winner { box-shadow: inset 0 0 0 4px var(--ink); }
.comp.is-winner .comp-name { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; }
.comp.is-ph { border-bottom-style: dashed; }
.comp.is-ph .comp-name { font-style: italic; font-weight: 800; font-size: var(--fs-md); }
.win-flag { font-weight: 900; }
.bye-line { margin: 0; padding: 12px; border-top: var(--bw) dashed var(--ink); background: var(--bg); font-weight: 900; }
.bout-card > .small { margin: 0; padding: 12px; border-top: var(--bw) solid var(--ink); font-weight: 700; }
.rank-list { display: grid; gap: 12px; margin-top: 12px; }
.rank-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.rank-row.is-mine { background: var(--main); box-shadow: var(--shadow); border-width: 4px; }
.rank-n { display: grid; place-items: center; width: 44px; height: 44px; border: var(--bw) solid var(--ink); border-radius: 50%; background: var(--bg); font-weight: 900; }
.rank-main { display: grid; min-width: 0; }
.rank-pts { font-weight: 900; font-variant-numeric: tabular-nums; }

/* sign-in, account, confirm */
.code-form { display: grid; gap: 12px; margin: 18px 0; }
.field-label { font-weight: 900; }
.field { width: 100%; min-height: 60px; padding: 12px 14px; border: var(--bw) solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); font: inherit; font-size: var(--fs-lg); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.field[aria-invalid="true"] { border-style: dashed; }
.form-msg { margin: 0; font-weight: 800; }
.form-msg:empty { display: none; }
.menu-panel .button { width: 100%; }
.account { display: grid; gap: 10px; }
.account p { margin: 0; }
.confirm-q { font-size: var(--fs-lg); font-weight: 900; }
.confirm-btns { display: grid; gap: 12px; margin-top: 4px; }

/* bottom nav */
.bottom-nav { position: fixed; z-index: 4; bottom: 0; left: 50%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(560px, 100%); padding: 6px max(8px, var(--safe-left)) calc(6px + var(--safe-bottom)) max(8px, var(--safe-right)); transform: translateX(-50%); border-top: var(--bw) solid var(--ink); background: var(--surface); }
.nav-button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 60px; color: var(--ink); text-decoration: none; font-size: var(--fs-xs); font-weight: 900; }
.nav-icon { display: grid; place-items: center; width: 56px; height: 34px; border: 2px solid transparent; border-radius: 17px; }
.nav-button.is-active .nav-icon { background: var(--main); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.nav-button.is-active .nav-label { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; }
.nav-icon svg { width: 24px; height: 24px; stroke: var(--ink); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* hover (mouse only): lift and a lighter fill; ink text stays above 4.5:1 on every fill used here */
@media (hover: hover) {
  .button:hover:not(:disabled), .menu-btn:hover:not([aria-expanded="true"]), .day-link:hover, .ev-row:hover, a.kata-row:hover, a.bout-link:hover, .season-toggle[aria-expanded="false"]:hover, .area-btn[aria-pressed="false"]:hover, .chip-btn[aria-pressed="false"]:hover, .tab[aria-pressed="false"]:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
  .button-plain:hover:not(:disabled), .day-link:not(.is-today):hover, .ev-row:hover, a.kata-row:hover, a.bout-link:hover, .area-btn[aria-pressed="false"]:hover, .chip-btn[aria-pressed="false"]:hover, .tab[aria-pressed="false"]:hover, .seg-btn[aria-pressed="false"]:hover, .path .button:hover:not(:disabled) { background: var(--hover); }
  .button-primary:hover:not(:disabled), .button-main:hover:not(:disabled), .menu-btn:hover, .day-link.is-today:hover, .area-btn[aria-pressed="true"]:hover, .chip-btn[aria-pressed="true"]:hover, .tab[aria-pressed="true"]:hover, .seg-btn[aria-pressed="true"]:hover { background: var(--main-hover); }
  .path .button-main:hover:not(:disabled) { background: var(--hover); }
  .button-quiet:hover:not(:disabled) { background: var(--off); box-shadow: none; transform: none; }
  .season-toggle:hover { background: var(--pop-hover); }
  .back-link:hover, .col-link:hover, .link-btn:hover { text-decoration-thickness: 5px; }
  .nav-button:not(.is-active):hover .nav-icon { background: var(--off); border-color: var(--ink); }
  .button:hover:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: none; }
  .button-quiet:hover:active:not(:disabled) { transform: none; }
  .day-link:hover:active { transform: translate(4px, 4px); box-shadow: none; }
  .ev-row:hover:active, a.kata-row:hover:active, a.bout-link:hover:active, .season-toggle[aria-expanded="false"]:hover:active, .area-btn[aria-pressed="false"]:hover:active, .chip-btn[aria-pressed="false"]:hover:active, .tab[aria-pressed="false"]:hover:active { transform: translate(3px, 3px); box-shadow: none; }
  .nav-button:hover .nav-label { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; }
  .drawing-open:hover img { box-shadow: 5px 5px 0 var(--ink); transform: translate(-1px, -1px); }
  .drawing-open:hover:active img { transform: translate(3px, 3px); box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (min-width: 600px) { .content { padding-left: 24px; padding-right: 24px; } .topbar { padding-left: 24px; padding-right: 24px; } .menu { right: 24px; } }
@media (min-width: 820px) { .topbar-main { padding-right: 0; } }
