/* =====================================================================
   BANGBOWBING OS — HOME (profile + wallet) styles
   Lifted out of os/os.css byte-for-byte by the v3 scene phase (ledger item 33's
   css split, kept under the item 44-47 game frame) so phase-2 app workers edit
   disjoint files. Shell, the shared app kit, the emote/rarity tokens and the
   lightbox stay in os.css; this file owns Profile and Wallet (the future Home app, ledger item 37).
   Linked from desktop.html AFTER os.css — same cascade order for ties.
   ===================================================================== */

/* ================================================== HOME (item 37) =====
   Profile + Wallet + Stash as three tabs of one app. The panes are all
   mounted at once and toggled with [hidden] rather than torn down, so the
   scroll position and a half-typed bio survive a tab trip. Each pane is
   content-height and the WINDOW scrolls, exactly as the three separate
   windows did — only the Store's CASES rack needs the height:100% treatment,
   because only it has a full-bleed reveal overlay. */
.home { display: flex; flex-direction: column; gap: 0; min-height: 0; }
.home > .tabs.apptabs { flex: 0 0 auto; padding: 12px 16px 0; }
.home-panes { flex: 1 1 auto; min-height: 0; }
.home-pane[hidden] { display: none; }
/* the panes bring their own .pad — do not double it */
.home-pane > .pad { padding-top: 12px; }

/* >=720px panel width (item 38): left profile column, right tabbed
   Wallet/Stash. .win-body has no width hook (os/wm.js), so os/apps/home.js
   measures its own root with a ResizeObserver and toggles .is-wide — plain
   class selectors here, not a container query. */
.home.is-wide {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "profile tabs" "profile side";
  gap: 0 16px;
  align-items: start;
  padding: 12px 16px;
}
.home.is-wide > .tabs.apptabs { grid-area: tabs; padding: 0 0 10px; }
.home.is-wide .home-panes { grid-area: unset; display: contents; }
.home.is-wide .home-pane-profile { grid-area: profile; }
.home.is-wide .home-pane-side { grid-area: side; }
.home.is-wide .home-pane-side[hidden] { display: none; }
.home.is-wide .home-pane > .pad { padding-top: 0; }

