/* The phone preview (phone.js, docs/COMPADRES.md, step 2): web copies of the app's screens at an iPhone 17
   Pro's real size, 402 by 874 points, one CSS pixel per point. The phone is an app zone (docs/WORK-DESIGN-
   SYSTEM.md): every colour, radius and type size inside it is a --tk- token from tokens.css (ios/AmigosDS);
   a number written here is a size from the app's Swift view it copies, named beside it. */
/* The controls beside the phone (and every .pv-tabs pick on the page) are Compadres' own and use Amigos
   Work's --w- tokens. Only the phone itself (.ph-frame and everything inside) is the app zone. */
.pv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--w-s6); align-items: start; }
.pv-side { display: grid; gap: var(--w-s4); min-width: 0; }
.pv-tabs { display: flex; flex-wrap: wrap; gap: var(--w-s2); }
.pv-tabs .btn { padding-left: var(--w-s3); padding-right: var(--w-s3); }
.pv-tabs .btn.on { background: var(--w-ink); border-color: var(--w-ink); color: var(--w-paper); }
.pv-games { display: grid; gap: var(--w-s2); }
.pv-game { display: flex; align-items: center; gap: var(--w-s3); padding: var(--w-s2); border-radius: var(--w-r3); background: var(--w-surface); border: 1px solid var(--w-line); min-height: var(--w-row); }
.pv-game.on { border-color: var(--w-ink); box-shadow: inset 0 0 0 1px var(--w-ink); }
.pv-game img, .pv-game .pv-noimg { width: 48px; height: 64px; border-radius: var(--w-r2); object-fit: cover; background: var(--w-surface-3); flex: none; }
.pv-game div { flex: 1; min-width: 0; }
.pv-game strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-game small { color: var(--w-ink-3); font-size: var(--w-fs-small); }
.pv-game .btn { flex: none; }
.pv-stage { width: var(--pv-w); height: var(--pv-h); position: relative; }

/* The phone itself: the screen, a black edge and the screen's round corners. */
.ph-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(var(--pv-scale, 1)); padding: 12px; border-radius: 67px; background: #000; box-shadow: 0 0 0 2px var(--tk-ink3), 0 30px 80px rgba(0, 0, 0, 0.5); }
.ph {
  position: relative; width: 402px; height: 874px; overflow: hidden; border-radius: 55px; background: var(--tk-ink0); color: var(--tk-text);
  font-family: var(--tk-font-body); font-size: 15px; line-height: 1.25; text-align: left; user-select: none; -webkit-font-smoothing: antialiased; contain: layout paint;
}
.ph.wide { width: 874px; height: 402px; }
.ph * { box-sizing: border-box; }
/* App zone guard: work.css styles plain elements (h3, labels) and a few shared names (.mark, .row, .label)
   for the page around the phone. Inside the phone the app's look wins. */
