/* Every device the family uses: Android phones and iPhones held either way,
   Android tablets and iPads upright and sideways, and desktops.

   Loaded LAST, after every other stylesheet, so a rule here is the final word
   for its size. tools/fit-check.mjs opens every screen at 14 sizes and checks
   for what these rules fix: anything past the edge of the screen, text over
   text, text cut off, buttons too small for a finger, text too small to read.

   Two floors hold at EVERY size:
     - Text is 12px or more.
     - Anything you tap is 40px or more in both directions (44px where there
       is room). A kid's finger is not a mouse pointer. */

/* ------------------------------------------------------------ the floors */

.type-badge-label { font-size: 12px; }
.cal-week span, .mini-week span, .sched-dow { font-size: 12px; }
.swatch { min-height: 44px; }
/* A long team name wraps to two lines rather than "Vancouver Goldene...". */
.swatch span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; }
.sched-cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lvl { font-size: 12px; }
.lvl.big { min-height: 40px; font-size: 14px; padding: 0 16px; }
.cat-chip { height: auto; min-height: 40px; border-radius: 20px; }
.cat-chip-n { font-size: 12px; }
.sched-mode { font-size: 12px; }
.cal-today-tag { font-size: 12px; }
.mini-kicker { font-size: 12px; }
.stat-sub { font-size: 12px; }
.theme-div { font-size: 12px; }
.sign-out { font-size: 12px; min-height: 40px; display: inline-flex; align-items: center; padding: 0 10px; }
.drag-handle { width: 40px; }
button.bd-tier-chip { min-height: 40px; }
.tab { min-height: 40px; height: auto; }
button.train-title { min-height: 40px; display: inline-flex; align-items: center; }
.parent-card input:not([type=checkbox]):not([type=radio]), .parent-card select,
.sheet input:not([type=checkbox]):not([type=radio]), .sheet select { min-height: 44px; }
/* Two lines of text in a box sized for one ran over each other. */
.train-kicker { line-height: 1.3; margin-bottom: 2px; }
.drill-title { line-height: 1.05; }
.drill-target { margin-top: 14px; }
.train-kicker + .train-title { margin-top: 2px; }
.mini-big { line-height: 1.15; margin-top: 4px; }

/* The Locker's panels keep their own height and the column scrolls. Left to
   shrink, the binder tile lost the first line of its title and its button
   hung off the bottom whenever the column was short. */
.locker-col > * { flex: none; }
.cal-legend { font-size: 12px; }
.kid-card-meta { font-size: max(12px, 1em); }
.train-title { line-height: 1.2; }

/* A short screen (a phone held sideways, a laptop with the browser's bars):
   the countdown's pieces were each pinned to a fixed spot and ran into each
   other. Stacked instead, with the number sized to what is left. */
