/* Chai Boil: the pot is a picture; every control is a button under it (design/REDESIGN.md section 2).
 * Sizes are Accessible Play's (20 px buttons, 22 px goal, 24 px HUD, 44 px targets); fit comes from layout. */

/* self-hosted faces: the same width on every phone (the 320 squeeze came from a fallback face) */
@font-face { font-family: "Hind"; src: url("fonts/hind-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind"; src: url("fonts/hind-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Rokkitt"; src: url("fonts/rokkitt-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
/* The tea-chest counter: Rokkitt for the title, the level name and the numbers; Hind for everything else. Chinese keeps the kit's CJK stack. */
:root { --display: "Rokkitt", Georgia, serif; --body: "Hind", system-ui, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif; --label: "Hind", system-ui, "Noto Sans TC", sans-serif; }
#play-screen .controls button, #goal { font-family: var(--body); }
#play-screen .controls button { font-size: var(--text-btn, 20px); font-weight: 600; border: 2px solid var(--t-ink); border-radius: 4px; background: var(--t-board); color: var(--t-ink); }
#goal { font-weight: 400; font-size: var(--text-rule, 22px); background: transparent; padding-left: 0; padding-right: 0; }
/* while the result sheet is open the goal line is hidden (it keeps its room, so the board does not move), so the poured glasses sit clear above the sheet */
:root[data-pl-screen="result"] #goal { visibility: hidden; }
/* top bar: a 2 px ink rule under it; the title is Rokkitt */
.pl-topbar { border-bottom: 2px solid var(--t-ink); }
.pl-brand-title { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .01em; }
:root:lang(zh-Hant) .pl-brand-title { font-family: var(--body); font-weight: 700; }
/* HUD: the level name in Rokkitt, "Time" in Hind muted, its number in Rokkitt */
.level-name { font-family: var(--display); font-weight: 800; font-size: var(--text-hud, 24px); color: var(--t-ink); }
:root:lang(zh-Hant) .level-name { font-family: var(--body); font-weight: 700; }
.chai-hud { font-family: var(--body); font-size: var(--text-hud, 24px); color: var(--t-muted); }
.chai-hud .pl-noun { font-family: var(--body); font-weight: 400; color: var(--t-muted); }
.chai-hud .pl-num { font-family: var(--display); font-weight: 800; font-size: var(--text-hud, 24px); color: var(--t-ink); font-variant-numeric: tabular-nums; }
:root:lang(zh-Hant) .chai-hud .pl-num { font-family: var(--body); font-weight: 700; }
/* a tea tin: the lid is a 6 px ink band on top; Pour and Try again are ink */
.chai-tray > button { border-top-width: 6px !important; }
.controls .chai-pour { background: var(--t-ink); color: var(--t-board); border-color: var(--t-ink); }
.controls .chai-pour.is-again { background: var(--t-ink); border-color: var(--t-ink); color: var(--t-board); }
/* the lesson card: an 8 px ink rule on the left, the tag in ink (the accent stays on fire) */
.rule-strip, #rule-strip { border: 2px solid var(--t-ink); border-left: 8px solid var(--t-ink); border-radius: 4px; background: var(--t-board); }
.rule-tag, #rule-strip #rule-tag { color: var(--t-ink); }

/* the board: the pot is a picture, the strip under it is the fire (game.js handles the finger there) */
#board { touch-action: pan-y; }
/* the fire for keyboards and screen readers: a real range input over the strip, invisible and never in a finger's way */
.chai-fire-keys { position: absolute; left: 0; right: 0; bottom: 0; height: 14%; width: 100%; margin: 0; opacity: 0; pointer-events: none; }

/* kit controls this game does not use (one pot, no undo; the clock is the game's own Time) */
#undo-button, #replay-button, #hint-button, #reset-button, #more-button, #stuck-button, #clock-count { display: none !important; }
/* the kit's How to play footer gives its buttons a display value that beats [hidden]; this game has no first-minute round */
[data-pl="first-minute-replay"][hidden] { display: none !important; }

/* the status line: what the pot is doing now, one line */
#play-screen #message { min-height: 1.45em; margin: 2px 0 4px; font-size: var(--text-body); line-height: 1.45; }
:root:lang(zh-Hant) #play-screen #message { min-height: 1.6em; line-height: 1.6; }

/* the Levels screen: each tile's level name is button text (20 px, Accessible Play) */
.level-tile small { font-size: var(--text-btn, 20px); line-height: 1.45; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.level-tile { min-width: 0; }
:root:lang(zh-Hant) .level-tile small { line-height: 1.6; }

/* the goal: balanced lines, so a wrapped line never leaves one word or one character alone */
#goal { text-wrap: balance; }

/* HUD: Time beside the level name */
.chai-hud .pl-noun { font-weight: 400; }
.chai-hud[hidden] { display: none; }

/* the controls: the order's ingredients and Pour, one row */
#play-screen .controls { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.chai-tray { display: flex; gap: 8px; flex: 1 1 0; min-width: 0; }
.chai-tray > button { flex: 1 1 0; min-width: 0; min-height: 52px; padding: 4px 2px; font-weight: 600; white-space: nowrap; }
.chai-tray > button[hidden] { display: none !important; }
/* everything is in: Pour (or Try again) takes the row */
.controls.chai-all-in .chai-tray { display: none; }
.controls.chai-all-in .chai-pour { flex: 1 1 auto; }

/* Pour: the one way to end the pot; Try again after a pot that went wrong */
.controls .chai-pour { flex: 0 0 auto; min-width: 84px; min-height: 52px; padding: 4px 12px; font-weight: 600; }
.controls .chai-pour:disabled { background: var(--t-board); color: var(--t-muted); border: 2px solid var(--t-muted); }

/* a phone under 360 px wide, three tins still in the row: the three take the whole row; Pour joins when the first goes in
   (nothing can be served before the tea) */
@media (max-width: 359px) {
  .controls .chai-pour { min-width: 72px; padding: 4px 8px; }
  .controls.chai-tins-first .chai-pour { display: none; }
}
/* a narrow short phone (320 x 568): the pot takes the full width; the status line sits under it */
@media (max-width: 359px) and (max-height: 640px) {
  #play-screen:not([hidden]) { display: block; }
  #play-screen #message { height: auto; margin: 2px 0 4px; }
}
