/* ===== ONE LOOK FOR THE FIRST PAGES (owner 2026-10-21: "every page has different buttons and text sizes") =====
   Start page, who-is-playing, settings and the parent page share exactly these parts (approved Q01 UI kit art, page-ui-mocks-v1):
     primary button  = navy kit button        (height --ui-h, radius --ui-r, text --ui-fs-m)
     secondary button = cream kit button       (same height, radius, text)
     pill            = cream kit chip, navy when chosen (height --ui-pill-h, text --ui-fs-s)
     input           = cream box, thin ink line (height --ui-h, radius --ui-r, text --ui-fs-m = 16 px: an iPhone zooms the page into any smaller input)
   and three text sizes: --ui-fs-s (notes, pills), --ui-fs-m (buttons, labels), --ui-fs-l (page titles).
   Loaded after style.css and landscape.css, so it wins over the older one-off sizes. */
:root { --ui-fs-s: 13px; --ui-fs-m: 16px; --ui-fs-l: 20px; --ui-h: 44px; --ui-pill-h: 34px; --ui-r: 16px; --ui-cream: #fffaf0; }

/* ---- primary ---- */
#screen-landing .land-enter, #who .big-btn, #settings .big-btn, #screen-parent .big-btn {
  box-sizing: border-box; height: var(--ui-h); min-height: var(--ui-h); min-width: 140px; padding: 0 24px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 0; border-radius: var(--ui-r); border-image: url(art/ui3/primary-button.png) 52 fill / 22px / 0 stretch;
  color: var(--ui-cream); font-family: inherit; font-size: var(--ui-fs-m); font-weight: 800; line-height: 1; letter-spacing: 0; white-space: nowrap; text-shadow: none; box-shadow: none;
}
/* ---- secondary ---- */
#screen-landing .land-bottom .land-btn, #screen-landing .land-parent, #who .sub-btn, #settings .set-v2 .set-links .sub-btn, #settings .sub-btn:not(.danger), #screen-parent .sub-btn:not(.danger) {
  box-sizing: border-box; height: var(--ui-h); min-height: var(--ui-h); min-width: 0; padding: 0 18px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--ui-r); border-image: url(art/ui3/secondary-button.png) 52 fill / 22px / 0 stretch;
  color: var(--ink, #1b1d4d); font-family: inherit; font-size: var(--ui-fs-m); font-weight: 800; line-height: 1.1; letter-spacing: 0; white-space: nowrap; text-shadow: none; box-shadow: none;
}
/* the one red button (wipe everything) keeps its warning colour but has the same size and corners */
#settings .reset-btn, #settings .set-v2 .set-data .reset-btn, #settings .sub-btn.danger {
  box-sizing: border-box; height: var(--ui-h); min-height: var(--ui-h); min-width: 140px; padding: 0 20px;
  border: 2.5px solid var(--ink, #1b1d4d); border-radius: var(--ui-r); border-image: none; background: var(--red, #ff5a6e); color: #fff;
  font-size: var(--ui-fs-m); font-weight: 800; line-height: 1; box-shadow: none; text-shadow: none;
}
/* ---- pill ---- */
#who .who-grades button, #settings .lang-pick button, #settings .set-v2 .lang-pick button, #settings .toggle, #settings .set-v2 .set-inline .toggle, #screen-parent .par-grades button {
  box-sizing: border-box; height: var(--ui-pill-h); min-height: var(--ui-pill-h); min-width: 0; padding: 0 10px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: transparent; border: 0; border-radius: var(--ui-r); border-image: url(art/ui3/chip-normal.png) 52 fill / 17px / 0 stretch;
  color: var(--ink, #1b1d4d); font-family: inherit; font-size: var(--ui-fs-s); font-weight: 800; line-height: 1; letter-spacing: 0; white-space: nowrap; transform: none; box-shadow: none; text-shadow: none;
}
#who .who-grades button.on, #settings .lang-pick button[aria-checked="true"], #settings .set-v2 .lang-pick button[aria-checked="true"], #screen-parent .par-grades button[aria-pressed="true"] { border-image-source: url(art/ui3/chip-selected.png); color: var(--ui-cream); transform: none; }
#settings .toggle b { color: inherit; font-size: var(--ui-fs-s); }
/* ---- input ---- */
.ui-input { box-sizing: border-box; width: 100%; height: var(--ui-h); margin: 0; padding: 0 14px; border: 2.5px solid var(--ink, #1b1d4d); border-radius: var(--ui-r); background: var(--ui-cream); color: var(--ink, #1b1d4d); font-family: inherit; font-size: var(--ui-fs-m); font-weight: 800; line-height: 1; outline: none; }
.ui-input::placeholder { color: #8d8aa6; font-weight: 600; }
.ui-input:focus { border-color: #5b63d8; box-shadow: 0 0 0 3px rgba(91, 99, 216, .2) !important; }
/* ---- page titles (one size) ---- */
#who #who-title, #settings #settings-title, #screen-parent #parent-title {
  box-sizing: border-box; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 22px; margin: 0;
  background: transparent; border: 0; border-radius: var(--ui-r); border-image: url(art/ui3/primary-button.png) 52 fill / 18px / 0 stretch;
  color: var(--ui-cream); font-size: var(--ui-fs-l); font-weight: 800; letter-spacing: .04em; line-height: 1;
}
/* the round close button: the same on settings and who-is-playing */
#who .who-x, #settings .set-v2 .set-x { position: absolute !important; left: auto !important; right: 12px !important; top: 10px !important; margin: 0 !important; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink, #1b1d4d); font-size: var(--ui-fs-m); font-weight: 900; border: 2.5px solid var(--ink, #1b1d4d); box-shadow: none; }
#who .who-x[hidden] { display: none; }

/* ---- start page ---- */
#screen-landing .land-enter { position: absolute; left: 77.5%; top: 55%; transform: translateX(-50%); z-index: 3; animation: ui-pulse 1.6s ease-in-out infinite; }
@keyframes ui-pulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.06); } }
body.reduced #screen-landing .land-enter { animation: none; }
#screen-landing .land-bottom { gap: 10px; }
#screen-landing .land-bottom .land-btn { min-width: 132px; }
#screen-landing .land-bottom .land-btn[hidden] { display: none; }
#screen-landing .land-parent { position: absolute; right: 3%; top: 4%; width: auto; max-width: none; }
#screen-landing .land-parent b { font-weight: 800; }
#screen-landing .land-gear { width: var(--ui-h); height: var(--ui-h); margin-top: 82px; padding: 0; border: 0; border-radius: var(--ui-r); background: transparent; border-image: url(art/ui3/secondary-button.png) 52 fill / 20px / 0 stretch; }
#screen-landing .land-gear img { width: 24px; height: 24px; }
#screen-landing .land-hi { font-size: var(--ui-fs-s); }

