/* 八種主題：白色、卡其、粉色、藍綠、淺藍、藏青（代號 winter）、深色、黑色。theme.js 一定會設 <html data-theme="white|khaki|pink|teal|blue|dark|black|winter">：
   選過的記在瀏覽器 localStorage，沒選過預設藏青。下面「沒有 data-theme 就跟系統淺深色」的樣式只在 theme.js 沒跑到時才用得到 */
:root {
  --radius: 14px;
  --card-alpha: .96;  /* 卡片底的不透明度（所有主題共用）；調低會讓背景特效透得更清楚、字比較難讀 */
  --surface-rgb: 244, 240, 228; --bg-rgb: 233, 228, 212; --soft-rgb: 239, 231, 204; --snow-rgb: 150, 112, 40;
  /* 卡其（預設淺色） */
  --bg: #e9e4d4;
  --surface: #f4f0e4;
  --text: #1c1a15;
  --muted: #5f5b4f;
  --line: #d4ccb6;
  --accent: #8f7125;  /* 卡其系的重點色（深卡其／土金），按鈕、標籤、連結都用它 */
  --accent-soft: #efe7cc;
  --accent2: #b8995a;
  --cold: #1c7ed6;
  --win: #0b7a3b;
  --bad: #c62828;
  color-scheme: light;
}
/* 卡其的按鈕：用淺一點的卡其（字用深色）；文字用的重點色維持較深才看得清楚。只給「沒選過主題、系統是淺色」和「卡其」用，其他主題不受影響 */
@media (not (prefers-color-scheme: dark)) {
  :root:not([data-theme]) { --btn-a: #cdb673; --btn-b: #e6d8a8; --btn-text: #2a2008; --glow-rgb: 143, 113, 37; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {  /* 黑色（預設深色） */
    --surface-rgb: 10, 12, 16; --bg-rgb: 6, 8, 11; --soft-rgb: 27, 30, 36; --snow-rgb: 255, 255, 255;
    --bg: #06080b;
    --surface: #0a0c10;
    --text: #eceff4;
    --muted: #9aa3b2;
    --line: #1f242d;
    --btn-a: #2d323c; --btn-b: #474f5d; --btn-text: #eceff4;  /* 按鈕：炭灰（黑色主題） */
    --accent: #f2f4f8;
    --accent-soft: #1b1e24;
    --accent2: #8a929f;
    --glow-rgb: 255, 255, 255;
    --cold: #74c0fc;
    --win: #4cd387;
    --bad: #ff6b6b;
    color-scheme: dark;
  }
}

:root[data-theme="khaki"] {
  --surface-rgb: 244, 240, 228; --bg-rgb: 233, 228, 212; --soft-rgb: 239, 231, 204; --snow-rgb: 150, 112, 40;
  --bg: #e9e4d4; --surface: #f4f0e4; --text: #1c1a15; --muted: #5f5b4f; --line: #d4ccb6;
  --accent: #8f7125; --accent-soft: #efe7cc; --accent2: #b8995a;
  --btn-a: #cdb673; --btn-b: #e6d8a8; --btn-text: #2a2008; --cold: #1c7ed6; --win: #0b7a3b; --bad: #c62828;
  --glow-rgb: 143, 113, 37;
  color-scheme: light;
}
:root[data-theme="white"] {
  --surface-rgb: 255, 255, 255; --bg-rgb: 244, 245, 247; --soft-rgb: 236, 238, 242; --snow-rgb: 95, 125, 180;
  --bg: #f4f5f7; --surface: #ffffff; --text: #15181e; --muted: #5d6573; --line: #dfe2e8;
  --accent: #20242c; --accent-soft: #eceef2; --accent2: #6b7380; --cold: #1c7ed6; --win: #0b7a3b; --bad: #c62828;  /* 黑白灰：重點色用近黑 */
  --btn-a: #d3d8e0; --btn-b: #eceff3; --btn-text: #15181e;  /* 按鈕：淺灰銀（白色主題） */
  --glow-rgb: 32, 36, 44;
  color-scheme: light;
}
:root[data-theme="pink"] {
  --surface-rgb: 254, 246, 248; --bg-rgb: 251, 238, 242; --soft-rgb: 253, 237, 242; --snow-rgb: 222, 66, 126;
  --bg: #fbeef2; --surface: #fef6f8; --text: #2b1a21; --muted: #7d5a68; --line: #f2dde5;
  --accent: #dc5083; --accent-soft: #fdedf2; --accent2: #f397b6; --cold: #1c7ed6; --win: #0b7a3b; --bad: #c62828;
  --glow-rgb: 220, 80, 131;
  --btn-a: #f2b3c8; --btn-b: #f9d3e0; --btn-text: #4a1730;  /* 按鈕：淡粉（字用深酒紅） */
  color-scheme: light;
}
:root[data-theme="teal"] {
  --surface-rgb: 244, 251, 250; --bg-rgb: 230, 244, 242; --soft-rgb: 220, 242, 239; --snow-rgb: 24, 135, 128;
  --bg: #e6f4f2; --surface: #f4fbfa; --text: #12262a; --muted: #4c6b6e; --line: #cde6e3;
  --accent: #1f8a85; --accent-soft: #dcf2ef; --accent2: #6cc0ba; --cold: #1c7ed6; --win: #0b7a3b; --bad: #c62828;
  --glow-rgb: 31, 138, 133;
  --btn-a: #9ed6d0; --btn-b: #cdebe8; --btn-text: #0c3a3a;  /* 按鈕：淡藍綠（字用深青） */
  color-scheme: light;
}
:root[data-theme="blue"] {
  --surface-rgb: 246, 250, 254; --bg-rgb: 234, 243, 251; --soft-rgb: 228, 240, 251; --snow-rgb: 40, 118, 200;
  --bg: #eaf3fb; --surface: #f6fafe; --text: #14202b; --muted: #50677b; --line: #d3e3f1;
  --accent: #2b7bc2; --accent-soft: #e4f0fb; --accent2: #6fb1e6; --cold: #1c7ed6; --win: #0b7a3b; --bad: #c62828;
  --glow-rgb: 43, 123, 194;
  --btn-a: #a8cdee; --btn-b: #d0e5f7; --btn-text: #10304f;  /* 按鈕：淡藍（字用深藍） */
  color-scheme: light;
}
:root[data-theme="black"] {
  --surface-rgb: 10, 12, 16; --bg-rgb: 6, 8, 11; --soft-rgb: 27, 30, 36; --snow-rgb: 255, 255, 255;
  --bg: #06080b; --surface: #0a0c10; --text: #eceff4; --muted: #9aa3b2; --line: #1f242d;
  --accent: #f2f4f8; --accent-soft: #1b1e24; --accent2: #8a929f; --cold: #74c0fc; --win: #4cd387; --bad: #ff6b6b;  /* 黑白灰：重點色用近白 */
  --btn-a: #2d323c; --btn-b: #474f5d; --btn-text: #eceff4;  /* 按鈕：炭灰（黑色主題） */
  --glow-rgb: 255, 255, 255;
  color-scheme: dark;
}
:root[data-theme="dark"] {
  --surface-rgb: 24, 28, 37; --bg-rgb: 15, 18, 24; --soft-rgb: 37, 43, 54; --snow-rgb: 255, 255, 255;
  --bg: #0f1218; --surface: #181c25; --text: #eceff4; --muted: #9aa3b2; --line: #2a303c;
  --accent: #eef1f6; --accent-soft: #252b36; --accent2: #98a1b0; --cold: #74c0fc; --win: #4cd387; --bad: #ff6b6b;  /* 黑白灰：重點色用近白 */
  --btn-a: #3a4457; --btn-b: #5a6579; --btn-text: #f1f4f9;  /* 按鈕：石板灰藍（深色主題） */
  --glow-rgb: 255, 255, 255;
  color-scheme: dark;
}
/* 藏青（代號 winter）：深藍夜色底、冰藍重點色 */
:root[data-theme="winter"] {
  --surface-rgb: 18, 32, 54; --bg-rgb: 10, 20, 36; --soft-rgb: 25, 50, 79; --snow-rgb: 255, 255, 255;
  --bg: #0a1424; --surface: #122036; --text: #eaf3ff; --muted: #9db2c9; --line: #25405f;
  --accent: #9ad4ff; --accent-soft: #19324f; --accent2: #5fa8dd; --cold: #8fd3ff; --win: #5fdb9a; --bad: #ff8080;
  --btn-a: #2c4a6e; --btn-b: #4a76a6; --btn-text: #f1f8ff;  /* 按鈕：冰湖藍 */
  --glow-rgb: 154, 212, 255;
  color-scheme: dark;
}
:root[data-theme="winter"] .home-main { border-color: var(--accent2); }
/* 特效一律會動，不看系統的「減少動態效果」設定（2026-11-29 決定）；不想看的人按標題右上角的特效開關。
   下雪背景（所有主題都有；theme.js 只放空元素）：固定鋪滿畫面、在內容後面、不擋點擊。雪的顏色是各主題的 --snow-rgb；
   卡片幾乎不透明（透明度在下面的 --card-alpha，1 = 完全不透明），特效主要從卡片之間的空隙看到，卡片裡只透出很淡一點。
   電腦版每層是一塊重複拼貼的雪花，整層用 transform 往下移一塊的高度再接回原位；transform 動畫交給繪圖晶片跑，不逐格重畫，手機才順 */
