/* Online version (server.py): extra screens, sign-in page and the phone layout. The desktop
   program never loads this file. */

/* ---------- online-only pieces */
body.remote .desktop-only, body:not(.is-admin) .admin-only { display: none !important; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 10px; font-size: 12px; }
.account #acct-name { font-weight: 600; color: var(--text); width: 100%; }
.hw-list { display: flex; flex-direction: column; gap: 12px; }
.hw { display: flex; flex-direction: column; gap: 8px; }
.hw.archived { opacity: .55; }
.hw-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hw-title { font: 500 21px/1.2 var(--serif); }
.hw-stat { color: var(--gold2); font-size: 12.5px; white-space: nowrap; }
.hw-notes { margin: 0; color: var(--text2); white-space: pre-wrap; }
.hw-mini { height: 126px; overflow: hidden; pointer-events: none; }
.hw-mini .exp-label { display: none; }
.late { color: var(--poor); }
.hw-chip { display: flex; align-items: center; gap: 12px; margin: -4px 24px 10px; padding: 6px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold2); font-size: 13px; font-weight: 600; }
.hw-chip .link { margin-left: auto; }
.hf-users { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 8px; }
.wide-in { background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; outline: none; min-width: 0; flex: 1; }
input.wide-in { width: 100%; }
.row .wide-in { width: auto; }
.tbl-scroll.tall { max-height: calc(100vh - 170px); }
#sx-modal .modal-card { width: min(560px, 94vw); }
#sx-modal textarea { font-family: var(--sans); }

/* ---------- sign-in page */
body.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; }
.login-card h1 { font: 400 34px/1 var(--serif); text-align: center; margin: 16px 0 22px; }
.login-card input { background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 12px; outline: none; font-size: 16px; }
.login-card input:focus { border-color: var(--gold-deep); }
.login-card button.gold { padding: 12px; font-size: 15px; }
.login-card #lang { align-self: center; }

/* ---------- phones */
@media (max-width: 760px) {
  body { flex-direction: column; height: 100dvh; }
  main { padding: 12px 12px 86px; }
  /* navigation becomes a bottom bar of icons */
  #nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; width: auto; height: 64px; flex-direction: row; padding: 6px 4px;
    border-right: 0; border-top: 1px solid var(--line); gap: 0; justify-content: space-around; background: var(--nav1); }
  #nav .brand, #nav .nav-foot { display: none; }
  #zoom-pill { bottom: 74px; right: 8px; }
  .nav-item { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10px; text-align: center; justify-content: center; border-radius: 8px; }
  .nav-item .ico { font-size: 18px; width: auto; }
  .nav-item.active { box-shadow: inset 0 2px 0 var(--gold); }
  /* the language and the account live in Settings on a phone */
  body.remote #view-settings .grid2 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; align-items: center; }
  .topbar .field.grow { flex-basis: 100%; }
  #ex-select { font-size: 17px; max-width: 100%; width: 100%; }
  .title { font-size: 22px; }
  .view-opts { gap: 8px 14px; margin: 0 0 8px; font-size: 12px; }
  .view-opts .toggle { font-size: 12px; }
  .stage { padding-top: 10px; }
  .stage-head { padding: 0 12px 8px; gap: 12px; }
  .count { font-size: 44px; min-width: 48px; }
  .vu { width: 70px; }
  .score-scroll { height: calc(100dvh - 330px); }
  .hint { display: none; }
  button.record { padding: 11px 18px 11px 14px; }
  /* review */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ring-card { grid-column: span 2; }
  .stat { padding: 12px 14px; }
  .stat-val { font-size: 30px; }
  .transport { flex-wrap: wrap; padding: 0 12px 10px; gap: 10px; }
  .legend { display: none; }
  .guide { border-left: 0; padding-left: 0; }
  table { font-size: 12px; }
  th, td { padding: 7px 8px; }
  /* editor */
  .modal { align-items: stretch; }
  .modal-card { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .b-body { grid-template-columns: 1fr; }
  .pat-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .theme-cards { grid-template-columns: repeat(2, 1fr); }
  .hw-top { flex-direction: column; gap: 4px; }
  .center-stage { padding: 30px 12px; }
  .big-timer { font-size: 60px; }
}
#phone-account { display: none; }
@media (max-width: 760px) { #phone-account { display: block; } }
/* passwords the admin types for other users: masked, but not a password field, so the browser
   doesn't treat them as the admin's own (no "save password" or leaked-password warnings) */
.pw-mask { -webkit-text-security: disc; text-security: disc; }

/* phones: two quick taps on a button (tempo + / -, record) must not zoom the page; pinch zoom
   still works. Fields at 16 px so focusing one never zooms in. */
button, select, input, label, .seg, .stepper, .nav-item, .cx-chip, svg.tl { touch-action: manipulation; }
@media (max-width: 760px) { select, input, textarea { font-size: 16px; } }

/* history: selection, debugging flag, delete */
.hi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
  background: color-mix(in srgb, #6fb6ff 10%, var(--card2)); border: 1px solid color-mix(in srgb, #6fb6ff 40%, transparent); font-size: 13px; }
.hi-actions #hi-seln { font-weight: 600; margin-right: auto; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
#hi-table td.hi-cb, #hi-table th:first-child { width: 34px; text-align: center; }
#hi-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: #6fb6ff; cursor: pointer; }
#hi-table tr.picked td { background: color-mix(in srgb, #6fb6ff 9%, transparent); }
/* popovers become bottom sheets on a phone */
@media (max-width: 760px) {
  .pop { position: fixed; left: 8px; right: 8px; top: auto; bottom: 70px; width: auto; max-height: 70vh; overflow: auto; }
  button.pick-btn span[data-i18n] { display: none; }
  .pol-table td { display: block; width: auto !important; border: 0; padding: 3px 0; }
  .pol-table tr { display: block; border-top: 1px solid var(--line2); padding: 6px 0; }
}
/* small menus open as a sheet at the bottom of a phone, never off the screen */
@media (max-width: 760px) {
  .pop-menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: 70px; min-width: 0; max-height: 70vh; overflow: auto; z-index: 60; }
  .pop-menu button { padding: 12px 14px; font-size: 15px; }
}
/* the bottom menu scrolls sideways when its buttons don't fit (an arrow shows there are more) */
@media (max-width: 760px) {
  #nav { overflow-x: auto; overflow-y: hidden; justify-content: flex-start; }
  #nav .nav-item { flex: 1 0 64px; min-width: 64px; }
  .ofl-arrow { background: none; }
  #nav ~ .ofl-arrow, .ofl-arrow { text-shadow: 0 0 6px #000; }
}
