/* =====================================================================
   v125: a PHONE TURNED SIDEWAYS (wide and short screen).
   The pages use the whole width: home in two columns, note reading menu in two columns,
   the exercise with the staff and the wheel side by side.
   ===================================================================== */
@media (orientation:landscape) and (max-height:520px){
  .app{max-width:min(1000px,100vw) !important}
  header{padding:6px 18px 6px !important;border-radius:0 0 14px 14px !important}
  header h1{font-size:1.2rem !important;margin:0 !important}
  header p{font-size:.75rem !important;margin:0 !important}
  main{padding-top:8px !important}

  /* ---- home: the quick buttons on one side, the topics in two columns on the other ---- */
  #home.on{display:grid !important;grid-template-columns:280px minmax(0,1fr);column-gap:18px;align-content:start;min-height:0 !important}
  #home.on > *{grid-column:1 / -1}
  #home.on > .tquick{grid-column:1;grid-row:1;flex-wrap:wrap;margin:0 !important}
  #home.on > #installBtn{grid-column:1;grid-row:2;margin:8px 0 0 !important;padding:10px !important;min-height:0 !important}
  #home.on > .hometopics{grid-column:2;grid-row:1 / span 3;margin:0 !important}
  #home.on .tlist{display:grid !important;grid-template-columns:1fr 1fr;gap:6px 12px}
  #home.on .tlist > button{min-height:0 !important;padding:7px 8px !important;margin:0 !important;gap:10px !important}
  #home.on .tlist > button b{font-size:1.15rem !important;line-height:1.2 !important;white-space:nowrap}
  #home.on .tlist > button small{font-size:.78rem !important;line-height:1.25 !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  #home.on .tlist > button > span:nth-child(2){min-width:0;overflow:hidden}
  #home.on .tlist > button .ti{width:34px !important;height:34px !important;flex:0 0 34px !important}
  #home.on .tlist > button .ti svg{width:30px !important;height:30px !important}
  #home.on .tquick > button{padding:4px 2px !important;min-height:0 !important}
  #home.on .tquick > button small{font-size:.78rem !important;white-space:nowrap}
  #home.on .tquick > button .qi svg{width:30px !important;height:30px !important}
  #home.on .homefoot,#home.on .copy{margin-top:6px !important}
  /* v132: the four quick keys (tuner, metronome, task, teacher) – big tiles, two by two, on the right */
  #home.on{grid-template-columns:300px minmax(0,1fr) !important}
  #home.on > .tquick{display:grid !important;grid-template-columns:1fr 1fr;gap:10px !important}
  #home.on .tquick > button{display:flex !important;flex-direction:column;align-items:center;justify-content:center;gap:6px !important;
    padding:12px 6px !important;min-height:92px !important;border-radius:16px !important;background:rgba(255,255,255,.06) !important;border:1px solid rgba(255,255,255,.1) !important}
  #home.on .tquick > button .qi svg{width:42px !important;height:42px !important}
  #home.on .tquick > button small{font-size:1.05rem !important;font-weight:700}
  #home.on > #installBtn{margin-top:10px !important}
}

/* ---- note reading / singing, page 1 and page 2: a wide screen (computer, or a phone turned sideways) ----
   page 1: the two big doors (game / practice) on one side, the settings on the other.
   page 2: the three levels next to each other, the rules under them. */