.ph h3 { text-transform: none; color: inherit; }
.ph .mark { display: block; flex: none; background: none; }
.ph .mark::after { content: none; }
.ph .row { border-top-color: var(--tk-line); min-height: var(--tk-size-hit); }
.ph .label { font: inherit; font-size: var(--tk-type-label-size); font-weight: var(--tk-type-label-weight); letter-spacing: var(--tk-type-label-tracking); }
:where(.ph button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ph .icon .fill { fill: currentColor; }
.ph .icon .line { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* The status bar and the Dynamic Island (an iPhone 17 Pro). */
.ph-status { position: absolute; top: 0; left: 0; right: 0; height: 54px; pointer-events: none; z-index: 40; }
.ph-time { position: absolute; left: 73px; top: 32px; transform: translate(-50%, -50%); font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.ph-island { position: absolute; left: 139px; top: 14px; width: 124px; height: 36px; border-radius: 18px; background: #000; }
.ph-bars { position: absolute; right: 32px; top: 25px; height: 13px; display: flex; align-items: flex-end; gap: 2px; }
.ph-bars i { width: 3px; border-radius: 1px; background: var(--tk-text); }
.ph-bars i:nth-child(1) { height: 5px; } .ph-bars i:nth-child(2) { height: 7px; } .ph-bars i:nth-child(3) { height: 10px; } .ph-bars i:nth-child(4) { height: 13px; }
.ph-battery { position: relative; width: 26px; height: 13px; margin-left: 6px; border-radius: 4px; background: var(--tk-text); }
.ph-home { position: absolute; left: 50%; bottom: 8px; width: 140px; height: 5px; margin-left: -70px; border-radius: 3px; background: var(--tk-text); z-index: 40; pointer-events: none; }
.ph.wide .ph-status, .ph.wide .ph-home { display: none; }

/* TKFade (Tokens.swift): night ink, eased out along a curve. */
.ph-fade-down, .ph-fade-up { position: absolute; left: 0; right: 0; pointer-events: none; }
.ph-fade-down { top: 0; height: 160px; background: linear-gradient(to bottom, rgba(11, 11, 32, 0.5), rgba(11, 11, 32, 0.37) 33%, rgba(11, 11, 32, 0.19) 58%, rgba(11, 11, 32, 0.04) 83%, rgba(11, 11, 32, 0)); }
.ph-fade-up { bottom: 0; height: 420px; background: linear-gradient(to top, rgba(11, 11, 32, 0.8), rgba(11, 11, 32, 0.8) 18%, rgba(11, 11, 32, 0.45) 50%, rgba(11, 11, 32, 0.12) 78%, rgba(11, 11, 32, 0)); }

/* The game: the brand's real game, run by the app's game kit, edge to edge. */
.ph-game { position: absolute; inset: 0; border: 0; width: 100%; height: 100%; display: block; background: var(--tk-ink0); }
.ph-game.quiet { pointer-events: none; }

/* The app's glass (TKGlass in Glass.swift): a sheen and a rim of light from the top left, no blur. */
.glass { background: linear-gradient(149deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.175), inset 0 0 4px rgba(255, 255, 255, 0.09), 0 4px 7px rgba(0, 0, 0, 0.05); }

/* TKIconButton (Buttons.swift): 44 round. */
.ph-iconbtn { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ph-iconbtn.solid { background: rgba(255, 255, 255, 0.1); }
.ph-iconbtn.size54 { width: 54px; height: 54px; }
/* TKButton (Buttons.swift): large 56 high, display 20; medium 48, display 17; small 40, body 14 bold. */
.ph-btn { display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 999px; font-family: var(--tk-font-display); font-weight: 800; white-space: nowrap; }
.ph-btn.primary { background: var(--tk-action); color: var(--tk-on-action); }
.ph-btn.secondary { box-shadow: inset 0 0 0 1.5px var(--tk-line-strong); color: var(--tk-text); }
.ph-btn.large { height: 56px; font-size: 20px; padding: 0 26px; }
.ph-btn.medium { height: 48px; font-size: 17px; padding: 0 20px; }
.ph-btn.small { height: 40px; font-family: var(--tk-font-body); font-size: 14px; padding: 0 16px; }
.ph-btn.block { width: 100%; }
.ph-btn.trail { padding: 0 8px 0 24px; justify-content: space-between; }
.ph-btn .trail { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--tk-hot-deep); font-family: var(--tk-font-body); font-size: 13px; font-weight: 700; }
/* TKTag (Controls.swift): body 12, 10 across, a block (8 round) or a pill. */
.ph-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; flex: none; }
.ph-tag.block { border-radius: 8px; padding: 5px 10px; font-weight: 800; }
.ph-tag.social { background: var(--tk-social); color: var(--tk-on-accent); }
.ph-tag.cat { padding: 0 10px 0 5px; height: 28px; }
.ph-tag.cat img { width: 20px; height: 20px; object-fit: contain; }
/* TKChip (Controls.swift): 44 high, 16 across, body 14 semibold. */
.ph-chip { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 99px; background: var(--tk-ink1); box-shadow: inset 0 0 0 1.5px var(--tk-line-strong); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; }
.ph-chip.on { background: rgba(255, 31, 143, 0.12); box-shadow: inset 0 0 0 1.5px var(--tk-action); }
/* .tkCard (Controls.swift): ink 1 with a hairline. */
.ph-card { background: var(--tk-ink1); box-shadow: inset 0 0 0 1px var(--tk-line); border-radius: var(--tk-radius-lg); }
/* TKAvatar (Controls.swift). */
.ph-face { border-radius: 50%; background: var(--tk-ink2) center / cover no-repeat; display: inline-flex; align-items: center; justify-content: center; font-family: var(--tk-font-display); font-weight: 800; color: var(--tk-ink0); flex: none; }

/* The tab bar (TabBar.swift): 54 high, dropped 10 into the strip above the home indicator. */
.ph-tabbar { position: absolute; left: 0; right: 0; bottom: 24px; height: 54px; padding: 0 8px; display: flex; align-items: flex-start; z-index: 20; }
.ph-tabbar::before { content: ""; position: absolute; left: 0; right: 0; top: -26px; bottom: -24px; z-index: -1; background: linear-gradient(to top, rgba(11, 11, 32, 0.8) 40%, rgba(11, 11, 32, 0.45) 70%, rgba(11, 11, 32, 0)); border-top: 1px solid rgba(255, 255, 255, 0.14); border-top-color: transparent; }
.ph-tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--tk-line-strong); opacity: 0.6; }
.ph-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--tk-text3); font-size: 11px; font-weight: 600; }
.ph-tab.on { color: var(--tk-text); }
.ph-tab .mark { width: 22px; height: 3px; border-radius: 2px; }
.ph-tab.on .mark { background: var(--tk-action); }
.ph-tab .icon { margin-top: 7px; height: 24px; }
.ph-create { flex: 1; display: flex; justify-content: center; padding-top: 9px; }
.ph-create span { width: 64px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(45deg, var(--tk-power) 0%, var(--tk-blue) 20%, var(--tk-green) 40%, var(--tk-gold) 60%, var(--tk-orange) 80%, var(--tk-hot) 100%); }
.ph-create .icon { filter: drop-shadow(2px 2px 0 var(--tk-ink0)); }

