/* =====================================================================
   The app shell and the browse surface.
   Built to the reference mockup: a dark navy rail down the left, a light
   working area, and photo-led cards.

   Everything here reads from the tokens in app.css. No colour is written
   as a literal, so the palette stays changeable in one place.
   ===================================================================== */

/* ---- the shell -------------------------------------------------------
   The rail is .app-rail, not .side. board.css has used .side since long
   before this file existed, to mean one team's half of a court -- and the
   moment the board started loading this stylesheet every court side became
   a sticky, full-height, navy sidebar. A generic class name in a shared
   stylesheet is a collision waiting for the next page that opts in. */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }

.app-rail {
  background: var(--brand);
  color: var(--on-brand);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.side-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 22px;
  color: var(--on-brand); text-decoration: none;
}
/* No fill of its own any more: the mark draws the whole ball, lime and
   all, so a lime disc behind it was a lime disc behind a lime ball. The
   box only sets the size now, and the SVG fills it. */
.side-logo .ball {
  width: 48px; height: 32px; flex: none;
  display: grid; place-items: center;
}
/* Both dimensions, at the mark's own 3:2. A box left to size itself from
   an image that is in turn sizing itself from the box is a circle the
   browser breaks by using the file's intrinsic 384px -- which is how a
   32px logo became a 400px ball across the sidebar. object-fit keeps the
   artwork undistorted if the box is ever a hair off the ratio. */
.side-logo .ball .ps-mark, .side-foot .ball .ps-mark {
  width: 100%; height: 100%; max-width: none; object-fit: contain;
}
.side-logo b { display: block; font-weight: 800; font-size: 15px; letter-spacing: -.01em; line-height: 1.1; }
/* The inner span -- the "Open Play" line -- not every span in the block.
   The markup nests the name and the tagline inside one wrapper, so a bare
   `.side-logo span` caught the wrapper too and uppercased the name through
   it. That went unnoticed while the name was meant to be uppercase; this
   one is a domain and PICOOL.PH is a different wordmark. */
.side-logo span span {
  display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; opacity: .6; margin-top: 3px;
}
.side-logo > span { display: block; }

.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--on-brand); text-decoration: none;
  font-size: 13.5px; font-weight: 500; opacity: .74;
}
.side-nav a:hover { opacity: 1; background: rgba(255,255,255,.07); }
.side-nav a.on { opacity: 1; background: rgba(255,255,255,.12); font-weight: 600; }
.side-nav a .ico { width: 18px; flex: none; display: grid; place-items: center; }
.side-nav .pip {
  margin-left: auto; background: var(--action); color: var(--on-action);
  font-size: 10.5px; font-weight: 700; border-radius: var(--r-full); padding: 1px 7px;
}

/* Pinned to the bottom, like the reference. */
.side-foot { margin-top: auto; padding: 18px; display: flex; align-items: center; gap: 10px; }
.side-foot .ball { width: 36px; height: 24px; flex: none;
  display: grid; place-items: center; }
.side-foot p { margin: 0; font-size: 11.5px; line-height: 1.35; opacity: .62; }

/* ---- the working area ------------------------------------------------ */
.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .grow { margin-left: auto; }
.topbar .iconbtn {
  width: 36px; height: 36px; border-radius: var(--r-full);
  display: grid; place-items: center; color: var(--text-muted); background: transparent;
}
.topbar .iconbtn:hover { background: var(--surface-alt); color: var(--text); }
.who { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: var(--r-full); text-decoration: none; }
.who:hover { background: var(--surface-alt); }
/* The name beside the disc. Scoped with :not(.avatar) because the disc is
   now a .avatar span from ps_avatar() rather than the old .av one, and a
   bare `.who span` would reach inside it and repaint the initials in the
   body colour at the body size. */
.who > span:not(.avatar) { font-size: 13.5px; font-weight: 600; color: var(--text); }
.who > .avatar { width: 30px; height: 30px; font-size: 12px; }

.page { padding: 22px 26px 48px; }
/* ---- narrow: the rail becomes a bottom bar --------------------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .app-rail {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; z-index: 40; flex-direction: row;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .side-logo, .side-foot { display: none; }
  .side-nav { flex-direction: row; width: 100%; padding: 4px; gap: 0; }
  .side-nav a { flex: 1 1 0; flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 10px; text-align: center; }
  .side-nav .pip { display: none; }
  .page { padding: 16px 16px 90px; }
  .topbar { padding: 10px 16px; }
}

/* A shell with no app rail: the session board, which carries its own.
   The grid stays so .main keeps its background and full height; only the
   sidebar track goes. Without this the board sits in a 232px column with
   nothing beside it.

   It lived here, moved into discover.css by accident when this file was
   split, and was scoped to .discover there — which killed it, because the
   board is not the discover page. */
.shell-norail { grid-template-columns: minmax(0, 1fr); }
