/* ── 遊戲頁頂列：長輩／語音／大廳（橫排，不壓標題） ── */
.family-toolbar {
  position: fixed;
  top: max(0.3rem, env(safe-area-inset-top, 0px));
  left: max(0.3rem, env(safe-area-inset-left, 0px));
  right: max(0.3rem, env(safe-area-inset-right, 0px));
  z-index: 80;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
  pointer-events: none;
}
.family-toolbar > * {
  pointer-events: auto;
}
body:not(.is-hub-page) {
  --fam-toolbar-h: 3.05rem;
  padding-top: calc(var(--fam-toolbar-h) + env(safe-area-inset-top, 0px)) !important;
}
html.elder-mode body:not(.is-hub-page) {
  --fam-toolbar-h: 3.45rem;
}
.family-tb-btn {
  min-height: 40px;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 2px solid rgba(251, 191, 36, 0.5);
  background: rgba(15, 26, 36, 0.92);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}
.family-tb-btn.active {
  background: rgba(251, 191, 36, 0.28);
  border-color: #fbbf24;
}
html.elder-mode .family-tb-btn {
  min-height: 46px;
  font-size: 0.92rem;
  font-weight: 900;
}
body.is-hub-page .family-toolbar {
  display: none !important;
}

/* ── 合集主頁按鈕（工具列內，不再單獨 fixed 擋標題） ── */
a.family-hub-btn {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 40px;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  border: 2px solid rgba(251, 191, 36, 0.55);
  background: rgba(15, 26, 36, 0.92);
  color: #fbbf24;
  font-weight: 900;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  line-height: 1.2;
}
a.family-hub-btn:active {
  transform: scale(0.97);
}
a.family-hub-btn:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}
/* 合集首頁本身不顯示 */
body.is-hub-page a.family-hub-btn {
  display: none !important;
}
html.elder-mode a.family-hub-btn {
  min-height: 46px !important;
  padding: 0.35rem 0.9rem !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
}
@media (max-height: 640px) {
  a.family-hub-btn {
    min-height: 38px;
    padding: 0.28rem 0.7rem;
    font-size: 0.85rem;
  }
}

/* 長輩模式 · 全站加大字與按鈕 */
html.elder-mode {
  font-size: 118%;
}
html.elder-mode body {
  line-height: 1.55;
}
html.elder-mode button,
html.elder-mode .btn,
html.elder-mode .btn-go,
html.elder-mode .btn-start,
html.elder-mode .chip,
html.elder-mode .chips button {
  min-height: 72px !important;
  font-weight: 900 !important;
  font-size: 1.05em !important;
}
html.elder-mode .family-toolbar button,
html.elder-mode .family-toolbar .family-tb-btn,
html.elder-mode .family-toolbar a.family-hub-btn {
  min-height: 44px !important;
  padding: 0.28rem 0.75rem !important;
  font-size: 0.88rem !important;
}
html.elder-mode h1 {
  font-size: clamp(1.35rem, 4.5vw, 1.75rem) !important;
}
html.elder-mode .gentle,
html.elder-mode .hint {
  font-size: 1.05em !important;
  font-weight: 700 !important;
}
html.elder-mode .toast {
  font-size: 1.15em !important;
}
html.elder-mode a.game {
  padding: 1.25rem 1.3rem !important;
  min-height: 108px;
}
html.elder-mode a.game h2 {
  font-size: 1.22rem !important;
}
html.elder-mode a.game p {
  font-size: 0.95rem !important;
}
html.elder-mode .tile,
html.elder-mode .card-tile,
html.elder-mode .num,
html.elder-mode .bingo-board button,
html.elder-mode .mahjong-tile,
html.elder-mode .pad {
  min-height: 64px !important;
  font-size: 1.15em !important;
}

