* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1C1F24; color: #F3F1EA;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif; user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; }
.panel { background: rgba(20, 24, 30, 0.72); border: 1px solid rgba(242, 194, 0, 0.35); border-radius: 8px;
  padding: 8px 12px; backdrop-filter: blur(3px); }

#tl { position: absolute; left: 14px; top: 14px; min-width: 150px; }
#tl .mode { font-size: 13px; color: #F2C200; letter-spacing: 2px; }
#tl .row { font-size: 22px; font-weight: bold; margin-top: 2px; }
#tl .row.small { font-size: 13px; font-weight: normal; color: #CFCBC0; }
#tl b { color: #fff; }

#tc { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); text-align: center; min-width: 320px; }
#tc .line1 { font-size: 18px; }
#tc .line1 b { color: #F2C200; }
#tc .line2 { font-size: 13px; color: #CFCBC0; margin-top: 2px; }
#tc .sep { margin: 0 8px; color: #777; }

#tr { position: absolute; right: 14px; top: 14px; width: 226px; display: flex; flex-direction: column; gap: 8px; }
.loss .cap { font-size: 12px; color: #CFCBC0; }
#lossTotal { font-size: 24px; font-weight: bold; color: #FF6B5A; }
.lossbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 4px; background: #333; }
#lossMine { background: #F2C200; width: 50%; transition: width 0.3s; }
#lossEnemy { background: #E0433A; width: 50%; transition: width 0.3s; }
.losslegend { display: flex; justify-content: space-between; font-size: 11px; margin-top: 3px; }
.losslegend .mine { color: #F2C200; }
.losslegend .enemy { color: #FF7A70; }
.minibox { padding: 6px; position: relative; }
#minimap { display: block; width: 200px; height: 160px; border-radius: 4px; }
#zoomBtn { position: absolute; right: 10px; bottom: 10px; pointer-events: auto; font: inherit; font-size: 12px;
  background: rgba(242, 194, 0, 0.9); color: #222; border: 0; border-radius: 4px; padding: 3px 8px; cursor: pointer; }

#pilot { position: absolute; left: 14px; bottom: 14px; width: 330px; display: flex; gap: 10px; align-items: center; }
#pilot .avatar { width: 72px; height: 72px; border-radius: 8px; background: linear-gradient(135deg, #F2C200, #C79A00);
  overflow: hidden; border: 2px solid #1F5A3A; flex: none; }
#pilot .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
#pilot .info { flex: 1; }
#pilot .pname { font-size: 16px; font-weight: bold; }
#pilot .ptitle { font-size: 11px; color: #CFCBC0; font-weight: normal; margin-left: 6px; }
#pilot .mname { font-size: 11px; color: #F2C200; margin-bottom: 4px; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-top: 3px; }
.stat .lbl { width: 28px; color: #CFCBC0; }
.stat .track { flex: 1; height: 9px; background: #333; border-radius: 4px; overflow: hidden; }
.stat .fill { height: 100%; width: 100%; transition: width 0.15s; }
.fill.hp { background: linear-gradient(90deg, #4CC864, #8BE07A); }
.fill.sh { background: linear-gradient(90deg, #3A9BE0, #8CCBFF); }
.fill.en { background: linear-gradient(90deg, #F2C200, #FFE36A); }
.stat .num { width: 74px; text-align: right; font-variant-numeric: tabular-nums; }

#skills { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 10px; }
.skill { position: relative; width: 74px; height: 74px; border-radius: 10px; background: rgba(20, 24, 30, 0.8);
  border: 2px solid #555; overflow: hidden; text-align: center; }
.skill.ready { border-color: #F2C200; }
.skill.ult.ready { border-color: #6CF08A; box-shadow: 0 0 14px #6CF08A; }
.skill .mask { position: absolute; left: 0; right: 0; top: 0; height: 0; background: rgba(0, 0, 0, 0.62); z-index: 2; }
.skill .icon { height: 46px; margin-top: 4px; }
.skill .icon img { height: 46px; width: 46px; object-fit: contain; display: block; margin: 0 auto; }
.skill .sname { font-size: 11px; margin-top: 2px; }
.skill .key { position: absolute; right: 4px; top: 2px; font-size: 12px; font-weight: bold; color: #F2C200; z-index: 3; }

#dialog { position: absolute; left: 14px; top: 42%; max-width: 330px; background: rgba(255, 255, 255, 0.94); color: #222;
  border-radius: 12px; padding: 10px 14px; border-left: 6px solid #F2C200; opacity: 0; transform: translateX(-20px);
  transition: opacity 0.25s, transform 0.25s; }
#dialog.show { opacity: 1; transform: translateX(0); }
#dialog .who { font-size: 12px; color: #1F5A3A; font-weight: bold; }
#dialogText { font-size: 16px; line-height: 1.45; }

#labels { position: absolute; inset: 0; overflow: hidden; }
.ebar { position: absolute; left: 0; top: 0; width: 90px; text-align: center; will-change: transform; }
.ebar .ename { font-size: 13px; font-weight: bold; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; white-space: nowrap; }
.ebar .etrack { height: 7px; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 4px; overflow: hidden; margin-top: 1px; }
.ebar .emark { display: block; width: 0; height: 0; margin: 3px auto 0; border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 12px solid #FF3A2E; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); animation: emark 0.8s ease-in-out infinite alternate; }
@keyframes emark { from { transform: translateY(0); } to { transform: translateY(4px); } }
.ebub { position: absolute; left: 50%; bottom: 100%; margin-bottom: 6px; transform: translateX(-50%) scale(0.6); opacity: 0;
  background: #fff; color: #222; font-size: 14px; font-weight: bold; padding: 5px 10px; border-radius: 12px; white-space: nowrap;
  border: 2px solid #2A2A2A; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); transition: opacity 0.2s, transform 0.2s; }
.ebub::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -7px; border: 7px solid transparent; border-top-color: #2A2A2A; }
.ebub.show { opacity: 1; transform: translateX(-50%) scale(1); }
.earrow { position: absolute; left: 0; top: 0; width: 0; height: 0; margin: -11px 0 0 -8px; border-top: 11px solid transparent; border-bottom: 11px solid transparent;
  border-left: 20px solid #FF3A2E; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9)); transform-origin: 8px 11px; }
.earrow.banyanKing, .earrow.bobaKing { border-left-color: #FF1A1A; border-top-width: 16px; border-bottom-width: 16px; border-left-width: 28px; margin-top: -16px; transform-origin: 8px 16px; }

#p1Tag { position: absolute; left: 0; top: 0; background: rgba(20, 24, 30, 0.85); color: #fff; font-size: 12px; padding: 2px 7px 2px 2px;
  border-radius: 4px; border: 1px solid #F2C200; white-space: nowrap; }
#p1Tag b { background: #F2C200; color: #1F2A22; padding: 0 5px; margin-right: 5px; border-radius: 3px; }

/* 新聞插播子畫面（右下） */
#news { position: absolute; right: 14px; bottom: 14px; width: min(340px, 27vw); background: #0E1A33; border: 2px solid #2E5BA8;
  border-radius: 6px; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); }
#news .nbar { display: flex; align-items: center; gap: 6px; background: linear-gradient(90deg, #12285A, #1B3E86); padding: 3px 4px 3px 0; font-size: 12px; }
#news .nflash { background: #E0281E; color: #fff; font-weight: bold; padding: 2px 8px; animation: nflash 1s steps(2) infinite; }
@keyframes nflash { 50% { background: #FF5A3A; } }
#news .ntitle { color: #FFD24A; font-weight: bold; font-size: 14px; letter-spacing: 1px; }
#news .nchan { color: #BFD3F5; margin-left: auto; font-size: 11px; }
#newsMin { pointer-events: auto; font: inherit; font-size: 11px; line-height: 1; background: rgba(255, 255, 255, 0.15); color: #fff; border: 0; border-radius: 3px; padding: 2px 6px; cursor: pointer; }
#news .nbody { position: relative; aspect-ratio: 3 / 2; background: #1B2B4A; }
#news .nbody img { display: block; width: 100%; height: 100%; object-fit: cover; }
#newsHead { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, rgba(180, 20, 20, 0.95), rgba(140, 16, 16, 0.92));
  color: #fff; font-weight: bold; font-size: 15px; line-height: 1.35; padding: 5px 8px; border-top: 2px solid #FFD24A; }
#newsHead.flash { animation: nhead 0.5s ease-out; }
@keyframes nhead { from { transform: translateX(-100%); } to { transform: translateX(0); } }
#news .ntick { display: flex; align-items: center; background: #F2F2F2; color: #142445; font-size: 12px; height: 20px; }
#newsClock { background: #142445; color: #FFD24A; font-weight: bold; padding: 0 6px; height: 100%; display: flex; align-items: center; flex: none; font-variant-numeric: tabular-nums; }
#news .ntrack { flex: 1; overflow: hidden; white-space: nowrap; }
#newsTickText { display: inline-block; padding-left: 100%; animation: ntick 22s linear infinite; }
@keyframes ntick { to { transform: translateX(-100%); } }
#news.min .nbody, #news.min .ntick { display: none; }
.ebar .efill { height: 100%; background: #FF4A4A; }
.ebar.banyan .efill { background: #4CC864; }
.ebar.papaya .efill, .ebar.zongzi .efill { background: #FF9A3A; }
.ebar.bear .efill { background: #FF7AB0; }

.float { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 22px; white-space: nowrap;
  -webkit-text-stroke: 1px rgba(40, 0, 0, 0.85); paint-order: stroke fill; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); animation: floatUp 1.8s ease-out forwards; }
.float.loss { color: #FF4A3A; font-size: 24px; }
.float.lossEnemy { color: #FF8A7A; font-size: 20px; }
.float.score { color: #FFE36A; }
.float.dmg { color: #fff; font-size: 16px; }
@keyframes floatUp {
  0% { opacity: 0; margin-top: 10px; }
  12% { opacity: 1; margin-top: 0; }
  100% { opacity: 0; margin-top: -70px; }
}

#nameTag { position: absolute; left: 0; top: 0; background: rgba(31, 90, 58, 0.9); color: #fff; padding: 3px 8px;
  border-radius: 4px; font-size: 13px; white-space: nowrap; border: 1px solid #F2C200; }

#banner { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(0.9); font-size: 40px; font-weight: bold;
  color: #F2C200; text-shadow: 0 3px 8px #000; opacity: 0; transition: opacity 0.3s, transform 0.3s; white-space: nowrap; }
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

#ultGlow { position: absolute; inset: 0; box-shadow: inset 0 0 120px 40px rgba(80, 240, 120, 0.75); opacity: 0; transition: opacity 0.3s; }
#ultGlow.on { opacity: 1; animation: pulse 0.5s infinite alternate; }
@keyframes pulse { from { box-shadow: inset 0 0 90px 30px rgba(80, 240, 120, 0.6); } to { box-shadow: inset 0 0 150px 50px rgba(80, 240, 120, 0.9); } }

#loading { position: fixed; inset: 0; background: rgba(12, 16, 26, 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#loading .lbox { width: min(520px, calc(100vw - 32px)); padding: 26px 32px 24px; text-align: center;
  background: linear-gradient(180deg, rgba(18, 34, 64, 0.97), rgba(10, 18, 38, 0.97));
  border: 1px solid rgba(242, 194, 0, 0.55);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 #F2C200, 0 12px 34px rgba(0, 0, 0, 0.7); }
#loading .ltitle { font-size: 34px; font-weight: bold; color: #F2C200; letter-spacing: 4px; margin-bottom: 12px; }
#loadingText { font-size: 16px; color: #F3F1EA; min-height: 24px; }
#loading .lbar { width: 100%; height: 14px; margin: 14px 0 6px; background: rgba(6, 12, 26, 0.85);
  border: 1px solid rgba(242, 194, 0, 0.5); overflow: hidden; transform: skewX(-16deg); }
#loadingFill { height: 100%; width: 0%; background: linear-gradient(90deg, #D9A400, #F2C200, #FFE36A); transition: width 0.16s ease-out; }
#loadingPct { font-size: 13px; font-weight: bold; color: #FFE36A; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
#loadingTip { margin-top: 14px; padding: 10px 14px; font-size: 13px; line-height: 1.55; color: #BFD3F5;
  background: rgba(6, 12, 26, 0.72); border-left: 3px solid #F2C200; text-align: left; }
#loadingTip:empty { display: none; }
#loadingErr { margin-top: 14px; }
#loadingErrMsg { font-size: 14px; color: #FF8A7A; line-height: 1.5; margin-bottom: 12px; word-break: break-word; }
#loading .lbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#loading .lbtns button { font: inherit; font-size: 16px; font-weight: bold; padding: 8px 24px; border-radius: 6px; border: 0;
  background: #F2C200; color: #1F2A22; cursor: pointer; box-shadow: 0 3px 0 #9A7A00; touch-action: manipulation; }
#loading .lbtns button:hover { background: #FFD633; }
#loading .lbtns button.alt { background: #2D6B48; color: #fff; box-shadow: 0 3px 0 #173B27; }
#loading .lbtns button.alt:hover { background: #3A8459; }
@media (max-height: 480px) {
  #loading .lbox { padding: 14px 20px 14px; }
  #loading .ltitle { font-size: 24px; margin-bottom: 6px; }
  #loadingTip { margin-top: 8px; padding: 6px 10px; font-size: 12px; }
}

.screen { position: fixed; inset: 0; background: rgba(12, 14, 18, 0.72); display: flex; align-items: center; justify-content: center; z-index: 10; }
.screen .box { background: rgba(24, 28, 34, 0.95); border: 2px solid #F2C200; border-radius: 14px; padding: 28px 36px; max-width: 640px; text-align: center; }
#title { background: #1C1F24 url("../assets/art/keyart.webp") center / cover no-repeat; }
#title .box { background: rgba(18, 22, 26, 0.86); max-width: 600px; padding: 18px 32px 24px; }
#title .logo { width: 260px; display: block; margin: -6px auto 0; }
#title h1 { font-size: 40px; }
.screen .box.small { padding: 20px 40px; }
.screen h1 { margin: 0; font-size: 46px; color: #F2C200; letter-spacing: 4px; }
.screen h2 { margin: 0 0 14px; color: #F2C200; }
.screen .sub { font-size: 14px; letter-spacing: 6px; color: #9BC8A8; margin-top: 4px; }
.story { margin: 18px 0; text-align: left; line-height: 1.7; font-size: 15px; color: #E6E2D8; }
.story p { margin: 4px 0; }
.screen button { font: inherit; font-size: 22px; font-weight: bold; padding: 10px 46px; border-radius: 10px; border: 0;
  background: #F2C200; color: #1F2A22; cursor: pointer; box-shadow: 0 4px 0 #9A7A00; }
.screen button:hover { background: #FFD633; }
.help { margin-top: 16px; font-size: 13px; color: #CFCBC0; line-height: 1.8; }
.help b { color: #F2C200; }
.help .warn { color: #FF8A7A; margin-top: 6px; }

/* 頭目血條（畫面上方，行政區面板下面） */
#boss { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); width: 520px; }
#boss .bname { display: flex; align-items: baseline; gap: 8px; font-size: 18px; text-shadow: 0 2px 4px #000; }
#boss .bname .tag { font-size: 12px; background: #E0433A; color: #fff; padding: 1px 6px; border-radius: 4px; }
#boss .bname b { color: #F2C200; }
#bossNum { margin-left: auto; font-size: 13px; color: #EDE9DF; font-variant-numeric: tabular-nums; }
#boss .btrack { height: 14px; margin-top: 4px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(242, 194, 0, 0.6); border-radius: 7px; overflow: hidden; }
#bossFill { height: 100%; width: 100%; background: linear-gradient(90deg, #2F6B2A, #6CC04A); transition: width 0.15s; }
#boss.boba #bossFill { background: linear-gradient(90deg, #8A5428, #E2B078); }
#boss.vuln #bossFill { background: linear-gradient(90deg, #E89A1A, #FFF07A); box-shadow: 0 0 12px rgba(255, 232, 106, 0.9); }

/* 結算畫面 */
.screen .box.result { max-width: 640px; min-width: 560px; padding: 22px 34px 20px; }
#rOutcome { font-size: 18px; font-weight: bold; letter-spacing: 3px; }
#rOutcome.win { color: #6CF08A; }
#rOutcome.lose { color: #FF7A70; }
.result .rcap { font-size: 12px; color: #9BC8A8; margin-top: 8px; letter-spacing: 2px; }
#rTitle { font-size: 40px; font-weight: bold; color: #F2C200; letter-spacing: 2px; line-height: 1.25; }
#rTitleSub { font-size: 15px; color: #E6E2D8; margin-top: 4px; }
#rQuote { margin: 12px auto 4px; max-width: 520px; background: rgba(255, 255, 255, 0.94); color: #222; border-left: 6px solid #F2C200;
  border-radius: 10px; padding: 8px 12px; font-size: 15px; text-align: left; line-height: 1.45; }
#rStats { margin: 10px 0 6px; }
#rStats .row { display: flex; justify-content: space-between; padding: 5px 4px; border-bottom: 1px solid #333; font-size: 15px; }
#rStats .row b { color: #fff; }
#rStats .row.mine b { color: #F2C200; }
#rStats .row.enemy b { color: #FF7A70; }
#rStats .row.total b { color: #FF5A4A; font-size: 20px; }
#rConv { font-size: 15px; color: #9BC8A8; margin: 8px 0 14px; }
.rbtns { display: flex; gap: 10px; justify-content: center; }
.screen .rbtns button { font-size: 17px; padding: 9px 20px; }
.screen .rbtns button.alt { background: #2D6B48; color: #fff; box-shadow: 0 4px 0 #173B27; }
.screen .rbtns button.alt:hover { background: #3A8459; }
#rToast { height: 18px; margin-top: 8px; font-size: 13px; color: #9FD8FF; }
.ebar.banyanKing .etrack, .ebar.bobaKing .etrack { display: none; }
.ebar.banyanKing .ename, .ebar.bobaKing .ename { font-size: 16px; color: #FFD24A; }
.ebar.banyanKing .emark, .ebar.bobaKing .emark { border-left-width: 13px; border-right-width: 13px; border-top-width: 18px; }
.ebar.bear .ename, .ebar.zongzi .ename { display: none; }   /* 小怪成群時名字會擠成一串，只留血條與標記 */

/* 介面統一風格（2026-11-09）：所有面板改成跟新聞插播同一套：深藍漸層底、細金框、上緣金色亮線、斜切右上角；
   技能四格收進同一個底座面板；駕駛員頭像加大 */
:root { --ui-bg: linear-gradient(180deg, rgba(18, 34, 64, 0.9), rgba(10, 18, 38, 0.9)); --ui-line: rgba(242, 194, 0, 0.55); --ui-gold: #F2C200; }
.panel, #skills, #news { background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 16px rgba(0, 0, 0, 0.45); }
#news { border-width: 1px; }
#news .nbar { background: linear-gradient(90deg, rgba(18, 40, 90, 0.95), rgba(27, 62, 134, 0.95)); }
#tl .mode, .loss .cap { color: var(--ui-gold); letter-spacing: 2px; font-size: 12px; }
#tc { padding: 6px 22px; }
#minimap { border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 0; }
#skills { padding: 8px 10px 6px; gap: 8px; bottom: 14px; }
.skill { background: rgba(6, 12, 26, 0.85); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 4px; }
.skill.ready { border-color: var(--ui-gold); box-shadow: inset 0 0 10px rgba(242, 194, 0, 0.35); }
.skill .key { background: var(--ui-gold); color: #1F2A22; border-radius: 3px; padding: 0 4px; right: 3px; top: 3px; font-size: 11px; }
#pilot { width: 360px; padding: 8px 12px 8px 8px; }
#pilot .avatar { width: 96px; height: 96px; border-radius: 0; border: 1px solid var(--ui-gold);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
#pilot .pname { font-size: 18px; }
.stat .track { background: rgba(0, 0, 0, 0.55); border-radius: 0; height: 10px; border: 1px solid rgba(255, 255, 255, 0.12);
  transform: skewX(-18deg); }
#dialog { background: var(--ui-bg); color: #F3F1EA; border: 1px solid var(--ui-line); border-left: 4px solid var(--ui-gold); border-radius: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
#dialog .who { color: var(--ui-gold); letter-spacing: 1px; }
#boss .btrack { border-radius: 0; transform: skewX(-18deg); }
#p1Tag, #nameTag { border-radius: 0; }
/* 技能列緊貼駕駛員面板右邊（對標做法），不再置中，窄螢幕才不會和駕駛員面板、新聞框疊在一起 */
#pilot { width: 330px; }
#pilot .avatar { width: 84px; height: 84px; }
#skills { left: 356px; transform: none; }

/* 配樂署名（2026-11-14） */
#title .credit { margin-top: 10px; font-size: 11px; opacity: 0.55; text-align: center; }

/* 深度與厚度（2026-11-16）：戰區選擇、波間整備、紀錄、成就提示、守護地標標記；沿用上面的統一主題（深藍漸層、細金框、斜切角） */
.screen .box.wide { max-width: min(1180px, calc(100vw - 32px)); width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 24px);
  overflow-y: auto; padding: 16px 22px 16px; background: linear-gradient(180deg, rgba(18, 34, 64, 0.97), rgba(10, 18, 38, 0.97));
  border: 1px solid var(--ui-line); border-radius: 0; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 10px 30px rgba(0, 0, 0, 0.6); }
.screen .box.wide h2 { margin: 0 0 4px; letter-spacing: 3px; }
.dsub { font-size: 13px; color: #BFD3F5; margin-bottom: 12px; }
.tbtns { display: flex; gap: 12px; justify-content: center; }
.screen button.alt { background: #2D6B48; color: #fff; box-shadow: 0 4px 0 #173B27; }
.screen button.alt:hover { background: #3A8459; }
.screen button:disabled { background: #555; color: #999; box-shadow: none; cursor: default; }
.kgrow b { color: #9BE07A !important; }
#kgNum.bump { animation: kgbump 0.35s ease-out; display: inline-block; }
@keyframes kgbump { 0% { transform: scale(1.5); color: #FFF36A; } 100% { transform: scale(1); } }

/* 戰區卡：桌面三欄兩列，窄螢幕兩欄 */
#dGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.dcard { position: relative; text-align: left; background: rgba(6, 12, 26, 0.85); border: 1px solid rgba(255, 255, 255, 0.18); cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); transition: transform 0.12s, border-color 0.12s; display: flex; flex-direction: column; }
.dcard:hover, .dcard:focus { border-color: var(--ui-gold); transform: translateY(-2px); box-shadow: inset 0 0 14px rgba(242, 194, 0, 0.25); outline: none; }
.dcard .art { height: clamp(70px, 15vh, 140px); background: linear-gradient(135deg, #1B3E86, #12285A); overflow: hidden; position: relative; }
.dcard .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcard .art.noimg img { display: none; }
.dcard .art .anum { position: absolute; left: 8px; top: 6px; background: var(--ui-gold); color: #1F2A22; font-weight: bold; font-size: 13px; padding: 0 6px; z-index: 2; }
.dcard .art.noimg::after { content: attr(data-name); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: bold; color: rgba(255, 255, 255, 0.18); letter-spacing: 6px; }
.dcard .dbody { padding: 8px 10px 10px; }
.dcard .dname { font-size: 19px; font-weight: bold; color: #fff; display: flex; align-items: baseline; gap: 8px; }
.dcard .dstars { margin-left: auto; color: var(--ui-gold); font-size: 16px; letter-spacing: 1px; }
.dstars .off, #rStars .off { color: rgba(255, 255, 255, 0.22); }
.dcard .dguard { font-size: 12px; color: #8CCBFF; margin-top: 2px; }
.dcard .dintro { font-size: 13px; color: #E6E2D8; margin-top: 5px; line-height: 1.45; }
.dcard .dbest { font-size: 11px; color: #9BC8A8; margin-top: 5px; }

/* 整備三選一 */
.dhead { display: flex; align-items: baseline; gap: 12px; }
.dkg { margin-left: auto; font-size: 16px; color: #CFCBC0; }
.dkg b { color: #9BE07A; font-size: 22px; }
#draftCards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ucard { position: relative; text-align: left; background: rgba(6, 12, 26, 0.88); border: 1px solid rgba(255, 255, 255, 0.2); cursor: pointer; padding: 0; font: inherit; color: inherit;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); display: flex; flex-direction: column; transition: transform 0.12s, border-color 0.12s; }
.ucard:hover, .ucard:focus { border-color: var(--ui-gold); transform: translateY(-3px); box-shadow: inset 0 0 18px rgba(242, 194, 0, 0.3); outline: none; }
.ucard .uart { height: clamp(90px, 24vh, 220px); background: radial-gradient(circle at 50% 40%, #24508F, #0C1A38); overflow: hidden; }
.ucard .uart img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ucard .uart.noimg { height: 40px; }
.ucard .uart.noimg img { display: none; }
.ucard .ubody { padding: 8px 12px 12px; }
.ucard .ukey { position: absolute; left: 8px; top: 8px; background: var(--ui-gold); color: #1F2A22; font-weight: bold; font-size: 15px; padding: 1px 8px; z-index: 2; }
.ucard .ulv { position: absolute; right: 16px; top: 8px; font-size: 12px; color: #fff; background: rgba(0, 0, 0, 0.55); border: 1px solid var(--ui-line); padding: 1px 6px; z-index: 2; }
.ucard .uname { font-size: 20px; font-weight: bold; color: var(--ui-gold); }
.ucard .udesc { font-size: 15px; color: #fff; margin-top: 4px; line-height: 1.4; }
.ucard .uflavor { font-size: 12px; color: #9BC8A8; margin-top: 6px; line-height: 1.4; }
.dfoot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
#draftOwned { flex: 1; text-align: left; font-size: 12px; color: #BFD3F5; line-height: 1.6; }
.chip { display: inline-block; background: rgba(242, 194, 0, 0.14); border: 1px solid rgba(242, 194, 0, 0.4); color: #F3F1EA; padding: 0 6px; margin: 0 4px 3px 0; font-size: 12px; }
.screen .dfoot button { font-size: 16px; padding: 8px 18px; white-space: nowrap; }

/* 紀錄頁 */
.recgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; }
.rechead { color: var(--ui-gold); font-size: 13px; letter-spacing: 2px; margin: 6px 0 6px; border-bottom: 1px solid rgba(242, 194, 0, 0.3); padding-bottom: 3px; }
.recrow { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 4px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.recrow .rn { width: 92px; color: #fff; font-weight: bold; flex: none; }
.recrow .rs { width: 52px; color: var(--ui-gold); flex: none; }
.recrow .rv { flex: 1; color: #CFCBC0; font-size: 12px; }
#recAch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ach { background: rgba(6, 12, 26, 0.8); border: 1px solid rgba(255, 255, 255, 0.12); padding: 5px 8px; font-size: 12px; color: #9AA3B5; }
.ach b { display: block; font-size: 14px; color: #6F7890; }
.ach.on { border-color: var(--ui-line); color: #E6E2D8; }
.ach.on b { color: var(--ui-gold); }
#recTitles { font-size: 12px; line-height: 1.8; }
#recTitles .chip.off { color: #6F7890; border-color: rgba(255, 255, 255, 0.12); background: none; }
#recTotals { font-size: 12px; color: #9BC8A8; margin: 10px 0; }

/* 成就提示（右上，小地圖下方；在所有畫面之上） */
#achv { position: fixed; right: 14px; top: 300px; width: 250px; z-index: 40; pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
.achtoast { background: linear-gradient(180deg, rgba(18, 34, 64, 0.96), rgba(10, 18, 38, 0.96)); border: 1px solid var(--ui-line); box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 16px rgba(0, 0, 0, 0.5);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); padding: 6px 10px; animation: achin 0.35s ease-out; }
.achtoast .cap { font-size: 11px; color: #9BC8A8; letter-spacing: 2px; }
.achtoast b { display: block; color: var(--ui-gold); font-size: 16px; }
.achtoast span { font-size: 12px; color: #E6E2D8; }
.achtoast.out { opacity: 0; transform: translateX(30px); transition: opacity 0.4s, transform 0.4s; }
@keyframes achin { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* 守護地標：藍色標記、名字、生命條；畫面外改藍色邊緣箭頭 */
#guard { position: absolute; left: 0; top: 0; width: 170px; text-align: center; will-change: transform; }
#guard .gname { font-size: 13px; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; white-space: nowrap; }
#guard .gtag { background: #2E7BE0; color: #fff; font-size: 11px; padding: 0 5px; margin-right: 4px; }
#guard .gtrack { height: 8px; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(140, 203, 255, 0.8); margin: 2px 10px 0; transform: skewX(-18deg); overflow: hidden; }
#guardFill { height: 100%; width: 100%; background: linear-gradient(90deg, #2E7BE0, #8CCBFF); transition: width 0.2s; }
#guard .gmark { display: block; width: 0; height: 0; margin: 3px auto 0; border-left: 11px solid transparent; border-right: 11px solid transparent;
  border-top: 15px solid #3A9BFF; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); animation: emark 0.8s ease-in-out infinite alternate; }
#guard.hit #guardFill { background: linear-gradient(90deg, #E0433A, #FF9A7A); }
#guard.down .gname b { text-decoration: line-through; color: #FF8A7A; }
#guardArrow { position: absolute; left: 0; top: 0; width: 0; height: 0; margin: -13px 0 0 -8px; border-top: 13px solid transparent; border-bottom: 13px solid transparent;
  border-left: 24px solid #3A9BFF; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9)); transform-origin: 8px 13px; }

/* 菁英怪：一律顯示名字（含扭蛋熊、肉粽怪），名字加詞綴前綴 */
.ebar.elite .ename, .ebar.bear.elite .ename, .ebar.zongzi.elite .ename { display: inline; color: #FFB84A; }
.ebar.elite .etrack { border-color: #FFB84A; }

/* 結算：戰區、星等、本局升級卡 */
#rDistrict { font-size: 13px; color: #8CCBFF; letter-spacing: 2px; }
#rStars { margin: 2px 0 0; font-size: 30px; color: var(--ui-gold); letter-spacing: 6px; line-height: 1.1; }
#rStars .conds { display: block; font-size: 12px; letter-spacing: 0; color: #8A93A6; margin-top: 2px; }
#rStars .conds i { font-style: normal; margin: 0 6px; }
#rStars .conds i.ok { color: #9BE07A; }
#rUpg { margin: -6px 0 12px; font-size: 12px; color: #BFD3F5; }
.screen .box.result { max-height: calc(100vh - 20px); overflow-y: auto; }
@media (max-height: 820px) {
  .screen .box.result { padding: 10px 26px 10px; }
  .result .rcap { margin-top: 2px; }
  #rTitle { font-size: 28px; }
  #rTitleSub { font-size: 13px; }
  #rQuote { margin: 5px auto 2px; padding: 4px 10px; font-size: 13px; }
  #rStats { margin: 4px 0 2px; }
  #rStats .row { padding: 2px 4px; font-size: 13px; }
  #rStats .row.total b { font-size: 17px; }
  #rConv { margin: 3px 0 8px; font-size: 13px; }
  #rStars { font-size: 22px; }
  .screen .rbtns button { font-size: 15px; padding: 7px 14px; }
}
@media (max-width: 900px) {
  #dGrid { grid-template-columns: repeat(2, 1fr); }
}
.float.heal { color: #8BE07A; font-size: 18px; }
/* 卡片是按鈕：蓋掉 .screen button 的黃底大字樣式 */
.screen button.ucard, .screen button.dcard { background: rgba(6, 12, 26, 0.88); padding: 0; font: inherit; font-size: 14px; font-weight: normal; color: #F3F1EA;
  border-radius: 0; box-shadow: none; }
.screen button.ucard:hover, .screen button.dcard:hover, .screen button.ucard:focus, .screen button.dcard:focus { background: rgba(14, 28, 58, 0.95); box-shadow: inset 0 0 18px rgba(242, 194, 0, 0.3); }
.dstars .off, .rs .off, #rStars .off { color: rgba(255, 255, 255, 0.22); }
/* 戰區卡（2026-11-16 正式圖 960×640）：圖加高，區名與星數疊在圖的下方三分之一 */
.dcard .art { height: clamp(96px, 21vh, 210px); }
.dcard .art img { object-position: 50% 62%; }
.dcard .art .dname { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; z-index: 2;
  background: linear-gradient(180deg, rgba(8, 14, 30, 0), rgba(8, 14, 30, 0.85) 55%); text-shadow: 0 1px 3px #000; }
.dcard .art.noimg .dname { background: none; }
.dcard .art.noimg::after { display: none; }
.dcard .art, .dcard .dbody, .ucard .uart, .ucard .ubody { width: 100%; align-self: stretch; }

/* 第二批怪（2026-11-17） */
.ebar.pineapple .efill { background: #F2B632; }
.ebar.shavedice .efill { background: #8FD8FF; }
.ebar.spintop .efill { background: #E8623A; }
.ebar.spintop .ename { display: none; }
.ebar.spintop.elite .ename { display: inline; color: #FFB84A; }

/* 擊倒明細（2026-11-18）：結算頁本局、紀錄頁累計 */
#rKills, #recKills { font-size: 12px; line-height: 1.9; text-align: left; }
#rKills { margin: 0 0 4px; text-align: center; }
.kchip { display: inline-block; white-space: nowrap; margin: 0 10px 0 0; color: #CFCBC0; }
.kchip i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; border: 1px solid rgba(255, 255, 255, 0.35); }
.kchip b { color: #fff; }
.kchip.off { color: #6F7890; }

/* 手把支援（2026-11-23）：選取框金色外框加發光（卡片有 clip-path，同時靠內框與 drop-shadow 顯現） */
.padsel, .screen button.padsel, .screen .rbtns button.padsel {
  border-color: #FFD633;
  outline: 2px solid #FFD633;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 2px #FFD633, inset 0 0 22px rgba(242, 194, 0, 0.45), 0 0 18px rgba(242, 194, 0, 0.8);
  filter: drop-shadow(0 0 10px rgba(242, 194, 0, 0.85));
}
.screen button.dcard.padsel, .screen button.ucard.padsel {
  background: rgba(18, 36, 74, 0.96);
  border-color: #FFD633;
  transform: translateY(-3px);
}
.help .padhelp { font-size: 12px; color: #BFD3F5; line-height: 1.55; margin-top: 2px; }

/* 連續收服連擊提示（2026-11-23）：畫面右側中間偏上，沿用深藍金框斜角介面；三段顏色分級、倒數閃爍、結算飄起淡出 */
#combo {
  position: absolute;
  right: 18px;
  top: clamp(296px, 34vh, 380px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
}
#combo.show { opacity: 1; visibility: visible; }
#combo.out { animation: comboOut 1.1s ease-out forwards; }
@keyframes comboOut {
  0% { opacity: 1; transform: translateY(0); }
  25% { opacity: 1; transform: translateY(-10px); }
  100% { opacity: 0; transform: translateY(-54px); }
}
#combo .cbox {
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 16px rgba(0, 0, 0, 0.5);
  padding: 8px 18px 8px 16px;
  text-align: right;
  min-width: 164px;
}
#combo .cmain {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font-weight: 900;
  line-height: 1.05;
  transform-origin: right center;
  text-shadow: 0 3px 8px #000;
}
#combo .cnum { font-size: 46px; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
#combo .clbl { font-size: 22px; letter-spacing: 2px; }
#combo .cmain.pop { animation: comboPop 0.18s ease-out; }
@keyframes comboPop {
  0% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
/* 3 到 5 連：白金色 */
#combo.tier1 .cnum { color: #FFF5CC; }
#combo.tier1 .clbl { color: var(--ui-gold); }
/* 6 到 9 連：橘色 */
#combo.tier2 .cbox { border-color: rgba(255, 154, 58, 0.75); box-shadow: inset 0 2px 0 #FF9A3A, 0 6px 16px rgba(0, 0, 0, 0.5); }
#combo.tier2 .cnum { color: #FFB84A; }
#combo.tier2 .clbl { color: #FF8C2A; }
/* 10 連以上：紅色加外發光（clip-path 用 drop-shadow 才不會被裁掉） */
#combo.tier3 { filter: drop-shadow(0 0 12px rgba(255, 68, 52, 0.85)); }
#combo.tier3 .cbox {
  border-color: rgba(255, 90, 74, 0.9);
  box-shadow: inset 0 2px 0 #FF4A3A, inset 0 0 18px rgba(255, 58, 46, 0.3), 0 6px 18px rgba(0, 0, 0, 0.55);
}
#combo.tier3 .cnum {
  color: #FF5A4A;
  text-shadow: 0 0 14px rgba(255, 74, 58, 0.95), 0 0 26px rgba(255, 42, 30, 0.7), 0 3px 8px #000;
}
#combo.tier3 .clbl {
  color: #FF7A70;
  text-shadow: 0 0 10px rgba(255, 74, 58, 0.8), 0 3px 8px #000;
}
/* 剩不到 0.8 秒：變淡閃爍提示快斷了 */
#combo.warn .cbox { animation: comboWarn 0.32s ease-in-out infinite alternate; }
@keyframes comboWarn {
  from { opacity: 0.9; }
  to { opacity: 0.3; }
}
/* 結算獎勵小字 */
#combo .creward { font-size: 16px; font-weight: bold; color: #9BE07A; margin-top: 2px; text-shadow: 0 2px 4px #000; letter-spacing: 1px; }
#combo .creward:empty { display: none; }

/* 加班模式（2026-11-23）：第五波準時下班按鈕、結算加班標題 */
#draftQuit { margin-top: 14px; font-size: 17px; padding: 9px 30px; background: #2D6B48; color: #fff; box-shadow: 0 4px 0 #173B27; }
#draftQuit:hover { background: #3A8459; }
#rOvertime { font-size: 28px; font-weight: bold; color: #F2C200; letter-spacing: 3px; margin: 2px 0; }
@media (max-height: 820px) {
  #rOvertime { font-size: 20px; }
}

/* 展示攤位閒置示範橫幅（2026-11-23）：畫面上方中間、半透明深藍金框斜切角、慢慢呼吸閃爍 */
#demoBanner {
  position: fixed;
  left: 50%;
  top: 78px;
  transform: translateX(-50%);
  z-index: 35;
  pointer-events: none;
  padding: 7px 26px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
  color: var(--ui-gold);
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(18, 34, 64, 0.78), rgba(10, 18, 38, 0.78));
  border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 16px rgba(0, 0, 0, 0.45);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  animation: demoPulse 2.4s ease-in-out infinite;
}
body:has(#boss:not(.hidden)) #demoBanner { top: 134px; }
@keyframes demoPulse {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.42; }
}

/* 手機觸控操作（2026-11-23）：非觸控桌機完全隱藏，沿用既有深藍金框視覺 */
.touch-only { display: none; }
.help .touchhelp { display: none; font-size: 14px; font-weight: bold; color: var(--ui-gold); letter-spacing: 1px; }
body.touch-ui .touch-only { display: inline-block; margin-top: 14px; }
body.touch-ui .help .deskhelp { display: none; }
body.touch-ui .help .touchhelp { display: block; }
body.touch-ui #game, body.touch-ui #game canvas { touch-action: none; }
body.touch-ui #zoomBtn { display: none; }
body.touch-ui .screen button { touch-action: manipulation; }

#touchUI { position: fixed; inset: 0; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; }
#touchControls { position: fixed; inset: 0; z-index: 5; pointer-events: none; touch-action: none; }

/* 左半邊浮動虛擬搖桿區 */
#touchJoyZone {
  position: absolute; left: 0; top: 0; width: 50%; height: 100%;
  pointer-events: auto; touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
#touchJoyBase {
  position: absolute; left: 26px; bottom: 24px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 34, 64, 0.56), rgba(10, 18, 38, 0.78));
  border: 2px solid var(--ui-line);
  box-shadow: inset 0 0 18px rgba(242, 194, 0, 0.2), 0 6px 18px rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0.72; pointer-events: none; touch-action: none;
  transition: opacity 0.12s, border-color 0.12s, box-shadow 0.12s;
}
#touchJoyBase.active {
  opacity: 1; border-color: var(--ui-gold);
  box-shadow: inset 0 0 22px rgba(242, 194, 0, 0.32), 0 6px 20px rgba(0, 0, 0, 0.55);
}
#touchJoyBase.sprint {
  border-color: #FFE36A;
  box-shadow: inset 0 0 26px rgba(255, 227, 106, 0.48), 0 0 18px rgba(242, 194, 0, 0.7);
}
#touchJoyKnob {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, rgba(255, 227, 106, 0.92), rgba(242, 194, 0, 0.75) 55%, rgba(18, 34, 64, 0.92));
  border: 2px solid var(--ui-gold);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), inset 0 1px 4px rgba(255, 255, 255, 0.45);
  pointer-events: none; touch-action: none; will-change: transform;
}

/* 右下圓形動作按鈕群（重擊 84px，其餘 72px，符合大拇指圓弧） */
#touchActions {
  position: absolute; right: 14px; bottom: 14px; width: 262px; height: 180px;
  pointer-events: none; touch-action: none;
}
.tbtn {
  position: absolute; width: 72px; height: 72px; border-radius: 50%;
  font: inherit; font-size: 18px; font-weight: bold; letter-spacing: 1px;
  color: #F3F1EA; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
  background: linear-gradient(180deg, rgba(18, 34, 64, 0.86), rgba(10, 18, 38, 0.9));
  border: 2px solid var(--ui-line);
  box-shadow: inset 0 2px 0 rgba(242, 194, 0, 0.65), 0 5px 14px rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 0;
  pointer-events: auto; touch-action: none; cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  transition: transform 0.08s ease-out, opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tbtn.strike {
  width: 84px; height: 84px; right: 4px; bottom: 4px;
  font-size: 21px; color: #FFF5CC; border-color: var(--ui-gold);
  background: linear-gradient(180deg, rgba(44, 66, 110, 0.92), rgba(16, 28, 56, 0.94));
  box-shadow: inset 0 2px 0 var(--ui-gold), inset 0 0 14px rgba(242, 194, 0, 0.28), 0 6px 16px rgba(0, 0, 0, 0.6);
}
.tbtn.jump { right: 100px; bottom: 4px; }
.tbtn.magnet { right: 4px; bottom: 100px; }
.tbtn.water { right: 92px; bottom: 92px; }
.tbtn.ult {
  right: 182px; bottom: 46px;
  opacity: 0.42; border-color: rgba(108, 240, 138, 0.45);
}
.tbtn.ult.ready {
  opacity: 1; color: #E6FFEC; border-color: #6CF08A;
  box-shadow: inset 0 2px 0 #6CF08A, inset 0 0 14px rgba(108, 240, 138, 0.35), 0 0 16px rgba(108, 240, 138, 0.85);
}
.tbtn.pressed {
  transform: scale(0.9);
  border-color: #FFE36A;
  box-shadow: inset 0 0 18px rgba(242, 194, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* 右上小地圖下方空處：暫停與遠近按鈕 */
#touchSysBtns {
  position: absolute; right: 14px; top: 286px;
  display: flex; gap: 8px; pointer-events: none; touch-action: none;
}
.tsys {
  min-width: 64px; height: 34px; padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: bold; letter-spacing: 1px;
  color: var(--ui-gold);
  background: var(--ui-bg); border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: auto; touch-action: none; cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  transition: transform 0.08s ease-out;
}
.tsys.pressed { transform: scale(0.92); }

/* 直式轉向遮罩（橫向時由 touch.js 加上 .hidden 收起） */
#touchPortrait {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 16, 30, 0.94);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; touch-action: none;
}
#touchPortrait .tp-box {
  background: var(--ui-bg); border: 2px solid var(--ui-gold);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 10px 30px rgba(0, 0, 0, 0.65);
  padding: 28px 34px; text-align: center; max-width: calc(100vw - 40px);
}
#touchPortrait .tp-icon { font-size: 46px; color: var(--ui-gold); line-height: 1.1; margin-bottom: 10px; }
#touchPortrait .tp-title { font-size: 24px; font-weight: bold; color: #fff; letter-spacing: 2px; }
#touchPortrait .tp-sub { font-size: 13px; color: #BFD3F5; margin-top: 8px; }

/* 觸控裝置橫向版面精簡（只在 pointer: coarse 生效，桌機外觀完全不變） */
@media (pointer: coarse) {
  .touch-only { display: inline-block; margin-top: 14px; }
  .help .deskhelp { display: none; }
  .help .touchhelp { display: block; }
  #game, #game canvas { touch-action: none; }
  .screen button { touch-action: manipulation; }
  #zoomBtn, #skills, #news { display: none; }

  #tl { left: 8px; top: 8px; min-width: 110px; padding: 4px 8px; }
  #tl .mode { font-size: 10px; }
  #tl .row { font-size: 15px; margin-top: 1px; }
  #tl .row.small { font-size: 11px; }

  #tc { top: 8px; min-width: 0; padding: 4px 12px; max-width: 44vw; }
  #tc .line1 { font-size: 13px; white-space: nowrap; }
  #tc .line2 { font-size: 10px; white-space: nowrap; }
  #tc .sep { margin: 0 4px; }

  #tr { right: 8px; top: 8px; width: 148px; gap: 4px; }
  #tr .loss { padding: 4px 8px; }
  #tr .loss .cap { font-size: 10px; }
  #lossTotal { font-size: 15px; }
  .lossbar { height: 5px; margin-top: 2px; }
  .losslegend { font-size: 9px; margin-top: 2px; }
  .minibox { padding: 4px; }
  #minimap { width: 138px; height: 82px; }

  #touchSysBtns { right: 8px; top: 154px; gap: 6px; }
  .tsys { min-width: 62px; height: 32px; padding: 0 10px; font-size: 12px; }
  #touchActions { right: 10px; bottom: 8px; }
  #touchJoyBase { left: 18px; bottom: 16px; }

  #pilot {
    left: 50%; bottom: 8px; transform: translateX(-50%);
    width: 224px; padding: 4px 8px 4px 6px; gap: 6px;
  }
  #pilot .avatar { width: 46px; height: 46px; }
  #pilot .pname { font-size: 12px; }
  #pilot .ptitle, #pilot .mname { display: none; }
  .stat { gap: 4px; font-size: 10px; margin-top: 2px; }
  .stat .lbl { width: 22px; }
  .stat .track { height: 7px; }
  .stat .num { width: 56px; font-size: 9px; }

  #boss { top: 52px; width: min(360px, 44vw); }
  #boss .bname { font-size: 13px; }
  #boss .btrack { height: 10px; }
  #demoBanner { top: 54px; font-size: 13px; padding: 5px 16px; }
  body:has(#boss:not(.hidden)) #demoBanner { top: 94px; }

  #dialog { left: 50%; top: auto; bottom: 96px; transform: translateX(-50%); max-width: 260px; padding: 6px 10px; }
  #dialog.show { transform: translateX(-50%); }
  #dialog .who { font-size: 11px; }
  #dialogText { font-size: 12px; line-height: 1.35; }

  #combo { right: 164px; top: 54px; }
  #combo .cbox { min-width: 110px; padding: 4px 10px; }
  #combo .cnum { font-size: 28px; }
  #combo .clbl { font-size: 14px; }
  #achv { right: auto; left: 8px; top: 96px; width: 190px; }

  #title .box { max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px 20px 14px; max-width: min(600px, calc(100vw - 24px)); }
  #title .logo { width: 150px; }
  #title h1 { font-size: 28px; }
  .story { margin: 8px 0; font-size: 13px; line-height: 1.5; }
  #title .tbtns button, #resumeBtn { font-size: 18px; padding: 8px 32px; }
  .screen .box.result { min-width: 0; width: min(640px, calc(100vw - 24px)); padding: 12px 18px; }
  #dGrid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* 桌機以 forceTouch() 縮成手機橫向視窗預覽時也套用精簡面板（一般桌機無 body.touch-ui 不受影響） */
@media (max-height: 540px) {
  body.touch-ui #skills, body.touch-ui #news { display: none; }
  body.touch-ui #tl { left: 8px; top: 8px; min-width: 110px; padding: 4px 8px; }
  body.touch-ui #tl .mode { font-size: 10px; }
  body.touch-ui #tl .row { font-size: 15px; margin-top: 1px; }
  body.touch-ui #tl .row.small { font-size: 11px; }
  body.touch-ui #tc { top: 8px; min-width: 0; padding: 4px 12px; }
  body.touch-ui #tc .line1 { font-size: 13px; }
  body.touch-ui #tc .line2 { font-size: 10px; }
  body.touch-ui #tr { right: 8px; top: 8px; width: 148px; gap: 4px; }
  body.touch-ui #tr .loss { padding: 4px 8px; }
  body.touch-ui #lossTotal { font-size: 15px; }
  body.touch-ui .minibox { padding: 4px; }
  body.touch-ui #minimap { width: 138px; height: 82px; }
  body.touch-ui #touchSysBtns { right: 8px; top: 154px; gap: 6px; }
  body.touch-ui #touchActions { right: 10px; bottom: 8px; }
  body.touch-ui #pilot { left: 50%; bottom: 8px; transform: translateX(-50%); width: 224px; padding: 4px 8px 4px 6px; gap: 6px; }
  body.touch-ui #pilot .avatar { width: 46px; height: 46px; }
  body.touch-ui #pilot .ptitle, body.touch-ui #pilot .mname { display: none; }
  body.touch-ui #title .box { max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px 20px 14px; }
  body.touch-ui .screen .box.result { min-width: 0; width: min(640px, calc(100vw - 24px)); }
}

/* 畫面外警示（2026-11-23）：鳳梨怪蓄力／衝撞邊緣警示、剉冰怪冰球落點邊緣警示 */
.earrow.danger {
  border-left-color: #FF5500;
  filter: drop-shadow(0 0 8px rgba(255, 85, 0, 0.95)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.95));
  animation: earrowDanger 0.28s ease-in-out infinite alternate;
}
.earrow.danger::after {
  content: "！";
  position: absolute;
  left: -30px;
  top: 0;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--ang, 0rad)));
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  color: #FFE36A;
  -webkit-text-stroke: 1px #991800;
  paint-order: stroke fill;
  text-shadow: 0 0 6px #FF4400, 0 1px 3px #000;
  pointer-events: none;
}
@keyframes earrowDanger {
  from { border-left-color: #FF3B00; opacity: 1; filter: drop-shadow(0 0 9px rgba(255, 68, 0, 1)) drop-shadow(0 0 2px #000); }
  to { border-left-color: #FF9A1F; opacity: 0.52; filter: drop-shadow(0 0 3px rgba(255, 145, 0, 0.65)) drop-shadow(0 0 2px #000); }
}

.icewarn {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
}
.icewarn span {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: #7EE8FF;
  -webkit-text-stroke: 1.5px #0B4C75;
  paint-order: stroke fill;
  text-shadow: 0 0 10px rgba(96, 224, 255, 0.95), 0 2px 4px rgba(0, 0, 0, 0.9);
  animation: iceWarnPulse 0.42s ease-in-out infinite alternate;
}
.icewarn.urgent span {
  color: #E0FBFF;
  animation-duration: 0.18s;
}
@keyframes iceWarnPulse {
  from { transform: translateY(-2px) scale(1); opacity: 1; filter: drop-shadow(0 0 8px rgba(100, 226, 255, 0.95)); }
  to { transform: translateY(3px) scale(1.14); opacity: 0.65; filter: drop-shadow(0 0 3px rgba(100, 226, 255, 0.55)); }
}

/* 設定畫面（2026-11-23）：沿用紀錄頁 .box.wide 風格，含音量、畫質、鍵位重設 */
.tbtns { flex-wrap: wrap; }
.skill .key { max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pause .pbtns { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 16px; }
#pause .pbtns button { font-size: 17px; padding: 9px 26px; }
body.touch-ui #pause .pbtns .touch-only { margin-top: 0; }
@media (pointer: coarse) {
  #title .tbtns button { padding: 8px 20px; }
  #pause .pbtns .touch-only { margin-top: 0; }
}

.setgrid { display: grid; grid-template-columns: 360px 1fr; gap: 22px; text-align: left; margin-bottom: 14px; }
.setvol { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.setrow { background: rgba(6, 12, 26, 0.72); border: 1px solid rgba(255, 255, 255, 0.12); padding: 10px 12px; }
.setlbl { font-size: 14px; color: #F3F1EA; font-weight: bold; margin-bottom: 8px; }
.setmuted { font-size: 12px; font-weight: normal; color: #FF8A7A; margin-left: 6px; }
.setctrl { display: flex; align-items: center; gap: 8px; }
.setctrl input[type="range"] { flex: 1; accent-color: var(--ui-gold); cursor: pointer; height: 6px; }
.screen button.setstep {
  width: 30px; height: 30px; padding: 0; font-size: 16px; line-height: 1;
  border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: #F3F1EA;
  border: 1px solid rgba(242, 194, 0, 0.4); box-shadow: none;
}
.screen button.setstep:hover:not(:disabled) { background: rgba(242, 194, 0, 0.25); color: #fff; }
.screen button.setstep:disabled { opacity: 0.35; background: rgba(255, 255, 255, 0.06); color: #9AA3B5; }
.setnum { width: 26px; text-align: right; font-size: 16px; font-weight: bold; color: var(--ui-gold); font-variant-numeric: tabular-nums; }

.setqual { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.screen button.qopt {
  padding: 9px 6px; font-size: 15px; border-radius: 4px;
  background: rgba(6, 12, 26, 0.85); color: #CFCBC0;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none;
}
.screen button.qopt:hover { border-color: var(--ui-gold); color: #fff; background: rgba(18, 36, 74, 0.9); }
.screen button.qopt.active {
  background: var(--ui-gold); color: #1F2A22; border-color: var(--ui-gold);
  box-shadow: 0 3px 0 #9A7A00;
}
.setdesc { font-size: 12px; color: #BFD3F5; margin-top: 8px; line-height: 1.5; }

#setKeys { display: flex; flex-direction: column; gap: 4px; }
.skrow {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px;
  background: rgba(6, 12, 26, 0.72); border: 1px solid rgba(255, 255, 255, 0.1);
}
.skrow.waiting { border-color: var(--ui-gold); background: rgba(44, 62, 102, 0.9); box-shadow: inset 0 0 12px rgba(242, 194, 0, 0.28); }
.skname { width: 84px; flex: none; font-size: 14px; font-weight: bold; color: #F3F1EA; }
.skval { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; font-size: 13px; }
.skval kbd {
  display: inline-block; font: inherit; font-weight: bold; font-size: 13px;
  padding: 2px 9px; border-radius: 4px;
  background: rgba(242, 194, 0, 0.16); color: #FFE36A; border: 1px solid rgba(242, 194, 0, 0.55);
}
.skalt { font-size: 12px; color: #9AA3B5; }
.skdup { font-size: 12px; color: #FF8A7A; font-weight: bold; }
.skwait { font-size: 13px; color: #FFE36A; font-weight: bold; }
.screen button.skbtn {
  flex: none; padding: 4px 12px; font-size: 13px; border-radius: 4px;
  background: #2D6B48; color: #fff; box-shadow: 0 2px 0 #173B27;
}
.screen button.skbtn:hover { background: #3A8459; }
.skrow.waiting button.skbtn { background: #7A322C; box-shadow: 0 2px 0 #451814; }
.skrow.waiting button.skbtn:hover { background: #964139; }
.setkfoot { display: flex; justify-content: flex-end; margin-top: 8px; }
.screen .setkfoot button { font-size: 14px; padding: 6px 16px; }

@media (max-width: 900px) {
  .setgrid { grid-template-columns: 1fr; gap: 14px; }
}

/* 實戰情境提示（2026-11-23）：畫面下方中央、技能列上方，深藍金框斜角風格，淡入淡出 0.25 秒；觸控移至上方中間 */
#setQualDesc { margin-bottom: 14px; }
.settips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.screen button.topt {
  padding: 9px 6px; font-size: 15px; border-radius: 4px;
  background: rgba(6, 12, 26, 0.85); color: #CFCBC0;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none;
}
.screen button.topt:hover { border-color: var(--ui-gold); color: #fff; background: rgba(18, 36, 74, 0.9); }
.screen button.topt.active {
  background: var(--ui-gold); color: #1F2A22; border-color: var(--ui-gold);
  box-shadow: 0 3px 0 #9A7A00;
}

#tip {
  position: absolute;
  left: 50%;
  bottom: 116px;
  transform: translateX(-50%) translateY(6px);
  z-index: 15;
  max-width: 40vw;
  width: max-content;
  padding: 8px 20px;
  font-size: 18px;
  font-weight: bold;
  line-height: 1.45;
  color: #F3F1EA;
  text-align: center;
  letter-spacing: 1px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 16px rgba(0, 0, 0, 0.5);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
#tip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
#tip kbd {
  display: inline-block;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  padding: 2px 8px;
  margin: 0 2px;
  border-radius: 4px;
  background: rgba(242, 194, 0, 0.22);
  color: #FFE36A;
  border: 1px solid var(--ui-gold);
  box-shadow: 0 2px 0 rgba(154, 122, 0, 0.85);
  vertical-align: baseline;
}
#tip.draft {
  position: fixed;
  bottom: auto;
  top: 160px;
  z-index: 25;
}
body:has(#tip.draft.show) #draft .dsub {
  margin-bottom: 58px;
}
body.touch-ui #tip:not(.draft) {
  bottom: auto;
  top: 68px;
}
body.touch-ui:has(#boss:not(.hidden)) #tip:not(.draft) {
  top: 108px;
}
@media (pointer: coarse) {
  #tip:not(.draft) {
    bottom: auto;
    top: 62px;
  }
  body:has(#boss:not(.hidden)) #tip:not(.draft) {
    top: 102px;
  }
}

/* 精彩時刻回放與拍照模式（2026-11-24）：沿用深藍金框斜切風格 */
#setTipsDesc, #setRecDesc { margin-bottom: 12px; }
.setrec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.screen button.ropt {
  padding: 9px 6px; font-size: 15px; border-radius: 4px;
  background: rgba(6, 12, 26, 0.85); color: #CFCBC0;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none;
}
.screen button.ropt:hover:not(:disabled) { border-color: var(--ui-gold); color: #fff; background: rgba(18, 36, 74, 0.9); }
.screen button.ropt.active {
  background: var(--ui-gold); color: #1F2A22; border-color: var(--ui-gold);
  box-shadow: 0 3px 0 #9A7A00;
}
.setphoto { margin-top: 8px; }
.screen button.setphotobtn { width: 100%; font-size: 16px; padding: 9px 16px; }

/* 結算畫面精彩回放縮圖按鈕 */
#rHighlights {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: rgba(6, 12, 26, 0.72);
  border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  text-align: left;
}
.rh-head {
  font-size: 12px; font-weight: bold; color: var(--ui-gold);
  letter-spacing: 2px; margin-bottom: 6px;
}
.rh-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.screen button.rh-card {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px;
  text-align: left; font: inherit; font-size: 13px; font-weight: normal;
  color: #F3F1EA; background: rgba(16, 30, 58, 0.9);
  border: 1px solid rgba(242, 194, 0, 0.42); border-radius: 0; box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: border-color 0.14s, background 0.14s, transform 0.12s;
}
.screen button.rh-card:hover, .screen button.rh-card:focus {
  border-color: var(--ui-gold); background: rgba(24, 48, 92, 0.96);
  transform: translateY(-1px); outline: none;
}
.rh-thumb {
  position: relative; width: 96px; height: 54px; flex: none; overflow: hidden;
  background: #0C162A; border: 1px solid rgba(255, 255, 255, 0.18);
}
.rh-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rh-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(14, 24, 48, 0.82); border: 1.5px solid var(--ui-gold);
  color: var(--ui-gold); font-size: 12px; line-height: 23px; text-align: center;
  padding-left: 2px;
}
.rh-info { flex: 1; min-width: 0; }
.rh-title { font-size: 14px; font-weight: bold; color: var(--ui-gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-sub { font-size: 11px; color: #BFD3F5; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-dur { font-size: 11px; color: #9BC8A8; margin-top: 1px; font-variant-numeric: tabular-nums; }

/* 精彩回放播放器覆層（蓋在結算畫面上方） */
#replayModal { z-index: 25; background: rgba(6, 10, 18, 0.82); }
.screen .box.replay-box {
  width: min(860px, calc(100vw - 32px)); max-width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 28px); overflow-y: auto; padding: 14px 20px 16px;
  background: linear-gradient(180deg, rgba(18, 34, 64, 0.98), rgba(10, 18, 38, 0.98));
  border: 1px solid var(--ui-line); border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 12px 34px rgba(0, 0, 0, 0.72);
}
.rp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; text-align: left; }
.rp-title-wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.rp-tag {
  background: var(--ui-gold); color: #1F2A22; font-size: 12px; font-weight: bold;
  padding: 1px 7px; letter-spacing: 1px;
}
#replayTitle { font-size: 19px; color: #fff; }
#replayMeta { font-size: 13px; color: #9BC8A8; }
.screen button.rp-x {
  width: 32px; height: 32px; padding: 0; font-size: 16px; line-height: 1;
  background: rgba(255, 255, 255, 0.12); color: #F3F1EA;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; box-shadow: none;
}
.screen button.rp-x:hover { background: rgba(242, 194, 0, 0.26); border-color: var(--ui-gold); color: #fff; }
.rp-stage {
  background: #050810; border: 1px solid rgba(242, 194, 0, 0.35);
  margin-bottom: 12px; overflow: hidden;
}
#replayVideo { display: block; width: 100%; max-height: 60vh; background: #000; }
#replayToast { height: 18px; margin-top: 8px; font-size: 13px; color: #9FD8FF; }

/* 拍照模式覆層（所有既有 HUD 與觸控介面均隱藏，只留極簡貼底工具列，截圖完全不含此列） */
#photoUI { position: fixed; inset: 0; z-index: 18; pointer-events: none; }
#photoFlash {
  position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none;
}
#photoFlash.flash { animation: photoShutter 0.28s ease-out; }
@keyframes photoShutter {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}
#photoToast {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%) translateY(-8px);
  padding: 7px 18px; font-size: 15px; font-weight: bold; color: #F3F1EA;
  background: var(--ui-bg); border: 1px solid var(--ui-gold);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 16px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.22s, transform 0.22s;
}
#photoToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#photoBar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  max-width: calc(100vw - 24px); padding: 8px 14px 7px;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(16, 30, 56, 0.84), rgba(8, 15, 32, 0.88));
  border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 8px 22px rgba(0, 0, 0, 0.55);
}
#photoBar .pb-row {
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.pb-title {
  font-size: 13px; font-weight: bold; color: var(--ui-gold); letter-spacing: 2px;
  padding-right: 4px;
}
.pb-filters, .pb-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#photoBar button {
  font: inherit; font-size: 13px; font-weight: bold; cursor: pointer;
  padding: 5px 11px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 12, 26, 0.86); color: #E6E2D8;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
#photoBar button:hover { border-color: var(--ui-gold); color: #fff; background: rgba(20, 42, 82, 0.95); }
#photoBar button.pf-btn.active {
  background: var(--ui-gold); color: #1F2A22; border-color: var(--ui-gold);
}
#photoBar button.pb-main {
  background: var(--ui-gold); color: #1F2A22; border-color: var(--ui-gold);
  box-shadow: 0 2px 0 #9A7A00;
}
#photoBar button.pb-main:hover { background: #FFD633; color: #1F2A22; }
#photoBar button.pb-alt { background: #2D6B48; color: #fff; border-color: rgba(155, 200, 168, 0.45); }
#photoBar button.pb-alt:hover { background: #3A8459; }
.pb-hint {
  margin-top: 5px; font-size: 11px; color: #BFD3F5; text-align: center; line-height: 1.4;
}
#photoShowBar {
  position: fixed; right: 14px; bottom: 14px; pointer-events: auto;
  font: inherit; font-size: 12px; font-weight: bold; padding: 6px 12px; cursor: pointer;
  color: var(--ui-gold); background: rgba(12, 22, 44, 0.72);
  border: 1px solid var(--ui-line); border-radius: 4px;
}
#photoShowBar:hover { background: rgba(20, 40, 78, 0.92); color: #fff; }

@media (max-height: 820px) {
  #rHighlights { margin: 0 0 8px; padding: 6px 8px; }
  .rh-thumb { width: 80px; height: 45px; }
}
@media (pointer: coarse) {
  #photoBar { bottom: 8px; padding: 6px 10px; }
  #photoBar button { font-size: 13px; padding: 6px 10px; touch-action: manipulation; }
  .pb-hint { font-size: 11px; }
}

/* 每日挑戰（2026-11-24）：標題按鈕、規則卡、紀錄分頁、技能鎖定與二選一版面 */
.screen button.daily {
  background: linear-gradient(180deg, #2578B8, #174B7D);
  color: #FFF6D0;
  border: 1px solid var(--ui-gold);
  box-shadow: 0 4px 0 #0D2D4E;
  padding: 10px 30px;
}
.screen button.daily:hover { background: linear-gradient(180deg, #3290D6, #1E5D98); }

#dailyHudTag {
  font-size: 11px;
  font-weight: bold;
  color: #7CE0FF;
  margin-top: 2px;
  letter-spacing: 0.5px;
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill.locked {
  opacity: 0.36;
  filter: grayscale(0.85);
  border-color: rgba(255, 90, 74, 0.55) !important;
  box-shadow: none !important;
}
.skill.locked::after {
  content: "禁用";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 16, 26, 0.72);
  color: #FF8A7A;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  z-index: 4;
}
.tbtn.locked {
  opacity: 0.28 !important;
  filter: grayscale(0.9);
  border-color: rgba(255, 90, 74, 0.5) !important;
  box-shadow: none !important;
}

/* 整備二選一置中 */
#draftCards.cols2 {
  grid-template-columns: repeat(2, minmax(0, 380px));
  justify-content: center;
}

/* 每日挑戰開局規則卡 */
.screen .box.daily-card {
  width: min(560px, calc(100vw - 32px));
  max-width: min(560px, calc(100vw - 32px));
  padding: 24px 32px 22px;
  background: linear-gradient(180deg, rgba(18, 34, 64, 0.97), rgba(10, 18, 38, 0.97));
  border: 1px solid var(--ui-line);
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 12px 34px rgba(0, 0, 0, 0.65);
  cursor: pointer;
}
.dc-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dc-badge {
  background: var(--ui-gold);
  color: #1F2A22;
  font-size: 13px;
  font-weight: 900;
  padding: 2px 10px;
  letter-spacing: 2px;
}
.dc-date {
  font-size: 14px;
  font-weight: bold;
  color: #7CE0FF;
  letter-spacing: 1px;
}
#dcRuleName {
  margin: 0;
  font-size: 36px;
  color: var(--ui-gold);
  letter-spacing: 3px;
}
.dc-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: bold;
  color: #FFE36A;
  background: rgba(242, 194, 0, 0.14);
  border: 1px solid rgba(242, 194, 0, 0.45);
}
.dc-district {
  margin-top: 14px;
  font-size: 15px;
  font-weight: bold;
  color: #BFD3F5;
}
.dc-desc {
  margin: 12px 0 14px;
  padding: 12px 16px;
  background: rgba(6, 12, 26, 0.78);
  border-left: 4px solid #4CC3FF;
  font-size: 17px;
  line-height: 1.55;
  color: #F3F1EA;
  text-align: left;
}
.dc-best {
  margin-bottom: 16px;
  font-size: 13px;
  color: #9BC8A8;
}
.dc-best b { color: var(--ui-gold); font-size: 15px; }
.dc-stars { color: var(--ui-gold); letter-spacing: 1px; }
.dc-stars .off { color: rgba(255, 255, 255, 0.22); }
.dc-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #9AA3B5;
  letter-spacing: 1px;
}

/* 紀錄頁分頁與最近 14 天每日挑戰成績 */
.rectabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 12px;
}
.screen button.rectab {
  font-size: 15px;
  padding: 7px 26px;
  border-radius: 0;
  background: rgba(6, 12, 26, 0.85);
  color: #BFD3F5;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.screen button.rectab:hover {
  border-color: var(--ui-gold);
  color: #fff;
  background: rgba(18, 36, 74, 0.92);
}
.screen button.rectab.active {
  background: var(--ui-gold);
  color: #1F2A22;
  border-color: var(--ui-gold);
  box-shadow: 0 3px 0 #9A7A00;
}
#recDailySummary {
  background: rgba(6, 12, 26, 0.78);
  border: 1px solid var(--ui-line);
  padding: 10px 14px;
  margin-bottom: 10px;
  text-align: left;
}
.dsum-main { font-size: 15px; font-weight: bold; color: var(--ui-gold); }
.dsum-sub { font-size: 12px; color: #BFD3F5; margin-top: 3px; }
.dsum-sub b { color: #fff; }
#recDailyList {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 52vh;
  overflow-y: auto;
  margin-bottom: 12px;
  text-align: left;
}
.drec-row {
  display: grid;
  grid-template-columns: 142px 112px 104px 58px 98px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background: rgba(6, 12, 26, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.drec-row.played { border-color: rgba(242, 194, 0, 0.36); }
.drec-row.today {
  background: rgba(22, 46, 86, 0.9);
  border-color: var(--ui-gold);
}
.drec-date { font-variant-numeric: tabular-nums; font-weight: bold; color: #F3F1EA; white-space: nowrap; }
.drec-today {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 10px;
  background: var(--ui-gold);
  color: #1F2A22;
  font-weight: 900;
}
.drec-rule { color: #7CE0FF; font-weight: bold; white-space: nowrap; }
.drec-dist { color: #E6E2D8; white-space: nowrap; }
.drec-stars { color: var(--ui-gold); letter-spacing: 1px; white-space: nowrap; }
.drec-stars .off { color: rgba(255, 255, 255, 0.22); }
.drec-score { text-align: right; color: #FFE36A; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drec-score b { font-size: 15px; color: var(--ui-gold); }
.drec-score.off { color: #6F7890; font-size: 12px; }
.drec-meta { color: #9AA3B5; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drec-win { color: #6CF08A; font-weight: bold; }
.drec-lose { color: #FF8A7A; }

/* 結算頁每日挑戰徽章與分數強調 */
#rDaily {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 14px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #1F2A22;
  background: linear-gradient(90deg, #F2C200, #FFE36A);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
#rStats .row.dailyScore b { color: #7CE0FF; font-size: 20px; }

@media (max-width: 900px) {
  .drec-row { grid-template-columns: 128px 1fr 86px; gap: 4px 8px; }
  .drec-dist, .drec-stars, .drec-meta { font-size: 11px; }
}
@media (max-height: 820px) {
  #rStats .row.dailyScore b { font-size: 17px; }
  .screen .box.daily-card { padding: 16px 22px 14px; }
  #dcRuleName { font-size: 28px; }
  .dc-desc { margin: 8px 0 10px; padding: 8px 12px; font-size: 15px; }
}
@media (pointer: coarse) {
  #dailyHudTag { font-size: 9px; max-width: 110px; }
}

/* 雙人同螢幕（2026-11-24）：標題雙人按鈕、橘白 P2 標籤與面板、倒下復活條、結算默契與雙人紀錄 */
.screen button.coop {
  background: linear-gradient(180deg, #F5862A, #D95E14);
  color: #FFFDF8;
  border: 1px solid #FFD2A6;
  box-shadow: 0 4px 0 #8A3808;
  padding: 10px 28px;
}
.screen button.coop:hover:not(:disabled) {
  background: linear-gradient(180deg, #FF9942, #E66D20);
}
.screen button.coop:disabled {
  background: linear-gradient(180deg, #4E4844, #363230);
  color: #A8A09A;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  opacity: 0.62;
  cursor: not-allowed;
}
.coop-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #FFB980;
  letter-spacing: 0.5px;
  min-height: 16px;
}
.coop-hint.ready { color: #9BE07A; }
.coop-hint:empty { display: none; }

/* 觸控裝置不顯示雙人按鈕與提示 */
body.touch-ui #coopBtn,
body.touch-ui #coopHint,
body.touch-ui #dailyCoopBtn,
body.touch-ui #dailyCoopHint,
body.touch-ui #dDailyCoop { display: none !important; }
@media (pointer: coarse) {
  #coopBtn, #coopHint, #dailyCoopBtn, #dailyCoopHint, #dDailyCoop { display: none !important; }
}

/* P2 機甲頭上標籤（橘白配色） */
#p2Tag {
  position: absolute; left: 0; top: 0;
  background: rgba(24, 18, 16, 0.88);
  color: #FFFDF8;
  font-size: 12px;
  padding: 2px 7px 2px 2px;
  border: 1px solid #FF8A38;
  border-radius: 0;
  white-space: nowrap;
}
#p2Tag b {
  background: #F26D1D;
  color: #FFFFFF;
  padding: 0 5px;
  margin-right: 5px;
  border-radius: 2px;
}

#coopReviveRow b { color: #FFB980 !important; }

/* 雙人戰鬥中版面（僅 body.coop-ui 生效，單人版面完全不動） */
body.coop-ui #pilot {
  left: 14px;
  bottom: 14px;
  width: 278px;
  padding: 6px 10px 6px 8px;
  gap: 8px;
}
body.coop-ui #pilot .avatar { width: 64px; height: 64px; }
body.coop-ui #pilot .pname { font-size: 14px; }
body.coop-ui #pilot .ptitle { font-size: 10px; margin-left: 4px; }
body.coop-ui #pilot .mname { font-size: 10px; margin-bottom: 2px; }
body.coop-ui #pilot .stat .num,
body.coop-ui #pilot2 .stat .num { width: 66px; font-size: 10px; }

#pilot2 {
  position: absolute;
  left: 304px;
  bottom: 14px;
  width: 278px;
  padding: 6px 10px 6px 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-color: rgba(242, 109, 29, 0.72);
  box-shadow: inset 0 2px 0 #F26D1D, 0 6px 16px rgba(0, 0, 0, 0.45);
}
#pilot2 .p2-emblem {
  width: 64px;
  height: 64px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F26D1D 0%, #FF9B4A 54%, #F7F6F2 54%, #E6E1DA 100%);
  border: 1px solid #FF9A4D;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
#pilot2 .p2-code { font-size: 22px; font-weight: 900; color: #FFFFFF; line-height: 1; }
#pilot2 .p2-sub { font-size: 11px; font-weight: bold; color: #2D3138; background: rgba(255, 255, 255, 0.82); padding: 0 5px; margin-top: 3px; }
#pilot2 .info { flex: 1; min-width: 0; }
#pilot2 .pname { font-size: 14px; font-weight: bold; color: #FFF8F0; }
#pilot2 .ptitle { font-size: 10px; color: #FFD0AE; font-weight: normal; margin-left: 4px; }
#pilot2 .mname { font-size: 10px; color: #FF9A4D; margin-bottom: 2px; }
#pilot2 .fill.hp { background: linear-gradient(90deg, #F26D1D, #FFB067); }

/* 雙人模式技能列收在各自駕駛員面板上方，避免與右下新聞框重疊 */
body.coop-ui #skills,
#skills2 {
  position: absolute;
  bottom: 106px;
  transform: none;
  display: flex;
  gap: 6px;
  padding: 5px 7px 4px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 var(--ui-gold), 0 6px 14px rgba(0, 0, 0, 0.45);
}
body.coop-ui #skills { left: 14px; }
#skills2 {
  left: 304px;
  border-color: rgba(242, 109, 29, 0.72);
  box-shadow: inset 0 2px 0 #F26D1D, 0 6px 14px rgba(0, 0, 0, 0.45);
}
body.coop-ui #skills .skill,
#skills2 .skill {
  width: 62px;
  height: 54px;
}
body.coop-ui #skills .skill .icon,
#skills2 .skill .icon { height: 32px; margin-top: 3px; }
body.coop-ui #skills .skill .icon img,
#skills2 .skill .icon img { height: 32px; width: 32px; }
body.coop-ui #skills .skill .sname,
#skills2 .skill .sname { font-size: 10px; margin-top: 1px; }
#skills2 .skill.ready { border-color: #FF8A38; box-shadow: inset 0 0 10px rgba(242, 109, 29, 0.4); }
#skills2 .skill .key { background: #F26D1D; color: #FFFDF8; }
body.coop-ui #tip:not(.draft) { bottom: 178px; }

/* 倒下復活狀態條 */
.down-badge {
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  color: #FFF5CC;
  background: rgba(196, 40, 28, 0.9);
  border: 1px solid #FF8A7A;
  letter-spacing: 0.5px;
  animation: coopDownPulse 0.8s ease-in-out infinite alternate;
}
.down-badge.out {
  background: rgba(56, 56, 64, 0.92);
  border-color: #888;
  color: #CCC;
  animation: none;
}
#pilot.downed, #pilot2.downed {
  opacity: 0.78;
  filter: saturate(0.55);
}
@keyframes coopDownPulse {
  from { opacity: 1; }
  to { opacity: 0.65; }
}

/* 結算畫面雙人默契稱號與兩人明細 */
#rCoop {
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: rgba(10, 20, 42, 0.86);
  border: 1px solid rgba(255, 138, 56, 0.65);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: inset 0 2px 0 #F26D1D;
  text-align: left;
}
.rcoop-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.rcoop-tag {
  background: #F26D1D;
  color: #FFFDF8;
  font-size: 11px;
  font-weight: bold;
  padding: 1px 7px;
  letter-spacing: 1px;
}
.rcoop-title {
  font-size: 20px;
  font-weight: 900;
  color: #FFD280;
  letter-spacing: 1px;
}
.rcoop-sub {
  font-size: 12px;
  color: #E6E2D8;
  margin-top: 3px;
  line-height: 1.4;
}
.rcoop-meta {
  font-size: 12px;
  color: #9BC8A8;
  margin-top: 3px;
}
.rcoop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 7px;
}
.rcoop-col {
  background: rgba(6, 12, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 8px;
  font-size: 12px;
}
.rcoop-col.p1 { border-left: 3px solid #F2C200; }
.rcoop-col.p2 { border-left: 3px solid #F26D1D; }
.rcoop-col .rp-name { font-weight: bold; color: #fff; margin-bottom: 2px; }
.rcoop-col .rp-stat { color: #CFCBC0; line-height: 1.45; }
.rcoop-col .rp-stat b { color: #FFF5CC; }

#recCoopAch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#recCoopTitles { font-size: 12px; line-height: 1.8; }
#recCoopTitles .chip.off { color: #6F7890; border-color: rgba(255, 255, 255, 0.12); background: none; }
#recCoopKills { font-size: 12px; line-height: 1.9; text-align: left; }
#recCoopTotals { font-size: 12px; color: #FFB980; margin: 10px 0; }

@media (max-width: 1080px) {
  body.coop-ui #pilot { width: 244px; }
  #pilot2 { left: 266px; width: 244px; }
  #skills2 { left: 266px; }
  body.coop-ui #skills .skill, #skills2 .skill { width: 54px; height: 50px; }
}

/* 頭目戰演出與舒適度設定（2026-11-28）：電影式登場黑邊與字卡、半血狂怒血條變色震動、擊倒大字與減弱閃光／震動 */
#setFlashDesc, #setShakeDesc { margin-bottom: 12px; }
.screen button.fopt,
.screen button.sopt {
  padding: 9px 6px; font-size: 15px; border-radius: 4px;
  background: rgba(6, 12, 26, 0.85); color: #CFCBC0;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none;
}
.screen button.fopt:hover,
.screen button.sopt:hover { border-color: var(--ui-gold); color: #fff; background: rgba(18, 36, 74, 0.9); }
.screen button.fopt.active,
.screen button.sopt.active {
  background: var(--ui-gold); color: #1F2A22; border-color: var(--ui-gold);
  box-shadow: 0 3px 0 #9A7A00;
}

/* 頭目血條半血狂怒狀態：變色、狂怒字樣與瞬間震動（珍奶破綻時仍保留金色高亮） */
#boss .rage-tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #FFF8D6;
  background: linear-gradient(90deg, #D92018, #FF5A2A);
  border: 1px solid #FFD24A;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  box-shadow: 0 0 10px rgba(255, 74, 42, 0.85);
  animation: bossRagePulse 0.65s ease-in-out infinite alternate;
}
@keyframes bossRagePulse {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.08); filter: brightness(1.22); }
}
body.reduce-flash #boss .rage-tag { animation: none; }
#boss.raged .btrack {
  border-color: #FF5A3A;
  box-shadow: 0 0 12px rgba(255, 64, 42, 0.72);
}
#boss.raged #bossFill {
  background: linear-gradient(90deg, #A81212, #E63222 55%, #FF7A32);
  box-shadow: inset 0 0 8px rgba(255, 210, 110, 0.45);
}
#boss.raged.boba #bossFill {
  background: linear-gradient(90deg, #8F1A14, #D93E26 52%, #FF8C3A);
}
#boss.raged.vuln #bossFill {
  background: linear-gradient(90deg, #E89A1A, #FFF07A);
  box-shadow: 0 0 12px rgba(255, 232, 106, 0.9);
}
#boss.rage-shake {
  animation: bossBarShake 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes bossBarShake {
  0% { transform: translateX(-50%) translate(0, 0) scale(1); }
  12% { transform: translateX(-50%) translate(-10px, -3px) scale(1.04); }
  25% { transform: translateX(-50%) translate(10px, 3px) scale(1.04); }
  38% { transform: translateX(-50%) translate(-8px, 2px) scale(1.03); }
  52% { transform: translateX(-50%) translate(8px, -2px) scale(1.02); }
  68% { transform: translateX(-50%) translate(-5px, 1px) scale(1.01); }
  84% { transform: translateX(-50%) translate(3px, -1px) scale(1); }
  100% { transform: translateX(-50%) translate(0, 0) scale(1); }
}
body.reduce-shake #boss.rage-shake { animation: none; }
body.reduce-flash #photoFlash.flash { animation: photoShutterSoft 0.22s ease-out; }
@keyframes photoShutterSoft {
  0% { opacity: 0.16; }
  100% { opacity: 0; }
}

/* 演出期間暫時隱藏干擾性戰鬥標記，凸顯頭目特寫與社群截圖觀感 */
body.boss-cinematic #labels,
body.boss-cinematic #tip,
body.boss-cinematic #combo,
body.boss-cinematic #guard,
body.boss-cinematic #guardArrow,
body.boss-cinematic #p1Tag,
body.boss-cinematic #p2Tag,
body.boss-cinematic #nameTag,
body.boss-cinematic #dialog,
body.boss-cinematic #banner { opacity: 0 !important; pointer-events: none !important; }
body.boss-cinematic-intro #tl,
body.boss-cinematic-intro #tc,
body.boss-cinematic-intro #tr,
body.boss-cinematic-intro #pilot,
body.boss-cinematic-intro #pilot2,
body.boss-cinematic-intro #skills,
body.boss-cinematic-intro #skills2,
body.boss-cinematic-intro #news,
body.boss-cinematic-intro #boss { opacity: 0 !important; transition: opacity 0.2s ease; }

/* 頭目戰電影式演出覆層（登場上下黑邊、頭目名牌字卡、擊倒大字） */
#bossCin {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}
#bossCin.intro-active { pointer-events: auto; cursor: pointer; touch-action: manipulation; }

#bossCin .bc-bar {
  position: fixed;
  left: 0;
  right: 0;
  height: clamp(54px, 10.5vh, 108px);
  background: linear-gradient(180deg, #060A14, #0A1020);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 2;
}
#bossCin .bc-bar.top {
  top: 0;
  border-bottom: 2px solid rgba(242, 194, 0, 0.65);
  transform: translateY(-105%);
}
#bossCin .bc-bar.bot {
  bottom: 0;
  border-top: 2px solid rgba(242, 194, 0, 0.65);
  transform: translateY(105%);
}
#bossCin.bars-on .bc-bar.top,
#bossCin.bars-on .bc-bar.bot {
  transform: translateY(0);
}

/* 頭目登場仰視立繪（2026-11-28，S533）：疊在上下黑邊之間、從右側滑入略放大；減弱畫面震動時改為直接淡入 */
#bossIntroArt {
  position: fixed;
  left: 0;
  right: 0;
  top: clamp(54px, 10.5vh, 108px);
  bottom: clamp(54px, 10.5vh, 108px);
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  transform-origin: 78% 60%;
  animation: bossArtIn 0.56s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}
#bossIntroArtImg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.58));
}
@keyframes bossArtIn {
  from { opacity: 0; transform: translateX(12%) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1.04); }
}
body.reduce-shake #bossIntroArt {
  animation: bossArtFadeIn 0.36s ease-out forwards;
}
@keyframes bossArtFadeIn {
  from { opacity: 0; transform: none; }
  to { opacity: 1; transform: none; }
}

/* 頭目登場名牌與稱號字卡 */
#bossIntroCard {
  position: fixed;
  left: clamp(24px, 5vw, 76px);
  bottom: clamp(82px, 14.5vh, 148px);
  z-index: 3;
  max-width: min(620px, calc(100vw - 48px));
  padding: 14px 34px 16px 24px;
  background: linear-gradient(105deg, rgba(10, 20, 42, 0.94) 0%, rgba(16, 34, 66, 0.88) 72%, rgba(16, 34, 66, 0.15) 100%);
  border-left: 6px solid var(--ui-gold);
  border-top: 1px solid rgba(242, 194, 0, 0.55);
  border-bottom: 1px solid rgba(242, 194, 0, 0.35);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  animation: bossCardIn 0.42s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}
#bossIntroCard.boba {
  border-left-color: #E6A964;
  border-top-color: rgba(230, 169, 100, 0.68);
  background: linear-gradient(105deg, rgba(32, 18, 12, 0.94) 0%, rgba(62, 34, 20, 0.88) 72%, rgba(62, 34, 20, 0.18) 100%);
}
#bossIntroCard.banyan {
  border-left-color: #7CE05A;
  border-top-color: rgba(124, 224, 90, 0.62);
  background: linear-gradient(105deg, rgba(10, 28, 18, 0.94) 0%, rgba(18, 48, 30, 0.88) 72%, rgba(18, 48, 30, 0.18) 100%);
}
@keyframes bossCardIn {
  from { opacity: 0; transform: translateX(-46px) skewX(-6deg); }
  to { opacity: 1; transform: translateX(0) skewX(0); }
}
.bi-kicker {
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #FFF8D6;
  background: #D92820;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}
.bi-name {
  font-size: clamp(34px, 5.2vw, 58px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 6px;
  color: #FFF5CC;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.88), 0 0 22px rgba(242, 194, 0, 0.35);
}
#bossIntroCard.boba .bi-name {
  color: #FFE9C8;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9), 0 0 22px rgba(230, 169, 100, 0.45);
}
.bi-line {
  width: min(360px, 68vw);
  height: 3px;
  margin: 8px 0 8px;
  background: linear-gradient(90deg, var(--ui-gold), rgba(242, 194, 0, 0));
}
#bossIntroCard.boba .bi-line { background: linear-gradient(90deg, #E6A964, rgba(230, 169, 100, 0)); }
#bossIntroCard.banyan .bi-line { background: linear-gradient(90deg, #7CE05A, rgba(124, 224, 90, 0)); }
.bi-epithet {
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: bold;
  letter-spacing: 3px;
  color: #F3F1EA;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

#bossIntroSkip {
  position: fixed;
  right: clamp(18px, 3vw, 38px);
  bottom: clamp(14px, 3vh, 32px);
  z-index: 4;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #E6E2D8;
  background: rgba(18, 34, 64, 0.72);
  border: 1px solid rgba(242, 194, 0, 0.48);
  pointer-events: none;
  animation: bossSkipBlink 1.5s ease-in-out infinite;
}
@keyframes bossSkipBlink {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.48; }
}
body.reduce-flash #bossIntroSkip { animation: none; opacity: 0.9; }

/* 頭目擊倒大字演出 */
#bossKOCard {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}
.bko-band {
  width: 100%;
  padding: 20px 16px 22px;
  text-align: center;
  background: linear-gradient(90deg, rgba(10, 18, 38, 0) 0%, rgba(14, 26, 52, 0.86) 22%, rgba(14, 26, 52, 0.86) 78%, rgba(10, 18, 38, 0) 100%);
  border-top: 2px solid rgba(242, 194, 0, 0.85);
  border-bottom: 2px solid rgba(242, 194, 0, 0.85);
  box-shadow: 0 0 36px rgba(0, 0, 0, 0.65);
  animation: bossKOBandIn 0.28s cubic-bezier(0.12, 0.88, 0.25, 1) forwards;
}
@keyframes bossKOBandIn {
  from { opacity: 0; transform: scaleY(0.25); }
  to { opacity: 1; transform: scaleY(1); }
}
.bko-main {
  font-size: clamp(58px, 10vw, 118px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 14px;
  padding-left: 14px;
  color: #FFE45C;
  -webkit-text-stroke: 3px #2A1208;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #8E2C12, 0 10px 26px rgba(0, 0, 0, 0.9), 0 0 32px rgba(255, 210, 74, 0.78);
  animation: bossKOStamp 0.34s cubic-bezier(0.14, 0.92, 0.28, 1.18) forwards;
}
@keyframes bossKOStamp {
  0% { opacity: 0; transform: scale(2.1) rotate(-4deg); }
  65% { opacity: 1; transform: scale(0.94) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
body.reduce-shake .bko-main {
  animation: bossKOStampSoft 0.26s ease-out forwards;
}
@keyframes bossKOStampSoft {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
.bko-sub {
  margin-top: 6px;
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: bold;
  letter-spacing: 4px;
  color: #FFF5CC;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

@media (pointer: coarse) {
  #bossCin .bc-bar { height: clamp(34px, 9.5vh, 64px); }
  #bossIntroArt { top: clamp(34px, 9.5vh, 64px); bottom: clamp(34px, 9.5vh, 64px); }
  #bossIntroCard { left: 16px; bottom: clamp(50px, 13vh, 84px); padding: 10px 22px 10px 16px; }
  .bi-kicker { font-size: 11px; margin-bottom: 3px; }
  .bi-name { font-size: clamp(26px, 6.2vw, 38px); letter-spacing: 4px; }
  .bi-line { margin: 5px 0; }
  .bi-epithet { font-size: clamp(13px, 3vw, 17px); letter-spacing: 2px; }
  #bossIntroSkip { right: 12px; bottom: 8px; font-size: 11px; padding: 3px 10px; }
  .bko-main { font-size: clamp(44px, 11vw, 72px); letter-spacing: 8px; padding-left: 8px; }
  .bko-sub { font-size: 14px; }
}