/* --- the STASH tab --------------------------------------------------- */
.stash-cases { display: flex; flex-wrap: wrap; gap: 8px; }
.stash-case {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--r-3, 6px);
  background: linear-gradient(180deg, #2b2d51, var(--screen-2));
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--screen-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.stash-case:hover, .stash-case:focus-visible {
  border-color: var(--aqua-lt);
  background: linear-gradient(180deg, #343762, var(--screen-2));
}
.stash-case-title { letter-spacing: 0.02em; }

@media (max-width: 759px) {
  .home > .tabs.apptabs { padding: 10px 12px 0; }
  .stash-cases { flex-direction: column; align-items: stretch; }
  .stash-case { justify-content: space-between; }
}

/* ============================================================== profile */
.app-col { display: grid; gap: 14px; align-content: start; }
.sect { display: grid; gap: 9px; }
.sect .kicker {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--aqua-lt);
}
.row.tight { gap: 7px; }
.hint.dim { color: var(--screen-dim); }
.screen .field-label { color: var(--screen-dim); }
.screen .input {
  color: var(--screen-ink);
  background: #0d0e1a;
  border-color: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.screen .input::placeholder { color: #949bb5; }
.screen .input.file { padding: 7px 8px; font-size: 12.5px; }
.screen .dlg-err { color: #ff9ab5; }

.profile-card .avatar.big { overflow: hidden; padding: 0; }
img.avatar { object-fit: cover; }

.xpbar {
  height: 16px;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #0c0d18, #23253c);
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.xpbar i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b6f4ff 0%, #4fc9f5 46%, #1d8fdc 54%, #63d6ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: width 0.4s var(--ease);
}
.xplabel { margin-top: 7px; font-size: 11.5px; color: var(--screen-dim); }

.badgerow { display: flex; flex-wrap: wrap; gap: 7px; }
.bpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--screen-ink);
  background: linear-gradient(180deg, #32355a, var(--screen-3));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.bpill img { width: 15px; height: 15px; object-fit: contain; }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.swatch.on { box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.55), 0 0 0 2px #fff, 0 0 0 4px var(--candy); }

.lvl {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: #12101a;
  background: linear-gradient(180deg, #d3d8e6, #a7afc4);
}
.lvl.t2 { background: linear-gradient(180deg, #c6f7b6, var(--lime)); }
.lvl.t3 { background: linear-gradient(180deg, #b9f2ff, #4bc9ec); }
.lvl.t4 { background: linear-gradient(180deg, #ffd39a, var(--tang)); }
.lvl.t5 { color: #fff; background: linear-gradient(180deg, #ff8ed9, var(--candy-2)); }
.modtag {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: #06280d;
  background: linear-gradient(180deg, #c6f7b6, var(--lime));
}

.offline-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #ffe0c9;
  background: linear-gradient(180deg, rgba(255, 154, 61, 0.16), rgba(255, 154, 61, 0.06));
  border: 1px solid rgba(255, 154, 61, 0.32);
  border-left: 3px solid var(--tang);
}
.offline-note strong { font-weight: 700; letter-spacing: 0.03em; color: var(--tang); }

/* --- wallet ------------------------------------------------------- */
.wal-balance { align-items: stretch; }
.wal-num { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 3px; }
.wal-num strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: var(--tang);
  text-shadow: 0 2px 10px rgba(255, 154, 61, 0.4);
}
.wal-coin {
  font-size: 21px;
  color: #ffd39a;
  text-shadow: 0 0 14px rgba(255, 211, 154, 0.7);
}
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 11px; }
.pack {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 13px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2b2d51, var(--screen-2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}
.pack::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 42%;
  border-radius: 11px 11px 40% 40% / 11px 11px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.pack > * { position: relative; }
.pack-price {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  color: #3d0524;
  background: linear-gradient(180deg, #ffd0ec, #ff86cf);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 3px rgba(0, 0, 0, 0.35);
}
.pack-coins { display: flex; align-items: baseline; gap: 6px; }
.pack-coins strong { font-family: var(--font-display); font-weight: 700; font-size: 23px; color: #fff; }
.pack-coins span { font-size: 11.5px; color: var(--screen-dim); }
.pack-title { font-size: 12px; color: var(--screen-dim); min-height: 15px; }
.pack-btns { margin-top: 4px; }
.buy-err:empty { display: none; }
.buy-err .dlg-err { margin: 4px 0 0; color: #ff9ab5; }

.txlist { display: grid; gap: 4px; }
.txrow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.tx-amt {
  min-width: 74px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-align: right;
}
.tx-amt.up { color: var(--lime); }
.tx-amt.down { color: #ff9ab5; }
.tx-what { display: grid; gap: 2px; }
.tx-reason { font-size: 12.5px; color: var(--screen-ink); text-transform: capitalize; }
.tx-when { font-size: 11px; color: var(--screen-dim); }
.tx-src { font-size: 9.5px; letter-spacing: 0.1em; }

/* --- narrow windows / phones -------------------------------------- */
@media (max-width: 759px) {
  .packs, .prods { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); }
  .txrow { gap: 8px; }
  .tx-amt { min-width: 62px; font-size: 13px; }
}


/* ---- Story app (HL2 menu entry) ---- */
.story-app { padding: 22px 24px 28px; max-width: 520px; }
.story-h {
  margin: 0 0 6px;
  font-family: var(--font-display, Orbitron, sans-serif);
  font-size: 22px;
  letter-spacing: 0.12em;
  color: #ff9a3c;
}
.story-lead { margin: 0 0 18px; color: #c8c2b4; font-size: 13px; letter-spacing: 0.04em; }
.story-body p { margin: 0 0 12px; line-height: 1.55; color: #e8e4d8; font-size: 14px; }
.story-body .dim { color: #8a8678; font-size: 13px; }
.story-door {
  margin-top: 8px;
  padding: 10px 16px;
  border: 1px solid #ff9a3c;
  background: rgba(255, 122, 40, 0.12);
  color: #ffc08a;
  font-family: var(--font-display, Orbitron, sans-serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  cursor: pointer;
}
.story-door:hover { background: rgba(255, 122, 40, 0.28); color: #fff; }


/* ================================================== HOME SCREEN (Pip-Boy) ==
   Bing sketch: large LIVE left (~2/3), CHAT + GAMES upper-right, blank under.
   Outer HL2 Esc menu is separate; this is the HOME app panel only. */
.home-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  padding: 12px 14px 14px;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(18, 40, 28, 0.55), rgba(8, 16, 12, 0.72)),
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 140, 0.03) 0 1px,
      transparent 1px 3px
    );
  color: #b6f5c8;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.home-screen-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: #7dffb0;
  flex: 0 0 auto;
}
.home-screen-brand { font-weight: 700; }
.home-screen-sub { opacity: 0.65; font-size: 10px; }
.home-screen-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) minmax(140px, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(88px, 0.42fr);
  grid-template-areas:
    "live chat games"
    "live blank blank";
  gap: 10px;
}
#home-pane-live, .home-pane-live { grid-area: live; }
#home-pane-chat, .home-pane-chat { grid-area: chat; }
#home-pane-games, .home-pane-games { grid-area: games; }
#home-pane-blank, .home-pane-blank { grid-area: blank; }

.home-pane-live,
.home-pane-chat,
.home-pane-games,
.home-pane-blank {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgba(125, 255, 176, 0.35);
  background: rgba(4, 12, 8, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.home-pane-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(125, 255, 176, 0.22);
  flex: 0 0 auto;
}
.home-pane-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #7dffb0;
}
.home-pane-tag {
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border: 1px solid rgba(125, 255, 176, 0.35);
  color: rgba(182, 245, 200, 0.75);
}
.home-pane-tag.on {
  color: #0b1020;
  background: #7dffb0;
  border-color: #7dffb0;
}
.home-live-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 140px;
  margin: 10px;
  border: 1px solid rgba(125, 255, 176, 0.25);
  background: #050a07;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.home-live-stage.is-live {
  box-shadow: inset 0 0 24px rgba(125, 255, 176, 0.12);
}
.home-live-scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 2px,
    rgba(0, 255, 120, 0.04) 2px 3px
  );
  pointer-events: none;
}
.home-live-mark {
  position: absolute; top: 8px; left: 10px;
  font-size: 10px; letter-spacing: 0.18em; opacity: 0.7;
}
.home-live-status {
  position: relative;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 0 12px;
}
.home-pane-go {
  margin: 0 10px 10px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(125, 255, 176, 0.45);
  background: rgba(20, 48, 32, 0.85);
  color: #b6f5c8;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  padding: 8px 10px;
  cursor: pointer;
}
.home-pane-go:hover, .home-pane-go:focus-visible {
  border-color: #7dffb0;
  color: #eafff1;
}
.home-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
}
.home-chat-line.dim { opacity: 0.55; }
.home-games-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 4px;
  padding: 8px;
  align-content: start;
}
.home-game-btn {
  appearance: none;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #b6f5c8;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  cursor: pointer;
}
.home-game-btn:hover, .home-game-btn:focus-visible {
  border-color: rgba(125, 255, 176, 0.45);
  background: rgba(125, 255, 176, 0.08);
}
.home-game-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.home-game-casino { margin-top: 4px; border-top: 1px solid rgba(125, 255, 176, 0.2); }
.home-pane-blank {
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  border-style: dashed;
}
.home-pane-blank-mark {
  letter-spacing: 0.3em;
  font-size: 12px;
}

@media (max-width: 759px) {
  .home-screen-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "live"
      "chat"
      "games"
      "blank";
    overflow: auto;
  }
  .home-pane-blank { min-height: 48px; }
  .home-live-stage { min-height: 120px; }
}


/* Live embed inside Home pane 1 — muted preview; full TV stays the real player. */
.home-live-stage.has-embed { cursor: pointer; }
.home-live-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  pointer-events: none; /* click goes to stage → open TV */
}
.home-live-stage.has-embed .home-live-status {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  font-size: 11px;
  letter-spacing: 0.08em;
}