/* 通關媽媽跳舞（共用注入） */
.fam-dance-box {
  margin: 0 0 0.55rem;
}
.fam-dance-stage {
  height: clamp(140px, 24vh, 200px);
  margin: 0 auto 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.fam-dance-wrap {
  width: min(180px, 46vw);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
.fam-dance-wrap video {
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 14px;
  pointer-events: none;
}
.fam-dance-stage .dance-note {
  position: absolute;
  font-size: 1.15rem;
  animation: note-float 1.1s ease-in-out infinite;
}
.fam-dance-stage .dance-note.n1 {
  left: 6%;
  top: 10%;
}
.fam-dance-stage .dance-note.n2 {
  right: 8%;
  top: 16%;
  animation-delay: 0.25s;
}
@keyframes note-float {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}
.cele-music-btn,
.fam-dance-btn {
  display: block;
  width: 100%;
  margin: 0 0 0.5rem;
  min-height: 52px;
  border: 2px solid rgba(251, 191, 36, 0.85);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #1a1205;
  font-weight: 900;
  font-size: 1.05rem;
  animation: music-pulse 1.2s ease-in-out infinite;
}
.cele-music-btn.playing,
.fam-dance-btn.playing {
  background: linear-gradient(180deg, #6ee7b7, #34d399);
  border-color: rgba(110, 231, 183, 0.85);
  color: #052e1a;
  animation: none;
  pointer-events: none;
  cursor: default;
  text-align: center;
  line-height: 52px;
}
@keyframes music-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .fam-dance-stage .dance-note,
  .cele-music-btn,
  .fam-dance-btn {
    animation: none !important;
  }
}

/* 通關撒花（更醒目，仍短促） */
.fam-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
  overflow: hidden;
}
.fam-burst-strong::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(251, 191, 36, 0.28), transparent 62%);
  animation: famCeleGlow 1.1s ease-out forwards;
}
.fam-burst-bit {
  position: absolute;
  bottom: 14%;
  animation: famBurstUp 2.1s ease-out forwards;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
@keyframes famBurstUp {
  0% {
    transform: translateY(16px) scale(0.55) rotate(-8deg);
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  100% {
    transform: translateY(-68vh) scale(1.15) rotate(12deg);
    opacity: 0;
  }
}
@keyframes famCeleGlow {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

/* P1.2：通關標題／遮罩更清楚（媽媽常玩） */
html.fam-cele-boom .overlay:not(.hidden),
html.fam-cele-boom #win:not(.hidden),
html.fam-cele-boom .celebrate.show {
  background: rgba(4, 10, 18, 0.86) !important;
}
.overlay:not(.hidden) .win-card,
.overlay:not(.hidden) #overlay-win .card,
#win:not(.hidden) .card,
.celebrate.show .celebrate-card {
  animation: famWinCardPop 0.55s cubic-bezier(0.34, 1.35, 0.64, 1);
  box-shadow:
    0 0 0 3px rgba(251, 191, 36, 0.45),
    0 18px 48px rgba(0, 0, 0, 0.5);
}
.overlay:not(.hidden) #win-title,
.overlay:not(.hidden) .win-card h2,
.overlay:not(.hidden) #wtitle,
#win:not(.hidden) #wtitle,
#win:not(.hidden) h2,
.celebrate.show .celebrate-title {
  font-size: clamp(1.9rem, 7.2vw, 2.85rem) !important;
  line-height: 1.22 !important;
  letter-spacing: 0.04em;
  font-weight: 900 !important;
  color: #fde68a !important;
  text-shadow:
    0 2px 0 rgba(120, 53, 15, 0.55),
    0 4px 18px rgba(251, 191, 36, 0.55) !important;
}
.overlay:not(.hidden) .win-msg,
.overlay:not(.hidden) #wmsg,
#win:not(.hidden) #wmsg,
.celebrate.show .celebrate-sub {
  font-size: clamp(1.15rem, 3.8vw, 1.45rem) !important;
  font-weight: 800 !important;
}
@keyframes famWinCardPop {
  0% { transform: scale(0.86); opacity: 0.4; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
/* 全站按下回彈（不依賴 feel-ready，避免腳本晚到就看不見） */
button:active:not(:disabled),
a.game:active,
.chip:active,
.family-tb-btn:active,
.chips button:active,
.who-chips button:active {
  transform: scale(0.92);
}
.fam-pressed {
  transform: scale(0.9) !important;
  filter: brightness(1.18);
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.55) !important;
}

.fam-tap-rip {
  position: fixed;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.55) 0%, rgba(251, 191, 36, 0) 70%);
  border: 3px solid rgba(253, 230, 138, 0.85);
  pointer-events: none;
  z-index: 400;
  animation: famRip 0.4s ease-out forwards;
}
@keyframes famRip {
  0% { transform: scale(0.35); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

.fam-feel-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 110;
  background: rgba(255, 236, 179, 0.42);
  opacity: 0;
}
.fam-feel-flash.on {
  animation: famFeelFlash 0.38s ease-out;
}
@keyframes famFeelFlash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

.fam-reveal {
  animation: famReveal 0.62s ease both;
  z-index: 3;
}
@keyframes famReveal {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.fam-turn-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 52px;
  padding: 0.35rem 0.85rem;
  border-radius: 14px;
  font-weight: 900;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  background: rgba(251, 191, 36, 0.18);
  border: 2px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}
html.elder-mode .fam-turn-bar {
  min-height: 64px;
  font-size: 1.22rem;
}
.fam-turn-bar.black,
.fam-turn-bar.is-black {
  background: rgba(15, 23, 42, 0.72);
  border-color: #94a3b8;
  color: #f8fafc;
}
.fam-turn-bar.white,
.fam-turn-bar.is-white {
  background: rgba(248, 250, 252, 0.88);
  border-color: #cbd5e1;
  color: #1e293b;
}
.fam-turn-bar.red,
.fam-turn-bar.is-red {
  background: rgba(185, 28, 28, 0.28);
  border-color: #f87171;
  color: #fecaca;
}
.fam-drop {
  animation: famDrop 0.22s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
@keyframes famDrop {
  0% { transform: scale(1.28) translateY(-10px); }
  100% { transform: scale(1) translateY(0); }
}
.fam-flip-y {
  animation: famFlipY 0.42s ease both;
}
@keyframes famFlipY {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0); }
}

.pop-ok {
  animation: popOk 0.45s ease;
}
@keyframes popOk {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

/* 母親照片小圖（配對／找不同／賓果格）— 共用 512² 遊戲組 */
.mom-pic,
.feat-photo,
.face.front img,
.who-photo,
.photo-card img,
.piece img,
.cell-photo,
.qphoto,
.prize-photo {
  object-fit: cover;
  object-position: center 28%;
  filter: contrast(1.12) saturate(1.14) brightness(1.04);
  image-rendering: -webkit-optimize-contrast;
  -ms-interpolation-mode: nearest-neighbor;
}
.mom-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  pointer-events: none;
  background: #1e293b;
}
.mom-pic-round {
  border-radius: 50%;
  object-fit: cover;
}
html.elder-mode .mom-pic,
html.elder-mode .qphoto,
html.elder-mode .who-photo,
html.elder-mode .prize-photo,
html.elder-mode .cell-photo {
  filter: contrast(1.16) saturate(1.16) brightness(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .fam-burst,
  .fam-burst-strong::before,
  .pop-ok,
  a.game,
  .fam-feel-flash,
  .fam-reveal,
  .fam-drop,
  .fam-flip-y,
  .fam-tap-rip,
  .overlay:not(.hidden) .win-card,
  .overlay:not(.hidden) #overlay-win .card,
  #win:not(.hidden) .card,
  .celebrate.show .celebrate-card {
    animation: none !important;
  }
}

/* =========================================================
   一屏適配（iPad / Safari 工具列 / 長輩大按鈕）
   - 遊戲殼層鎖在 100dvh，避免整頁往下長
   - 中間可捲，底部「回首頁」列永遠在可視區
   - 由 elder.js 對遊戲頁加上 body.fit-viewport
   ========================================================= */
body.fit-viewport {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
body.fit-viewport .app,
body.fit-viewport .wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}
/* 無 .app 殼層的單頁棋類（五子棋／象棋等） */
body.fit-viewport > header,
body.fit-viewport > footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 720px;
}
body.fit-viewport > main,
body.fit-viewport > main.panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 720px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
body.fit-viewport > main .board-wrap,
body.fit-viewport > main.panel .board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.fit-viewport > main .actions,
body.fit-viewport > main.panel .actions {
  flex-shrink: 0;
}
/* 棋盤 canvas 依可視高度縮放，避免 iPad 必須下滑 */
body.fit-viewport canvas#board,
body.fit-viewport .board-wrap > canvas {
  width: min(92vw, 480px, 58dvh) !important;
  height: min(92vw, 480px, 58dvh) !important;
  max-width: 100%;
  max-height: 58dvh;
}
/* 遊戲中畫面：欄位配置，底部列不消失 */
body.fit-viewport .screen:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}
/* 選單／首頁：內容可捲（姓名、難度選項較多時） */
body.fit-viewport #home.screen:not(.hidden),
body.fit-viewport #screen-home.screen:not(.hidden),
body.fit-viewport .screen-home:not(.hidden) {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* 遊戲中：頂部統計、底部按鈕不壓縮 */
body.fit-viewport #game.screen:not(.hidden) > .bar,
body.fit-viewport #game.screen:not(.hidden) > .row,
body.fit-viewport #game.screen:not(.hidden) > .actions,
body.fit-viewport #screen-game.screen:not(.hidden) > .game-head,
body.fit-viewport #screen-game.screen:not(.hidden) > header,
body.fit-viewport #screen-game.screen:not(.hidden) > .actions,
body.fit-viewport #screen-game.screen:not(.hidden) > .game-actions,
body.fit-viewport #screen-game.screen:not(.hidden) > .row,
body.fit-viewport .screen-game:not(.hidden) > .game-actions,
body.fit-viewport .screen-game:not(.hidden) > header,
body.fit-viewport .sticky-home-bar {
  flex-shrink: 0;
}
/* 中間遊戲區吃剩餘高度，必要時自己捲 */
body.fit-viewport .stage,
body.fit-viewport .game-body,
body.fit-viewport .board-wrap,
body.fit-viewport .board-area,
body.fit-viewport .qcard,
body.fit-viewport .bins,
body.fit-viewport .play-area,
body.fit-viewport .scratch-wrap,
body.fit-viewport #board-wrap,
body.fit-viewport .ball-stage,
body.fit-viewport .board-wrap + .bingo-board,
body.fit-viewport .flex-grow {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* 戳泡泡等固定高度舞台：改成吃滿剩餘空間 */
body.fit-viewport .stage {
  height: auto !important;
  max-height: none !important;
}
/* 問答卡不要硬性 min-height 把回首頁擠出螢幕 */
body.fit-viewport .qcard {
  min-height: 0 !important;
}
/* 底部操作列：視覺上貼齊底部 + 安全區 */
body.fit-viewport .sticky-home-bar,
body.fit-viewport #game.screen:not(.hidden) > .row:last-child,
body.fit-viewport #game.screen:not(.hidden) > .actions,
body.fit-viewport #game.screen:not(.hidden) > #btn-leave-game,
body.fit-viewport #screen-game.screen:not(.hidden) > .actions,
body.fit-viewport #screen-game.screen:not(.hidden) > .game-actions,
body.fit-viewport .screen-game:not(.hidden) > .game-actions {
  z-index: 12;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.4rem;
  padding-bottom: max(0.3rem, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    180deg,
    rgba(10, 16, 24, 0) 0%,
    rgba(10, 16, 24, 0.88) 35%,
    rgba(10, 16, 24, 0.97) 100%
  );
}
/* 遊戲中段內容可捲（臥底詞卡、賓果板等） */
body.fit-viewport #game.screen:not(.hidden) > .word-card,
body.fit-viewport #game.screen:not(.hidden) > .speak-box,
body.fit-viewport #game.screen:not(.hidden) > .vote-box,
body.fit-viewport #game.screen:not(.hidden) > .reveal-box,
body.fit-viewport #screen-game.screen:not(.hidden) > .ball-stage,
body.fit-viewport #screen-game.screen:not(.hidden) > .history-strip,
body.fit-viewport #screen-game.screen:not(.hidden) > .board-wrap {
  flex-shrink: 1;
  min-height: 0;
}
/* 矮螢幕／iPad 橫向：壓縮長輩大按鈕與間距，避免必須下滑 */
@media (max-height: 820px) {
  html.elder-mode {
    font-size: 108%;
  }
  html.elder-mode button,
  html.elder-mode .btn,
  html.elder-mode .btn-go,
  html.elder-mode .btn-start,
  html.elder-mode .chip,
  html.elder-mode .chips button {
    min-height: 60px !important;
  }
  body.fit-viewport {
    padding-top: calc(var(--fam-toolbar-h, 3.05rem) + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: max(0.2rem, env(safe-area-inset-bottom, 0px)) !important;
  }
  body.fit-viewport .screen:not(.hidden) {
    gap: 0.35rem !important;
  }
  body.fit-viewport h1,
  body.fit-viewport .top h1,
  body.fit-viewport .top-header h1 {
    font-size: clamp(0.95rem, 2.8vw, 1.2rem) !important;
    margin: 0 !important;
  }
  body.fit-viewport .panel {
    padding: 0.65rem !important;
  }
  body.fit-viewport .who-opts button,
  body.fit-viewport .ans {
    min-height: 52px !important;
  }
}
/* 極矮（iPad 橫向 + Safari 工具列） */
@media (max-height: 640px) {
  html.elder-mode {
    font-size: 100%;
  }
  html.elder-mode button,
  html.elder-mode .btn,
  html.elder-mode .btn-go,
  html.elder-mode .btn-start,
  html.elder-mode .chip,
  html.elder-mode .chips button {
    min-height: 48px !important;
  }
  body.fit-viewport .gentle {
    font-size: 0.85rem !important;
    margin: 0.1rem 0 !important;
  }
  body.fit-viewport .bar {
    padding: 0.35rem 0.55rem !important;
  }
}

/* 接龍／釣魚等無 .app 的頁：主內容區可捲、工具列不消失 */
body.fit-viewport > .toolbar,
body.fit-viewport > .family-bar,
body.fit-viewport > header {
  flex-shrink: 0;
}
body.fit-viewport > .table,
body.fit-viewport > #wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* 首頁長輩工具列 */
.elder-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.75rem 0 1.25rem;
}
.elder-bar button {
  min-height: 52px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  font-weight: 800;
  cursor: pointer;
  font: inherit;
}
.elder-bar button.active {
  background: rgba(251, 191, 36, 0.28);
  border-color: #fbbf24;
}
.elder-tip {
  text-align: center;
  color: #9bb0c4;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 0.06em;
  margin: 1.35rem 0 0.65rem;
  padding-left: 0.25rem;
}
.section-title:first-of-type {
  margin-top: 0.25rem;
}
.mom-steps {
  background: rgba(26, 35, 50, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  color: #e2e8f0;
}
.mom-steps h2 {
  color: #7dd3fc;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.mom-steps ol {
  margin-left: 1.2rem;
  font-weight: 700;
  line-height: 1.65;
  color: #cbd5e1;
}
.mom-steps li {
  margin: 0.25rem 0;
}
.badge-online {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 900;
  color: #052e16;
  background: linear-gradient(180deg, #6ee7b7, #34d399);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* 教學遮罩（派對遊戲共用樣式） */
.tutor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 20, 0.82);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tutor-overlay.hidden {
  display: none !important;
}
.tutor-card {
  background: #1a2a3a;
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  width: min(420px, 100%);
  border: 2px solid rgba(125, 211, 252, 0.35);
  color: #f0f6fc;
}
.tutor-card h2 {
  text-align: center;
  color: #fbbf24;
  margin-bottom: 0.65rem;
  font-size: 1.25rem;
}
.tutor-card ol {
  margin: 0.5rem 0 1rem 1.2rem;
  font-weight: 700;
  line-height: 1.65;
  color: #cbd5e1;
}
.tutor-card .btn-go {
  width: 100%;
  min-height: 64px;
  border: none;
  border-radius: 16px;
  font-weight: 900;
  font-size: 1.1rem;
  background: linear-gradient(180deg, #7dd3fc, #0ea5e9);
  color: #082f49;
  cursor: pointer;
}

/* 飛機走格動畫 */
.plane.hop {
  animation: planeHop 0.45s ease;
}
@keyframes planeHop {
  0% {
    transform: scale(1) translateY(0);
  }
  40% {
    transform: scale(1.25) translateY(-8px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* 賓果球彈跳 */
.ball-pop {
  animation: ballPop 0.5s ease;
}
@keyframes ballPop {
  0% {
    transform: scale(0.4);
    opacity: 0.3;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 遊戲廳分享：大 QR + 房號 + 複製 */
.fe-room-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0.55rem 0 0.35rem;
  padding: 0.7rem 0.65rem 0.8rem;
  border-radius: 16px;
  background: rgba(110, 231, 183, 0.12);
  border: 2px solid rgba(110, 231, 183, 0.45);
  text-align: center;
}
.fe-room-share.compact {
  padding: 0.45rem 0.5rem 0.55rem;
}
.fe-room-share .fe-rs-kicker {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #6ee7b7;
}
.fe-room-share .fe-rs-code {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}
.fe-room-share.compact .fe-rs-code {
  font-size: 1.45rem;
  letter-spacing: 0.2em;
}
.fe-room-share .fe-rs-qr {
  display: block;
  width: min(280px, 72vw);
  height: auto;
  max-width: 280px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.fe-room-share.compact .fe-rs-qr {
  width: min(160px, 46vw);
  max-width: 160px;
  padding: 6px;
}
.fe-room-share .fe-rs-url {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  word-break: break-all;
  line-height: 1.35;
  max-width: 22rem;
}
.fe-room-share .fe-rs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  width: 100%;
  margin-top: 0.2rem;
}
.fe-room-share .fe-rs-btn {
  min-height: 48px;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  color: #1a1410;
  touch-action: manipulation;
}
.fe-room-share .fe-rs-btn.alt {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  color: #0f172a;
}
.fe-room-share .fe-rs-status {
  margin: 0.1rem 0 0;
  min-height: 1.2em;
  font-size: 0.88rem;
  font-weight: 700;
  color: #6ee7b7;
}
html.elder-mode .fe-room-share .fe-rs-code {
  font-size: 2.2rem;
}
html.elder-mode .fe-room-share .fe-rs-btn {
  min-height: 52px;
  font-size: 1.05rem;
}


/* =========================================================
   batch4 residual — hub / global chips match per-game touch
   （合集首頁籌碼不要比遊戲內選項還小）
   ========================================================= */
.chip,
.chips button,
.who-chips button,
.elder-bar button {
  min-height: 56px;
  font-weight: 800;
}
.who-chips button {
  min-height: 56px !important;
  padding: 0.45rem 1rem !important;
  font-size: 1.02rem;
  border-width: 2px;
}
html.elder-mode .who-chips button {
  min-height: 72px !important;
  font-size: 1.1rem !important;
  font-weight: 900 !important;
}
html.elder-mode .elder-bar button {
  min-height: 64px !important;
  font-size: 1.05rem !important;
}
body.is-hub-page a.game {
  min-height: 96px;
  padding: 1.1rem 1.15rem;
}
html.elder-mode body.is-hub-page a.game {
  min-height: 112px !important;
  padding: 1.3rem 1.35rem !important;
}
/* 一般模式遊戲頁籌碼底線（被遊戲 CSS 覆寫時仍有下限） */
button.chip,
.chips > button {
  min-height: 56px;
}

/* =========================================================
   batch5 — 全站焦點環／照片銳利呈現（長輩友善）
   ========================================================= */
:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
.chip:focus-visible,
.chips button:focus-visible,
.who-chips button:focus-visible,
.family-tb-btn:focus-visible,
a.game:focus-visible {
  outline: 4px solid #fbbf24;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px rgba(15, 26, 36, 0.9), 0 0 0 6px rgba(251, 191, 36, 0.45);
}
html.elder-mode :focus-visible,
html.elder-mode button:focus-visible,
html.elder-mode a:focus-visible,
html.elder-mode a.game:focus-visible {
  outline-width: 5px;
  outline-offset: 4px;
  box-shadow: 0 0 0 2px rgba(15, 26, 36, 0.95), 0 0 0 8px rgba(251, 191, 36, 0.55);
}

/* 卡片／照片：Retina 清晰縮放 */
img.mom-pic,
img.feat-photo,
.face.front img,
.who-photo,
.photo-card img,
.piece img,
.cell-photo,
.qphoto,
.prize-photo,
a.game .game-ico {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
}

body.is-hub-page a.game {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), 0 2px 0 rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}
body.is-hub-page a.game.mom-fav {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(251, 191, 36, 0.14),
    0 0 18px rgba(251, 191, 36, 0.08);
}
body.is-hub-page a.game.featured .feat-photo {
  filter: contrast(1.14) saturate(1.14) brightness(1.05);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}
