/* 美美下班開鍋｜局外畫面：主畫面、小衣櫃、結算
   class 一律 sc- 前綴；深色主題固定，不跟系統深淺色走。色票沿用 game.css 的變數。
   body 是 touch-action:none，所以捲動交給 #screens 自己（pan-y）。 */
#screens {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 30;
  overflow-x: hidden; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  color-scheme: dark; color: var(--cream, #fff3d6); background: var(--night, #141024);
  font-size: 15px; line-height: 1.55;
}
/* 背景掛在捲動容器上：內容捲動時背景不跟著跑 */
#screens.sc-on-title {
  background: linear-gradient(rgba(22, 35, 32, 0.68), rgba(12, 18, 24, 0.92)), var(--arena-background, url(../assets/breath-background.png)) center / cover no-repeat, #141024;
}
#screens.sc-on-wardrobe {
  background: linear-gradient(rgba(20, 16, 36, 0.93), rgba(12, 9, 24, 0.97)), url(../assets/breath-background.png) center / cover no-repeat, #141024;
}
/* 結算疊在停住的戰場上 */
#screens.sc-on-results { background: rgba(10, 7, 22, 0.86); }

.sc-screen { min-height: 100%; display: flex; flex-direction: column; }
.sc-wrap {
  flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: calc(16px + var(--sat, 0px)) calc(16px + var(--sar, 0px)) calc(16px + var(--sab, 0px)) calc(16px + var(--sal, 0px));
}
.sc-screen .btn { margin-top: 0; }
.sc-note { font-size: 12px; line-height: 1.6; text-align: center; color: rgba(255, 243, 214, 0.72); }
.sc-mode:focus-visible, .sc-card:focus-visible, .sc-link:focus-visible { outline: 3px solid var(--teal, #58e0d0); outline-offset: 2px; }

/* ---------- 造型大圖（整張切換）＋小跟班 ---------- */
.sc-hero { position: relative; height: clamp(170px, 30vh, 300px); }
.sc-hero-glow {
  position: absolute; left: 50%; bottom: 0; width: 88%; max-width: 460px; height: 24%; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 184, 77, 0.36), rgba(255, 184, 77, 0)); pointer-events: none;
}
.sc-hero-main { position: absolute; left: 6%; right: 6%; top: 0; bottom: 10px; }
.sc-has-buddy .sc-hero-main { right: 32%; }
.sc-hero-buddy { position: absolute; right: 3%; bottom: 10px; width: 31%; height: 38%; animation: sc-bob 2.6s ease-in-out infinite; }
.sc-fig {
  display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  pointer-events: none; -webkit-user-drag: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
}