#snow { position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; z-index: 0; }
:root[data-theme="winter"] #snow { background: linear-gradient(180deg, #071020 0%, #0a1424 45%, #112442 100%); }
#snow i { position: absolute; left: -24px; right: -24px; bottom: 0; background-repeat: repeat; will-change: transform; }
#snow i:nth-child(1) { top: -220px; background-size: 220px 220px; background-image: radial-gradient(circle 1.6px at 23px 31px, rgba(var(--snow-rgb), 0.65) 0 55%, transparent 100%), radial-gradient(circle 1.6px at 141px 12px, rgba(var(--snow-rgb), 0.65) 0 55%, transparent 100%), radial-gradient(circle 1.6px at 188px 97px, rgba(var(--snow-rgb), 0.65) 0 55%, transparent 100%), radial-gradient(circle 1.6px at 62px 128px, rgba(var(--snow-rgb), 0.65) 0 55%, transparent 100%), radial-gradient(circle 1.6px at 113px 186px, rgba(var(--snow-rgb), 0.65) 0 55%, transparent 100%); animation: snow-1 17s linear infinite; }
#snow i:nth-child(2) { top: -300px; background-size: 300px 300px; background-image: radial-gradient(circle 2.4px at 48px 212px, rgba(var(--snow-rgb), 0.85) 0 55%, transparent 100%), radial-gradient(circle 2.4px at 172px 64px, rgba(var(--snow-rgb), 0.85) 0 55%, transparent 100%), radial-gradient(circle 2.4px at 265px 158px, rgba(var(--snow-rgb), 0.85) 0 55%, transparent 100%), radial-gradient(circle 2.4px at 121px 281px, rgba(var(--snow-rgb), 0.85) 0 55%, transparent 100%); animation: snow-2 14s linear infinite; }
#snow i:nth-child(3) { top: -420px; background-size: 420px 420px; background-image: radial-gradient(circle 3.4px at 96px 77px, rgba(var(--snow-rgb), 0.9) 0 55%, transparent 100%), radial-gradient(circle 3.4px at 331px 236px, rgba(var(--snow-rgb), 0.9) 0 55%, transparent 100%), radial-gradient(circle 3.4px at 187px 372px, rgba(var(--snow-rgb), 0.9) 0 55%, transparent 100%); animation: snow-3 12s linear infinite; }
@keyframes snow-1 { 0% { transform: translate3d(0, 0, 0); } 25% { transform: translate3d(8px, 55px, 0); } 50% { transform: translate3d(0, 110px, 0); } 75% { transform: translate3d(-8px, 165px, 0); } 100% { transform: translate3d(0, 220px, 0); } }
@keyframes snow-2 { 0% { transform: translate3d(0, 0, 0); } 25% { transform: translate3d(12px, 75px, 0); } 50% { transform: translate3d(0, 150px, 0); } 75% { transform: translate3d(-12px, 225px, 0); } 100% { transform: translate3d(0, 300px, 0); } }
@keyframes snow-3 { 0% { transform: translate3d(0, 0, 0); } 25% { transform: translate3d(18px, 105px, 0); } 50% { transform: translate3d(0, 210px, 0); } 75% { transform: translate3d(-18px, 315px, 0); } 100% { transform: translate3d(0, 420px, 0); } }
/* 粉色主題：不下雪，改飄櫻花花瓣（同一套三層、只移動圖層；花瓣是內嵌的 SVG 圖，左右飄得比雪大） */
:root[data-theme="pink"] #snow i { left: -60px; right: -60px; }
:root[data-theme="pink"] #snow i:nth-child(1) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(26 34) rotate(20) scale(0.45)' fill='%23f6a5c4' opacity='0.75'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(150 18) rotate(-55) scale(0.4)' fill='%23f8b8d0' opacity='0.7'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(196 104) rotate(110) scale(0.45)' fill='%23f290b5' opacity='0.7'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(60 126) rotate(200) scale(0.38)' fill='%23f8b8d0' opacity='0.75'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(118 188) rotate(-120) scale(0.45)' fill='%23f6a5c4' opacity='0.7'/%3E%3C/svg%3E"); animation: sakura-1 19s linear infinite; }
:root[data-theme="pink"] #snow i:nth-child(2) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(52 208) rotate(35) scale(0.7)' fill='%23f290b5' opacity='0.85'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(176 66) rotate(-40) scale(0.62)' fill='%23f6a5c4' opacity='0.9'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(262 160) rotate(150) scale(0.7)' fill='%23f77fab' opacity='0.8'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(120 276) rotate(-100) scale(0.6)' fill='%23f8b0cb' opacity='0.85'/%3E%3C/svg%3E"); animation: sakura-2 15s linear infinite; }
:root[data-theme="pink"] #snow i:nth-child(3) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(98 80) rotate(60) scale(1.0)' fill='%23f77fab' opacity='0.9'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(334 232) rotate(-30) scale(0.9)' fill='%23f290b5' opacity='0.9'/%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' transform='translate(196 360) rotate(135) scale(0.95)' fill='%23f6a5c4' opacity='0.9'/%3E%3C/svg%3E"); animation: sakura-3 13s linear infinite; }
@keyframes sakura-1 { 0% { transform: translate3d(0px, 0px, 0); } 12.5% { transform: translate3d(15px, 27.5px, 0); } 25% { transform: translate3d(22px, 55px, 0); } 37.5% { transform: translate3d(15px, 82.5px, 0); } 50% { transform: translate3d(0px, 110px, 0); } 62.5% { transform: translate3d(-15px, 137.5px, 0); } 75% { transform: translate3d(-22px, 165px, 0); } 87.5% { transform: translate3d(-15px, 192.5px, 0); } 100% { transform: translate3d(0px, 220px, 0); } }
@keyframes sakura-2 { 0% { transform: translate3d(0px, 0px, 0); } 12.5% { transform: translate3d(22px, 37.5px, 0); } 25% { transform: translate3d(32px, 75px, 0); } 37.5% { transform: translate3d(22px, 112.5px, 0); } 50% { transform: translate3d(0px, 150px, 0); } 62.5% { transform: translate3d(-22px, 187.5px, 0); } 75% { transform: translate3d(-32px, 225px, 0); } 87.5% { transform: translate3d(-22px, 262.5px, 0); } 100% { transform: translate3d(0px, 300px, 0); } }
@keyframes sakura-3 { 0% { transform: translate3d(0px, 0px, 0); } 12.5% { transform: translate3d(32px, 52.5px, 0); } 25% { transform: translate3d(46px, 105px, 0); } 37.5% { transform: translate3d(32px, 157.5px, 0); } 50% { transform: translate3d(0px, 210px, 0); } 62.5% { transform: translate3d(-32px, 262.5px, 0); } 75% { transform: translate3d(-46px, 315px, 0); } 87.5% { transform: translate3d(-32px, 367.5px, 0); } 100% { transform: translate3d(0px, 420px, 0); } }
/* 卡其主題：不下雪，改飄楓葉（做法和櫻花一樣） */
:root[data-theme="khaki"] #snow i { left: -60px; right: -60px; }
:root[data-theme="khaki"] #snow i:nth-child(1) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg transform='translate(40 44) rotate(25) scale(0.5)' opacity='0.7'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23c9772a'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/g%3E%3Cg transform='translate(158 160) rotate(-60) scale(0.45)' opacity='0.65'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23b4441f'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/g%3E%3C/svg%3E"); animation: maple-1 18s linear infinite; }
:root[data-theme="khaki"] #snow i:nth-child(2) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg transform='translate(70 214) rotate(40) scale(0.75)' opacity='0.85'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23c4501f'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/g%3E%3Cg transform='translate(224 74) rotate(-35) scale(0.68)' opacity='0.85'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23d98a24'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/g%3E%3C/svg%3E"); animation: maple-2 14s linear infinite; }
:root[data-theme="khaki"] #snow i:nth-child(3) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cg transform='translate(100 86) rotate(55) scale(1.15)' opacity='0.9'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23b8431c'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/g%3E%3Cg transform='translate(300 296) rotate(-35) scale(1.05)' opacity='0.9'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23d77f22'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/g%3E%3C/svg%3E"); animation: maple-3 12s linear infinite; }
@keyframes maple-1 { 0% { transform: translate3d(0px, 0px, 0); } 12.5% { transform: translate3d(17px, 27.5px, 0); } 25% { transform: translate3d(24px, 55px, 0); } 37.5% { transform: translate3d(17px, 82.5px, 0); } 50% { transform: translate3d(0px, 110px, 0); } 62.5% { transform: translate3d(-17px, 137.5px, 0); } 75% { transform: translate3d(-24px, 165px, 0); } 87.5% { transform: translate3d(-17px, 192.5px, 0); } 100% { transform: translate3d(0px, 220px, 0); } }
@keyframes maple-2 { 0% { transform: translate3d(0px, 0px, 0); } 12.5% { transform: translate3d(25px, 37.5px, 0); } 25% { transform: translate3d(36px, 75px, 0); } 37.5% { transform: translate3d(25px, 112.5px, 0); } 50% { transform: translate3d(0px, 150px, 0); } 62.5% { transform: translate3d(-25px, 187.5px, 0); } 75% { transform: translate3d(-36px, 225px, 0); } 87.5% { transform: translate3d(-25px, 262.5px, 0); } 100% { transform: translate3d(0px, 300px, 0); } }
@keyframes maple-3 { 0% { transform: translate3d(0px, 0px, 0); } 12.5% { transform: translate3d(36px, 52.5px, 0); } 25% { transform: translate3d(52px, 105px, 0); } 37.5% { transform: translate3d(36px, 157.5px, 0); } 50% { transform: translate3d(0px, 210px, 0); } 62.5% { transform: translate3d(-36px, 262.5px, 0); } 75% { transform: translate3d(-52px, 315px, 0); } 87.5% { transform: translate3d(-36px, 367.5px, 0); } 100% { transform: translate3d(0px, 420px, 0); } }
/* 淺藍主題：不下雪，改下細雨（細斜線往下落；整層傾斜 9 度，沿著傾斜方向移動一塊高度再接回原位） */
:root[data-theme="blue"] #snow i { left: -160px; right: -160px; bottom: -120px; }
:root[data-theme="blue"] #snow i:nth-child(1) { top: -360px; background-size: 150px 240px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='240'%3E%3Cpath d='M34 30v7' stroke='%235a9cda' stroke-width='0.7' stroke-linecap='round' opacity='0.35' fill='none'/%3E%3C/svg%3E"); animation: rain-1 1.7s linear infinite; }
:root[data-theme="blue"] #snow i:nth-child(2) { top: -450px; background-size: 210px 330px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='210' height='330'%3E%3Cpath d='M150 66v10' stroke='%234a8fd2' stroke-width='0.8' stroke-linecap='round' opacity='0.4' fill='none'/%3E%3Cpath d='M52 236v9' stroke='%236aa9e0' stroke-width='0.8' stroke-linecap='round' opacity='0.35' fill='none'/%3E%3C/svg%3E"); animation: rain-2 1.6s linear infinite; }
:root[data-theme="blue"] #snow i:nth-child(3) { top: -560px; background-size: 290px 440px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='290' height='440'%3E%3Cpath d='M210 150v13' stroke='%233f86cc' stroke-width='1' stroke-linecap='round' opacity='0.45' fill='none'/%3E%3C/svg%3E"); animation: rain-3 1.5s linear infinite; }
@keyframes rain-1 { from { transform: rotate(9deg) translate3d(0, 0, 0); } to { transform: rotate(9deg) translate3d(0, 240px, 0); } }
@keyframes rain-2 { from { transform: rotate(9deg) translate3d(0, 0, 0); } to { transform: rotate(9deg) translate3d(0, 330px, 0); } }
@keyframes rain-3 { from { transform: rotate(9deg) translate3d(0, 0, 0); } to { transform: rotate(9deg) translate3d(0, 440px, 0); } }
/* 藍綠主題：不下雪，改飄泡泡（唯一往上飄的；圖層多留下面一塊，往上移一塊的高度再接回原位） */
:root[data-theme="teal"] #snow i:nth-child(1) { top: 0; bottom: -230px; background-size: 230px 230px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='230' height='230'%3E%3Cg opacity='0.5'%3E%3Ccircle cx='34' cy='52' r='3.5' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='0.8'/%3E%3Ccircle cx='32.7' cy='50.7' r='0.8' fill='%23ffffff'/%3E%3C/g%3E%3Cg opacity='0.45'%3E%3Ccircle cx='158' cy='128' r='2.8' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='0.8'/%3E%3Ccircle cx='157.0' cy='127.0' r='0.7' fill='%23ffffff'/%3E%3C/g%3E%3Cg opacity='0.5'%3E%3Ccircle cx='96' cy='196' r='4' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='0.8'/%3E%3Ccircle cx='94.6' cy='194.6' r='1.0' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E"); animation: bubble-1 21s linear infinite; }
:root[data-theme="teal"] #snow i:nth-child(2) { top: 0; bottom: -320px; background-size: 320px 320px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg opacity='0.6'%3E%3Ccircle cx='64' cy='232' r='6.5' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='0.8'/%3E%3Ccircle cx='61.7' cy='229.7' r='1.6' fill='%23ffffff'/%3E%3C/g%3E%3Cg opacity='0.55'%3E%3Ccircle cx='204' cy='74' r='8' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='0.9'/%3E%3Ccircle cx='201.1' cy='71.1' r='1.9' fill='%23ffffff'/%3E%3C/g%3E%3Cg opacity='0.6'%3E%3Ccircle cx='272' cy='186' r='5.5' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='0.8'/%3E%3Ccircle cx='270.0' cy='184.0' r='1.3' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E"); animation: bubble-2 17s linear infinite; }
:root[data-theme="teal"] #snow i:nth-child(3) { top: 0; bottom: -440px; background-size: 440px 440px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='440' height='440'%3E%3Cg opacity='0.6'%3E%3Ccircle cx='110' cy='108' r='13' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='1.4'/%3E%3Ccircle cx='105.3' cy='103.3' r='3.1' fill='%23ffffff'/%3E%3C/g%3E%3Cg opacity='0.65'%3E%3Ccircle cx='324' cy='300' r='10' fill='%233fb8ae' fill-opacity='.12' stroke='%231f8a85' stroke-width='1.1'/%3E%3Ccircle cx='320.4' cy='296.4' r='2.4' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E"); animation: bubble-3 14s linear infinite; }
@keyframes bubble-1 { 0% { transform: translate3d(0px, -0px, 0); } 12.5% { transform: translate3d(6px, -28.8px, 0); } 25% { transform: translate3d(9px, -57.5px, 0); } 37.5% { transform: translate3d(6px, -86.2px, 0); } 50% { transform: translate3d(0px, -115px, 0); } 62.5% { transform: translate3d(-6px, -143.8px, 0); } 75% { transform: translate3d(-9px, -172.5px, 0); } 87.5% { transform: translate3d(-6px, -201.2px, 0); } 100% { transform: translate3d(0px, -230px, 0); } }
@keyframes bubble-2 { 0% { transform: translate3d(0px, -0px, 0); } 12.5% { transform: translate3d(10px, -40px, 0); } 25% { transform: translate3d(15px, -80px, 0); } 37.5% { transform: translate3d(10px, -120px, 0); } 50% { transform: translate3d(0px, -160px, 0); } 62.5% { transform: translate3d(-10px, -200px, 0); } 75% { transform: translate3d(-15px, -240px, 0); } 87.5% { transform: translate3d(-10px, -280px, 0); } 100% { transform: translate3d(0px, -320px, 0); } }
@keyframes bubble-3 { 0% { transform: translate3d(0px, -0px, 0); } 12.5% { transform: translate3d(15px, -55px, 0); } 25% { transform: translate3d(22px, -110px, 0); } 37.5% { transform: translate3d(15px, -165px, 0); } 50% { transform: translate3d(0px, -220px, 0); } 62.5% { transform: translate3d(-15px, -275px, 0); } 75% { transform: translate3d(-22px, -330px, 0); } 87.5% { transform: translate3d(-15px, -385px, 0); } 100% { transform: translate3d(0px, -440px, 0); } }
:root[data-theme="white"] #snow { display: none; }  /* 白色主題：不放任何飄落動畫 */
/* 手機（窄畫面或觸控螢幕）：不用上面三張滿版圖層——每一格都要把三張「比整個螢幕還大」的半透明圖層疊起來，手機容易卡。
   改成幾十顆小圖案各自飄（theme.js 放的 <b>，分 s1 遠 / s2 中 / s3 近），要疊的面積少非常多；--x = 水平位置、--p = 起跑進度、--r = 花瓣和楓葉的角度 */