@media (max-height: 600px) {
  .countdown { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
  .countdown .cd-get-ready, .countdown .cd-name, .countdown .cd-actions { position: static; }
  .countdown .cd-get-ready { font-size: 22px; order: 1; }
  .countdown .cd-num { font-size: min(220px, 34vh); order: 2; }
  .countdown .cd-name { font-size: 22px; order: 3; }
  .countdown .cd-actions { order: 4; }
}

/* The Locker in one column (phones, and tablets held upright): one scroll
   for the whole page. A column scrolling on its own inside it shrank to fit,
   and the next column drew over it -- Personal Bests ran under the binder. */
@media (max-width: 980px) {
  /* The board in one column the same way: the calendar at its full height --
     held upright, a tablet squeezed each day to a 31px strip -- and the day's
     drills at their full length, the whole board scrolling as one page. */
  .board { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .board-right { min-height: 0; }
  .train, .cal { flex: none; }
  .train-list { flex: none; min-height: 0; overflow: visible; }
  .cal-grid { flex: none; grid-auto-rows: 64px; }
  .locker { display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .locker-col { overflow: visible; min-height: auto; flex: none; }
}

/* A very wide screen keeps the drill screen readable. */
.drill-screen { max-width: 1700px; width: 100%; margin: 0 auto; }

/* Two columns side by side (a tablet held sideways, a desktop): a long
   description pushed START off the bottom of the right column with no way to
   scroll to it. Each column now scrolls on its own, and START stays pinned
   to the bottom of the right one, as it already is on smaller screens. (Below
   1100px wide, or under 500px tall, the whole grid scrolls instead -- styles.css.) */
@media (min-width: 1101px) and (min-height: 501px) {
  .drill-left, .drill-right { overflow-y: auto; overscroll-behavior: contain; }
}
/* One column (an iPad held upright): the whole grid scrolls, and START sticks
   to the bottom of the screen once its column is in view. */
.drill-right .big-btn { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -14px 16px -6px var(--app-bg); }

/* ---------------------------------------------- phones held upright */

@media (max-width: 600px) {
  /* The schedule calendar: a seventh of a phone is too narrow for the word,
     so the day shows its plan as a coloured bar (the words stay for a screen
     reader, and the list above says each weekday in full). */
  .sched-cell .sched-mode { font-size: 0; display: block; width: 70%; height: 6px; padding: 0; margin: 4px auto 0; }

  /* The kid's Settings: one column that scrolls as a whole. Each column
     scrolling on its own ran its sections into each other. */
  .settings { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .settings-col > * { flex: none; }
  .locker-binder { flex-wrap: wrap; min-height: 0; }
  /* The Locker: the binder and Cash in first, ahead of badges and bests.
     The two columns dissolve so their cards can be put in any order. */
  .locker .locker-col { display: contents; }
  .locker .locker-binder { order: -2; }
  .locker .cash-in-card { order: -1; }
  .locker-binder-title { font-size: 28px; }
  .settings-body { display: flex; flex-direction: column; flex: none; }
  .settings-col { min-height: auto; overflow: visible; }
  .swatch span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; }

  /* The drill screen: YOUR BEST and WITH CAIDEN? one above the other. Side by
     side, the partner card's words went one per line. */
  .drill-cards { flex-direction: column; }
  .drill-cards .mini { flex: none; }

  /* Parent lists: a row's name keeps the width and its buttons go underneath,
     instead of every word on its own line beside four buttons. */
  .list-row { flex-wrap: wrap; row-gap: 8px; }
  .list-row .grow { flex: 1 1 150px; }
  .parent-card { max-width: none; }
  .parent-body { overflow-x: hidden; }
  .tab { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .btn-row { flex-wrap: wrap; }
  .field.row2, .field.row3 { grid-template-columns: minmax(0, 1fr); }

  /* The GOAL screen: the drill line was a 34px block that took three lines,
     and the two buttons wrapped their words. */
  .celebrate-inner { padding: 0 14px; }
  .goal-sub { font-size: 20px; text-align: center; }
  .goal-btns { flex-wrap: wrap; justify-content: center; }
  .goal-btn { white-space: nowrap; font-size: 20px; padding: 0 20px; }
}

/* -------------------------------------------- phones held sideways */

@media (max-height: 500px) and (orientation: landscape) {
  .tab { min-height: 40px; }
  /* Team colours: three to a row, and a long name wraps rather than "Light
     the La...". */
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .swatch span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; }
  .locker-binder-title { font-size: 24px; }
  .kid-card-meta { font-size: 12px; }
  /* GOAL: everything small enough to fit one short screen, and it scrolls if
     a big day still does not. */
  .celebrate { overflow-y: auto; justify-content: flex-start; padding: 8px 0; }
  .celebrate-inner { gap: 6px; margin: auto 0; }
  .goal-sub { font-size: 17px; text-align: center; }
  .goal-chip { font-size: 13px; padding: 5px 12px; }
  .goal-btn { height: 48px; font-size: 18px; padding: 0 18px; white-space: nowrap; }
  .goal-btns { margin-top: 4px; }
  /* Counting reps: the screen is too short for all of it, so it closes up and
     scrolls, with STOP pinned to the bottom like START on the drill screen. */
  .rep { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0; }
  .rep-hint { display: none; }
  .rep-title { margin-top: 0; }
  .rep .stop-btn { position: sticky; bottom: 0; z-index: 5; flex: none; box-shadow: 0 -12px 14px -6px var(--app-bg); margin-bottom: 8px; }
}

/* Parent mode > Settings > Fix a day: the amount in the drill's own units. A
   row wraps under the name on a phone rather than squeezing it. */
.fix-row { flex-wrap: wrap; }
.fix-row .grow { min-width: 160px; }
.fix-amount { display: flex; align-items: center; gap: 8px; }
.fix-box { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--gray); }
.fix-box input { height: 44px; border-radius: 10px; border: 2px solid #E3E7EA; padding: 0 10px; font-size: 16px; }

/* Parent mode > Drills: the drills that are on, and beside them (underneath
   on a narrow screen, folded) a card of the ones turned off. */
.drills-cols { display: flex; flex-direction: column; gap: 14px; }
.drills-cols > .parent-card { max-width: none; min-width: 0; }
.drills-off > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 44px; }
.drills-off > summary::-webkit-details-marker { display: none; }
.drills-off > summary h2 { margin: 0; font-size: 18px; }
.drills-off > summary::after { content: '+'; margin-left: auto; font-size: 22px; font-weight: 700; color: var(--gray); }
.drills-off[open] > summary::after { content: '\2212'; }
.drills-off .list-row.off { opacity: 1; }
.drills-off .list-row .grow > div { color: var(--gray); }
.drills-off .drill-tile { display: none; }
@media (min-width: 1101px) {
  .drills-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; max-width: 1400px; }
}

/* The LTL mark on a standard drill. */
.ltl-mark { width: 20px; height: 20px; border-radius: 5px; flex: none; vertical-align: -4px; margin-right: 7px; }
.drill-row-name { font-weight: 700; display: flex; align-items: center; }
.ltl-key .ltl-mark { margin-right: 5px; }
.std-title { display: flex; align-items: center; }
.std-title .ltl-mark { width: 28px; height: 28px; border-radius: 7px; margin-right: 10px; }
.std-about { margin-top: 18px; border-top: 1px solid #E3E7EA; padding-top: 6px; }
.std-about > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.std-fact { font-size: 15px; line-height: 1.45; white-space: pre-wrap; }

/* Parent mode > Analytics in one column (phones, tablets held upright): the
   whole tab scrolls with the page. The kids' summaries scrolling in a box of
   their own under the calendar squeezed it to nothing, and on a phone it
   could not be scrolled at all (2026-11-05). */
@media (max-width: 1100px) {
  .analytics { height: auto; overflow: visible; }
  .analytics-right { overflow: visible; min-height: auto; }
}

/* Analytics > See all details. */
.see-details { margin-top: 14px; width: 100%; }
.kid-details { margin-top: 16px; }
.detail-table { display: flex; flex-direction: column; }
.detail-tr { display: grid; grid-template-columns: minmax(0, 1fr) 52px minmax(70px, auto) 92px; gap: 10px;
             padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; align-items: baseline; }
.detail-tr.head { font-size: 12px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; }
.detail-tr span:first-child { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.detail-tr span:not(:first-child) { text-align: right; }
.detail-day { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.detail-day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.detail-day-head b { min-width: 92px; }
.detail-pts { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--gray); }
.day-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
            font-size: 12px; font-weight: 700; background: #F2F5F7; color: var(--gray); }
.day-chip.won { background: #FFF3D6; color: #8A5A00; }
.day-chip.part { background: #E6F4EC; color: #2C6E49; }
.day-chip.rest { background: #ECEBFA; color: #4B479A; }
.day-chip.missed { background: #FDE8E8; color: #A3262A; }
.detail-done { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.detail-drill { font-size: 13px; font-weight: 600; background: #F7F9FA; border-radius: 8px; padding: 4px 9px; }
.detail-drill i { font-style: normal; font-weight: 500; color: var(--gray); }
@media (max-width: 600px) {
  .detail-tr { grid-template-columns: minmax(0, 1fr) 44px minmax(60px, auto); }
  .detail-tr span:nth-child(4) { display: none; }
}
