/* Writing Systems' own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the
   score, the list down the left with its sub-rows, the settings and their "i", the windows, the result, the phone
   layout, and the wide middle column every trainer has). Only this tool's subject goes here: letters in their scripts'
   fonts, the plate a letter is asked on, Explore's letter and chart, a lesson's card, and the buttons under the board
   (the same sizes as Dog Breeds' and Car Brands' answers). Colours and fonts are the shell's variables. */

/* letters in the scripts' own fonts: the system's, with Noto for devices without them */
:root { --f-script: system-ui, -apple-system, "Segoe UI", "Nirmala UI", "Noto Sans", "Noto Sans Georgian", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Sans Gujarati", "Noto Sans Gurmukhi", "Noto Sans Oriya", "Noto Sans Thai", "Noto Sans SC", "Noto Sans CJK SC", "Noto Sans CJK JP", "Noto Sans KR", sans-serif; }
:is([lang="ru"], [lang="el"], [lang="ko"], [lang="ja"], [lang="he"], [lang="ar"], [lang="ka"], [lang="zh"], [lang="th"], [lang="hi"], [lang="bn"], [lang="te"], [lang="ta"], [lang="gu"], [lang="kn"], [lang="ml"], [lang="or"], [lang="pa"]) { font-family: var(--f-script); }

/* the subject, in the middle column under the name card */
.board {
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: clamp(14px, 2.6vh, 26px) clamp(14px, 2vw, 26px);
  background: radial-gradient(80% 60% at 50% 22%, #13222c 0%, #0c141b 72%);
  border: 1px solid var(--line-strong); border-radius: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  container-type: inline-size;
}
.board > :first-child { margin-top: auto; }
.board > :last-child { margin-bottom: auto; }
.board .note { color: var(--muted); text-align: center; max-width: 52ch; line-height: 1.55; margin: 0; }

/* the letter (or word) asked, on its plate; what it is appears under it after an answer */
.plate { display: grid; justify-items: center; gap: 14px; width: min(100%, 620px); padding: 8px 0; }
.glyph { font-size: clamp(88px, 17vh, 156px); font-weight: 600; line-height: 1.08; color: var(--bone); text-align: center; letter-spacing: .02em; }
.glyph.word { font-size: clamp(44px, 9vh, 84px); }

/* what a letter is: its sound, its memory hook, a real word with it */
.facts { display: grid; gap: 10px; justify-items: center; text-align: center; max-width: 52ch; }
.lsound { font-family: var(--f-mono); font-size: 22px; font-weight: 600; color: var(--scan); letter-spacing: .02em; }
.hook { margin: 0; color: var(--fg); font-size: 15.5px; line-height: 1.5; text-wrap: balance; }
.example { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; }
.exword { font-size: 28px; font-weight: 600; color: var(--bone); }
.exmeta { font-size: 14px; color: var(--muted); }

/* Explore: the letter, and beside it the whole script, lesson by lesson */
.explore { display: grid; gap: 22px; width: min(100%, 1040px); align-items: start; }
@container (min-width: 620px) { .explore { grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr); } .explore .detail { position: sticky; top: 0; } }
.detail {
  display: grid; justify-items: center; align-content: center; gap: 14px; padding: 22px 18px;
  background: var(--bg-lift); border: 1px solid var(--line); border-radius: 16px;
}
.detail .glyph { font-size: clamp(80px, 14vh, 128px); }
.explore.words .detail .glyph { font-size: clamp(38px, 7vh, 64px); }
.chart { display: grid; gap: 16px; min-width: 0; }
.lgroup { display: grid; gap: 8px; }
.lgroup.is-later { opacity: .5; }
.ghead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--scan); }
.ghead em { font-style: normal; color: var(--muted); letter-spacing: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.tile, .wtile {
  font: inherit; color: var(--fg); cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px 7px; min-height: 62px; box-sizing: border-box;
}
.tile b { font-size: 25px; font-weight: 600; line-height: 1.15; }
.tile small, .wtile small { font-family: var(--f-mono); font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile:hover, .wtile:hover { border-color: var(--scan); }
.tile.is-on, .wtile.is-on { border-color: var(--bone); box-shadow: 0 0 0 1px var(--bone); background: var(--bg-lift); }
.tile.is-known small { color: var(--ok); }
.wtiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wtile { padding: 8px 12px 7px; min-height: 0; }
.wtile b { font-size: 19px; font-weight: 600; }
.wtile.is-later { opacity: .45; }
div.tile, div.wtile { cursor: default; }

/* a lesson's card, before it is practised: each new letter with what it is */
.lesson { display: grid; gap: 16px; justify-items: center; width: min(100%, 1000px); }
.lede { margin: 0; max-width: 62ch; text-align: center; color: var(--fg); font-size: 15px; line-height: 1.55; text-wrap: balance; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; width: 100%; }
.lcard { display: grid; align-content: start; justify-items: center; gap: 8px; padding: 14px 12px 16px; background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.cglyph { font-size: 46px; font-weight: 600; color: var(--bone); line-height: 1.1; }
.lcard .lsound { font-size: 17px; }
.lcard .hook { font-size: 14px; }
.lcard .exword { font-size: 21px; }
.lcard .exmeta { font-size: 13px; }

/* after a test, under its result: the misses */
.summary { display: grid; gap: 10px; justify-items: center; width: min(100%, 640px); }
.summary .tiles { width: 100%; }

/* the buttons under the board: the answers (two by two), a row of actions, or a box to type in */
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.actions:empty { display: none; }
.actions.row { display: flex; flex-wrap: wrap; justify-content: center; }
.act {
  font: inherit; font-weight: 700; font-stretch: 102%; font-size: 15px; color: var(--fg); cursor: pointer; text-align: start;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; min-height: 46px;
  display: flex; align-items: center; gap: 10px; position: relative; line-height: 1.2;
}
.act kbd { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; flex: none; }
.act .txt { flex: 1; min-width: 0; }
.actions.row > .act { justify-content: center; text-align: center; flex: 0 1 auto; min-width: 120px; }
.act:hover:not(:disabled) { border-color: var(--scan); }
.act:disabled { opacity: .32; cursor: default; }
.act.primary { background: var(--bone); color: #1b1610; border-color: var(--bone); }
.act.primary kbd { color: #5d5345; border-color: #a99c84; }
.act.is-right { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); opacity: 1; }
.act.is-wrong { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); opacity: 1; }
.actions:not(.row) > .act.primary { grid-column: 1 / -1; justify-self: center; justify-content: center; width: min(100%, 360px); }
.act.hear { min-height: 36px; padding: 7px 12px; font-size: 13.5px; flex: none; }
.typebox { width: min(100%, 520px); display: flex; gap: 6px; }
.type {
  flex: 1; min-width: 0; box-sizing: border-box; font-family: var(--f-mono); font-size: 19px; font-weight: 600; text-align: center;
  color: var(--fg); background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 12px; outline: none;
}
.type::placeholder { font-size: 14px; color: var(--muted); font-weight: 500; }
.type:focus { border-color: var(--scan); }
.type.is-ok { border-color: var(--ok); color: var(--ok); }
.type.is-bad { border-color: var(--bad); color: var(--bad); }
.typebox .act { flex: none; }

@media (max-width: 900px) {
  .board { border-radius: 14px; gap: 14px; padding: 12px; }
  .act { padding: 10px 11px; font-size: 14px; min-height: 44px; }
  .act kbd { display: none; }
  .actions.row > .act { min-width: 0; flex: 1 1 0; }
  .typebox { width: 100%; }
  .detail { padding: 16px 12px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
  .tile { min-height: 56px; }
  .tile b { font-size: 22px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lcard { padding: 12px 10px 14px; gap: 8px; }
  .cglyph { font-size: 40px; }
  .lcard .hook { font-size: 13px; }
  .type { font-size: 17px; }
}