@media (min-width:900px) and (min-height:521px), (orientation:landscape) and (max-height:520px){
  #menu.pk1.on{display:grid !important;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) !important;column-gap:22px !important;row-gap:0 !important;
    align-content:start}
  #menu.pk1.on > *{grid-column:2 !important;min-width:0}
  #menu.pk1.on > .inst:has(> .pknav){display:contents !important}
  #menu.pk1.on > .inst:has(> .pknav) > *{grid-column:2;min-width:0}
  #menu.pk1.on > .inst > .pknav{grid-column:1 !important;grid-row:1 / span 12 !important;align-self:stretch;display:flex !important;flex-direction:column;margin:0 !important}
  #menu.pk1.on > .inst > .pknav > b{margin:0 0 8px !important}
  #menu.pk1.on > .inst > .pknav > .ngmodes{flex:1 1 auto;display:grid !important;grid-template-columns:1fr 1fr;gap:14px;min-height:0}
  #menu.pk1.on > .inst > .pknav .ngmode{height:100% !important;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
  #menu.pk1.on > .inst:not(:has(> .pknav)){background:transparent !important;border:0 !important;box-shadow:none !important;padding:0 !important;margin:0 0 6px !important}
  #menu.pk1.on > .inst:has(> .pknav) > :not(.pknav){margin-inline:0 !important}

  #menu.pk2.on{display:block !important}
  #menu.pk2.on #levels:has(> .lvl.nglv){display:grid !important;grid-template-rows:auto auto;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0 14px}
  #menu.pk2.on #levels:has(> .lvl.nglv) > .lvl{margin:0 !important}
  #menu.pk2.on #levels:has(> .lvl.nglv) > .ngpickrow{margin:6px 0 0 !important}
  #menu.pk2.on #menuHint{margin-top:14px !important}
}
/* the phone sideways: everything a bit smaller so a page fits the short screen */
@media (orientation:landscape) and (max-height:520px){
  #menu.pk1.on,#menu.pk2.on{max-width:1000px !important;margin-inline:auto !important}
  #menu.pk1.on > .inst > .pknav .ngmode{padding:10px 8px !important}
  #menu.pk1.on .seg button{padding-block:7px !important;min-height:0 !important}
  #menu.pk1.on .inst b,#menu.pk1.on .inst > div:not(.seg):not(.pknav){font-size:.85rem;margin:4px 0 3px !important}
  #menu.pk2.on #pkBar{margin-bottom:8px !important}
  #menu.pk2.on .pkbar{padding:6px 10px !important}
  #menu.pk2.on #levels .lvl.nglv{padding:10px 12px !important;min-height:0 !important}
  #menu.pk2.on #levels .lvl.nglv .nglvart{transform:scale(.8)}
  #menu.pk2.on #levels .ngpickrow .ngchip{padding:7px 8px !important;font-size:.9rem !important}
}
/* computer: page 1 and page 2 a little bigger, in the middle of the screen */
@media (min-width:900px) and (min-height:521px){
  #menu.pk1.on > .inst > .pknav > .ngmodes{min-height:min(48vh,400px)}
  #menu.pk1.on > .inst > .pknav .ngmode{zoom:1.5}
  #menu.pk1.on .seg button{padding-block:22px !important;font-size:1.15rem !important}
  #menu.pk1.on .inst b{font-size:1.05rem}
}

/* ---- the exercise on a phone turned sideways: staff and wheel side by side, a compact top bar ---- */
@media (orientation:landscape) and (max-height:520px){
  #quiz.on{max-width:1000px !important;margin-inline:auto !important}
  .nrstage #nopts,.sgstage #sopts{display:grid !important;grid-template-columns:1fr 1fr;align-items:center;gap:8px 22px;margin:0 auto}
  .nrstage #nopts .nrstaff,.sgstage #sopts .nrstaff{max-width:none !important;width:100%;margin:0 !important}
  .sgstage #sopts > .sgmet,.sgstage #sopts > .sgtries{grid-column:1 / -1}
  .sgstage #sopts .sglive{width:100% !important;margin:0 !important}
  body.inquiz header{padding:4px 14px 4px !important}
  #quiz .stage{padding-block:8px !important}
  #quiz .actions{margin-top:6px !important}
  #quiz .actions .btn{padding-block:8px !important;min-height:0 !important}
}
@media (orientation:landscape) and (max-height:520px){
  body.inquiz header p{display:none !important}
  body.inquiz header h1{font-size:1.05rem !important}
  .nrstage #instLabel,.nrstage .inst-label{display:none !important}
  .nrstage #modeLabel{margin:0 0 4px !important;padding:2px 10px !important;font-size:.85rem !important}
}
@media (orientation:landscape) and (max-height:520px){
  body.inquiz main{padding-bottom:6px !important}
  #quiz .stage.nrstage{position:relative}
  .nrstage #modeLabel{position:absolute;top:6px;inset-inline-end:10px;z-index:2}
  .nrstage .nrwheel .nrok{font-size:.8rem !important}
}
@media (orientation:landscape) and (max-height:520px){
  .nrstage #feedback{position:absolute;bottom:6px;inset-inline-start:0;width:50%;margin:0 !important;text-align:center;z-index:2}
}

