/* app.css: the team app's shell in kges2026.com's look, kept light and compact (October 2026: "too
 * big, clunky"). Sign in; ONE slim bar (the KGES mark, the three steps as the site's pill tabs, your
 * money and profit / loss, the pills); ONE event line under it (the phase, the event, what to do now,
 * what comes next, the clock); the step fills the rest; the status line at the foot. On phones the
 * steps are a pill tab bar at the bottom. base.css carries the components. */

:root { --foot-h: 34px; --gut: 16px; }

/* ------------------------------------------------------------------ sign in (a KGES portal page) */
body.is-login { overflow: auto; }
.login { position: fixed; inset: 0; z-index: 90; overflow-y: auto; padding: 0 var(--gut) 40px; }
.login__nav { display: flex; align-items: center; height: 72px; max-width: 1240px; margin: 0 auto; }
.login__card {
  max-width: 500px; margin: 4vh auto 0; padding: 28px 30px 26px; border-radius: 22px; border: 1px solid var(--line-10);
  background: var(--card-bg); box-shadow: 0 40px 90px -60px rgba(0, 0, 0, .9);
  display: flex; flex-direction: column; gap: 12px;
}
.login__title { font-family: var(--font-display); font-size: 34px; line-height: 1.02; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.login__sub { font-size: 14px; line-height: 1.55; color: var(--ink-60); }
.login__field { margin-top: 4px; }
.login__input { font-size: 19px; letter-spacing: .12em; }
.login__hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-45); }
.login__err { min-height: 18px; color: var(--down); font-size: 13px; font-weight: 600; }
.login__err:empty { min-height: 0; }
.login__btn { align-self: flex-start; margin-top: 2px; }
.login__btn:disabled { opacity: .7; cursor: progress; }
.login__steps { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line-08); }
.login__steps li { display: flex; gap: 12px; align-items: center; font-size: 13.5px; color: var(--ink-72); }
.login__steps b { color: var(--ink); }
.login__n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--navy); background: var(--accent-2); }

