/* Phone (portrait) usability layer, 2026-10-01. Loaded last; only .phone-p (the app's portrait-phone layout) is touched.
   Stable (育成) in one thumb-friendly flow: horse tabs → short 3D view → action bar stuck to the top → the opened menu → stats.
   Before: the actions sat ~1,250 px down (below the 3D view and all stats) and a menu list was ~2,000 px long. */

.phone-p .stable-home { padding: 8px 10px 16px; gap: 8px; }
.phone-p .stable-home .sh-main { display: contents; }
.phone-p .stable-home .sh-top { order: 1; gap: 6px; }
.phone-p .stable-home .sh-stage { order: 2; height: clamp(190px, 30vh, 300px); min-height: 0; border-radius: 12px; }
.phone-p .stable-home .sh-bar { order: 3; }
.phone-p .stable-home .sh-drawer { order: 4; min-height: 0; scroll-margin-top: 66px; }
.phone-p .stable-home .sh-info { order: 5; max-height: none; }

/* horse tabs: one swipeable row instead of two wrapped rows */
.phone-p .stable-home .sh-top .horse-tabs { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.phone-p .stable-home .sh-top .horse-tabs::-webkit-scrollbar { display: none; }
.phone-p .stable-home .sh-top .horse-tabs > .btn { flex: 0 0 auto; white-space: nowrap; }

/* the action bar stays under the thumb while the menu below scrolls */
.phone-p .stable-home .sh-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -10px; padding: 7px 10px; border-radius: 0;
  background: rgba(7, 13, 30, .95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .35); scrollbar-width: none;
}
.phone-p .stable-home .sh-bar::-webkit-scrollbar { display: none; }
.phone-p .stable-home .sh-bar .btn { flex: 0 0 auto; min-width: 74px; min-height: 44px; padding: 6px 13px; font-size: 14px; white-space: nowrap; scroll-snap-align: start; }
.phone-p .stable-home .sh-bar .btn.gold { box-shadow: 0 0 0 2px rgba(255, 210, 74, .35); }
/* a hint that the bar scrolls sideways */
.phone-p .stable-home .sh-bar.tfm-more { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }

/* training menus: two compact columns (icon + name, effect underneath); the long description is in the confirm sheet anyway */
.phone-p .stable-home .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px; } /* the bundle forces one column with !important */
.phone-p .stable-home .menu-card.pick { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: 2px 7px; min-height: 0; padding: 8px 8px 9px; }
.phone-p .stable-home .menu-card.pick .menu-icon { width: 34px; height: 34px; }
.phone-p .stable-home .menu-card.pick .menu-text { display: contents; }
.phone-p .stable-home .menu-card.pick .menu-text > b { grid-column: 2; align-self: center; font-size: 14.5px; line-height: 1.25; }
.phone-p .stable-home .menu-card.pick .menu-text > .muted { display: none; }
.phone-p .stable-home .menu-card.pick .menu-text > .block { grid-column: 1 / -1; font-size: 11.5px; line-height: 1.35; color: #c9d4ea; }
.phone-p .stable-home .menu-card.pick:active { transform: scale(.98); }
.phone-p .stable-home .sh-drawer > .col > .row:first-child > .muted { display: none; }

/* feed / items: two columns that fit 360–430 px */
.phone-p .stable-home .feed-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

/* the strength sheet: three big choices side by side, always on screen */
.phone-p .train-choose-bg { align-items: flex-end; }
.phone-p .train-choose { width: 100%; max-height: 88vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.phone-p .train-choose .intensity-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex-wrap: nowrap; }
.phone-p .train-choose .big-intensity { min-width: 0; width: 100%; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.phone-p .train-choose .big-intensity img { width: 100%; height: auto; max-height: 70px; object-fit: contain; }
.phone-p .train-choose .big-intensity > span:not(.tiny) { font-size: 16px; font-weight: 800; }
.phone-p .train-choose .big-intensity .tiny { font-size: 10.5px; text-align: center; line-height: 1.3; }

/* save list on the title screen (no-account mode): the 「続きから」 button stays reachable */
.phone-p .tfm-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* the floating stamp button never covers a dialog's buttons (it sat on top of 「強め」) */
body:has(.modal-bg) .tfs-btn, body:has([role="dialog"][aria-modal="true"]) .tfs-btn { visibility: hidden; }