#snow b { display: none; }
@media (max-width: 719px), (pointer: coarse) {
  #snow { bottom: auto; height: 100vh; height: 100lvh; }  /* 高度固定用「網址列收起來時」的畫面高，網址列收放時特效不會跟著重排 */
  #snow i { display: none; }
  #snow b { display: block; position: absolute; top: -40px; left: calc(var(--x) * 100%); width: var(--size); height: var(--size); will-change: transform; animation: lite-drift var(--dur) linear infinite; animation-delay: calc(var(--p) * var(--dur) * -1); }
  #snow b::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; background: rgba(var(--snow-rgb), var(--a)); }
  #snow b.s1 { --size: 3px; --dur: 64s; --a: .65; }
  #snow b.s2 { --size: 4.5px; --dur: 42s; --a: .85; }
  #snow b.s3 { --size: 6.5px; --dur: 27s; --a: .9; }
  :root[data-theme="pink"] #snow b { animation-name: lite-drift-wide; }
  :root[data-theme="pink"] #snow b::before { border-radius: 0; transform: rotate(var(--r)); background: var(--img) center / contain no-repeat; opacity: .85; }
  :root[data-theme="pink"] #snow b.s1 { --size: 9px; --dur: 72s; --img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' fill='%23f8b8d0'/%3E%3C/svg%3E"); }
  :root[data-theme="pink"] #snow b.s2 { --size: 13px; --dur: 44s; --img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' fill='%23f6a5c4'/%3E%3C/svg%3E"); }
  :root[data-theme="pink"] #snow b.s3 { --size: 20px; --dur: 29s; --img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Cpath d='M0 10C-7 5-9-3-4.5-9L0-6L4.5-9C9-3 7 5 0 10Z' fill='%23f77fab'/%3E%3C/svg%3E"); }
  :root[data-theme="khaki"] #snow b { animation-name: lite-drift-wide; }
  :root[data-theme="khaki"] #snow b:nth-of-type(n+25) { display: none; }
  :root[data-theme="khaki"] #snow b::before { border-radius: 0; transform: rotate(var(--r)); background: var(--img) center / contain no-repeat; opacity: .85; }
  :root[data-theme="khaki"] #snow b.s1 { --size: 12px; --dur: 70s; --img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23c9772a'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/svg%3E"); }
  :root[data-theme="khaki"] #snow b.s2 { --size: 17px; --dur: 42s; --img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23d98a24'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/svg%3E"); }
  :root[data-theme="khaki"] #snow b.s3 { --size: 26px; --dur: 27s; --img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cpath d='M0-11L2-6.5L5-8L4-2L7.5-5L8.3-3L11.5-3.5L9.5 1L11 2.2L5.5 5.8L6.3 7.8L.7 6.8L.8 11.5L-.8 11.5L-.7 6.8L-6.3 7.8L-5.5 5.8L-11 2.2L-9.5 1L-11.5-3.5L-8.3-3L-7.5-5L-4-2L-5-8L-2-6.5Z' fill='%23b8431c'/%3E%3Cpath d='M0 8V-7M0 3L7-2.5M0 3L-7-2.5M0 5L5 5M0 5L-5 5' fill='none' stroke='%23fff2d8' stroke-opacity='.45' stroke-width='.6'/%3E%3C/svg%3E"); }
  :root[data-theme="teal"] #snow b { top: auto; bottom: -40px; animation-name: lite-rise; }
  :root[data-theme="teal"] #snow b:nth-of-type(n+31) { display: none; }
  :root[data-theme="teal"] #snow b::before { background: radial-gradient(circle at 32% 32%, #ffffff 0 10%, rgba(63, 184, 174, .12) 16%); border: 1px solid #1f8a85; opacity: .55; }
  :root[data-theme="teal"] #snow b.s1 { --size: 7px; --dur: 75s; }
  :root[data-theme="teal"] #snow b.s2 { --size: 13px; --dur: 47s; }
  :root[data-theme="teal"] #snow b.s3 { --size: 23px; --dur: 29s; }
  :root[data-theme="blue"] #snow b { left: calc(var(--x) * 135%); width: 1px; height: var(--size); animation-name: lite-rain; }
  :root[data-theme="blue"] #snow b:nth-of-type(n+22) { display: none; }
  :root[data-theme="blue"] #snow b::before { border-radius: 1px; transform: rotate(9deg); background: #4a8fd2; opacity: .42; }
  :root[data-theme="blue"] #snow b.s1 { --size: 7px; --dur: 6.4s; }
  :root[data-theme="blue"] #snow b.s2 { --size: 10px; --dur: 4.4s; }
  :root[data-theme="blue"] #snow b.s3 { --size: 13px; --dur: 3.1s; }
}
@keyframes lite-drift { 0% { transform: translate3d(0px, 0vh, 0); } 6.25% { transform: translate3d(10px, 6.75vh, 0); } 12.5% { transform: translate3d(14px, 13.5vh, 0); } 18.75% { transform: translate3d(10px, 20.25vh, 0); } 25% { transform: translate3d(0px, 27vh, 0); } 31.25% { transform: translate3d(-10px, 33.75vh, 0); } 37.5% { transform: translate3d(-14px, 40.5vh, 0); } 43.75% { transform: translate3d(-10px, 47.25vh, 0); } 50% { transform: translate3d(0px, 54vh, 0); } 56.25% { transform: translate3d(10px, 60.75vh, 0); } 62.5% { transform: translate3d(14px, 67.5vh, 0); } 68.75% { transform: translate3d(10px, 74.25vh, 0); } 75% { transform: translate3d(0px, 81vh, 0); } 81.25% { transform: translate3d(-10px, 87.75vh, 0); } 87.5% { transform: translate3d(-14px, 94.5vh, 0); } 93.75% { transform: translate3d(-10px, 101.25vh, 0); } 100% { transform: translate3d(0px, 108vh, 0); } }
@keyframes lite-drift-wide { 0% { transform: translate3d(0px, 0vh, 0); } 6.25% { transform: translate3d(23px, 6.75vh, 0); } 12.5% { transform: translate3d(32px, 13.5vh, 0); } 18.75% { transform: translate3d(23px, 20.25vh, 0); } 25% { transform: translate3d(0px, 27vh, 0); } 31.25% { transform: translate3d(-23px, 33.75vh, 0); } 37.5% { transform: translate3d(-32px, 40.5vh, 0); } 43.75% { transform: translate3d(-23px, 47.25vh, 0); } 50% { transform: translate3d(0px, 54vh, 0); } 56.25% { transform: translate3d(23px, 60.75vh, 0); } 62.5% { transform: translate3d(32px, 67.5vh, 0); } 68.75% { transform: translate3d(23px, 74.25vh, 0); } 75% { transform: translate3d(0px, 81vh, 0); } 81.25% { transform: translate3d(-23px, 87.75vh, 0); } 87.5% { transform: translate3d(-32px, 94.5vh, 0); } 93.75% { transform: translate3d(-23px, 101.25vh, 0); } 100% { transform: translate3d(0px, 108vh, 0); } }
@keyframes lite-rise { 0% { transform: translate3d(0px, -0vh, 0); } 6.25% { transform: translate3d(10px, -6.75vh, 0); } 12.5% { transform: translate3d(14px, -13.5vh, 0); } 18.75% { transform: translate3d(10px, -20.25vh, 0); } 25% { transform: translate3d(0px, -27vh, 0); } 31.25% { transform: translate3d(-10px, -33.75vh, 0); } 37.5% { transform: translate3d(-14px, -40.5vh, 0); } 43.75% { transform: translate3d(-10px, -47.25vh, 0); } 50% { transform: translate3d(0px, -54vh, 0); } 56.25% { transform: translate3d(10px, -60.75vh, 0); } 62.5% { transform: translate3d(14px, -67.5vh, 0); } 68.75% { transform: translate3d(10px, -74.25vh, 0); } 75% { transform: translate3d(0px, -81vh, 0); } 81.25% { transform: translate3d(-10px, -87.75vh, 0); } 87.5% { transform: translate3d(-14px, -94.5vh, 0); } 93.75% { transform: translate3d(-10px, -101.25vh, 0); } 100% { transform: translate3d(0px, -108vh, 0); } }
@keyframes lite-rain { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-17vh, 108vh, 0); } }