/* ---------- 主畫面 ---------- */
.sc-title .sc-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.sc-head { text-align: center; }
.sc-logo {
  font-size: clamp(28px, 8.4vw, 50px); line-height: 1.15; font-weight: 900; letter-spacing: 0.06em; color: var(--amber, #ffb84d);
  text-shadow: 0 3px 0 #5a2d0c, 0 8px 22px rgba(0, 0, 0, 0.65);
}
.sc-sub {
  display: inline-block; margin-top: 8px; padding: 2px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: 0.2em; text-indent: 0.2em;
  color: #1b1230; background: var(--teal, #58e0d0);
}
.sc-herobox { min-width: 0; }
.sc-wearline { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 12px; margin-top: 6px; font-size: 12px; color: rgba(255, 243, 214, 0.78); }
.sc-wearline b { font-size: 15px; font-weight: 900; color: var(--cream, #fff3d6); }
.sc-side { display: grid; gap: 12px; min-width: 0; align-content: start; }
.sc-run-summary { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid rgba(255, 210, 136, .65); border-radius: 14px; background: rgba(39, 47, 35, .88); }
.sc-run-summary b { color: #ffe1a2; font-size: 15px; line-height: 1.5; }
.sc-run-summary span { color: #d0f7df; font-size: 12px; line-height: 1.7; }
.sc-run-summary small { color: #f1ead7; font-size: 11px; line-height: 1.6; }
.sc-arena-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.sc-arena { overflow: hidden; border: 2px solid var(--line); border-radius: 12px; background: rgba(20,25,31,.9); color: var(--cream); font-family: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.sc-arena img { display: block; width: 100%; height: 55px; object-fit: cover; }
.sc-arena b { display: block; padding: 5px 7px 0; font-size: 13px; line-height: 1.4; }
.sc-arena small { display: block; padding: 2px 7px 7px; font-size: 11px; line-height: 1.4; opacity: .8; }
.sc-arena.sc-on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.sc-arena:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
@media (max-width: 639px) {
  .sc-title .sc-hero { height: 170px; }
}

.sc-modes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.sc-mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 96px; padding: 10px 12px 12px; text-align: left;
  border-radius: 16px; border: 2px solid var(--line, rgba(255, 243, 214, 0.18)); background: rgba(34, 27, 58, 0.9); color: var(--cream, #fff3d6);
  font-family: inherit; cursor: pointer; touch-action: manipulation;
}
.sc-mode b { font-size: 19px; line-height: 1.3; font-weight: 900; }
.sc-mode small { font-size: 12.5px; line-height: 1.5; color: rgba(255, 243, 214, 0.82); }
.sc-mode-mark {
  visibility: hidden; padding: 0 9px; border-radius: 999px; font-size: 11px; line-height: 18px; font-weight: 900; letter-spacing: 0.06em;
  background: var(--amber, #ffb84d); color: #1b1230;
}
.sc-mode.sc-on { border-color: var(--amber, #ffb84d); background: linear-gradient(rgba(255, 184, 77, 0.24), rgba(255, 184, 77, 0.1)), #221b3a; box-shadow: 0 0 0 2px rgba(255, 184, 77, 0.35), 0 8px 20px rgba(0, 0, 0, 0.4); }
.sc-mode.sc-on b { color: var(--amber, #ffb84d); }
.sc-mode.sc-on .sc-mode-mark { visibility: visible; }
.sc-mode:active { transform: translateY(2px); }

.sc-screen .sc-go { min-height: 58px; font-size: 21px; letter-spacing: 0.4em; text-indent: 0.4em; box-shadow: 0 5px 0 #a8641a, 0 12px 24px rgba(0, 0, 0, 0.4); }
.sc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.sc-btn-note { display: block; margin-top: 1px; font-size: 11px; font-weight: 700; color: rgba(255, 243, 214, 0.7); }
.sc-row .btn { padding-top: 8px; padding-bottom: 8px; }

.sc-how {
  list-style: none; display: grid; gap: 3px; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.6;
  background: rgba(20, 16, 36, 0.78); border: 1px solid var(--line, rgba(255, 243, 214, 0.18));
}
.sc-how li { display: flex; gap: 10px; }
.sc-how b { flex: none; color: var(--teal, #58e0d0); font-weight: 900; }
.sc-how .sc-how-ab b { color: var(--amber, #ffb84d); }
.sc-record { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; font-size: 13px; color: rgba(255, 243, 214, 0.86); font-variant-numeric: tabular-nums; }
.sc-record b { color: var(--amber, #ffb84d); font-weight: 900; }

/* ---------- 小衣櫃 ---------- */
/* 窄版用一般區塊排版：grid 子項的 sticky 只能在自己的格子裡動，會黏不住 */
.sc-wardrobe .sc-wrap { display: block; padding-top: 0; padding-bottom: 14px; }
.sc-wd-preview {
  position: sticky; top: 0; z-index: 3;
  margin: 0 calc(-16px - var(--sar, 0px)) 0 calc(-16px - var(--sal, 0px));
  padding: calc(10px + var(--sat, 0px)) calc(16px + var(--sar, 0px)) 10px calc(16px + var(--sal, 0px));
  background: rgba(20, 15, 38, 0.97); border-bottom: 1px solid var(--line, rgba(255, 243, 214, 0.18)); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.sc-wd-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sc-wd-top h2 { font-size: 21px; line-height: 1.2; font-weight: 900; color: var(--amber, #ffb84d); }
.sc-count { font-size: 13px; font-weight: 800; padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line, rgba(255, 243, 214, 0.18)); background: rgba(0, 0, 0, 0.4); font-variant-numeric: tabular-nums; }
.sc-count b { color: var(--teal, #58e0d0); font-size: 16px; }
.sc-wd-stage { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 10px; align-items: center; }
.sc-wd-figure { min-width: 0; }
.sc-wardrobe .sc-hero { height: 138px; }
.sc-hero-name { margin-top: 2px; text-align: center; font-size: 13px; font-weight: 900; line-height: 1.35; }
.sc-hero-name small { display: block; font-size: 11px; font-weight: 700; color: rgba(255, 243, 214, 0.75); }
.sc-gear { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 6px; min-width: 0; }
.sc-gear-title { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; color: rgba(255, 243, 214, 0.65); }
.sc-gear-card {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 54px; padding: 5px 8px;
  border-radius: 12px; background: var(--panel2, #2c2449); border: 1px solid var(--line, rgba(255, 243, 214, 0.18));
}
.sc-gear-pic { display: block; width: 42px; height: 42px; }
.sc-gear-txt { display: block; min-width: 0; }
.sc-gear-txt b { display: block; font-size: 13px; line-height: 1.35; font-weight: 900; }
.sc-gear-txt small { display: block; font-size: 11.5px; line-height: 1.4; color: rgba(255, 243, 214, 0.8); }
.sc-gear-card.sc-empty { border-style: dashed; background: rgba(44, 36, 73, 0.45); }
.sc-gear-card.sc-empty b { color: rgba(255, 243, 214, 0.7); }
.sc-gear-card.sc-empty .sc-gear-pic { border-radius: 10px; border: 1.5px dashed rgba(255, 243, 214, 0.22); }
.sc-card-pic .sc-fig, .sc-gear-pic .sc-fig, .sc-new-pic .sc-fig { object-position: center; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4)); }

.sc-wd-list { display: grid; gap: 16px; align-content: start; min-width: 0; margin-top: 14px; }
.sc-slot-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 8px; }
.sc-slot-head h3 { font-size: 16px; font-weight: 900; }
.sc-slot-head span { font-size: 12px; color: rgba(255, 243, 214, 0.68); }
.sc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px 10px; }
.sc-card {
  position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; min-height: 112px; padding: 10px;
  text-align: left; border-radius: 16px; border: 2px solid var(--line, rgba(255, 243, 214, 0.18)); background: var(--panel, #221b3a); color: var(--cream, #fff3d6);
  font-family: inherit; font-size: inherit; cursor: pointer; touch-action: manipulation;
}
.sc-card-pic { display: block; width: 84px; height: 92px; }
.sc-card-body { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.sc-tag {
  padding: 0 8px; border-radius: 999px; font-size: 10.5px; line-height: 17px; font-weight: 800; letter-spacing: 0.08em;
  background: rgba(88, 224, 208, 0.14); color: var(--teal, #58e0d0); border: 1px solid rgba(88, 224, 208, 0.5);
}
.sc-card-name { font-size: 16px; line-height: 1.3; font-weight: 900; }
.sc-card-cap { font-size: 12px; line-height: 1.45; color: rgba(255, 243, 214, 0.76); }
.sc-card-abi { font-size: 12.5px; line-height: 1.45; font-weight: 700; color: #ffe2a8; }
.sc-card-state { margin-top: 2px; font-size: 12px; font-weight: 800; color: rgba(255, 243, 214, 0.62); }
.sc-card-mark {
  position: absolute; top: -10px; right: 10px; padding: 0 10px; border-radius: 999px; font-size: 11px; line-height: 19px; font-weight: 900; letter-spacing: 0.06em;
  background: var(--amber, #ffb84d); color: #1b1230; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.sc-card.sc-equipped { border-color: var(--amber, #ffb84d); background: linear-gradient(rgba(255, 184, 77, 0.2), rgba(255, 184, 77, 0.07)), #221b3a; box-shadow: 0 0 0 2px rgba(255, 184, 77, 0.3); }
.sc-card.sc-equipped .sc-card-state { color: var(--amber, #ffb84d); }
.sc-card.sc-locked { cursor: not-allowed; border-style: dashed; background: rgba(28, 22, 48, 0.82); }
.sc-card.sc-locked .sc-fig { filter: grayscale(1) brightness(0.3); }
.sc-card.sc-locked .sc-tag { color: rgba(255, 243, 214, 0.66); border-color: rgba(255, 243, 214, 0.3); background: transparent; }
.sc-card.sc-locked .sc-card-name, .sc-card.sc-locked .sc-card-cap, .sc-card.sc-locked .sc-card-abi { opacity: 0.62; }
.sc-card-state.sc-lock { display: inline-flex; align-items: center; gap: 5px; color: #ffc2b8; }
.sc-ico { flex: none; }
.sc-card:active { transform: translateY(1px); }
.sc-card.sc-shake { animation: sc-shake 0.32s; }
.sc-link {
  justify-self: center; min-height: 44px; padding: 0 14px; border: 0; background: none; color: rgba(255, 243, 214, 0.55);
  font-family: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; touch-action: manipulation;
}
.sc-link.sc-armed { color: #ffc2b8; font-weight: 800; }

/* ---------- 底部固定的按鈕列（小衣櫃、結算）：不用捲到底也按得到 ---------- */
.sc-bar {
  position: sticky; bottom: 0; z-index: 4; flex: none;
  padding: 10px calc(16px + var(--sar, 0px)) calc(10px + var(--sab, 0px)) calc(16px + var(--sal, 0px));
  background: rgba(14, 10, 28, 0.97); border-top: 1px solid var(--line, rgba(255, 243, 214, 0.18));
}
.sc-bar-in { position: relative; max-width: 1088px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.sc-bar-in.sc-three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sc-bar-in.sc-three .primary { grid-column: 1 / -1; }
.sc-bar .btn { padding-left: 8px; padding-right: 8px; }
.sc-results .sc-bar-in { max-width: 828px; }
.sc-toast {
  position: absolute; left: 50%; bottom: calc(100% + 20px); transform: translateX(-50%); width: max-content; max-width: 94%; padding: 6px 16px;
  border-radius: 999px; background: rgba(255, 243, 214, 0.97); color: #1b1230; font-size: 13px; font-weight: 800; text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); pointer-events: none; animation: sc-toast 2.4s ease forwards;
}
.sc-toast:empty { display: none; }

/* ---------- 結算 ---------- */
.sc-results .sc-wrap { max-width: 860px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: center; animation: sc-rise 0.3s ease-out both; }
.sc-res-head { text-align: center; }
.sc-res-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.3em; text-indent: 0.3em; color: rgba(255, 243, 214, 0.7); }
.sc-res-title { font-size: clamp(23px, 6.4vw, 40px); line-height: 1.25; font-weight: 900; color: var(--amber, #ffb84d); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 8px 22px rgba(0, 0, 0, 0.6); }
.sc-out-retreat .sc-res-title { color: var(--teal, #58e0d0); }
.sc-out-death .sc-res-title { color: #ff9aa2; }
.sc-res-sub { margin-top: 2px; font-size: 13px; color: rgba(255, 243, 214, 0.82); }
.sc-debug-tag {
  display: inline-block; margin-top: 8px; padding: 1px 12px; border-radius: 999px; border: 1.5px dashed var(--amber, #ffb84d); color: var(--amber, #ffb84d);
  font-size: 12px; font-weight: 900; letter-spacing: 0.08em; background: rgba(0, 0, 0, 0.4);
}
.sc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sc-stat { padding: 8px 4px; border-radius: 14px; text-align: center; background: rgba(34, 27, 58, 0.94); border: 1px solid var(--line, rgba(255, 243, 214, 0.18)); }
.sc-stat small { display: block; font-size: 11.5px; color: rgba(255, 243, 214, 0.72); }
.sc-stat b { display: block; font-size: clamp(13px, 4.4vw, 21px); line-height: 1.35; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 模式目前是最後一欄；完整模式與加辣文案在卡片內換行。 */
.sc-results .sc-stat:last-child b { white-space: normal; overflow-wrap: anywhere; }
.sc-new { display: grid; gap: 10px; }
.sc-run-result { padding: 12px 14px; background: rgba(33, 50, 42, .9); border: 1px solid #6b997e; border-radius: 16px; }
.sc-run-result h3 { font-size: 15px; text-align: center; color: #caffde; margin-bottom: 9px; }
.sc-milestones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; gap: 8px; }
.sc-milestones li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 6px; padding: 7px; border: 1px solid rgba(255,243,214,.22); border-radius: 10px; color: #c6cec7; background: rgba(0,0,0,.2); }
.sc-milestones li > span { grid-row: 1 / 3; font-size: 18px; }
.sc-milestones b { font-size: 13px; }
.sc-milestones small { font-size: 11px; }
.sc-milestones li.sc-achieved { color: #d0ffe2; border-color: #77c99b; }
.sc-run-result > p { margin-top: 8px; font-size: 12px; text-align: center; color: #e5f3e7; }
.sc-challenge-invite { display: grid; justify-items: center; gap: 8px; }
.sc-challenge-invite h3, .sc-challenge-invite > p { margin: 0; }
.sc-challenge-invite .btn { width: min(100%, 320px); }
.sc-challenge-invite > small { color: #d0dfd3; font-size: 12px; text-align: center; }
.sc-new-title { text-align: center; font-size: 16px; font-weight: 900; letter-spacing: 0.06em; color: var(--teal, #58e0d0); }
/* 寬畫面兩欄（一次拿到 3～4 件時不用一直往下捲）；窄畫面一欄。落單的最後一張橫跨置中 */
.sc-new-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); justify-items: center; gap: 12px; }
.sc-new-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sc-new-card {
  width: 100%; max-width: 440px;
  display: grid; grid-template-columns: minmax(92px, 36%) minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 184, 77, 0.24), rgba(88, 224, 208, 0.1)), #221b3a; border: 2px solid var(--amber, #ffb84d);
  box-shadow: 0 0 0 3px rgba(255, 184, 77, 0.22), 0 14px 34px rgba(0, 0, 0, 0.5); animation: sc-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.sc-new-card:nth-child(2) { animation-delay: 0.08s; }
.sc-new-card:nth-child(3) { animation-delay: 0.16s; }
.sc-new-card:nth-child(4) { animation-delay: 0.24s; }
.sc-new-pic { height: 150px; min-width: 0; }
.sc-new-body { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.sc-tag.sc-tag-new { font-size: 12px; line-height: 20px; padding: 0 10px; background: var(--amber, #ffb84d); color: #1b1230; border-color: #ffe2a8; }
.sc-new-name { font-size: 21px; line-height: 1.3; font-weight: 900; }
.sc-new-slot { font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; color: rgba(255, 243, 214, 0.7); }
.sc-screen .sc-wear { margin-top: 8px; min-height: 44px; padding: 8px 12px; font-size: 15px; }
.sc-screen .sc-wear.sc-done { background: rgba(88, 224, 208, 0.16); border-color: var(--teal, #58e0d0); color: var(--teal, #58e0d0); cursor: default; }
.sc-next {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; text-align: center; font-size: 14px; line-height: 1.6;
  background: rgba(20, 16, 36, 0.82); border: 1px dashed rgba(255, 243, 214, 0.32);
}
.sc-next b { color: var(--amber, #ffb84d); font-size: 17px; font-variant-numeric: tabular-nums; }
.sc-next.sc-all { border-style: solid; border-color: var(--teal, #58e0d0); color: var(--teal, #58e0d0); font-weight: 900; }

/* ---------- 寬版（桌面、手機橫向）：左邊造型、右邊內容 ---------- */
@media (min-width: 640px) {
  .sc-title .sc-wrap { grid-template-columns: minmax(220px, 1fr) minmax(300px, 460px); grid-template-areas: "hero head" "hero side"; column-gap: 28px; align-content: center; }
  .sc-title .sc-head { grid-area: head; text-align: left; }
  .sc-title .sc-side { grid-area: side; }
  .sc-title .sc-herobox { grid-area: hero; align-self: start; position: sticky; top: calc(16px + var(--sat, 0px)); }
  .sc-title .sc-hero { height: min(600px, calc(100vh - 84px)); height: min(600px, calc(100dvh - 84px)); }
  .sc-logo { font-size: clamp(28px, 4.2vw, 46px); }
  .sc-record { justify-content: flex-start; }
  .sc-title .sc-note { text-align: left; }

  .sc-wardrobe .sc-wrap { display: grid; grid-template-columns: minmax(240px, 34%) minmax(0, 1fr); column-gap: 20px; align-content: start; padding-top: calc(14px + var(--sat, 0px)); }
  .sc-wd-list { margin-top: 0; }
  .sc-wd-preview { align-self: start; top: calc(14px + var(--sat, 0px)); margin: 0; padding: 12px; border: 1px solid var(--line, rgba(255, 243, 214, 0.18)); border-radius: 18px; }

  .sc-bar-in.sc-three { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
  .sc-bar-in.sc-three .primary { grid-column: auto; }
}
/* 寬而且夠高（桌面、平板）：預覽改成上圖下卡，大圖放大 */
@media (min-width: 640px) and (min-height: 560px) {
  .sc-wd-stage { grid-template-columns: minmax(0, 1fr); }
  .sc-wardrobe .sc-hero { height: min(400px, calc(100vh - 400px)); height: min(400px, calc(100dvh - 400px)); }
  .sc-hero-name { margin-top: 6px; font-size: 15px; }
  .sc-hero-name small { font-size: 12px; }
  .sc-new-pic { height: 180px; }
}
/* 很矮的橫向手機：字與間距收一點，出發鍵不用捲就看得到 */
@media (max-height: 430px) {
  .sc-wrap { padding-top: calc(10px + var(--sat, 0px)); }
  .sc-sub { margin-top: 4px; }
  .sc-side { gap: 8px; }
  .sc-mode { min-height: 0; padding: 8px 10px; }
  .sc-mode b { font-size: 17px; }
  .sc-mode small { font-size: 12px; line-height: 1.45; }
  .sc-title .sc-mode small, .sc-title .sc-arena small { display: none; }
  .sc-title .sc-arena b { padding-bottom: 5px; }
  .sc-screen .sc-go { min-height: 50px; }
  .sc-wardrobe .sc-hero { height: 124px; }
  .sc-wardrobe .sc-wrap { grid-template-columns: minmax(280px, 42%) minmax(0, 1fr); }
  .sc-results .sc-wrap { gap: 10px; }
  .sc-new-pic { height: 120px; }
  .sc-run-summary { padding: 8px 11px; gap: 3px; }
  .sc-run-summary b { font-size: 13px; }
  .sc-run-summary span { font-size: 11px; }
  .sc-run-summary small { display: none; }
}
/* 又窄又矮的小螢幕：預覽不固定在上方，免得把清單擠到看不見 */
@media (max-height: 430px) and (min-width: 640px) {
  .sc-challenge-invite { grid-template-columns: minmax(0, 1fr) minmax(160px, 34%); gap: 4px 12px; padding: 8px 12px; align-items: center; justify-items: stretch; }
  .sc-challenge-invite h3, .sc-challenge-invite > p, .sc-challenge-invite > small { grid-column: 1; }
  .sc-challenge-invite .btn { grid-column: 2; grid-row: 1 / 4; width: 100%; }
}
@media (max-width: 639px) and (max-height: 520px) {
  .sc-wd-preview { position: static; }
}
@media (hover: hover) {
  .sc-mode:hover, .sc-card:not(.sc-locked):hover { border-color: var(--amber, #ffb84d); }
  .sc-link:hover { color: var(--cream, #fff3d6); }
}

@keyframes sc-bob { 50% { transform: translateY(-5px); } }
/* 進場動畫只動位置與大小、不從透明開始：分頁在背景時動畫不會跑，內容不能因此看不見 */
@keyframes sc-rise { from { transform: translateY(12px); } to { transform: none; } }
@keyframes sc-pop { from { transform: scale(0.88); } to { transform: none; } }
@keyframes sc-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes sc-toast { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sc-hero-buddy, .sc-results .sc-wrap, .sc-new-card, .sc-card.sc-shake { animation: none; }
  .sc-toast { animation-duration: 4s; }
}

.sc-style-picker > p { margin: 10px 0 8px; color: #ffe2a8; font-size: 13px; font-weight: 800; }
.sc-style-picker .sc-modes { margin-bottom: 12px; }

.sc-innate { display: block; text-align: left; line-height: 1.5; }
.sc-innate b { color: #d9f5b3; }
.sc-challenge { margin: 8px 0 14px; }
.sc-challenge > p { color: #ffe2a8; font-size: 13px; font-weight: 800; margin: 6px 0; }
.sc-challenge-note { display: block; color: #f5dfba; line-height: 1.5; margin-top: 6px; }

/* ADV-080: the first visit presents one goal, three actions, then start. */
.sc-title .sc-start-note { margin: 0; font-size: 13px; line-height: 1.65; color: #f9e9cb; }
.sc-title .sc-current { margin: 0; font-size: 12px; color: #d0f7df; }
.sc-title .sc-go { letter-spacing: .08em; text-indent: .08em; }
.sc-options { border: 1px solid rgba(255,243,214,.22); border-radius: 14px; padding: 0 12px; background: rgba(20,16,36,.74); min-width: 0; }
.sc-options > summary { cursor: pointer; min-height: 48px; padding: 12px 0; font-weight: 800; font-size: 14px; }
.sc-options[open] { padding-bottom: 12px; }
.sc-options > .sc-run-summary + .sc-run-summary { margin-top: 10px; }
.sc-choice-label { color: #ffe2a8; font-weight: 800; font-size: 13px; margin: 10px 0 7px; }
@media (max-width: 639px) {
  .sc-title .sc-wrap { gap: 8px; padding-top: calc(10px + var(--sat, 0px)); }
  .sc-title .sc-hero { height: 80px; }
  .sc-title .sc-wearline { display: none; }
  .sc-title .sc-sub { margin-top: 6px; font-size: 11px; }
  .sc-title .sc-side { gap: 9px; }
  .sc-title .sc-intro { padding: 9px 11px; }
  .sc-title .sc-intro b { font-size: 14px; }
}

#hopeShareCard { width: min(100%, 390px); justify-self: center; text-align: center; }
#hopeShareCard img { display: block; width: 100%; height: auto; border-radius: 14px; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; touch-action: auto; }
#hopeShareCard .hope-share-save { width: 100%; text-decoration: none; border-color: #bf9473; background: #603b38; color: #fff2d9; }
#hopeShareCard p { margin-top: 6px; color: #eadbc7; font-size: 12px; }