/* ---- The feed card (FeedView.swift: topBar, chrome, card, rail, cta). */
.fd-top { position: absolute; top: 54px; left: 16px; right: 6px; height: 44px; display: flex; align-items: center; z-index: 10; }
.fd-logo { width: 44px; height: 44px; display: flex; align-items: center; }
.fd-tabs { flex: 1; display: flex; justify-content: center; gap: 20px; }
.fd-tab { position: relative; height: 44px; display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--tk-text2); }
.fd-tab.on { font-weight: 700; color: var(--tk-text); }
.fd-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 3px; border-radius: 2px; background: var(--tk-action); }
.fd-tab i { width: 8px; height: 8px; border-radius: 50%; background: var(--tk-live); }
.fd-chrome { position: absolute; left: 16px; right: 16px; top: 116px; bottom: 92px; display: flex; flex-direction: column; z-index: 10; pointer-events: none; }
.fd-chrome > * { pointer-events: auto; }
.fd-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.fd-badge .who { color: var(--tk-text3); font-weight: 500; }
.fd-badge .icon { color: var(--tk-score); }
.fd-row { margin-top: auto; display: flex; align-items: flex-end; gap: 12px; }
.fd-info { flex: 1; min-width: 0; }
.fd-tags { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.fd-title { margin-top: 10px; font-family: var(--tk-font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.7px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fd-by { margin-top: 6px; height: 22px; display: flex; align-items: center; gap: 5px; font-size: 15px; color: var(--tk-text3); white-space: nowrap; overflow: hidden; }
.fd-by b { color: var(--tk-text); font-weight: 600; }
.fd-by .icon { color: var(--tk-social); }
.fd-stats { margin-top: 2px; height: 18px; display: flex; gap: 14px; align-items: center; font-size: 13px; font-weight: 600; }
.fd-stats span { display: inline-flex; align-items: center; gap: 4px; }
.fd-stats .gold { color: var(--tk-score); }
.fd-pills { margin-top: 12px; display: flex; gap: 8px; }
.fd-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.fd-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 44px; }
.fd-follow { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.fd-follow .ph-face { box-shadow: 0 0 0 2px var(--tk-text); }
.fd-follow .plus { position: absolute; bottom: -6px; left: 14px; width: 16px; height: 16px; border-radius: 50%; background: var(--tk-action); color: var(--tk-on-action); display: flex; align-items: center; justify-content: center; }
.fd-railbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 44px; font-size: 11px; font-weight: 600; }
.fd-railbtn span:first-child { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.fd-cta { margin-top: 16px; display: flex; gap: 10px; }

/* ---- The brand's page (BrandView.swift), as a visitor opens it from a game: in a sheet. */
.br-dim { position: absolute; inset: 0; background: #000; }
.br-own .br-scroll { padding-bottom: 104px; }
.br-own .br-banner { height: 212px; }
.br-own .br-bar { top: 72px; }
.br-actions { display: flex; gap: 8px; }
.br-sheet { position: absolute; left: 0; right: 0; top: 62px; bottom: 0; border-radius: 38px 38px 0 0; overflow: hidden; background: var(--tk-ink0); }
.br-scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; padding-bottom: 20px; }
.br-scroll::-webkit-scrollbar { display: none; }
.br-banner { position: relative; height: 150px; background: var(--tk-ink2) center / cover no-repeat; }
.br-bar { position: absolute; left: 16px; right: 16px; top: 10px; display: flex; justify-content: space-between; }
.br-head { position: relative; z-index: 1; padding: 0 16px; display: flex; flex-direction: column; gap: 6px; }
.br-logo { margin-top: -46px; padding: 4px; border-radius: 50%; background: var(--tk-ink0); align-self: flex-start; }
.br-name { display: flex; align-items: center; gap: 6px; }
.br-name h3 { font-family: var(--tk-font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.7px; line-height: 1.1; margin: 0; }
.br-name .icon { color: var(--tk-social); }
.br-tagline { font-size: 15px; color: var(--tk-text2); }
.br-link { display: flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--tk-social); }
.br-body { padding: 20px 16px 0; display: flex; flex-direction: column; gap: 20px; }
.br-numbers { display: flex; justify-content: space-between; padding: 14px 24px; border-radius: 20px; }
.br-numbers div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.br-numbers b { font-family: var(--tk-font-display); font-weight: 800; font-size: 22px; }
.br-numbers span { font-size: 13px; color: var(--tk-text3); }
.br-pinned { border-radius: 20px; overflow: hidden; }
.br-pinned .pic { position: relative; height: 190px; background: var(--tk-ink2) center / cover no-repeat; }
.br-pinned .pic .ph-tag { position: absolute; left: 10px; top: 10px; }
.br-pinned .row { display: flex; align-items: center; gap: 12px; padding: 12px; }
.br-pinned .row div { flex: 1; min-width: 0; }
.br-pinned .row strong { display: block; font-family: var(--tk-font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-pinned .row small { font-size: 13px; color: var(--tk-text3); }
.br-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.br-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.br-tile { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--tk-ink2) center / cover no-repeat; text-align: left; }
.br-tile div { position: absolute; left: 8px; right: 8px; bottom: 8px; }
.br-tile strong { display: block; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-tile small { font-size: 12px; color: var(--tk-text2); }
.br-empty { padding: 24px; text-align: center; font-size: 15px; color: var(--tk-text3); }
.br-about { padding: 16px; font-size: 15px; color: var(--tk-text2); }

/* ---- A run (HudView.swift): the score at the top, Exit and sound in the bottom bar. */
.rn-top { position: absolute; top: 62px; left: 16px; right: 16px; height: 44px; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 10; }
.rn-score { font-family: var(--tk-font-display); font-weight: 800; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.rn-bottom { position: absolute; left: 16px; right: 16px; bottom: 36px; display: flex; justify-content: space-between; z-index: 10; }
.ph.wide .rn-top { top: 6px; }
.ph.wide .rn-bottom { left: 62px; right: 62px; bottom: 25px; }
.rn-end { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(11, 11, 32, 0.7); z-index: 30; }
.rn-card { width: 346px; padding: 26px 20px 20px; border-radius: 32px; background: var(--tk-ink1); box-shadow: inset 0 0 0 1px var(--tk-line-strong); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.rn-card .label { color: var(--tk-text3); }
.rn-card b { font-family: var(--tk-font-display); font-weight: 800; font-size: 88px; letter-spacing: -2.6px; line-height: 1; }
.ph-note { position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); text-align: center; color: var(--tk-text3); font-size: 15px; }

@media (max-width: 1100px) { .pv { grid-template-columns: 1fr; } .pv-stage { justify-self: center; } }

/* Widgets on a brand's page (BrandWidgetViews.swift): cards of 14 points in, corners of 20, gap 12. */
.br-widgets { display: flex; flex-direction: column; gap: 12px; }
.wg-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 20px; }
.wg-row { display: flex; align-items: center; gap: 12px; }
.wg-row.top { align-items: flex-start; }
.wg-grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wg-k { display: flex; align-items: center; gap: 6px; color: var(--tk-text3); font-size: var(--tk-type-label-size); font-weight: var(--tk-type-label-weight); letter-spacing: var(--tk-type-label-tracking); }
.wg-h2 { font-family: var(--tk-type-h2-family); font-weight: var(--tk-type-h2-weight); font-size: var(--tk-type-h2-size); letter-spacing: var(--tk-type-h2-tracking); line-height: 1.15; }
.wg-text { font-size: 14px; color: var(--tk-text2); }
.wg-small { font-size: 13px; color: var(--tk-text3); }
.wg-price { font-size: 15px; font-weight: 700; color: var(--tk-score); }
.wg-shop { align-self: flex-start; margin-top: 4px; }
.wg-pic { display: grid; place-items: center; flex: none; border-radius: 14px; background: var(--tk-ink2); padding: 6px; }
.wg-pic.s64 { width: 64px; height: 64px; }
.wg-pic.s84 { width: 84px; height: 84px; }
.wg-pic img { width: 100%; height: 100%; object-fit: contain; }
.wg-rule { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--tk-score); }
.wg-prize { display: flex; gap: 8px; font-size: 15px; font-weight: 600; }
.wg-prize b { min-width: 44px; font-size: 13px; color: var(--tk-text3); }
.wg-board { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--tk-ink2); }
.wg-board div { display: flex; gap: 8px; font-size: 14px; }
.wg-board span { width: 18px; color: var(--tk-text3); font-weight: 700; }
.wg-board strong { flex: 1; font-weight: 600; }
.wg-board b { font-variant-numeric: tabular-nums; }
.wg-answers { display: flex; flex-direction: column; gap: 8px; }
.wg-digits { display: flex; gap: 8px; }
.wg-digit { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; border-radius: 14px; background: var(--tk-ink2); }
.wg-digit b { font-family: var(--tk-font-display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.wg-digit span { font-size: 12px; color: var(--tk-text3); }
.ph-tag.action { background: var(--tk-action); color: var(--tk-on-action); align-self: flex-start; }
.ph-tag.live { background: var(--tk-live); color: var(--tk-on-accent); align-self: flex-start; }