/* ------------------------------------------------------------------ the frame (laptops): fixed, the step fills the middle */
.app { position: fixed; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.main { position: relative; min-height: 0; min-width: 0; display: flex; padding: 0 var(--gut) 10px; }
.tab-pane { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tab-pane[hidden] { display: none; }

/* ------------------------------------------------------------------ the bar: mark · steps · money · pills */
.topnav { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 var(--gut); min-width: 0; }
.topnav__brand { gap: 10px; }
.topnav__brand .brand__logo { width: 32px; height: 32px; }
.topnav__brand .brand__eyebrow { font-size: 9.5px; letter-spacing: .16em; }
.topnav__brand .brand__title { margin-top: 1px; font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.topnav__steps { margin: 0 auto; padding: 3px; }
.topnav__steps .tab { padding: 6px 15px; font-size: 13px; gap: 7px; }
.tab__n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 800; background: rgba(255, 255, 255, .08); color: var(--ink-60); }
.tab.is-on .tab__n { background: var(--navy); color: var(--accent); }
.step__badge { margin-left: 1px; }
.tab.is-on .step__badge { background: var(--navy); color: var(--accent); }
.topnav__pills { margin-left: 0; padding: 3px; gap: 2px; }
.topnav__pills .pill { padding: 6px 12px; font-size: 12.5px; }
.topnav__pills .pill--account { height: 30px; padding: 0 11px; }
.topnav__team { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app.is-offline .pill--account { color: var(--down); border-color: rgba(255, 143, 143, .5); background: rgba(255, 143, 143, .1); }
.app.is-offline .pill--account::after { content: 'Offline'; font-weight: 800; }
#btn-sound.is-muted { color: var(--ink-45); }

/* Your money: two small figures in one quiet pill; a click opens Trade */
.acct {
  flex: none; display: flex; align-items: center; gap: 0; height: 40px; padding: 0 4px; border-radius: 14px;
  border: 1px solid var(--line-10); background: rgba(255, 255, 255, .035); text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.acct:hover { border-color: var(--line-22); background: rgba(255, 255, 255, .06); }
.acct__cell { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0 10px; min-width: 0; }
.acct__cell + .acct__cell { border-left: 1px solid var(--line-08); }
.acct__k { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-45); white-space: nowrap; }
.acct__v { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 72px; }
.acct__v.up { color: var(--ok); }
.acct__v.down { color: var(--down); }
.acct__v.dim { color: var(--ink-45); }
.acct__v.is-borrowed { color: var(--gold); }
/* Bust: the account hit zero. Calm but unmistakable, next to the money. */
.acct__bust { margin: 0 6px 0 2px; padding: 3px 9px; border-radius: 99px; background: var(--down-strong); color: var(--navy); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.app.is-bust .acct { border-color: rgba(255, 107, 107, .5); background: rgba(255, 107, 107, .08); }

/* ------------------------------------------------------------------ the event line: phase · event · now · next · clock */
.evhead {
  display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 40px; margin: 0 var(--gut) 10px; padding: 5px 8px 5px 10px;
  border-radius: 14px; border: 1px solid var(--line-08); background: rgba(255, 255, 255, .03);
}
.evhead.is-urgent { border-color: rgba(243, 140, 46, .55); background: rgba(243, 140, 46, .1); }
.evhead__id { flex: 0 1 auto; min-width: 0; max-width: 360px; display: flex; align-items: center; gap: 8px; }
.evhead__name { min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; white-space: nowrap; }
.evhead__badge { flex: none; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--accent-2); }
.evhead__badge.is-double { padding: 1px 7px; border-radius: 99px; color: var(--navy); background: var(--gold); letter-spacing: .06em; }
.evhead__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 700; color: var(--ink); }
.phase { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; letter-spacing: 0; text-transform: none; font-size: 11px; }
.phase .dot { width: 6px; height: 6px; box-shadow: none; }
.phase[data-phase="running"] { color: var(--ok); background: rgba(123, 216, 143, .12); }
.phase[data-phase="paused"] { color: var(--accent-2); background: rgba(243, 140, 46, .14); }
.phase[data-phase="settling"] { color: var(--gold); background: rgba(245, 196, 81, .12); }
.phase[data-phase="voided"] { color: var(--down); background: rgba(255, 143, 143, .12); }
/* WHAT TO DO NOW: one plain sentence */
.now { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line-08); }
.now__k { flex: none; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--accent); }
.now__t { min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.now__next { flex: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.now__next:empty { display: none; }
.now__nl { font-size: 12px; font-weight: 600; color: var(--ink-55); }
.now__nt { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.now__next.is-urgent .now__nt { color: var(--accent-2); }
.now__truth { padding: 3px 11px; border-radius: 99px; font-weight: 800; font-size: 13px; color: var(--navy); }
.now__truth--true { background: var(--ok); }
.now__truth--false { background: var(--down-strong); }
.now__truth--partly { background: var(--gold); }
.evhead__clock { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 4px 0 14px; border-left: 1px solid var(--line-08); }
.clock { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.clock.is-idle { color: var(--ink-30); }
.app.is-offline .clock { color: var(--ink-40); }
.evhead__tl { width: 130px; }

/* ------------------------------------------------------------------ foot: the status line */
.foot { min-width: 0; }
.foot__status { position: relative; inset: auto; z-index: 5; }
.foot .status { min-height: 30px; font-size: 12.5px; }
.foot .status__more { padding: 4px 11px; }
.tabbar { display: none; }

/* ------------------------------------------------------------------ help */
.help { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
.help__col { min-width: 0; }
.help .label { display: block; margin-bottom: 8px; }
.help__rules { display: flex; flex-direction: column; gap: 10px; }
.help__rules li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-72); }
.help__rules b { color: var(--accent-2); font-size: 12.5px; font-weight: 700; }
.help__keys { width: 100%; border-collapse: collapse; }
.help__keys td { padding: 5px 0; vertical-align: middle; font-size: 12.5px; color: var(--ink-72); border-bottom: 1px solid var(--line-06); }
.help__keys td:first-child { width: 104px; white-space: nowrap; }
.help__keys .kbd { margin-right: 3px; }
.help__gl { margin-top: 18px; }
.help__groups { display: flex; flex-direction: column; gap: 5px; }
.help__groups li { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 10px; font-size: 12.5px; }
.help__gkey { font-family: var(--font-mono); color: var(--accent-2); font-size: 11px; padding-top: 1px; }
.help__gname { font-weight: 700; color: var(--ink); }
.help__gmem { grid-column: 2; color: var(--ink-50); font-size: 12px; }
.help__words { display: flex; flex-direction: column; gap: 5px; }
.help__words li { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; font-size: 12.5px; color: var(--ink-72); }
.help__words b { color: var(--ink); }

/* ------------------------------------------------------------------ narrower laptops */
@media (max-width: 1279px) and (min-width: 761px) {
  .topnav__brand .brand__text { display: none; }
  .evhead__id { max-width: 300px; }
  .evhead__tl { width: 96px; }
}
@media (max-width: 1150px) and (min-width: 761px) {
  :root { --gut: 14px; }
  .topnav { gap: 10px; }
  .topnav__steps .tab { padding: 6px 12px; }
  .topnav__pills .pill { padding: 6px 10px; }
  .topnav__team { max-width: 110px; }
  .acct__cell { padding: 0 8px; }
  .evhead { gap: 10px; }
  .now, .evhead__clock { padding-left: 10px; }
  .evhead__id { max-width: 270px; }
  .evhead__tl { width: 72px; }
}
/* Short screens (1366 x 768 at 125 %, 1093 x 615): a little less air */
@media (max-height: 660px) and (min-width: 761px) {
  .topnav { height: 48px; }
  .evhead { min-height: 36px; margin-bottom: 8px; padding-top: 3px; padding-bottom: 3px; }
  .acct { height: 36px; }
  .main { padding-bottom: 8px; }
  .foot .status { min-height: 28px; }
}

/* ------------------------------------------------------------------ phones: the page scrolls, one step at a time */
@media (max-width: 760px) {
  :root { --foot-h: calc(92px + var(--safe-b)); --gut: 14px; }
  .app { position: static; display: block; min-height: 100%; }
  .main { display: block; padding: 0 var(--gut) calc(var(--foot-h) + 16px); }
  .tab-pane { display: block; }
  .topnav { position: sticky; top: 0; z-index: 40; height: 58px; padding: var(--safe-t) var(--gut) 0; gap: 8px; background: rgba(0, 5, 16, .92); border-bottom: 1px solid var(--line-08); }
  .topnav__brand .brand__text { display: none; }
  .topnav__steps, #btn-help, #btn-sound { display: none; }
  .acct { margin-left: auto; height: 40px; padding: 0 2px; }
  .acct__cell { padding: 0 7px; }
  .acct__k { font-size: 8.5px; letter-spacing: .06em; }
  .acct__v { font-size: 14px; min-width: 0; }
  .acct__bust { margin: 0 4px 0 0; padding: 2px 6px; font-size: 9.5px; }
  .topnav__pills { margin-left: 0; }
  .topnav__pills .pill { padding: 6px 9px; }
  .topnav__pills .pill--account { padding: 0 8px; gap: 6px; }
  .topnav__team { max-width: 58px; }
  .evhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; margin: 12px var(--gut) 12px; padding: 10px 12px; }
  .evhead__id { max-width: none; grid-column: 1; grid-row: 1; }
  .evhead__clock { grid-column: 2; grid-row: 1; padding-left: 0; border-left: 0; }
  .evhead__tl { display: none; }
  .now { grid-column: 1 / -1; grid-row: 2; padding-left: 0; border-left: 0; align-items: flex-start; }
  .now__t { -webkit-line-clamp: 4; font-size: 14px; }
  .now__next { grid-column: 1 / -1; grid-row: 3; }
  .foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding-bottom: var(--safe-b); background: #020a1d; border-top: 1px solid var(--line-08); }
  .foot__status { border-top: 0; background: transparent; }
  .tabbar { display: flex; gap: 4px; margin: 0 10px 8px; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-08); }
  .tabbar__btn { position: relative; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border-radius: 99px; color: var(--ink-60); font-size: 14px; font-weight: 700; }
  .tabbar__btn--help { flex: 0 0 64px; color: var(--ink-45); }
  .tabbar__n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 800; background: rgba(255, 255, 255, .08); }
  .tabbar__btn.is-on { background: var(--accent); color: var(--navy); }
  .tabbar__btn.is-on .tabbar__n { background: var(--navy); color: var(--accent); }
  .tabbar__badge { position: absolute; top: -4px; right: 2px; }
  .help { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .help__rules li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .login__card { padding: 24px 20px 22px; margin-top: 2vh; }
  .login__title { font-size: 30px; }
  .login__input { font-size: 18px; }
  html.has-sheet .foot { display: none; }
  html.has-sheet body { overflow: hidden; }
}