/* 主題選擇：標題下面一排四個小按鈕，每個前面一顆該主題底色的小圓點 */
.theme-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 22px; }
.theme-pick .tp-label { color: var(--muted); font-size: .85rem; margin-right: 2px; }
.tp-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: .82rem; color: var(--text);
  padding: 7px 10px 7px 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.tp-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tp-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 特效開關和中英切換：固定在標題右上角（八個主題按鈕自己一排） */
.hero { position: relative; }
.hero-tools { position: absolute; top: 4px; right: 0; display: inline-flex; gap: 6px; }
.fx-btn { font: inherit; font-size: .85rem; font-weight: 700; padding: 6px 12px; white-space: nowrap; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.fx-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.fx-btn:hover:not(:disabled) { border-color: var(--accent); }
.fx-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fx-btn:disabled { color: var(--muted); border-color: var(--line); opacity: .6; cursor: default; }  /* 白色主題沒有特效 */
:root[data-fx-off] #snow i, :root[data-fx-off] #snow b { display: none; }  /* 特效關掉：飄落的圖層和小圖案整個不畫（藏青的深藍底色保留） */
.lang-btn { font: inherit; font-size: .85rem; font-weight: 700; padding: 6px 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 英文版「賽前預測比分」那句很長：標題自己一行，比分寫在下面 */
html[lang="en"] .ps-lbl, html[lang="en"] .h2h-rec { display: block; }  /* 交手紀錄標題的「幾勝幾敗」也換到下一行 */
/* 英文版手機：比分那一排（比分＋箭頭＋比分）要放得進中間欄、數據表的英文欄名要能換行，不然會疊字或撐出畫面 */
@media (max-width: 480px) {
  html[lang="en"] .gm-score { gap: 4px; }
  html[lang="en"] .gm-pts { font-size: 1.3rem; }  /* 即時比分中間是「Halftime」之類的字，三位數比分要小一點才放得下 */
  html[lang="en"] .gm-pts.pred { font-size: 1.05rem; }
  html[lang="en"] .stats td:nth-child(2), html[lang="en"] .stats th:nth-child(2) { white-space: normal; }
  html[lang="en"] .nb, html[lang="en"] .h2h-total .nw { white-space: normal; }  /* 警語、三季平均比分這些英文長句放不下就換行 */
  html[lang="en"] .tabs .tab { min-width: 0; white-space: normal; font-size: .8rem; line-height: 1.25; }  /* 「Custom matchup」放不下就換行 */
  html[lang="en"] .st-head { flex-wrap: wrap; }  /* 排名卡的分區按鈕放不下就換到標題下面 */
  html[lang="en"] .hero h1 { padding-right: 132px; font-size: 1.45rem; line-height: 1.25; }  /* 右上角兩顆按鈕的位置留給它們，「Game Predictor」放不下就分兩行 */
}
@media (max-width: 340px) {  /* 很窄的手機：中文警語也放不下要能換行；英文標題字再小一點 */
  .backrow .backrow-warn .nb { white-space: normal; }
  html[lang="en"] .hero h1 { font-size: 1.2rem; }
}
/* 英文隊名比較長：不要把字拆成「Clipper / s」，手機上字再小一點 */
html[lang="en"] .gm-name { overflow-wrap: break-word; }
@media (max-width: 480px) { html[lang="en"] .gm-name { font-size: .72rem; letter-spacing: -.01em; } html[lang="en"] .game { --gm-mid: 8.4rem; } html[lang="en"] .gm-row { grid-template-columns: minmax(0, 1fr) 8.4rem minmax(0, 1fr); } }  /* 中間欄縮窄一點，隊名欄才放得下 Mavericks */
.lang-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tp-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .55); }
@media (max-width: 719px) {  /* 手機和窄視窗：八個按鈕要擠在同一排，圓點改放在字的上面（按鈕變窄） */
  .theme-pick { gap: 4px; }
  .theme-pick .tp-label { margin-right: 0; font-size: .8rem; }
  .tp-btn { flex-direction: column; gap: 3px; font-size: .78rem; line-height: 1.1; padding: 6px 8px 5px; border-radius: 16px; }
  .tp-dot { width: 14px; height: 14px; }
}
@media (max-width: 500px) { .tp-btn { padding: 6px 5px 5px; } }
@media (max-width: 400px) {  /* 更窄的手機（360 寬）：拿掉「主題」兩個字、按鈕再縮一點，八個才擠得進同一排 */
  .theme-pick { gap: 3px; }
  .theme-pick .tp-label { display: none; }
  .tp-btn { padding: 6px 4px 5px; font-size: .74rem; border-radius: 14px; }
}
@media (max-width: 340px) { .tp-btn { padding: 6px 2px 5px; } }
.tp-btn[data-t="white"] .tp-dot { background: #ffffff; }
.tp-btn[data-t="khaki"] .tp-dot { background: #e9e4d4; }
.tp-btn[data-t="pink"] .tp-dot { background: #f7dbe5; }  /* 小圓點比實際底色再深一點點，才看得出是粉色 */
.tp-btn[data-t="teal"] .tp-dot { background: #c2e6e2; }
.tp-btn[data-t="blue"] .tp-dot { background: #cfe3f5; }
.tp-btn[data-t="dark"] .tp-dot { background: #181c25; }
.tp-btn[data-t="black"] .tp-dot { background: #06080b; }
.tp-btn[data-t="winter"] .tp-dot { background: #1b3a63; }  /* 藏青 */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  position: relative; z-index: 1;  /* 內容永遠蓋在雪上面 */
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.hero h1 { margin: 0 0 16px; font-size: 1.7rem; letter-spacing: .02em; }

.notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .9rem;
  margin-bottom: 20px;
}

/* 選隊 */
.picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
.side label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
select {
  width: 100%;
  font: inherit;
  padding: 11px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
select:focus-visible, .swap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.swap {
  font-size: 1.3rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.swap:hover { border-color: var(--accent); color: var(--accent); }

.hint { color: var(--accent); margin: 8px 0 0; }
.neutral-note { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }

/* 分頁：自選對戰 / 賽程 */
.tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.tab {
  flex: 1;
  font: inherit; font-weight: 600;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.tab { padding: 10px 4px; font-size: .92rem; white-space: nowrap; }  /* 四個分頁並排，手機上也放得下 */
/* 標題：左邊一條橘金色粗線，上面是小小的「NBA · 球季」，下面是大大的「對戰預測」 */
.hero { margin-bottom: 20px; }
.hero h1 {
  display: block; margin: 0; padding-left: 14px;
  border-left: 5px solid var(--accent);
  border-image: linear-gradient(180deg, var(--accent), var(--accent2)) 1;
  line-height: 1.15;
}
.hero .logo { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .3em; color: var(--accent); }
#page-title { display: block; margin-top: 3px; font-size: 2.05rem; font-weight: 900; letter-spacing: .06em; }

/* 首頁：三個大項目，賽程最大 */
.home { display: grid; gap: 14px; }
.home-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.home-row .home-card { text-align: center; display: flex; flex-direction: column; justify-content: center; }  /* 下面兩張小卡（自選對戰、準確率）：標題、說明、猜對場數都置中；兩張並排時高度一樣高，文字組在卡片裡上下也置中（自選對戰只有兩行，會往下移） */
.home-card {
  display: block;
  padding: 18px 16px;
  color: inherit; text-decoration: none;
  background: linear-gradient(160deg, rgba(var(--surface-rgb), var(--card-alpha)), rgba(var(--bg-rgb), var(--card-alpha)));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  transition: transform .15s, border-color .15s;
}
a.home-card:hover, a.home-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.home-main {
  padding: 22px 20px 20px;
  background: linear-gradient(135deg, rgba(var(--soft-rgb), var(--card-alpha)), rgba(var(--surface-rgb), var(--card-alpha)));
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(var(--glow-rgb, 232, 89, 12), .18);  /* 光暈顏色跟著主題的重點色走 */
}
.home-main { position: relative; }
.home-btns { position: absolute; top: 22px; right: 20px; display: flex; gap: 8px; }  /* 右上角的按鈕們：今日賽果、明日賽程 */
.home-result {
  padding: 7px 14px; white-space: nowrap; border-radius: 999px;
  font-size: .85rem; font-weight: 800; text-decoration: none;
  color: var(--btn-text, #1a1206);
  background: linear-gradient(90deg, var(--btn-a, var(--accent)), var(--btn-b, var(--accent2)));
  box-shadow: 0 3px 10px rgba(var(--glow-rgb, 232, 89, 12), .3);
  transition: transform .15s;
}
/* 黑白灰三個主題（白色、深色、黑色）：賽程大卡片跟下面其他卡片一樣，不要特別亮的邊框和光暈，按鈕也只留一點點陰影 */
:root[data-theme="white"] .home-main, :root[data-theme="dark"] .home-main, :root[data-theme="black"] .home-main {
  background: linear-gradient(160deg, rgba(var(--surface-rgb), var(--card-alpha)), rgba(var(--bg-rgb), var(--card-alpha))); border-color: var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
:root[data-theme="white"] .home-result, :root[data-theme="dark"] .home-result, :root[data-theme="black"] .home-result { box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
@media (prefers-color-scheme: dark) {  /* 沒選過主題、系統是深色 = 黑色主題，同樣處理 */
  :root:not([data-theme]) .home-main { background: linear-gradient(160deg, rgba(var(--surface-rgb), var(--card-alpha)), rgba(var(--bg-rgb), var(--card-alpha))); border-color: var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
  :root:not([data-theme]) .home-result { box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
}
@media (max-width: 420px) { .home-btns { top: 20px; right: 14px; gap: 6px; } .home-result { padding: 6px 10px; font-size: .78rem; } }  /* 手機：兩顆按鈕縮小，才不會貼到左邊的「賽程」 */
/* 英文版按鈕的字比較長，在手機會蓋到標題：改成不浮在右上角，排在標題上面一行、靠右 */
@media (max-width: 560px) { html[lang="en"] .home-btns { position: static; justify-content: flex-end; margin: 0 0 10px; } }
.home-result:hover, .home-result:focus-visible { transform: translateY(-1px); outline: 3px solid var(--accent); outline-offset: 2px; }
.home-link { display: block; color: inherit; text-decoration: none; }
/* 前面有 emoji 的標題（app.js 的 iconTitle、首頁的卡片）：文字在正中間，emoji 掛在左邊另外算 */
.t-mid { position: relative; display: inline-block; }
.t-ico { position: absolute; right: 100%; margin-right: .35em; white-space: nowrap; }
.home-main .t-ico { position: static; }  /* 最上面的賽程大卡是靠左排版，emoji 留在字的前面（掛出去會超出卡片） */
.home-title { display: block; font-size: 1.1rem; font-weight: 800; }
.home-main .home-title { font-size: 1.8rem; font-weight: 900; }
.home-desc { display: block; margin-top: 6px; color: var(--muted); font-size: .88rem; }
.home-main .home-desc { color: var(--accent); font-weight: 700; font-size: .95rem; }
.home-sub { display: block; margin-top: 10px; font-size: .9rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.home-games { margin-top: 14px; }
.home-games summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer; list-style: none;
  font-weight: 700; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.home-games summary::-webkit-details-marker { display: none; }
.home-games summary::after { content: "▾"; color: var(--accent); transition: transform .15s; }
.home-games[open] summary::after { transform: rotate(180deg); }
.home-games summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.home-games .game-list { margin-top: 10px; }
.gm-pts.pred { font-size: 1.3rem; }

/* 留言卡片（比賽頁）：輸入框 + 字數 / 送出 + 留言列表（新的在上面，匿名） */
.cm-form { margin-top: 2px; }
.cm-input { width: 100%; box-sizing: border-box; font: inherit; font-size: .95rem; padding: 10px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; resize: vertical; min-height: 4.2em; }
.cm-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cm-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.cm-count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.cm-send { font: inherit; font-weight: 700; padding: 6px 18px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.cm-send:hover { border-color: var(--accent); color: var(--accent); }
.cm-send:disabled { opacity: .5; cursor: default; }
.cm-msg { margin: 8px 0 0; text-align: center; color: var(--bad); font-weight: 600; font-size: .85rem; }
.cm-list { list-style: none; margin: 12px 0 0; padding: 0; }
.cm-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.cm-t { display: block; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.cm-m { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
/* 首頁交流區：更早的留言收在下拉選單裡 */
.cm-list .cm-older-li { padding: 0; }
.cm-older > summary { cursor: pointer; list-style: none; padding: 10px 0; text-align: center; color: var(--accent); font-weight: 700; font-size: .85rem; }
.cm-older > summary::-webkit-details-marker { display: none; }
.cm-older > summary::before { content: "▾ "; visibility: hidden; }  /* 左邊放看不見的箭頭，文字才會正中 */
.cm-older > summary::after { content: " ▾"; }
.cm-older[open] > summary::after { content: " ▴"; }
.cm-older > ul { list-style: none; margin: 0; padding: 0; }
.cm-older > ul > li { padding: 10px 0; border-top: 1px solid var(--line); }
.cm-list .cm-empty { text-align: center; color: var(--muted); font-size: .85rem; border-top: 0; }


/* 得分前三球員：左客隊、右主隊，同一排是同名次；每人四個數字（得分、籃板、助攻、+/-） */
.pl-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2px 0 6px; font-weight: 800; text-align: center; }
.pl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.pl-cell { min-width: 0; }
.pl-name { font-weight: 700; font-size: .9rem; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.pl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 6px; text-align: center; }
.pl-st b { display: block; font-size: .85rem; font-variant-numeric: tabular-nums; }
.pl-st span { display: block; color: var(--muted); font-size: .62rem; }
.pl-st b.pos { color: var(--win); }
.pl-st b.neg { color: var(--bad); }
.pl-st b.hot { color: var(--bad); }
.pl-nm { position: relative; display: inline-block; }  /* 球員名字：文字固定置中；大三元皇冠浮在名字旁邊（左邊那隊在左、右邊那隊在右），不推擠名字 */
.pl-crown { position: absolute; top: 50%; transform: translateY(-50%); font-size: .9em; line-height: 1; }
.pl-crown-l { right: 100%; margin-right: 4px; }
.pl-crown-r { left: 100%; margin-left: 4px; }  /* 單場得分 30 以上、籃板 / 助攻 10 以上：紅字 */
.pl-empty { color: var(--muted); text-align: center; }
.pl-note { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; text-align: center; }  /* 輪替陣容卡片最下面的小說明 */
.rp-row { padding: 9px 0; border-top: 1px solid var(--line); }  /* 本季輪替陣容球員：每人兩行（名字、七項數據） */
.rp-inj { margin-top: 3px; text-align: center; line-height: 1.2; }  /* 輪替陣容球員目前的傷病狀態：名字下面獨立一行，名字維持置中不被推歪 */
.rp-inj .inj-st { font-size: .66rem; padding: 0 7px; }
.rp-injd { margin-left: 6px; color: var(--muted); font-size: .68rem; }
.rp-stats { grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 5px; }
.rp-stats .pl-st b { font-size: .8rem; }
.rp-stats .pl-st span { font-size: .6rem; white-space: nowrap; }
@media (max-width: 340px) { .rp-stats .pl-st b { font-size: .74rem; } }

/* 傷病名單：先寫「沒參考傷病」，再一隊一段，缺陣紅色、每日觀察橘色 */
.inj-warn { margin: 2px 0 12px; text-align: center; color: var(--muted); font-size: .85rem; }
.inj-team { margin: 14px 0 6px; font-weight: 800; }
.inj-list { list-style: none; margin: 0; padding: 0; }
.inj-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.inj-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inj-pos { color: var(--muted); font-size: .75rem; }
.inj-st { padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); }
.inj-st.out { color: var(--bad); border-color: var(--bad); }
.inj-st.dtd { color: var(--accent); border-color: var(--accent); }
.inj-stat { margin-top: 2px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.inj-stat .inj-gp { color: var(--muted); font-size: .75rem; }
.inj-what { margin-top: 2px; color: var(--muted); font-size: .82rem; }
.inj-none { margin: 0; color: var(--muted); font-size: .85rem; }
.inj-note { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: .75rem; }

/* 首頁傷病名單：卡片本身是可展開的，裡面東西區切換 + 每隊一列（再點展開那隊的傷病） */
.inj-home summary { list-style: none; cursor: pointer; text-align: center; }
.inj-home summary::-webkit-details-marker { display: none; }
.inj-home > summary::after { content: "▾"; display: block; margin-top: 4px; color: var(--accent); transition: transform .15s; }
.inj-home[open] > summary::after { transform: rotate(180deg); }
.inj-home summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.inj-home-body { margin-top: 14px; text-align: left; }
.inj-home-body > .seg { display: flex; width: max-content; margin: 0 auto; }
.inj-t { border-top: 1px solid var(--line); }
.inj-t > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px; text-align: left; }
.inj-t > summary .st-team { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.inj-t > summary::after { content: "▾"; margin: 0; color: var(--accent); transition: transform .15s; }
.inj-t[open] > summary::after { transform: rotate(180deg); }
.inj-cnt { display: inline-flex; gap: 4px; margin-left: auto; }
.inj-t .inj-list { padding: 0 2px 8px; text-align: center; }
/* 首頁的球員列：左邊放狀態（缺陣 / 每日觀察），名字和位置維持在正中間 */
.inj-t .inj-who, .inj-card .inj-who { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.inj-t .inj-who .inj-st, .inj-card .inj-who .inj-st { order: -1; justify-self: start; white-space: nowrap; }
.inj-t .inj-who .inj-nm, .inj-card .inj-who .inj-nm { grid-column: 2; }
.inj-season { font-size: .75rem; font-weight: 700; color: var(--bad); white-space: nowrap; }
.inj-t .inj-who .inj-season, .inj-card .inj-who .inj-season { grid-column: 3; justify-self: end; }  /* 整季報銷註記放在最右邊 */
/* 比賽頁的傷病卡片：和首頁一樣置中（球隊名、球員、傷勢說明、沒有傷病的提示） */
.inj-card .inj-list, .inj-card .inj-none { text-align: center; }
/* 球隊名：和對戰記分板一樣，隊徽在上、隊名在下，置中 */
.inj-card .inj-team { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 20px 0 8px; }
.inj-card .inj-team .badge { display: inline-block; min-width: 56px; padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: .85rem; letter-spacing: .05em; text-align: center; }
.inj-card .inj-team .inj-tn { font-weight: 700; font-size: 1.05rem; }
.inj-t .inj-none { padding: 0 2px 10px; }

/* 排名 */
.standings { margin-bottom: 0; min-width: 0; }  /* 首頁是 grid：不加 min-width: 0，全聯盟那張寬表會把整張卡片和整個首頁撐寬 */
.st-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.st-head h2 { margin: 0; }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.seg-btn { font: inherit; font-size: .9rem; font-weight: 700; padding: 6px 18px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { color: var(--btn-text, #fff); background: linear-gradient(90deg, var(--btn-a, var(--accent)), var(--btn-b, var(--accent2))); }
.seg-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.st-table th, .st-table td { padding: 8px 4px; }
.st-table th:nth-child(2), .st-table td:nth-child(2) { text-align: left; }
.st-table td:first-child { color: var(--muted); width: 1.8em; }
.st-table td:nth-child(2) { white-space: nowrap; }
.st-table .st-team { display: flex; align-items: center; gap: 8px; font-weight: 700; }
/* 7～10 名（附加賽區間）：不上底色，只在第 6 與 7 名、第 10 與 11 名之間畫虛線 */
.st-table tr.st-cut td { border-bottom: 1px dashed var(--muted); }
.st-table tr.st-out td { background: rgba(0, 0, 0, .13); }  /* 11 名以後（淘汰區）：很淡的黑色底 */
:root[data-theme="dark"] .st-table tr.st-out td, :root[data-theme="black"] .st-table tr.st-out td { background: rgba(0, 0, 0, .28); }
:root[data-theme="dark"] .st-table .st-w { color: var(--win); font-weight: 800; }
.st-table .st-l { color: var(--bad); font-weight: 800; }
/* 全聯盟：欄位多，手機上整張表可以左右滑，球隊那一欄固定在左邊；欄位標題可以點（排序） */
.st-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-league { width: max-content; min-width: 100%; }  /* 照內容寬度排，不夠卡片寬就撐滿；太寬就在 .st-scroll 裡左右滑（球隊那欄不要被多餘寬度撐大） */
.st-league th, .st-league td { padding: 7px 5px; font-size: .85rem; white-space: nowrap; }
.st-hint { margin: 8px 0 0; color: var(--muted); font-size: .72rem; text-align: center; }
.st-league th:first-child, .st-league td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; color: var(--text); }
.st-league th:nth-child(2), .st-league td:nth-child(2) { text-align: center; }  /* 全聯盟第 2 欄是「勝」，不是球隊，不要靠左 */
.st-league .st-team { gap: 6px; }
.st-league .st-rk { min-width: 1.2em; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-league th.st-sort { cursor: pointer; user-select: none; }
.st-league th.st-sort.on { color: var(--text); }

/* 準確率頁 */
.acc-big { text-align: center; }
.acc-label { color: var(--muted); font-size: .85rem; }
.acc-num { margin: 4px 0; font-size: 2.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.acc-num small { margin-left: 8px; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.acc-note { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
#stats-page .card h2, #stats-page .acc-note { text-align: center; }
.acc-warn { text-align: center; font-weight: 700; color: var(--bad); }  /* 準確率頁最下面的警語 */
.nb { white-space: nowrap; }  /* 警語的每一段不斷行（手機上只在段與段之間換行） */
html[lang="en"] .nb1::after { content: " "; }  /* 英文翻譯會把結尾空格去掉，用這個補回段與段之間的空格 */
.foot-warn { font-weight: 700; color: var(--bad); }  /* 頁尾「數據來源與說明」最後一行的警語 */
body[data-view="stats"] .foot-warn, body[data-view="matchup"] .foot-warn { display: none; }  /* 準確率頁（警語卡）、對戰頁（最上面一排）已經有警語，頁尾不重複 */
.acc-details summary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; list-style: none; font-size: 1.05rem; font-weight: 700;
}
.acc-details summary::-webkit-details-marker { display: none; }
.acc-details summary::before { content: "▾"; visibility: hidden; }  /* 左邊放看不見的箭頭，文字才會正中 */
.acc-details summary::after { content: "▾"; color: var(--accent); transition: transform .15s; }
.acc-details[open] summary::after { transform: rotate(180deg); }
.acc-details summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.acc-details .acc-table { table-layout: fixed; }  /* 三欄固定寬，月份小計、每天、合計才會上下對齊 */
.acc-details .acc-table th:first-child { width: 44%; }
.acc-details .acc-table th:nth-child(2) { width: 30%; }
.acc-details .acc-month { margin-top: 8px; }
.acc-details .acc-month + .acc-month { margin-top: 0; border-top: 1px solid var(--line); }
.acc-details .acc-month > summary { display: grid; grid-template-columns: 44% 30% 26%; gap: 0; font-size: .92rem; font-variant-numeric: tabular-nums; text-align: center; }
.acc-details .acc-month > summary::before, .acc-details .acc-month > summary::after { content: none; }
.acc-month > summary > span { padding: 8px 6px; }
.acc-month > summary > span:first-child { text-align: left; white-space: nowrap; }
.acc-month > summary > span:first-child::before { content: "▸ "; color: var(--accent); }
.acc-month[open] > summary > span:first-child::before { content: "▾ "; }
.acc-details .acc-total { margin-top: 4px; }
.acc-total td { width: 26%; }
.acc-total td:first-child { width: 44%; }
.acc-total td:nth-child(2) { width: 30%; }
@media (max-width: 360px) { .acc-details .acc-month > summary { font-size: .85rem; } .acc-month > summary > span { padding-left: 2px; padding-right: 2px; } }  /* 很窄的手機（英文版）：月份名稱才不會貼到旁邊的數字 */
.acc-table td, .acc-table th { text-align: center; }
.acc-table td:first-child, .acc-table th:first-child { text-align: left; }
.acc-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line); }
.acc-table .muted { color: var(--muted); }
.tab:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, a.game:focus-visible, .back a:focus-visible,
.datebar input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* 賽程：選日期 + 當天的比賽 */
.datebar { display: flex; gap: 8px; align-items: center; }
.datebar input[type="date"] {
  flex: 1; min-width: 0;
  font: inherit;
  padding: 9px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color-scheme: inherit;  /* 跟著主題（白色/卡其 = 淺色、深色/黑色 = 深色），不是跟系統 */
}
.icon-btn {
  flex: none;
  width: 40px; height: 40px;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.chip {
  flex: none;
  font: inherit; font-size: .85rem;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.gamenav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.game-pos { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
#view-schedule .datebar { margin-bottom: 12px; }
.day-summary { margin: 16px 0 0; text-align: center; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.game {
  display: block;
  padding: 14px 14px 12px;
  color: inherit; text-decoration: none;
  background: rgba(var(--surface-rgb), var(--card-alpha));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
a.game:hover { border-color: var(--accent); }
.game.is-static { opacity: .78; }
/* 仿 NBA 官網：客隊在左、主隊在右，中間是開賽時間或比分 */
.gm-tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.game { --gm-mid: 11rem; --gm-gap: 8px; }  /* 中間欄寬度和欄距（和下面各個螢幕寬度的 .gm-row 同步）：「出賽成疑」要和球隊欄位對齊，用它們算出球隊欄寬 */
.gm-row { display: grid; grid-template-columns: minmax(0, 1fr) 11rem minmax(0, 1fr); align-items: center; gap: 8px; }  /* 中間欄固定寬度：不管顯示開賽時間、即時比分或最終比分，兩隊的位置每張卡都對齊 */
@media (max-width: 420px) { .game { --gm-mid: 9.5rem; } .gm-row { grid-template-columns: minmax(0, 1fr) 9.5rem minmax(0, 1fr); } .gm-score { gap: 10px; } }
.gm-team { min-width: 0; text-align: center; }
.gm-name { margin-top: 4px; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.gm-rec { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.gm-cup { color: var(--accent); font-size: .8rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }  /* NBA 盃戰績（盃賽卡片，本季戰績下面） */
.gm-topl { height: 19px; line-height: 19px; font-size: .7rem; font-weight: 700; color: var(--accent); white-space: nowrap; }  /* 隊徽上面的小行：連勝 / 連敗（每行固定 19px，兩隊的隊徽才對得齊） */
.gm-topl .cold { color: var(--cold); }
.gm-wp { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; position: relative; }  /* 預測勝率條：客隊% | 條 | 主隊%（信心下面） */
.gm-wc { color: var(--muted); font-size: .6rem; line-height: 1.2; text-align: center; margin-top: 1px; }  /* 勝率條下面的小字：賭盤勝率 / 模型勝率 */
.gm-wbar { display: flex; width: calc(var(--gm-mid) - 3.6rem); height: 5px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 1px; }
.gm-wbar > span { display: block; height: 100%; }
.gm-wbar > span:last-child { flex: 1; }
.gm-wn { color: var(--muted); font-size: .68rem; font-variant-numeric: tabular-nums; min-width: 2.1em; }
.gm-wn:first-child, .gm-wna { text-align: right; }
.gm-mid { min-width: 4.5em; text-align: center; }
.game-time { font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.gm-conf { margin-top: 5px; font-size: .95rem; position: relative; top: 11px; }  /* 賽程卡片：開賽時間下面的信心程度（置中靠 .gm-mid 的 text-align；top 只視覺下移，對齊兩側戰績那一行） */
.gm-mid:has(.gm-conf) .game-time { position: relative; top: 11px; }  /* 時間下面有信心時，整塊會被撐高、時間偏上：視覺下移，回到和沒有信心的卡片同樣的高度（兩側球隊那一欄的正中間） */
/* 中間欄有賭盤勝率條時：不用上面那個「視覺下移」，改成真的撐開、留足空間（不然條和小字會貼到下面的分隔線） */
.gm-mid:has(.gm-wp) .gm-conf { top: 0; margin-top: 7px; }
.gm-mid:has(.gm-wp) .game-time { top: 0; }
.gm-mid .gm-wp { margin-top: 1px; }  /* 勝率條的中心 = 戰績那一行的中心 */
.gm-mid .gm-wc { margin-top: 3px; font-size: .62rem; }
.gm-row:has(.gm-mid .gm-wp) { align-items: start; padding-top: 7px; padding-bottom: 0; }  /* 有賭盤勝率條的卡片：兩側隊徽欄和中間欄都從上緣開始排，下面的中間欄用 padding 對齊兩側 */
.gm-mid:has(.gm-wp) { padding-top: calc(27.5px + var(--gm-top, 0px)); }  /* 開賽時間的中心 = 隊名那一行的中心 */
@media (max-width: 600px) {  /* 手機：開賽時間放大、往上移一點，離賭盤勝率條遠一些（條仍然對齊戰績那一行） */
  .game-time { font-size: 2rem; }
  .gm-mid:has(.gm-wp) { padding-top: calc(12.4px + var(--gm-top, 0px)); }
  .gm-mid .gm-wp { margin-top: 8.9px; }
}
.game-pred .gm-wp { margin-top: 9px; }
.gm-conf-c { position: absolute; right: 0; bottom: 0; font-size: .85rem; line-height: 1.2; }  /* 信心：卡片右下角 */
.gm-an-c { position: absolute; left: 0; bottom: 0; font-size: 1rem; line-height: 1.2; }  /* 有賽前分析：卡片左下角的 📝 */
.game-pred:not(:has(.gm-wp)) .gm-an-c { position: static; display: block; margin-top: 4px; text-align: left; }  /* 沒有勝率條（只有一行字或沒有字）：自己一行，才不會疊在字上 */
.gm-upset { margin-right: 4px; cursor: help; }  /* 🚨 = 有機會倒打，放在信心字樣前面 */
@media (max-width: 360px) { .gm-upset { margin-right: 1px; font-size: .7rem; } }  /* 很窄的手機（英文版）：圖示縮小，才不會貼到勝率條下面的小字 */
.gm-conf-mid { position: relative; display: inline-block; }  /* 首頁卡片：信心字樣在正中間（有沒有 🚨 都一樣） */
.gm-conf-mid .gm-upset { position: absolute; right: 100%; }
.game-pred .gm-wc { margin-top: 3px; font-size: .62rem; }
.gm-sub { color: var(--muted); font-size: .75rem; }
.gm-sub.live { color: var(--accent); font-weight: 600; }
.gm-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }  /* gap：比分和中間「箭頭＋已完賽」的距離（電腦、一般手機；很窄的手機在下面改小） */  /* 兩邊比分各佔一半寬，中間的「已完賽」才會永遠在正中央（119 和 80 位數不同也一樣） */
.gm-score > :first-child { text-align: right; white-space: nowrap; }
.gm-score > :last-child { text-align: left; white-space: nowrap; }
.gm-pts { font-size: 1.8rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .gm-pts { font-size: 1.45rem; } .gm-pts.pred { font-size: 1.15rem; } }  /* 手機：三位數比分（119）才放得進中間欄，不會貼到隊名 */
@media (max-width: 360px) {  /* 更窄的手機：中間欄、比分、隊名再縮一點，四個字的隊名（塞爾提克）才不會斷成兩行 */
  .game { --gm-mid: 8.5rem; --gm-gap: 4px; }
  .gm-row { grid-template-columns: minmax(0, 1fr) 8.5rem minmax(0, 1fr); gap: 4px; }
  .gm-score { gap: 6px; }
  .gm-pts { font-size: 1.3rem; }
  .gm-pts.pred { font-size: 1.05rem; }
  .gm-name { font-size: .85rem; }
}
.gm-pts.win { color: var(--text); }
.gm-pts.lose { color: var(--muted); font-weight: 600; }
.gm-final { color: var(--muted); font-size: .72rem; line-height: 1.3; text-align: center; white-space: nowrap; }
.gm-final b { display: block; color: var(--text); font-size: .9rem; }
.gm-final.live { color: var(--accent); font-weight: 700; }  /* 即時比分：第幾節、剩餘時間用主色 */
.gm-final.live b { color: var(--accent); }
/* 已完賽卡片最上面一列：有標籤 = 左邊標籤、右邊預測正確/失敗；沒標籤 = 預測正確/失敗置中 */
.game { position: relative; }
.gm-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.gm-head-l { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.gm-res { margin-left: auto; font-size: .85rem; white-space: nowrap; }
.gm-head.solo { justify-content: center; }  /* 沒有標籤：預測正確/失敗置中 */
.gm-head.solo .gm-head-l { display: none; }
.gm-head.solo .gm-res { margin-left: 0; }
.mini-badge {
  display: inline-block;
  min-width: 42px; padding: 1px 8px;
  border-radius: 6px;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-align: center;
}
.mini-badge.tbd { color: var(--muted); background: var(--line); }
.game-tag { padding: 1px 8px; font-size: .72rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; }
.game-pred { position: relative; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); text-align: center; }
.game-empty { padding: 28px 0; text-align: center; color: var(--muted); }
.game-empty p { margin: 0 0 12px; }
.ok { color: var(--win); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.backrow { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.backrow .back { margin: 0; flex: none; }
.backrow-warn { margin: 0; min-width: 0; flex: 1; text-align: center; font-size: .78rem; font-weight: 700; color: var(--bad); line-height: 1.4; }  /* 對戰頁：警語放在「回到賽程」右邊、在剩下的空間裡置中 */
@media (min-width: 640px) {  /* 寬螢幕：警語在整排正中間（和下面「第 1 / 6 場」同一條中線），「回到賽程」靠左；窄螢幕才退回「右邊剩下的空間裡置中」 */
  .backrow { display: grid; grid-template-columns: 1fr auto 1fr; }
  .backrow .back { grid-column: 1; }
  .backrow-warn { grid-column: 2; flex: none; max-width: 15rem; }  /* 最寬 15rem，英文比較長就換成兩行 */
}
.back { margin: 0 0 12px; font-size: .9rem; }
.back a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* 結果 */
.result { margin-top: 16px; }
.card {
  background: rgba(var(--surface-rgb), var(--card-alpha));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }

.board-title {
  display: flex; justify-content: center; align-items: center;
  font-size: .85rem; color: var(--muted); margin-bottom: 12px;
}
.tag {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 2px 10px; font-weight: 600;
}
.board-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.vs { color: var(--muted); font-size: 1.2rem; }
.team .badge {
  display: inline-block;
  min-width: 56px;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  letter-spacing: .05em;
}
.team .streak { min-height: 1.4em; margin-bottom: 4px; color: var(--accent); font-size: .85rem; font-weight: 700; }
.team .streak .cold { color: var(--cold); }
.team .name { margin-top: 4px; font-weight: 600; }
.team .role { font-size: .75rem; color: var(--muted); }
.team .score { font-size: 3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.team.winner .score { color: var(--win); }
.team:not(.winner) .score { color: var(--muted); }
.margin { text-align: center; margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.h2h {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center; font-size: .9rem;
}
/* 已完賽的固定頁面：這張卡只留交手紀錄（上面已經有實際比分和賽前預測） */
.card.board.only-h2h > :not(.h2h) { display: none; }
.card.board.only-h2h > .h2h { margin-top: 0; padding-top: 0; border-top: 0; }
.alt {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center; font-size: .9rem;
}
.alt-title { font-weight: 600; margin-bottom: 4px; }
.alt-line { font-variant-numeric: tabular-nums; }
/* 預測信心：高 = 綠、中 = 橘、低 = 紅 */
.conf { font-weight: 700; }
.conf-high { color: var(--win); }
.conf-mid { color: var(--accent); }
/* 淺色主題的重點色當小字對比不到 4.5（看不清楚），「中信心」改用同色系深一點的顏色 */
:root[data-theme="khaki"] .conf-mid { color: #7b6120; }
:root[data-theme="pink"] .conf-mid { color: #b7426d; }
:root[data-theme="teal"] .conf-mid { color: #1b7975; }
:root[data-theme="blue"] .conf-mid { color: #2770b1; }
@media (not (prefers-color-scheme: dark)) { :root:not([data-theme]) .conf-mid { color: #7b6120; } }
.conf-low { color: var(--bad); }
.alt-line .conf { font-size: 1.1rem; }
.h2h-block + .h2h-block { margin-top: 10px; }
.h2h-pick { margin-bottom: 8px; }
.h2h-pick select { width: auto; min-width: 11rem; font-size: .9rem; padding: 6px 10px; }  /* 交手紀錄的球季下拉選單 */
.h2h-none { color: var(--muted); padding: 6px 0; }
.h2h-total .nw { white-space: nowrap; }
.h2h-total { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-weight: 600; font-size: .85rem; }  /* 交手紀錄最下面一行：統計三季幾勝幾敗 */
.h2h-title { font-weight: 600; margin-bottom: 4px; }
.h2h-game { color: var(--muted); font-variant-numeric: tabular-nums; }
.h2h-win { color: var(--text); font-weight: 700; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { text-align: left; }
.stats td:nth-child(2), .stats th:nth-child(2) { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.rate { display: block; font-size: .78rem; color: var(--muted); }
.rate.rate-cup { color: var(--accent); font-weight: 700; }  /* 比賽頁本季戰績下面的 NBA 盃戰績 */
.stats .sv { position: relative; display: inline-block; width: 2.9rem; text-align: center; }  /* 數字固定置中、每一格一樣寬；星星浮在這個框的左邊 / 右邊，所以每一列的星星也在同一個位置 */
.best { position: absolute; top: 50%; transform: translateY(-50%); font-size: .85em; line-height: 1; }
.best-l { right: 100%; margin-right: 4px; }
.best-r { left: 100%; margin-left: 4px; }
.trend { position: absolute; top: 50%; transform: translateY(-50%); font-size: .8em; line-height: 1; }  /* 近 5 場比近 10 場變好 ▲ / 變差 ▼，浮在數字旁（和星星不同邊） */
.trend-up { color: var(--bad); }  /* 變好 = 紅色向上三角形 */
.trend-down { color: var(--win); }  /* 變差 = 綠色向下三角形 */
.trend-l { right: 100%; margin-right: 4px; }
.trend-r { left: 100%; margin-left: 4px; }
@media (max-width: 480px) { .stats td:first-child, .stats th:first-child, .stats td:last-child, .stats th:last-child { width: 5.2rem; } }  /* 手機：兩邊欄位留夠寬，星星才不會跑到卡片外面 */
.stats td.adv { font-weight: 700; }  /* 數據對照：較優的一邊用粗體 */
.row-note { display: block; font-size: .72rem; }
.stats td:first-child, .stats th:first-child, .stats td:last-child, .stats th:last-child { text-align: center; }

/* 已完賽的固定頁面：賽前預測 / 比分 / 信心，三行置中 */
.pre-board { text-align: center; }
.pre-title { color: var(--muted); font-size: .85rem; font-weight: 600; }
.pre-score { margin: 4px 0; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pre-conf .conf { font-size: 1.1rem; }
/* 各節得分表（放在已完賽比分下面） */
.final-q { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.q-table td, .q-table th { padding: 6px 4px; }
.q-table th:first-child, .q-table td:first-child { text-align: left; }
.q-table .q-team { color: inherit; font-size: .88rem; font-weight: 700; white-space: nowrap; }
.q-table .q-win { font-weight: 800; }
.q-table .q-total { font-weight: 800; }
.q-table tbody td:not(.q-win):not(.q-total) { color: var(--muted); }
.odds-picks { display: grid; grid-template-columns: auto auto auto; justify-content: center; column-gap: 12px; font-size: .95rem; line-height: 1.8; font-variant-numeric: tabular-nums; }  /* 賭盤結果：球隊 | 內容 | 對錯，三欄格線，每行一樣寬 */
.odds-picks .op-n { text-align: left; }
.odds-picks .op-v { text-align: center; }
.odds-picks .op-m { text-align: center; }
.ot-details > summary { cursor: pointer; font-weight: 700; text-align: center; list-style: none; padding: 2px 0; }  /* 開盤 / 收盤賠率：折疊（點開才看到表格） */
.fold[open] > summary { margin-bottom: 12px; }  /* 折疊卡片：展開後標題和內容之間留空 */
.ot-details > summary::-webkit-details-marker { display: none; }
.ot-details > summary::after { content: " ▾"; color: var(--muted); }
.ot-details > summary::before { content: "▾ "; visibility: hidden; }  /* 左邊放一個看不見、跟右邊箭頭一樣寬的字，標題文字才會真的置中（箭頭不會把字推向左） */
.ot-details[open] > summary::after { content: " ▴"; }
.ot-g { margin-top: 12px; font-variant-numeric: tabular-nums; }  /* 開盤 / 收盤：三欄（隊 | 開盤 | 收盤），每個盤口一小節，數字固定寬度、上下對齊 */
.ot-h, .ot-r { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; column-gap: 8px; }  /* 三等分：隊名 | 初始 | 最終；中間那欄（初始）剛好在卡片正中間，和上面「賭盤變化」標題對齊 */
.ot-h { padding-bottom: 6px; color: var(--muted); font-size: .8rem; font-weight: 600; text-align: center; }
.ot-sec { margin-top: 12px; padding-left: 8px; border-left: 3px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; }
.ot-r { padding: 5px 0; font-size: .92rem; }
.ot-t { font-weight: 700; text-align: left; white-space: nowrap; }
.ot-cell { display: flex; justify-content: center; align-items: baseline; gap: 8px; padding: 3px 0; border-radius: 8px; white-space: nowrap; }
.ot-cell .ot-ln { min-width: 3.6em; text-align: right; font-weight: 600; font-style: normal; }
.ot-cell .ot-od { min-width: 2.6em; text-align: left; color: var(--muted); font-style: normal; }
.ot-cell .ot-solo { min-width: 0; text-align: center; }
.ot-cell .ot-od.ot-solo { color: var(--text); }
.ot-cell.ot-cl { font-weight: 700; }  /* 最終那一欄數字加粗（最準），沒有底色 */
.ot-cell.ot-cl .ot-ln, .ot-cell.ot-cl .ot-od { font-weight: 700; }
.ot-cell.ot-cl .ot-od { color: var(--text); }
@media (max-width: 360px) { .ot-h, .ot-r { column-gap: 4px; } .ot-cell { gap: 5px; } .ot-r { font-size: .86rem; } .ot-cell .ot-ln { min-width: 3.3em; } .ot-cell .ot-od { min-width: 2.4em; } }

/* 最近五場戰績（還沒開賽的比賽頁）：A / B 隊按鈕 + 每場一塊（日期、勝敗、對手、比分，下面是每一節的比分表） */
.rc-seg { display: flex; width: max-content; margin: 0 auto 10px; }
.rc-sum { margin: 0 0 4px; text-align: center; font-weight: 800; }
.rc-game { padding: 10px 0; border-top: 1px solid var(--line); }
.rc-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.rc-date { min-width: 2.8em; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.rc-res { font-weight: 800; }
.rc-w { color: var(--win); }
.rc-l { color: var(--bad); }
.rc-opp { flex: 1; min-width: 0; font-weight: 700; }
.rc-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-q { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .86rem; font-variant-numeric: tabular-nums; }
.rc-q th { padding: 2px 0; color: var(--muted); font-size: .75rem; font-weight: 600; text-align: center; }
.rc-q td { padding: 3px 0; color: var(--muted); text-align: center; }
.rc-q th:first-child, .rc-q td.rc-nm { width: 24%; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-q tr.rc-pr td { padding-top: 4px; font-size: .72rem; font-weight: 600; }  /* 最下面一列：我們當初的賽前預測比分，置中在各節欄位下面 */
.rc-q td.rc-nm { color: var(--text); font-weight: 700; }
.rc-q td.rc-hi { color: var(--text); font-weight: 800; }  /* 那一節得分比較高的那隊 */
.rc-q td.rc-tot { color: var(--text); font-weight: 800; }
.rc-q th:last-child { font-weight: 800; }
.ot-wr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; column-gap: 8px; padding: 5px 0; font-size: .92rem; }  /* 賭盤勝率條：標籤（初始 / 最終）| 客隊 % 條 主隊 % */
.ot-wl { font-weight: 700; }
@media (max-width: 360px) { .ot-wr { column-gap: 4px; } }  /* 窄螢幕：欄寬和上面的表格一樣（要放在 .ot-wr 的主規則後面才會生效） */
.ot-wp { display: flex; align-items: center; gap: 6px; min-width: 0; grid-column: 2 / 4; }  /* 勝率條佔「初始」「最終」兩欄的寬度 */
.ot-wp b { min-width: 2.4em; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: left; }
.ot-wp b:first-child { text-align: right; }
.ot-wbar { flex: 1; display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 1px; }
.ot-wbar > span { display: block; height: 100%; }
.ot-wbar > span:last-child { flex: 1; }
.ot-wlg .ot-wp { justify-content: space-between; font-size: .82rem; font-weight: 700; padding: 0 2px; }  /* 條上面標出左右各是哪一隊 */
.ot-upset { margin: 8px 0 0; text-align: center; font-size: .9rem; font-weight: 700; }  /* 「模型」勝率條下面置中：○○有機會倒打 */
.ot-note { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: .72rem; }
.odds-title { margin: 0 0 8px; text-align: center; font-weight: 700; }
.odds-msg { margin: 0; text-align: center; color: var(--muted); font-size: .9rem; }
.odds-note { margin: 4px 0 16px; text-align: center; color: var(--muted); font-size: .78rem; }
#odds-body td[colspan] { text-align: center; }

.foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 24px; }
.foot p { margin: 0; }  /* 小標題和內文同色同字級、中間不空行 */

[hidden] { display: none !important; }

@media (max-width: 480px) {
  .hero h1 { font-size: 1.65rem; }
  .team .score { font-size: 2.4rem; }
  .picker { grid-template-columns: 1fr 1fr; }
  .swap { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: 40px; height: 40px; }
}
#odds-card[hidden] ~ .odds-note { display: none; }  /* 沒有賭盤卡片時，下面的資料來源說明也不顯示 */

/* 賽前分析卡片（analysis.js 的手寫紀錄；比賽頁留言上面，預設收起） */
.an { margin-top: 12px; text-align: left; line-height: 1.65; }
.an-pick { display: flex; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.an-main { flex: 1; min-width: 0; padding: 10px 14px; }
.an-label { display: block; font-size: .75rem; font-weight: 700; color: var(--accent); }
.an-pick-text { display: block; font-size: 1.35rem; font-weight: 900; }
.an-res { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 68px; padding: 10px 12px; border-left: 1px dashed var(--accent); white-space: nowrap; }
.an-res-mark { font-size: 1.35rem; }
.an-h { margin: 16px 0 8px; font-weight: 800; }
.an-reasons { list-style: none; counter-reset: an; margin: 0; padding: 0; display: grid; gap: 12px; }
.an-reasons li { counter-increment: an; position: relative; padding-left: 34px; font-size: .94rem; }
.an-reasons li::before { content: counter(an); position: absolute; left: 0; top: 2px; display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); font-size: .78rem; font-weight: 800; }
.an-reasons b { display: block; }
.an-num { display: inline-block; }  /* 一組數字（116-96）整組換行；太長（連續好幾組總分）時還是能在裡面折行 */
.an-counter { margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 10px; font-size: .94rem; }
.an-counter b { display: block; color: var(--bad); }