/* v133: on a computer the home page always looks like the phone turned sideways – the four big keys on the right, the topics in two columns */
@media (min-width:900px) and (min-height:521px){
  html .app:has(#home.on){max-width:min(1180px,100vw) !important}
  /* ---- home: the quick buttons on one side, the topics in two columns on the other ---- */
  html #home.on{display:grid !important;grid-template-columns:280px minmax(0,1fr);column-gap:18px;align-content:start;min-height:0 !important}
  html #home.on > *{grid-column:1 / -1}
  html #home.on > .tquick{grid-column:1;grid-row:1;flex-wrap:wrap;margin:0 !important}
  html #home.on > #installBtn{grid-column:1;grid-row:2;margin:8px 0 0 !important;padding:10px !important;min-height:0 !important}
  html #home.on > .hometopics{grid-column:2;grid-row:1 / span 3;margin:0 !important}
  html #home.on .tlist{display:grid !important;grid-template-columns:1fr 1fr;gap:6px 12px}
  html #home.on .tlist > button{min-height:0 !important;padding:7px 8px !important;margin:0 !important;gap:10px !important}
  html #home.on .tlist > button b{font-size:1.15rem !important;line-height:1.2 !important;white-space:nowrap}
  html #home.on .tlist > button small{font-size:.78rem !important;line-height:1.25 !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  html #home.on .tlist > button > span:nth-child(2){min-width:0;overflow:hidden}
  html #home.on .tlist > button .ti{width:34px !important;height:34px !important;flex:0 0 34px !important}
  html #home.on .tlist > button .ti svg{width:30px !important;height:30px !important}
  html #home.on .tquick > button{padding:4px 2px !important;min-height:0 !important}
  html #home.on .tquick > button small{font-size:.78rem !important;white-space:nowrap}
  html #home.on .tquick > button .qi svg{width:30px !important;height:30px !important}
  /* v132: the four quick keys (tuner, metronome, task, teacher) – big tiles, two by two, on the right */
  html #home.on{grid-template-columns:300px minmax(0,1fr) !important}
  html #home.on > .tquick{display:grid !important;grid-template-columns:1fr 1fr;gap:10px !important}
  html #home.on .tquick > button{display:flex !important;flex-direction:column;align-items:center;justify-content:center;gap:6px !important;
    padding:12px 6px !important;min-height:92px !important;border-radius:16px !important;background:rgba(255,255,255,.06) !important;border:1px solid rgba(255,255,255,.1) !important}
  html #home.on .tquick > button .qi svg{width:42px !important;height:42px !important}
  html #home.on .tquick > button small{font-size:1.05rem !important;font-weight:700}
  html #home.on > #installBtn{margin-top:10px !important}
  html #home.on{grid-template-columns:360px minmax(0,1fr) !important;column-gap:28px !important}
  html #home.on .tquick > button{min-height:130px !important}
  html #home.on .tquick > button .qi svg{width:54px !important;height:54px !important}
  html #home.on .tquick > button small{font-size:1.25rem !important}
  html #home.on .tlist > button b{font-size:1.35rem !important}
  html #home.on .tlist > button small{font-size:.92rem !important}
  html #home.on .tlist > button{padding:12px 10px !important}
  html #home.on .tlist > button .ti{width:42px !important;height:42px !important;flex:0 0 42px !important}
  html #home.on .tlist > button .ti svg{width:36px !important;height:36px !important}
  html.desk #home.on .tlist{max-width:none !important;margin:0 !important}
  html.desk #home.on .tlist > button{flex-direction:row !important;justify-content:flex-start !important;text-align:start !important;background:none !important;border-radius:12px !important}
  html.desk #home.on .tlist > button:hover{background:#1f1f22 !important}
  html.desk #home.on .tlist .chev{display:block !important;margin-inline-start:auto}
  html.desk #home.on .hometopics{max-width:none !important}
  html.desk #home.on .tquick{max-width:none !important;margin:0 !important}
}

/* v133b: on a computer the home page fills the whole screen */
@media (min-width:900px) and (min-height:521px){
  html .app:has(#home.on){max-width:96vw !important}
  html #home.on{grid-template-columns:minmax(380px,36%) minmax(0,1fr) !important;column-gap:3vw !important;min-height:calc(100vh - 150px) !important;align-content:center !important;row-gap:14px !important}
  html #home.on .tquick{gap:16px !important}
  html #home.on .tquick > button{min-height:clamp(140px,24vh,260px) !important;border-radius:22px !important}
  html #home.on .tquick > button .qi svg{width:clamp(54px,7vh,84px) !important;height:clamp(54px,7vh,84px) !important}
  html #home.on .tquick > button small{font-size:clamp(1.25rem,2.4vh,1.8rem) !important}
  html #home.on > #installBtn{font-size:1.2rem !important;padding:14px !important}
  html.desk #home.on .tlist{gap:clamp(8px,2vh,26px) 2vw !important}
  html #home.on .tlist > button b{font-size:clamp(1.35rem,2.6vh,2rem) !important}
  html #home.on .tlist > button small{font-size:clamp(.92rem,1.7vh,1.25rem) !important}
  html #home.on .tlist > button .ti{width:clamp(42px,6vh,64px) !important;height:clamp(42px,6vh,64px) !important;flex:0 0 clamp(42px,6vh,64px) !important}
  html #home.on .tlist > button .ti svg{width:100% !important;height:100% !important}
}


/* v136: home quick icons in soft muted colours, thin lines (tuner teal-grey, metronome sand, task lilac, teacher blue-grey) */
#home .tquick > button:nth-child(1){--qc:#8fc9d4}
#home .tquick > button:nth-child(2){--qc:#d6c08f}
#home .tquick > button:nth-child(3){--qc:#b3aacd}
#home .tquick > button:nth-child(4){--qc:#97acc9}
html body #home .tquick > button .qi{color:var(--qc) !important;filter:none !important}
html body #home .tquick > button .qi svg{stroke-width:.8 !important}
/* v136: nothing in the exercise (flying points, confetti) may widen the page – a wider page re-fits and the wheel jumps */
html:has(body.inquiz),body.inquiz{overflow-x:clip}