/* ---- who is playing: one phone screen, label column on the left, 開始 centred ---- */
#who .who-card { position: relative; box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(100%, 640px); max-width: 640px; max-height: calc(100dvh - 12px); padding: 16px 22px 18px; overflow: hidden; }
#who #who-title { align-self: center; }
#who .who-new { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px; } /* the rows share one label column (display: contents), so the boxes line up in every language */
#who .who-new[hidden], #who .who-list[hidden], #who .sub-btn[hidden] { display: none; }
#who .who-row { display: contents; }
#who .who-lbl { min-width: 44px; font-size: var(--ui-fs-m); font-weight: 800; color: var(--ink, #1b1d4d); text-align: right; white-space: nowrap; }
#who .who-avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
#who .who-avatars button { box-sizing: border-box; height: var(--ui-h); padding: 0; display: grid; place-items: center; background: transparent; border: 0; border-radius: var(--ui-r); border-image: url(art/ui3/secondary-button.png) 52 fill / 16px / 0 stretch; transform: none; box-shadow: none; font-size: 0; }
#who .who-avatars button.on { border-image-source: url(art/ui3/chip-selected.png); }
#who .who-avatars button img, #who .who-avatars button .av-img { width: 32px; height: 32px; object-fit: contain; }
#who .who-grades { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
#who .who-grades button { flex: 1 1 auto; max-width: 25%; } /* long English names (Kindergarten) wrap to a second row instead of being cut */
#who #who-go { grid-column: 1 / -1; justify-self: center; align-self: center; min-width: 180px; margin-top: 2px; }
#who .who-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 140px)); justify-content: center; gap: 8px; }
#who .who-list button { box-sizing: border-box; height: 92px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; border: 0; border-radius: var(--ui-r); border-image: url(art/ui3/secondary-button.png) 52 fill / 20px / 0 stretch; color: var(--ink, #1b1d4d); box-shadow: none; }
#who .who-list button.on { border-image-source: url(art/ui3/chip-selected.png); color: var(--ui-cream); }
#who .who-list button > * { flex: 0 0 auto; }
#who .who-list button .em { display: block; font-size: 0; line-height: 0; }
#who .who-list button .em img, #who .who-list button .av-img { width: 40px; height: 40px; object-fit: contain; }
#who .who-list button .who-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ui-fs-m); font-weight: 800; }
#who .who-list button small { font-size: var(--ui-fs-s); opacity: .8; }
#who #who-add { align-self: center; min-width: 200px; }

/* ---- settings ---- */
#settings .set-v2 .set-label { font-size: var(--ui-fs-m); }
#settings .set-v2 .set-note, #settings .set-note { font-size: var(--ui-fs-s); line-height: 1.25; }
#settings .set-v2 .set-links { gap: 8px; }
#settings .set-v2 .set-links .sub-btn { width: 100%; padding: 0 8px; white-space: normal; line-height: 1.05; text-align: center; }
#settings .lang-pick { display: flex; gap: 6px; }
#settings .lang-pick button { flex: 1 1 0; width: auto; max-width: none; }

/* ---- parent page ---- */
#screen-parent .tree-head { align-items: center; }
#screen-parent .par-bk-btns { display: flex; gap: 10px; }
#screen-parent .par-bk-btns .sub-btn { flex: 1 1 0; }
#screen-parent .par-bk-note, #screen-parent .par-privacy, #screen-parent .par-bk-msg { font-size: var(--ui-fs-s); }
