/* Portrait layouts (lane: meta). Every rule is scoped to body.portrait so landscape never changes.
   Screens: Store (#store), Museum (#museum), Profile (#profile), Social (#social), Leaderboard (#ranks), the store item
   sheet and the replay bar. Stage is 900 wide; chrome vars (--top-h, --nav-h, --gut) come from portrait-core.css.
   Layout: header (core) > a sub-row (page tabs as a segmented pill row, or the Museum stat strip) > a horizontal chip
   row for Store sections / Museum rooms > one scrolling column of content above the docked nav. */

body.portrait { --mt-row: 110px; }
/* where content starts on a page that has a sub-row under its header */
body.portrait :is(#store, #profile, #social) { --mt-top: calc(var(--top-h, 120px) + var(--mt-row) + 26px); }

/* =====================================================================
   PAGE TABS: out of the header into a thumb-height segmented row below it
   ===================================================================== */
body.portrait :is(#store, #profile, #social, #shop) .top .tabs { position: absolute; left: var(--gut, 24px); right: var(--gut, 24px); top: calc(100% + 14px); height: var(--mt-row); box-sizing: border-box;
  display: flex; gap: 6px; padding: 6px; margin: 0; border-radius: 30px; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-x;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 240, 200, .06) inset; }
body.portrait :is(#store, #profile, #social, #shop) .top .tabs::-webkit-scrollbar { display: none; }
body.portrait :is(#store, #profile, #social, #shop) .top .tabs .tab { flex: 1 0 auto; min-height: 96px; padding: 0 26px; border-radius: 24px; font-size: 26px; font-weight: 800; letter-spacing: .01em; }
body.portrait #profile .top .tabs .tab { padding: 0 18px; }
body.portrait :is(#store, #profile, #social, #shop) .top .tabs .tab.on::after { left: 30%; right: 30%; bottom: 6px; height: 3px; }

/* header extras on the right */
body.portrait #museum #toStore { flex: none; min-height: 96px; padding: 0 30px; border-radius: 26px; font-size: 24px; }
/* Profile: Museum + How to Play become square icon chips (labels stay for screen readers) */
body.portrait #profile .top :is(#museumBtn, #rules) { flex: none; width: 96px; height: 96px; min-width: 0; padding: 0; border-radius: 26px; font-size: 0; letter-spacing: 0; display: grid; place-items: center; }
body.portrait #profile .top :is(#museumBtn, #rules)::before { content: ""; position: static; display: block; width: 50px; height: 50px; transform: none; animation: none; background: var(--gold-1, #f2c14e);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
body.portrait #profile .top #museumBtn::before { background: #2b1600;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 3h5'/%3E%3Cpath d='M10.3 3v2.4c0 1.2-3.8 2.6-3.8 7.2 0 3.7 2.1 6.3 3.6 7.9h3.8c1.5-1.6 3.6-4.2 3.6-7.9 0-4.6-3.8-6-3.8-7.2V3'/%3E%3Cpath d='M7.4 8.6C5.2 8.4 4.6 10.8 6.8 12.3M16.6 8.6c2.2-.2 2.8 2.2.6 3.7'/%3E%3Cpath d='M7 12h10'/%3E%3C/svg%3E"); }
body.portrait #profile .top #rules::before {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M9.6 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1.1.9-1.1 1.6v.4'/%3E%3Cpath d='M12 16.9v.1'/%3E%3C/svg%3E"); }
/* the Lore Archive button (injected by screens-lore.js) joins them as a book chip */
body.portrait #profile .top #loreBtn { flex: none; width: 96px; height: 96px; min-width: 0; padding: 0; border-radius: 26px; display: grid; place-items: center; }
body.portrait #profile .top #loreBtn > span { display: none; }
body.portrait #profile .top #loreBtn .ico { width: 48px; height: 48px; }
body.portrait #profile .top h1 { font-size: 40px; }

/* shared page furniture */
body.portrait :is(#profile, #social) > .body { top: var(--mt-top); padding: 0 0 40px; }
body.portrait :is(#store, #museum, #profile, #social, #ranks) .m-h { font-size: 30px; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
body.portrait :is(#store, #museum, #profile, #social, #ranks) .m-h small { font-size: 22px; }
body.portrait :is(#store, #museum, #profile, #social, #ranks) .m-h .ico { width: 32px; height: 32px; }
body.portrait :is(#museum, #profile, #social) .m-empty { max-width: none; margin: 24px 0 0; padding: 56px 36px 44px; border-radius: 30px; }
body.portrait :is(#museum, #profile, #social) .m-empty .ico { width: 110px; height: 110px; font-size: 52px; margin-bottom: 20px; }
body.portrait :is(#museum, #profile, #social) .m-empty .ico .ico { width: 52px; height: 52px; }
body.portrait :is(#museum, #profile, #social) .m-empty h2 { font-size: 46px; line-height: 1.15; }
body.portrait :is(#museum, #profile, #social) .m-empty p { font-size: 27px; max-width: none; margin-bottom: 30px; }
body.portrait :is(#museum, #profile, #social) .m-empty .acts { flex-direction: column; align-items: stretch; gap: 16px; }
body.portrait :is(#museum, #profile, #social) .m-empty .acts .btn { min-height: 104px; font-size: 28px; justify-content: center; }
body.portrait :is(#store, #museum, #profile, #social, #ranks) .spinner { margin: 80px auto; transform: scale(1.8); }
body.portrait :is(#store, #museum, #profile, #social, #ranks) .err { font-size: 26px; }

/* =====================================================================
   STORE + MUSEUM: section / room chips in a swipe row, one column below
   ===================================================================== */
body.portrait :is(#store, #museum) .lcs-wrap { top: var(--mt-top); left: 0; right: 0; bottom: var(--nav-h, 132px); flex-direction: column; gap: 16px; }
body.portrait :is(#store, #museum) .lcs-rail { position: relative; width: auto; flex: none; flex-direction: row; gap: 12px; padding: 4px var(--gut, 24px) 6px; overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x; scrollbar-width: none; scroll-padding: 0 var(--gut, 24px); }
body.portrait :is(#store, #museum) .lcs-rail::-webkit-scrollbar { display: none; }
body.portrait :is(#store, #museum) .lcs-rail button { flex: none; min-height: 96px; padding: 0 32px; border-radius: 99px; font-size: 26px; white-space: nowrap; text-align: center; }
body.portrait :is(#store, #museum) .lcs-rail button:hover { transform: none; }
body.portrait :is(#store, #museum) .lcs-rail button.on { box-shadow: 0 8px 20px rgba(0, 0, 0, .45), 0 0 22px rgba(120, 60, 220, .35), 0 0 0 1px rgba(246, 217, 138, .35) inset; }
body.portrait :is(#store, #museum) .lcs-rail button.on::before { left: 30%; right: 30%; top: auto; bottom: 8px; width: auto; height: 3px; }
body.portrait :is(#store, #museum) .lcs-main { flex: 1 1 0; min-height: 0; padding: 4px var(--gut, 24px) 44px; }
body.portrait :is(#store, #museum, #sheet) .lcs-intro { font-size: 26px; line-height: 1.45; margin: 4px 0 22px; padding-left: 20px; border-left-width: 3px; max-width: none; }
body.portrait :is(#store, #museum, #sheet) .lcs-small { font-size: 23px; line-height: 1.4; }
body.portrait :is(#store, #museum, #sheet) .lcs-owned { font-size: 23px; padding: 8px 18px; }
body.portrait :is(#store, #museum, #sheet) .lcs-rar { font-size: 18px; padding: 4px 12px; }
body.portrait :is(#store, #museum, #sheet) .lcs-new { font-size: 17px; padding: 5px 12px; }
body.portrait :is(#store, #museum, #sheet) .lcs-prog { height: 38px; } body.portrait :is(#store, #museum, #sheet) .lcs-prog span { font-size: 22px; line-height: 38px; }
body.portrait :is(#store, #museum, #sheet) .lcs-prog.sm { height: 12px; }
body.portrait :is(#store, #museum) .lcs-main .btn { min-height: 96px; font-size: 24px; padding: 0 30px; }

/* ---------- store tiles: a 2-column shelf ---------- */
body.portrait :is(#store, #museum) .lcs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body.portrait :is(#store, #museum) .lcs-tile { min-height: 0; gap: 12px; padding: 14px 14px 16px; border-radius: 22px; }
body.portrait :is(#store, #museum) .lcs-tile:hover { transform: none; }
body.portrait :is(#store, #museum) .lcs-tile:active { transform: scale(.98); }
body.portrait :is(#store, #museum) .lcs-tile::before { inset: 7px; border-radius: 16px; }
body.portrait :is(#store, #museum) .lcs-tile .lcs-prev { height: 230px; border-radius: 16px; }
body.portrait :is(#store, #museum) .lcs-tile .lcs-prev .cc-sm { transform: scale(.9); }
/* previews are built at landscape sizes; zoom them up to fill the taller portrait tile */
body.portrait :is(#store, #museum) .lcs-tile .lcs-prev:is(.k-board, .k-boardVariant) > * { zoom: 1.4; }
body.portrait :is(#store, #museum) .lcs-tile .lcs-prev:is(.k-companion, .k-companionColor, .k-companionPose, .k-outfit) > * { zoom: 1.5; }
body.portrait :is(#store, #museum) .lcs-meta { gap: 8px 10px; }
body.portrait :is(#store, #museum) .lcs-meta b { flex-basis: 100%; font-size: 27px; line-height: 1.15; }
body.portrait :is(#store, #museum) .lcs-foot { flex-wrap: wrap; gap: 10px; padding-top: 14px; }
body.portrait :is(#store, #museum) .lcs-price { padding: 8px 18px; gap: 10px; flex-wrap: wrap; }
body.portrait :is(#store, #museum) .lcs-price b { font-size: 28px; gap: 8px; }
body.portrait :is(#store, #museum) .lcs-price small { font-size: 20px; }
body.portrait :is(#store, #museum) .lcs-price .coin, body.portrait :is(#store, #museum) .lcs-price .gemicon { width: 30px; height: 30px; }
body.portrait :is(#store, #museum) .lcs-earn { font-size: 22px; line-height: 1.35; }
body.portrait :is(#store, #museum) .lcs-tile.own .lcs-foot::after { font-size: 22px; }
body.portrait :is(#store, #museum) .lcs-tile.eq .lcs-foot::after { font-size: 18px; padding: 8px 16px; }
body.portrait :is(#store, #museum, #sheet) .lcs-bundle { gap: 10px; }
body.portrait :is(#store, #museum, #sheet) .lcs-bundle span { font-size: 21px; padding: 6px 16px; }
body.portrait :is(#store, #museum, #sheet) .lcs-plaque { font-size: 26px; padding: 18px 26px; }
body.portrait :is(#store, #museum, #sheet) .lcs-plaque.small { font-size: 22px; padding: 12px 20px; }
body.portrait :is(#store, #museum, #sheet) .lcs-record span { font-size: 21px; }
body.portrait :is(#store, #museum) .lcs-cardwrap .card { width: 130px; height: 182px; }

/* ---------- gems ---------- */
body.portrait #store .lcs-gemrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body.portrait #store .lcs-gempack { width: auto; gap: 12px; padding: 26px 18px 22px; border-radius: 24px; }
body.portrait #store .lcs-gempack:hover { transform: none; }
body.portrait #store .lcs-gemart { height: 120px; } body.portrait #store .lcs-gemart i { width: 54px; height: 54px; }
body.portrait #store .lcs-gempack b { font-size: 36px; }
body.portrait #store .lcs-gempack span { font-size: 22px; text-align: center; }
body.portrait #store .lcs-gempack .btn { align-self: stretch; min-width: 0; min-height: 96px; font-size: 30px; }
body.portrait #store .lcs-paynote { margin-top: 24px; padding: 20px 24px; border-radius: 20px; font-size: 25px; line-height: 1.4; max-width: none; }
body.portrait #store .lcs-receipts { max-width: none; margin-top: 24px; }
body.portrait #store .lcs-receipts h3 { font-size: 30px; }
body.portrait #store .lcs-receipts div { font-size: 24px; padding: 14px 0; }

/* ---------- item sheet ---------- */
body.portrait #sheet .lcs-sheet { grid-template-columns: minmax(0, 1fr); gap: 22px; }
body.portrait #sheet .lcs-sprev .lcs-prev { min-height: 360px; border-radius: 20px; }
body.portrait #sheet .lcs-kind { font-size: 22px; }
body.portrait #sheet .lcs-sinfo .lead { font-size: 26px; line-height: 1.45; }
body.portrait #sheet .lcs-how { font-size: 25px; line-height: 1.45; }
body.portrait #sheet .lcs-list { font-size: 25px; padding-left: 30px; }
body.portrait #sheet .lcs-actions .btn { flex: 1 1 300px; }
body.portrait #sheet .lcs-strow.big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0 6px; }
body.portrait #sheet .lcs-strow.big button { padding: 16px 12px 20px; border-radius: 22px; gap: 6px; }
body.portrait #sheet .lcs-strow.big button b { font-size: 26px; text-align: center; }
body.portrait #sheet .lcs-strow.big button span { font-size: 21px; }

/* ---------- museum: stat strip under the header ---------- */
body.portrait #museum { --mt-top: calc(var(--top-h, 120px) + 94px); }
body.portrait #museum .top .lcs-sum { position: absolute; left: var(--gut, 24px); right: var(--gut, 24px); top: calc(100% + 14px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex-wrap: nowrap; }
body.portrait #museum .top .lcs-sum span { font-size: 22px; padding: 12px 6px; border-radius: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* calling card */
body.portrait #museum .lcs-cardtop { flex-direction: column; align-items: stretch; gap: 22px; padding: 24px; border-radius: 26px; }
body.portrait #museum .lcs-cardprev { align-self: center; max-width: 100%; }
body.portrait #museum .lcs-cardside .lead { font-size: 26px; text-align: center; margin: 0 0 16px; }
body.portrait #museum .lcs-cardside .btn { width: 100%; min-height: 104px; font-size: 28px; }
body.portrait #museum .lcs-slots { gap: 16px; }
body.portrait #museum .lcs-slot { padding: 20px 20px 22px; border-radius: 22px; }
body.portrait #museum .lcs-slot h4 { font-size: 22px; margin-bottom: 14px; }
body.portrait #museum .lcs-chips { gap: 12px; align-items: center; }
body.portrait #museum .lcs-chips button { min-height: 96px; padding: 0 28px; font-size: 26px; }
body.portrait #museum .lcs-chips button:hover { transform: none; }
body.portrait #museum .lcs-medals { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; max-width: none; margin-top: 20px; }
body.portrait #museum .lcs-medal { width: 100%; height: auto; aspect-ratio: 1; }
body.portrait #museum .lcs-medal.on::after { width: 38px; height: 38px; font-size: 20px; }

/* grand hall */
body.portrait #museum .lcs-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
body.portrait #museum .lcs-case { gap: 10px; padding: 22px 16px; border-radius: 22px; }
body.portrait #museum .lcs-case:hover { transform: none; }
body.portrait #museum .lcs-glass { width: 170px; height: 170px; border-radius: 18px 18px 6px 6px; }
body.portrait #museum .lcs-glass .lcs-icon { width: 100px; height: 100px; }
body.portrait #museum .lcs-case b { font-size: 26px; }
body.portrait #museum .lcs-case span { font-size: 22px; }
body.portrait #museum .lcs-case em { font-size: 22px; }

/* scene gallery */
body.portrait #museum .lcs-scenehead { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 20px; }
body.portrait #museum .lcs-scenehead .lcs-intro { margin-bottom: 0; }
body.portrait #museum .lcs-frag { flex-wrap: wrap; gap: 14px; font-size: 26px; }
body.portrait #museum .lcs-frag b { font-size: 40px; }
body.portrait #museum .lcs-frag .btn { flex: 1 1 320px; }
body.portrait #museum .lcs-dio { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; border-radius: 24px; margin-bottom: 18px; }
body.portrait #museum .lcs-pano { height: 300px; border-radius: 16px; }
body.portrait #museum .lcs-slice.miss span { font-size: 60px; }
body.portrait #museum .lcs-dioinfo { gap: 10px; }
body.portrait #museum .lcs-dioinfo b { font-size: 34px; }
body.portrait #museum .lcs-dioinfo > span { font-size: 22px; }
body.portrait #museum .lcs-dioinfo p { font-size: 26px; }
body.portrait #museum .lcs-dioinfo .btn { width: 100%; height: auto; padding: 18px 26px; white-space: normal; line-height: 1.3; }

/* leader library */
body.portrait #museum .lcs-journals { gap: 20px; }
body.portrait #museum .lcs-journal { padding: 20px; border-radius: 24px; border-left-width: 6px; }
body.portrait #museum .lcs-jhead { gap: 20px; margin-bottom: 16px; }
body.portrait #museum .lcs-jav { width: 96px; height: 96px; border-width: 3px; }
body.portrait #museum .lcs-jhead b { font-size: 32px; }
body.portrait #museum .lcs-jhead span { font-size: 22px; }
body.portrait #museum .lcs-pages { grid-template-columns: minmax(0, 1fr); gap: 12px; }
body.portrait #museum .lcs-page { min-height: 0; padding: 18px 22px; border-radius: 14px; }
body.portrait #museum .lcs-page h5 { font-size: 25px !important; }
body.portrait #museum .lcs-page p { font-size: 24px !important; line-height: 1.45; }

/* music room: record + text, buttons along the bottom */
body.portrait #museum .lcs-records, body.portrait #museum .lcs-titles { gap: 16px; }
body.portrait #museum .lcs-rec { flex-wrap: wrap; gap: 16px 20px; padding: 20px; border-radius: 22px; }
body.portrait #museum .lcs-rec .lcs-record i { width: 110px; height: 110px; }
body.portrait #museum .lcs-rec > div:nth-child(2) { flex: 1 1 calc(100% - 140px); min-width: 0; gap: 6px; }
body.portrait #museum .lcs-rec b { font-size: 28px; }
body.portrait #museum .lcs-rec span { font-size: 22px; }
body.portrait #museum .lcs-rec > .btn { flex: 1 1 0; }
/* hall of titles: plaque + action on top, what it means below */
body.portrait #museum .lcs-trow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "plq act" "inf inf"; gap: 14px 18px; padding: 20px; border-radius: 22px; }
body.portrait #museum .lcs-trow .lcs-plaque { grid-area: plq; justify-self: start; min-width: 0; max-width: 100%; }
body.portrait #museum .lcs-trow .lcs-tinfo { grid-area: inf; gap: 8px; }
body.portrait #museum .lcs-trow .lcs-tinfo span { font-size: 22px; }
body.portrait #museum .lcs-trow > .btn, body.portrait #museum .lcs-trow > .lcs-small { grid-area: act; align-self: center; }
body.portrait #museum .lcs-trow > .lcs-small { font-size: 34px; }
/* themed rooms */
body.portrait #museum .lcs-room { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px; border-radius: 24px; }
body.portrait #museum .lcs-roomart svg { border-radius: 16px; }
body.portrait #museum .lcs-roominfo h3 { font-size: 38px; }
body.portrait #museum .lcs-roominfo p { font-size: 25px; line-height: 1.45; }
body.portrait #museum .lcs-list { font-size: 25px; padding-left: 10px; list-style: none; }
body.portrait #museum .lcs-sub { font-size: 30px; margin: 30px 0 16px; }

/* =====================================================================
   PROFILE
   ===================================================================== */
/* header card: calling card + level ring, then the four stats, then XP */
body.portrait #profile .phead { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; gap: 20px 16px; margin: 0 0 22px; padding: 22px; border-radius: 26px; }
body.portrait #profile .phead .pcc { grid-row: 1; grid-column: 1; min-width: 0; }
body.portrait #profile .phead .pcc .cc { max-width: 100%; }
body.portrait #profile .phead .pcc:hover { transform: none; }
body.portrait #profile .plvl { grid-row: 1; grid-column: 2; width: 132px; height: 132px; }
body.portrait #profile .plvl .mring { inset: 10px; width: 112px; height: 112px; }
body.portrait #profile .plvl::before { inset: 20px; }
body.portrait #profile .plvl b { font-size: 42px; }
body.portrait #profile .plvl span { font-size: 15px; letter-spacing: .14em; }
body.portrait #profile .pstats { grid-row: 2; grid-column: 1 / -1; align-self: stretch; gap: 10px; }
body.portrait #profile .pstats div { padding: 12px 6px 10px; border: 1px solid rgba(232, 186, 90, .2); border-radius: 18px; background: rgba(8, 4, 18, .45); text-align: center; }
body.portrait #profile .pstats b { font-size: 42px; }
body.portrait #profile .pstats span { font-size: 18px; letter-spacing: .12em; }
body.portrait #profile .pxp { display: flex; grid-row: 3; grid-column: 1 / -1; gap: 18px; }
body.portrait #profile .pxp span { font-size: 22px; }
body.portrait #profile .pxp .qbar { height: 12px; }

/* match history: each game is a card */
body.portrait #profile .m-h.hh { margin: 6px 0 16px; }
body.portrait #profile .hlist { gap: 14px; }
body.portrait #profile .hrow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "vs res rate" "vs who who" "mode date rp"; gap: 10px 20px; min-height: 0; padding: 22px 22px 20px 30px; border-radius: 22px; }
body.portrait #profile .hrow:hover { transform: none; }
body.portrait #profile .hrow::before { width: 8px; }
body.portrait #profile .hres { grid-area: res; display: flex; align-items: baseline; gap: 14px; min-width: 0; }
body.portrait #profile .hres b { font-size: 36px; }
body.portrait #profile .hres span { font-size: 22px; }
body.portrait #profile .hvs { grid-area: vs; gap: 8px; align-self: center; }
body.portrait #profile .hl { width: 80px; height: 80px; }
body.portrait #profile .hvs i { font-size: 18px; }
body.portrait #profile .hwho { grid-area: who; }
body.portrait #profile .hwho b { font-size: 28px; }
body.portrait #profile .hwho span { font-size: 22px; white-space: normal; line-height: 1.3; }
body.portrait #profile .hmode { grid-area: mode; align-self: center; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
body.portrait #profile .hmode small { font-size: 20px; }
body.portrait #profile .hchip { font-size: 19px; padding: 8px 16px; }
body.portrait #profile .hdate { grid-area: date; display: block; align-self: center; font-size: 22px; }
body.portrait #profile .hrate { grid-area: rate; align-self: start; }
body.portrait #profile .hrate b { font-size: 34px; } body.portrait #profile .hrate span, body.portrait #profile .hrate .muted { font-size: 22px; }
body.portrait #profile .hrp { grid-area: rp; min-height: 96px; padding: 0 28px; font-size: 24px; }

/* stats */
body.portrait #profile .sgrid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
body.portrait #profile .sgrid > .m-panel { padding: 24px; border-radius: 24px; }
body.portrait #profile .swr { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 30px; }
body.portrait #profile .swr .m-h { grid-column: 1 / -1; }
body.portrait #profile .donut { margin: 0; }
body.portrait #profile .donut b { font-size: 56px; } body.portrait #profile .donut small { font-size: 24px; } body.portrait #profile .donut span { font-size: 22px; }
body.portrait #profile .snums { grid-template-columns: minmax(0, 1fr); gap: 14px; }
body.portrait #profile .snums div { padding: 16px; border-radius: 18px; }
body.portrait #profile .snums b { font-size: 40px; } body.portrait #profile .snums span { font-size: 18px; }
body.portrait #profile .m-h.sub { margin-top: 26px; font-size: 26px; }
body.portrait #profile .sbar2 { grid-template-columns: auto minmax(0, 1fr) 90px; gap: 16px; margin-bottom: 18px; }
body.portrait #profile .sav { width: 60px; height: 60px; }
body.portrait #profile .sbt { flex-wrap: wrap; gap: 4px 12px; }
body.portrait #profile .sbt b { font-size: 26px; }
body.portrait #profile .sbt em { display: inline; font-size: 22px; }
body.portrait #profile .sbtrack { height: 14px; margin-top: 8px; }
body.portrait #profile .sbar2 strong { font-size: 32px; }
body.portrait #profile .snone { font-size: 24px; }
body.portrait #profile .topcards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.portrait #profile .tcard { border-radius: 16px; }
body.portrait #profile .tcard b { font-size: 22px; padding: 3px 12px; top: 8px; right: 8px; }
body.portrait #profile .tcard span { font-size: 22px; left: 10px; right: 10px; bottom: 8px; }

/* settings: the panel frame only; the rows themselves (icon, text, segmented controls, switch) are styled by the core lane */
body.portrait #profile .settings.m-panel { max-width: none; padding: 26px 26px 16px; border-radius: 26px; }

/* account */
body.portrait #profile .acctpanel { grid-template-columns: 110px minmax(0, 1fr); gap: 22px 24px; padding: 30px 26px; border-radius: 26px; }
body.portrait #profile .acctpanel .ico { width: 104px; height: 104px; font-size: 46px; } body.portrait #profile .acctpanel .ico .ico { width: 46px; height: 46px; }
body.portrait #profile .acctpanel h2 { font-size: 36px; } body.portrait #profile .acctpanel p { font-size: 26px; line-height: 1.4; }
body.portrait #profile .acctpanel > .btn { grid-column: 1 / -1; min-height: 104px; font-size: 28px; }

/* mastery (rendered by screens-progress.js): only type sizes for the upright stage */
body.portrait #profile .mast { max-width: none; }

/* =====================================================================
   SOCIAL
   ===================================================================== */
body.portrait #social .m-h { max-width: none; }
/* leaderboard */
body.portrait #social .socgrid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
body.portrait #social .lbpanel { padding: 26px 22px 22px; border-radius: 26px; }
body.portrait #social .podium { gap: 16px; margin: 12px 0 20px; }
body.portrait #social .podav .pav { width: 120px; height: 120px; }
body.portrait #social .pod.p1 .podav .pav { width: 160px; height: 160px; }
body.portrait #social .podrank { width: 44px; height: 44px; font-size: 22px; bottom: -12px; }
body.portrait #social .pod.p1 .podrank { width: 54px; height: 54px; font-size: 26px; bottom: -14px; }
body.portrait #social .podrank .ico { width: 24px; height: 24px; } body.portrait #social .pod.p1 .podrank .ico { width: 28px; height: 28px; }
body.portrait #social .pod b { margin-top: 18px; font-size: 26px; } body.portrait #social .pod.p1 b { font-size: 30px; }
body.portrait #social .podr { font-size: 32px; } body.portrait #social .pod small { font-size: 22px; }
body.portrait #social .plinth { height: 70px; border-radius: 16px 16px 4px 4px; } body.portrait #social .pod.p1 .plinth { height: 110px; } body.portrait #social .pod.p3 .plinth { height: 50px; }
body.portrait #social .plinth i { font-size: 40px; }
body.portrait #social table.ranks.lb { font-size: 28px; }
body.portrait #social table.ranks.lb td { padding: 14px 10px; }
body.portrait #social table.ranks.lb td.rk { width: 60px; font-size: 26px; }
body.portrait #social table.ranks.lb td.pl { gap: 18px; min-width: 0; }
body.portrait #social table.ranks.lb td.pl > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.portrait #social table.ranks.lb td.pl .pav { width: 72px; height: 72px; flex: none; }
body.portrait #social table.ranks.lb td.rt { width: 110px; font-size: 32px; }
body.portrait #social table.ranks.lb td.wl { width: 104px; font-size: 22px; white-space: nowrap; }
body.portrait #social table.ranks.lb tr.me td:first-child { box-shadow: 5px 0 0 var(--gold-1) inset; }
body.portrait #social .youtag { font-size: 17px; padding: 5px 12px; flex: none; }
body.portrait #social .none { font-size: 26px; padding: 30px !important; }
body.portrait #social .lbme { grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 18px; margin-top: 18px; padding: 16px 20px; border-radius: 20px; }
body.portrait #social .lbme .pav { width: 76px; height: 76px; }
body.portrait #social .lbme b { font-size: 18px; } body.portrait #social .lbme span { display: block; font-size: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.portrait #social .lbme em, body.portrait #social .lbme strong { font-size: 36px; }
body.portrait #social .soclist { gap: 12px; }
body.portrait #social .socrow { grid-template-columns: 44px 76px minmax(0, 1fr) auto; gap: 18px; padding: 16px 20px; border-radius: 20px; }
body.portrait #social .socrow .rk { font-size: 26px; }
body.portrait #social .socrow .crest { width: 72px; height: 82px; font-size: 20px; }
body.portrait #social .socrow b { font-size: 28px; } body.portrait #social .socrow div > span { font-size: 22px; }
body.portrait #social .socrow strong { font-size: 32px; }
body.portrait #social .soclist .none { font-size: 24px; }

/* society: join / create */
body.portrait #social .clubjoin { grid-template-columns: minmax(0, 1fr); gap: 22px; margin: 0; }
body.portrait #social .cjcard { border-radius: 26px; }
body.portrait #social .cjart { height: 220px; }
body.portrait #social .cjbody { gap: 16px; padding: 0 30px 30px; margin-top: -40px; }
body.portrait #social .cjbody .af-eyebrow { font-size: 22px; }
body.portrait #social .cjbody h3 { font-size: 42px; }
body.portrait #social .cjbody p { font-size: 26px; }
body.portrait #social .cjbody input { height: 92px; padding: 0 24px; font-size: 28px !important; border-radius: 18px; }
body.portrait #social .cjbody .codein { font-size: 40px !important; }
body.portrait #social .cjrow { grid-template-columns: 240px minmax(0, 1fr); gap: 14px; }
body.portrait #social .cjbody .btn { align-self: stretch; min-height: 104px; font-size: 28px; justify-content: center; }
body.portrait #social #cErr { font-size: 26px; margin-top: 16px; }
/* society: your club */
body.portrait #social .clubhead { grid-template-columns: 130px minmax(0, 1fr); gap: 22px 24px; margin: 0 0 24px; padding: 26px; border-radius: 26px; }
body.portrait #social .crest.big { width: 124px; height: 142px; font-size: 32px; }
body.portrait #social .clubhead .af-eyebrow { font-size: 19px; line-height: 1.5; letter-spacing: .12em; }
body.portrait #social .clubhead h2 { font-size: 48px; line-height: 1.1; }
body.portrait #social .motto { font-size: 26px; }
body.portrait #social .clubhead .invite { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 18px 24px; border-radius: 20px; }
body.portrait #social .clubhead .invite .af-eyebrow { flex-basis: 100%; font-size: 20px; }
body.portrait #social .clubhead .roomcode { font-size: 52px; margin: 0; }
body.portrait #social .clubhead .invite .btn { min-height: 96px; padding: 0 30px; font-size: 24px; }
body.portrait #social .members { grid-template-columns: minmax(0, 1fr); gap: 12px; }
body.portrait #social .member { grid-template-columns: 84px minmax(0, 1fr) auto; gap: 18px; padding: 14px 20px; border-radius: 20px; min-height: 110px; box-sizing: border-box; }
body.portrait #social .mav2 .pav { width: 78px; height: 78px; }
body.portrait #social .mav2 .dot { width: 22px; height: 22px; border-width: 3px; }
body.portrait #social .mtx b { font-size: 28px; gap: 10px; } body.portrait #social .mtx > span { font-size: 22px; }
body.portrait #social .own { font-size: 24px; } body.portrait #social .own .ico { width: 26px; height: 26px; }
body.portrait #social .member .btn { min-height: 96px; padding: 0 24px; font-size: 22px; }
body.portrait #social .inm { font-size: 22px; }
body.portrait #social .clubacts { max-width: none; margin-top: 18px; }
body.portrait #social .clubacts .btn { min-height: 96px; padding: 0 30px; font-size: 24px; }
/* society expedition + lent decks (markup from screens-season.js): the trail becomes a sideways swipe */
body.portrait #social .socPanel { max-width: none; margin-top: 26px; gap: 22px; }
body.portrait #social :is(.socMap, .socDecks) { padding: 24px; border-radius: 24px; }
body.portrait #social .socMap { overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; }
body.portrait #social .socMap::-webkit-scrollbar { display: none; }
body.portrait #social .socPanel .sSub { font-size: 22px; line-height: 1.4; }
body.portrait #social .expPath { width: 1300px; height: 170px; margin: 22px 70px 10px; }
body.portrait #social .expPath::before, body.portrait #social .expFill { top: 33px; height: 6px; }
body.portrait #social .expStop { width: 130px; gap: 10px; }
body.portrait #social .expStop i { width: 72px; height: 72px; font-size: 28px; }
body.portrait #social .expStop span { font-size: 21px; }
body.portrait #social .expInfo { position: sticky; left: 0; max-width: 804px; gap: 8px 12px; font-size: 24px; }
body.portrait #social .expInfo .btn { min-height: 96px; font-size: 24px; }
body.portrait #social .lendRow { flex-wrap: wrap; gap: 14px; }
body.portrait #social .lendRow select { flex: 1 1 100%; min-width: 0; height: 92px; font-size: 26px !important; border-radius: 18px; }
body.portrait #social .lendRow .btn { flex: 1 1 0; min-height: 96px; font-size: 24px; }
body.portrait #social .lent { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; padding: 16px; border-radius: 18px; }
body.portrait #social .lent > div:nth-child(2) { grid-column: 2 / -1; min-width: 0; }
body.portrait #social .lent .lav { width: 76px; height: 76px; }
body.portrait #social .lent b { font-size: 26px; } body.portrait #social .lent span { font-size: 22px; }
body.portrait #social .lent .btn { min-height: 96px; font-size: 22px; }
body.portrait #social .lent .btn[data-load] { grid-column: 1 / 3; }
body.portrait #social .lent .btn[data-test] { grid-column: 3; }
/* watch live */
body.portrait #social .livehead { flex-wrap: wrap; gap: 16px 20px; max-width: none; margin-bottom: 20px; }
body.portrait #social .livehead p { flex-basis: 100%; order: 3; font-size: 25px; }
body.portrait #social .livepill { font-size: 20px; padding: 12px 22px; } body.portrait #social .livepill i { width: 14px; height: 14px; }
body.portrait #social .livehead .btn { margin-left: auto; min-height: 96px; font-size: 24px; padding: 0 30px; }
body.portrait #social .livelist { grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: none; }
body.portrait #social .live.m-panel { border-radius: 24px; }
body.portrait #social .lmatch { height: 230px; }
body.portrait #social .lside { gap: 14px; padding: 18px 20px; }
body.portrait #social .lside .pav { width: 72px; height: 72px; }
body.portrait #social .lside b { font-size: 28px; } body.portrait #social .lside span { font-size: 22px; }
body.portrait #social .lvs { width: 86px; height: 86px; font-size: 30px; }
body.portrait #social .lfoot { flex-wrap: wrap; gap: 12px 22px; padding: 18px 22px; font-size: 22px; }
body.portrait #social .lfoot .ico { width: 26px; height: 26px; }
body.portrait #social .lfoot .hchip { font-size: 19px; padding: 8px 16px; }
body.portrait #social .lfoot .btn { min-height: 96px; font-size: 24px; padding: 0 30px; }
/* trades */
body.portrait #social .tradegrid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
body.portrait #social .trade.m-panel { gap: 18px; padding: 24px 22px; margin-bottom: 16px; border-radius: 24px; }
body.portrait #social .thead { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; }
body.portrait #social .thead .pav { width: 72px; height: 72px; }
body.portrait #social .thead b { font-size: 28px; } body.portrait #social .tnote { font-size: 24px; margin-top: 4px; }
body.portrait #social .tdir { font-size: 17px; padding: 8px 14px; }
body.portrait #social .tcols { grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr); gap: 12px; padding: 18px; border-radius: 18px; }
body.portrait #social .tcols .af-eyebrow { font-size: 20px; }
body.portrait #social .tswap { width: 56px; height: 56px; } body.portrait #social .tswap .ico { width: 28px; height: 28px; }
body.portrait #social .tchips { gap: 10px; margin-top: 10px; }
body.portrait #social .tchip { font-size: 22px; line-height: 1.2; padding: 6px 16px 6px 6px; gap: 10px; }
body.portrait #social .tchip i { width: 44px; height: 44px; flex: none; }
body.portrait #social .trade .tb { gap: 14px; }
body.portrait #social .trade .tb .btn { flex: 1 1 0; min-height: 96px; font-size: 24px; }
body.portrait #social .trade.done { flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px; border-radius: 18px; font-size: 22px; line-height: 1.4; margin-bottom: 10px; }
body.portrait #social .trade.done em { font-size: 18px; }
body.portrait #social .tradegrid .muted { font-size: 22px; }
body.portrait #social .tempty { gap: 22px; padding: 26px; border-radius: 22px; font-size: 44px; }
body.portrait #social .tempty > .ico { width: 48px; height: 48px; flex: none; }
body.portrait #social .tempty b { font-size: 28px; } body.portrait #social .tempty span { font-size: 23px; line-height: 1.4; }
body.portrait #social .tradeform.m-panel { gap: 12px; padding: 26px; border-radius: 24px; }
body.portrait #social .tradeform label { font-size: 21px; margin-top: 12px; }
/* the touch-device rule in style.css forces inputs to max(16px, 1em) !important; these sizes are all well above 16px */
body.portrait #social .tradeform input { height: 92px; padding: 0 24px; font-size: 28px !important; border-radius: 18px; box-sizing: border-box; }
body.portrait #social .tradeform .picks { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
body.portrait #social .tradeform .picks button { min-height: 88px; padding: 0 22px; font-size: 25px; text-align: left; border-radius: 16px; }
body.portrait #social .tradeform .chips { gap: 10px; }
body.portrait #social .tradeform .chips span { font-size: 23px; padding: 12px 18px; border-radius: 99px; }
body.portrait #social .tradeform > .btn { min-height: 104px; margin-top: 16px; font-size: 28px; justify-content: center; }
body.portrait #social #tErr { font-size: 24px; }

/* =====================================================================
   LEADERBOARD (#ranks): the table becomes a stack of rounded rows
   ===================================================================== */
body.portrait #ranks .ranklist { top: calc(var(--top-h, 120px) + 16px); left: var(--gut, 24px); right: var(--gut, 24px); bottom: calc(var(--nav-h, 132px) + 10px); width: auto; transform: none; padding-bottom: 30px; }
body.portrait #ranks table.ranks { border-collapse: separate; border-spacing: 0 12px; font-size: 28px; }
body.portrait #ranks table.ranks th { font-size: 20px; letter-spacing: .14em; padding: 8px 18px 0; border: 0; }
body.portrait #ranks table.ranks th:nth-child(n+3), body.portrait #ranks table.ranks td:nth-child(n+3) { text-align: right; }
body.portrait #ranks table.ranks td { height: 96px; padding: 0 18px; border: 0; background: rgba(24, 13, 46, .9);
  border-top: 1px solid rgba(190, 160, 255, .14); border-bottom: 1px solid rgba(190, 160, 255, .14); }
body.portrait #ranks table.ranks td:first-child { width: 70px; text-align: center; border-left: 1px solid rgba(190, 160, 255, .14); border-radius: 20px 0 0 20px; font: 900 28px var(--font-title); color: var(--muted); }
body.portrait #ranks table.ranks td:last-child { border-right: 1px solid rgba(190, 160, 255, .14); border-radius: 0 20px 20px 0; color: var(--muted); font-size: 24px; white-space: nowrap; }
body.portrait #ranks table.ranks td:nth-child(2) { font-weight: 700; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.portrait #ranks table.ranks td:nth-child(3) { font: 900 32px var(--font-title); color: #fff4d6; }
body.portrait #ranks table.ranks tr:nth-child(1) td:first-child { color: #f6d98a; } body.portrait #ranks table.ranks tr:nth-child(2) td:first-child { color: #d6dce8; }
body.portrait #ranks table.ranks tr:nth-child(3) td:first-child { color: #d99a66; }
body.portrait #ranks table.ranks tr.me td { background: rgba(92, 64, 30, .92); border-color: rgba(242, 193, 78, .5); }
body.portrait #ranks table.ranks td[colspan] { text-align: center; color: var(--gold-1); font: 700 26px var(--font-ui); border-radius: 20px; border: 1px solid rgba(190, 160, 255, .14); }
body.portrait #ranks .ranklist .lead { font-size: 26px; margin-top: 16px; }
body.portrait #ranks .ranklist > .err { font-size: 26px; text-align: center; margin-top: 40px; }

/* =====================================================================
   REPLAY BAR (battle stage in portrait): along the top-left edge, above the rival plate (top 84px) and clear of the
   menu button (top-right)
   ===================================================================== */
body.portrait #replayBar.rpbar { left: 16px; right: auto; top: 10px; transform: none; gap: 12px; padding: 5px 6px 5px 20px; }
body.portrait .rplabel { gap: 10px; padding-right: 12px; }
body.portrait .rplabel b { font-size: 22px; }
body.portrait .rplabel span { min-width: 90px; font-size: 20px; }
body.portrait .rplabel .rpdot { width: 12px; height: 12px; }
body.portrait .rpbtn { height: 60px; min-width: 60px; }
body.portrait .rpbtn .ico { width: 30px; height: 30px; }
body.portrait .rpbtn.wide { width: 60px; padding: 0; }
body.portrait .rpbtn.wide span { display: none; }
body.portrait .seg.mseg.rpspd { grid-template-columns: repeat(3, 66px); }
body.portrait .rpspd button { padding: 14px 0; font-size: 20px; }

/* Booster Packs (#shop) shares the Packs / Store / Museum tab row with the Store, so its title gets the header back */
body.portrait #shop { --ct: calc(var(--top-h, 120px) + var(--mt-row) + 26px); }
