:root { --bg: #0d0a12; --fg: #f3eef8; --mut: #9d93ad; --line: rgba(255,255,255,.1); --acc: #ff8a3d; --gold: #ffd84a; --panel: rgba(18,14,26,.86);
  --f: -apple-system, "SF Pro Display", "PingFang TC", "Noto Sans TC", system-ui, sans-serif; }
html[lang=ja] { --f: -apple-system, "SF Pro Display", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif; } /* R118 日文用日文字形 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--f); overflow: hidden; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#safe { position: fixed; inset: 0; pointer-events: none; visibility: hidden; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; touch-action: none; display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--mut); }

.screen { position: fixed; inset: 0; display: none; padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 16px) calc(env(safe-area-inset-bottom) + 16px) calc(env(safe-area-inset-left) + 16px); }
.screen.on { display: flex; }
.hudlayer { pointer-events: none; }
.hudlayer > * { pointer-events: auto; }

/* 首頁：背後是活的戰場 */
#home { flex-direction: column; align-items: center; justify-content: space-between; background: radial-gradient(ellipse at 50% 40%, rgba(13,10,18,.15), rgba(13,10,18,.82) 75%); }
.logo { text-align: center; margin-top: 8vh; }
.logo h1 { font-size: clamp(52px, 15vw, 92px); margin: 0; font-weight: 900; letter-spacing: .06em; line-height: 1;
  background: linear-gradient(180deg, #fff6e0 10%, #ffb36a 55%, #ff5a2a 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(255,110,40,.45)); }
.logo .en { margin: 10px 0 0; font-weight: 800; letter-spacing: .55em; font-size: 13px; color: #ffcf9a; opacity: .85; padding-left: .55em; }
.logo p:last-child { margin: 14px 0 0; color: #d9cfe6; font-size: 15px; letter-spacing: .04em; text-shadow: 0 2px 10px #000; }
.menu { width: min(360px, 100%); display: flex; flex-direction: column; gap: 10px; margin-bottom: 4vh; }
.menu button, .panel button:not(.pick):not(.srow):not(.card) { min-height: 50px; border-radius: 14px; background: rgba(28,22,40,.85); border: 1px solid var(--line); font-weight: 700; font-size: 16px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .08s; }
button:active { transform: scale(.97); }
button:disabled { opacity: .35; }
.primary { background: linear-gradient(180deg, #ffa24a, #ff5f2a) !important; border: 0 !important; color: #1a0a02 !important; font-weight: 900 !important; font-size: 20px !important; min-height: 60px !important; letter-spacing: .08em; box-shadow: 0 8px 28px rgba(255,100,40,.35), inset 0 1px 0 rgba(255,255,255,.5); }
.primary.big { min-height: 64px !important; font-size: 22px !important; }
.daily { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-color: rgba(255,216,74,.35) !important; }
.daily small { color: var(--gold); font-weight: 600; font-size: 12px; }
.ghost { background: transparent !important; border-color: transparent !important; color: var(--mut); }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.row.small button { min-height: 40px !important; font-size: 14px !important; }
.dust { position: fixed; top: calc(env(safe-area-inset-top) + 14px); right: calc(env(safe-area-inset-right) + 16px); color: #cfc0ff; font-weight: 700; font-size: 15px; text-shadow: 0 2px 8px #000; }
.dust.inline { position: static; }

/* 面板頁 */
.panel { flex-direction: column; gap: 10px; background: linear-gradient(180deg, rgba(13,10,18,.94), rgba(13,10,18,.98)); overflow-y: auto; align-items: stretch; }
.panel > * { width: min(640px, 100%); margin-left: auto; margin-right: auto; }
.panel header { display: flex; justify-content: space-between; align-items: center; }
.panel header .ghost { min-height: 40px !important; padding: 0 6px; text-align: left; }
.panel h2 { margin: 6px 0 2px; font-size: 15px; letter-spacing: .12em; color: var(--mut); font-weight: 700; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px; border-radius: 14px; background: rgba(28,22,40,.8); border: 1.5px solid var(--line); text-align: center; min-height: 160px; }
.pick img { width: 72px; height: 72px; }
.pick b { font-size: 15px; }
.pick span { font-size: 11px; color: var(--mut); line-height: 1.35; }
.pick.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 24px color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 10%, rgba(28,22,40,.9)); }
.pick.lock { opacity: .55; filter: grayscale(.8); }
.maps .pick { min-height: 92px; justify-content: center; background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--c) 30%, transparent), var(--g)); }
.maps .pick span { display: flex; flex-wrap: wrap; justify-content: center; }
.maps .pick span img { width: 26px; height: 26px; }
#btnGo, #btnDailyGo { margin-top: auto; }
#difficultyPick { flex-shrink: 0; gap: 6px; }
#difficultyPick button { min-height: 46px; }
#difficultyPick button[aria-pressed="true"] { border: 2px solid #ffb36a; color: #ffcf95; background: #392636; }
#difficultyHelp { margin: -2px auto 2px; color: var(--mut); font-size: 13px; line-height: 1.45; }

#dailyInfo { text-align: center; padding: 20px 0; }
.dnum { font-size: 64px; font-weight: 900; color: var(--gold); text-shadow: 0 0 30px rgba(255,216,74,.4); }
.drule { margin: 10px 0 20px; color: var(--mut); display: flex; flex-direction: column; gap: 6px; } .drule b { color: var(--fg); font-size: 17px; }
.dpick { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; } .dpick img { width: 64px; }

.sitem { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(28,22,40,.8); border: 1px solid var(--line); margin-bottom: 8px; }
.sitem > div { flex: 1; display: flex; flex-direction: column; gap: 3px; } .sitem span { font-size: 13px; color: var(--mut); }
.sitem button { min-height: 40px !important; min-width: 88px; font-size: 14px !important; color: #e6dcff; }
.pips { display: flex; gap: 4px; margin-top: 3px; } .pips i { width: 14px; height: 4px; border-radius: 2px; background: #ffffff1f; } .pips i.on { background: #b8a8ff; box-shadow: 0 0 6px #b8a8ff; }

#dexList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dx { padding: 10px 6px; border-radius: 14px; background: rgba(28,22,40,.8); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; gap: 2px; }
.dx .dimg { display: flex; justify-content: center; } .dx img { width: 64px; height: 64px; }
.dx.s0 img { filter: brightness(0) opacity(.5); } .dx.s1 img { filter: saturate(.3) brightness(.7); }
.dx.s3 { border-color: var(--c); }
.dx.s3 .dimg img { width: 50px; height: 50px; }
.dx b { font-size: 13px; } .dx span { font-size: 11px; color: var(--mut); }

.srow { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px; background: rgba(28,22,40,.8); border: 1px solid var(--line); margin-bottom: 8px; font-size: 16px; }
.srow b { color: var(--acc); }

/* 暫停鈕、提示 */
.pausebtn { position: fixed; top: calc(env(safe-area-inset-top) + 92px); right: calc(env(safe-area-inset-right) + 10px); width: 40px; height: 40px; border-radius: 12px; background: rgba(18,14,26,.6); border: 1px solid var(--line); font-size: 12px; letter-spacing: -2px; color: #ddd; }
.hint { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%); padding: 12px 18px; border-radius: 99px; background: rgba(18,14,26,.75); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; animation: hintp 1.6s ease-in-out infinite; pointer-events: none; }
@keyframes hintp { 50% { transform: translateX(-50%) translateY(-6px); } }

/* 升級卡 */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 12px); background: rgba(6,4,10,.62); z-index: 20; }
.modal.on { display: flex; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.mbox { width: min(520px, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.mbox.center { align-items: center; text-align: center; }
.panelTip { margin: 0; align-self: center; max-width: 100%; padding: 4px 10px; border-radius: 8px; background: #241e2d; color: #f2e8cf; font-size: 13px; line-height: 1.4; text-align: center; }
.mbox h2 { text-align: center; margin: 0 0 4px; font-size: 22px; font-weight: 900; letter-spacing: .1em; color: var(--gold); text-shadow: 0 0 20px rgba(255,216,74,.5); }
#cards { display: flex; flex-direction: column; gap: 9px; }
.card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 88px; border-radius: 16px; background: linear-gradient(100deg, color-mix(in srgb, var(--c) 16%, #1a1426), #15111e 60%); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: cardin .32s cubic-bezier(.2,1.4,.4,1) both; animation-delay: var(--d); }
@keyframes cardin { from { opacity: 0; transform: translateY(18px) scale(.94); } }
.card.evo { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(255,216,74,.35); background: linear-gradient(100deg, rgba(255,216,74,.22), #1d1608 70%); }
.card.evo .cn { color: var(--gold); }
.ci { width: 58px; height: 58px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--c); }
.ci canvas { width: 58px; height: 58px; }
.ct { flex: 1; min-width: 0; }
.cn { font-weight: 800; font-size: 17px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cn em { font-style: normal; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 6px; background: var(--c); color: #120c06; letter-spacing: .05em; }
.cn small { font-size: 12px; color: var(--mut); font-weight: 600; }
.cd { font-size: 13px; color: #cfc6dc; margin-top: 3px; line-height: 1.4; }
.cd i { display: block; font-style: normal; color: color-mix(in srgb, var(--c) 70%, #fff); font-size: 12px; margin-top: 2px; }
#cards.banishing .card { border-style: dashed; filter: saturate(.5); }
#btnBanish.active { color: #ff6b8a !important; }

/* 寶匣（R16 重做：插畫寶匣、光芒旋轉、獎勵跟升級卡同一套） */
.chestTitle { margin: 0; font-size: 22px; letter-spacing: .1em; color: var(--gold); text-shadow: 0 0 18px rgba(255,216,74,.5); }
.chestbox { position: relative; width: 190px; height: 190px; flex-shrink: 0; margin: 6px auto 0; cursor: pointer; }
.chestbox img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 2; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.chestbox .cclosed { animation: shakebox 1.1s ease-in-out infinite; }
.chestbox .copen { opacity: 0; transform: scale(.85); transition: opacity .2s, transform .45s cubic-bezier(.2,1.8,.4,1); }
.chestbox .halo { position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(255,216,74,.45), transparent 65%); animation: halop 1.6s ease-in-out infinite; z-index: 1; }
.chestbox .rays { position: absolute; left: 50%; top: 50%; width: 400px; height: 400px; margin: -200px 0 0 -200px; border-radius: 50%; opacity: 0; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,222,120,.24) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 15%, transparent 50%); mask: radial-gradient(circle, #000 15%, transparent 50%); transition: opacity .4s; }
.chestbox.open { cursor: default; }
.chestbox.open .cclosed { opacity: 0; animation: none; }
.chestbox.open .copen { opacity: 1; transform: scale(1.05); }
.chestbox.open .rays { opacity: 1; animation: spin 9s linear infinite; }
.chestbox.open .halo { inset: -10%; background: radial-gradient(circle, rgba(255,240,190,.7), rgba(255,216,74,.25) 40%, transparent 70%); }
@keyframes shakebox { 0%,62%,100% { transform: rotate(0) scale(1); } 70% { transform: rotate(-5deg) scale(1.04); } 78% { transform: rotate(5deg) scale(1.04); } 86% { transform: rotate(-3deg); } 94% { transform: rotate(2deg); } }
@keyframes halop { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes spin { to { transform: rotate(360deg); } }
.chestHint { margin: 0; font-size: 17px; font-weight: 800; color: #ffe9a0; min-height: 1.2em; animation: hintp 1.6s ease-in-out infinite; }
#chestItems { display: flex; flex-direction: column; gap: 10px; width: 100%; position: relative; z-index: 3; }
.citem { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 78px; border-radius: 16px; text-align: left;
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 18%, #1a1426), #15111e 65%); border: 1.5px solid color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 6px 20px rgba(0,0,0,.45);
  animation: cardin .45s cubic-bezier(.2,1.6,.4,1) both; animation-delay: var(--d); }
.citem canvas { width: 58px; height: 58px; flex: none; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 60%, transparent)); }
.citem .hp { width: 58px; flex: none; font-style: normal; font-size: 40px; text-align: center; color: var(--c); text-shadow: 0 0 14px var(--c); }
.citem em { display: inline-block; font-style: normal; font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 6px; background: var(--c); color: #120c06; letter-spacing: .05em; }
.citem b { display: block; margin-top: 4px; font-size: 20px; font-weight: 900; color: #fff; line-height: 1.25; }
.citem.evo { box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(255,216,74,.4); } .citem.evo b { color: var(--gold); font-size: 22px; }
@media (orientation: landscape) and (max-height: 500px) { .chestbox { width: 120px; height: 120px; } .chestTitle { display: none; } #chestItems { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } .citem { min-height: 64px; } .citem b { font-size: 17px; } }
body.calm .chestbox.open .rays { animation: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .mbox .chestTitle.trialReward { display: block; font-size: 16px; letter-spacing: .02em; }
  #chestHint:empty { display: none; }
  .chestbox.open { width: 64px; height: 64px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  #chestItems { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .citem { padding: 6px 8px; gap: 8px; }
  .citem canvas, .citem .hp { width: 36px; height: 36px; }
  .citem.evo b { font-size: 17px; }
}

/* 暫停內容 */
.prow { display: flex; flex-wrap: wrap; gap: 6px; }
.pi { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 10px; background: rgba(28,22,40,.85); font-size: 12px; font-weight: 700; }
.pi canvas { width: 34px; height: 34px; } .pi.sm canvas { width: 24px; height: 24px; }
.links span { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; border: 1px solid var(--c); color: color-mix(in srgb, var(--c) 70%, #fff); }

/* 橫幅 */
.banner { position: fixed; left: 50%; top: 26%; transform: translate(-50%, -50%) scale(.8); display: flex; align-items: center; gap: 12px; padding: 12px 22px 12px 14px; border-radius: 18px; background: linear-gradient(90deg, rgba(10,6,16,.0), rgba(10,6,16,.88) 15%, rgba(10,6,16,.88) 85%, rgba(10,6,16,0)); opacity: 0; pointer-events: none; z-index: 15; white-space: nowrap; transition: opacity .25s, transform .35s cubic-bezier(.2,1.6,.4,1); }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (orientation: portrait) {
  .banner { width: max-content; max-width: calc(100vw - 24px); white-space: normal; }
}
@media (orientation: portrait) and (max-height: 700px) {
  body:has(#tip.show:not(.hidden)) .banner { top: calc(env(safe-area-inset-top) + 225px); }
}
@media (orientation: portrait) and (max-height: 700px) and (max-width: 520px) {
  body:has(#tip.show:not(.hidden)) .banner { top: calc(env(safe-area-inset-top) + 170px); left: calc((100% - env(safe-area-inset-right) - 50px) / 2); max-width: calc(100vw - env(safe-area-inset-right) - 76px); }
}
.banner canvas { width: 52px; height: 52px; filter: drop-shadow(0 0 12px var(--c)); }
.banner b { display: block; font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 0 18px var(--c), 0 2px 0 #000; letter-spacing: .04em; }
.banner span { display: block; font-size: 13px; color: color-mix(in srgb, var(--c) 60%, #fff); font-weight: 700; margin-top: 2px; }
.banner.big b { font-size: 30px; } .banner.big canvas { width: 72px; height: 72px; }
.banner.small { top: 34%; } .banner.small b { font-size: 18px; color: color-mix(in srgb, var(--c) 40%, #fff); }

/* 結算 */
.result { align-items: center; text-align: center; justify-content: center; gap: 12px; }
.result h1 { margin: 0; font-size: 40px; font-weight: 900; color: #ff6b8a; letter-spacing: .08em; }
#resContext { margin: 4px 0 0; font-size: 14px; line-height: 1.35; color: var(--fg); }
.result.won h1 { background: linear-gradient(180deg, #fff6e0, #ffb36a 60%, #ff5a2a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { display: flex; flex-direction: column; padding: 10px 4px; border-radius: 12px; background: rgba(28,22,40,.8); } .stats span { font-size: 11px; color: var(--mut); } .stats b { font-size: 20px; }
.team { display: flex; justify-content: center; gap: 6px; min-height: 0; } .team canvas { width: 58px; height: 58px; }
.dmg { display: flex; flex-direction: column; gap: 4px; }
.drow { display: grid; grid-template-columns: 26px 1fr 64px; align-items: center; gap: 8px; font-size: 12px; text-align: left; position: relative; }
.drow :is(img, canvas) { width: 26px; height: 26px; } .drow span { position: relative; z-index: 1; font-weight: 700; padding-left: 4px; } .drow b { text-align: right; font-variant-numeric: tabular-nums; }
.drow i { position: absolute; left: 34px; top: 4px; bottom: 4px; max-width: calc(100% - 106px); border-radius: 4px; background: linear-gradient(90deg, rgba(255,138,61,.45), rgba(255,138,61,.1)); }
.note { color: var(--gold); font-size: 14px; font-weight: 700; min-height: 0; margin: 0; }
#resNextGoal { margin: 0 auto; color: #f2dab2; font-size: 14px; font-weight: 650; line-height: 1.35; }
#resNextGoal:empty, #btnTryUnlock:empty, #resTeam:empty, #resQuest:empty { display: none; }
#setCode { width: 100%; box-sizing: border-box; margin: 10px 0 0; padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: var(--mut); font: 11px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; resize: none; }
/* R94 新手視角審查修正 */
#pause .mbox { padding: clamp(12px, 3vw, 20px); border: 1px solid #55404c; border-radius: 16px; background: #19141e; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
#pause .mbox .primary { border-radius: 14px !important; }
#pauseBody { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#btnRelease.ghost { border: 1px solid rgba(255,255,255,.24) !important; border-radius: 14px; color: #e6dcef; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
#btnRelease small { font-size: 11px; color: var(--mut); font-weight: 600; margin-top: 2px; }
#setup #btnGo, #dailyIntro #btnDailyGo { position: sticky; bottom: 6px; z-index: 3; box-shadow: 0 -6px 24px rgba(13,10,18,.9), 0 6px 18px rgba(255,110,40,.35); }
body:has(#levelup.on) .dashbtn, body:has(#levelup.on) .burstbtn, body:has(#chest.on) .dashbtn, body:has(#chest.on) .burstbtn { visibility: hidden; }
.burstbtn .blbl { position: absolute; left: 0; right: 0; bottom: -17px; text-align: center; font-size: 11px; font-weight: 800; color: #e8d9ff; text-shadow: 0 1px 4px #000; pointer-events: none; }
/* R95 新手視角審查第二批 */
.sitem button { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.sitem button small { font-size: 10px; font-weight: 700; opacity: .8; }
.sitem button.buy { background: linear-gradient(180deg, #ffb055, #ff7a2a) !important; border-color: transparent !important; color: #1a0a02 !important; font-weight: 900; }
.sitem button.short { opacity: 1 !important; color: #ff8f8f !important; background: rgba(255,255,255,.04) !important; }
.sitem button.maxed { color: #b8a8ff !important; }
.pips i { background: #ffffff38; }
.panel { background: linear-gradient(180deg, rgba(13,10,18,.975), rgba(13,10,18,.99)); }
#home .menu .row .ghost { border: 1px solid rgba(255,255,255,.14) !important; border-radius: 12px; }
/* R96 子頁標題與說明跟內容對齊（.panel h2 的 margin 簡寫蓋掉了置中，橫式時標題貼最左邊） */
.panel > h2, .panel > p { margin-left: auto; margin-right: auto; }
/* R101 新手視角第二次審查 */
.sitem button span.pr { color: inherit; font-size: 15px; font-weight: 900; }
.sitem button em.sd { font-style: normal; color: #b8a8ff; text-shadow: 0 0 4px rgba(0,0,0,.6); }
.sitem button.buy em.sd { color: #4a2a8a; }
#result #btnHome.ghost { border: 1px solid rgba(255,255,255,.18) !important; border-radius: 14px; color: #e6dcef !important; }
.panel { background: linear-gradient(180deg, #0d0a12, #0b0910); }
.pausebtn { font-size: 0 !important; display: flex; align-items: center; justify-content: center; gap: 5px; }
.pausebtn::before, .pausebtn > .pb { content: ''; width: 5px; height: 16px; border-radius: 2px; background: #e8e0f4; }
.pausebtn::before { box-shadow: 10px 0 0 #e8e0f4; margin-right: 10px; }
body.pad .pausebtn::after { font-size: 12px; }
@media (orientation: landscape) and (max-height: 500px) {
  #setup #btnGo, #dailyIntro #btnDailyGo { min-height: 50px !important; font-size: 18px !important; }
  #setup, #dailyIntro { padding-bottom: 8px; }
  #setup::after, #dailyIntro::after { content: ''; flex: 0 0 4px; }
}
/* R91 首頁顯示下一個解鎖目標 */
.homegoal { margin: 0; padding: 6px 14px; border-radius: 999px; background: rgba(28,22,40,.72); border: 1px solid rgba(255,207,138,.28); color: #f2dab2; font-size: 13px; font-weight: 650; text-align: center; max-width: calc(100vw - 32px); }
.homegoal:empty { display: none; }
@media (orientation: landscape) and (max-height: 500px) { .homegoal { display: none; } }
@media (orientation: portrait) and (max-height: 600px) { .homegoal { display: none; } }
/* R89 每日補給 */
.gifttoast { position: fixed; left: 50%; top: max(calc(env(safe-area-inset-top) + 64px), 27vh); width: max-content; transform: translate(-50%, -14px); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; border-radius: 16px; background: rgba(36,22,14,.94); border: 1px solid rgba(255,190,110,.6); box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 24px rgba(255,140,50,.25); color: #ffe2b0; text-align: center; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
.gifttoast.show { opacity: 1; transform: translate(-50%, 0); }
.gifttoast b { font-size: 16px; font-weight: 800; white-space: nowrap; } .gifttoast small { font-size: 12px; color: #c9b8d6; font-weight: 600; }
body.calm .gifttoast { transition: opacity .3s; transform: translate(-50%, 0); }
/* R83 加到主畫面提示 */
.installtip { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-radius: 14px; background: rgba(255,170,90,.09); border: 1px solid rgba(255,170,90,.32); color: #f2dab2; font-size: 12.5px; font-weight: 600; line-height: 1.4; text-align: left; }
.installtip.hidden { display: none; }
.installtip span { flex: 1; }
.installtip button { min-height: 32px !important; flex: none; }
#btnInstall { padding: 0 14px; border-radius: 10px; background: #ff9a3c; color: #1a1020; font-weight: 800; }
#btnInstallX { width: 32px; padding: 0; color: var(--mut); }
@media (orientation: landscape) and (max-height: 500px) { .installtip { display: none; } }
@media (orientation: portrait) and (max-height: 600px) { .installtip { display: none; } }
#setPrivacy { white-space: pre-line; margin: 14px 4px 0; color: var(--mut); font-size: 12px; font-weight: 500; line-height: 1.5; text-align: center; }
#resBest { margin: 0 auto; color: #f2dab2; font-size: 13px; font-weight: 650; line-height: 1.35; }
#resBest:empty { display: none; }
.stats div { position: relative; }
.stats div.rec { background: linear-gradient(180deg, rgba(90,62,18,.9), rgba(40,28,14,.9)); box-shadow: 0 0 0 1px rgba(255,210,110,.75), 0 0 18px rgba(255,180,60,.35); }
.stats div.rec b { color: #ffe08a; }
.stats div.rec em { position: absolute; top: -8px; right: -4px; padding: 1px 6px; border-radius: 8px; background: #ffb83f; color: #2a1606; font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: .5px; }
#resQuest { margin: 0 auto; color: var(--mut); font-size: 13px; font-weight: 600; line-height: 1.35; }
#result.on ~ #banner:not(.pad-connected) { display: none; }
.resultActions { display: flex; flex-direction: column; gap: 8px; }
.resultActions > button { flex: 1; min-width: 0; padding: 8px 12px; }
#btnTryUnlock { background: #2b222a; color: #ffe7b2; border: 1px solid #96764d; }
@media (min-width: 540px) {
  .resultActions { flex-direction: row; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .logo { margin-top: 2vh; } .logo h1 { font-size: 48px; } .menu { margin-bottom: 0; gap: 6px; } .menu button { min-height: 42px; } .primary { min-height: 50px !important; }
  .picks { grid-template-columns: repeat(3, 1fr); } .pick { min-height: 120px; } .pick img { width: 52px; height: 52px; }
  #cards { display: grid; grid-template-columns: repeat(3, 1fr); } .card { flex-direction: column; text-align: center; min-height: 0; } .cn { justify-content: center; }
  .mbox { width: min(820px, 100%); }
  .banner { top: 38%; }
}
@media (min-width: 900px) { #cards { display: grid; grid-template-columns: repeat(3, 1fr); } .card { flex-direction: column; text-align: center; padding: 18px 14px; } .cn { justify-content: center; } .mbox { width: min(860px, 100%); } .ci, .ci canvas { width: 72px; height: 72px; } }
@media (orientation: landscape) and (max-height: 500px) {
  #levelup .mbox:has(#cards > :nth-child(4)) h2 { align-self: center; padding: 0 10px; border-radius: 8px; background: #19141e; }
  #cards:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #cards:has(> :nth-child(4)) .card { gap: 6px; padding: 8px; }
  #cards:has(> :nth-child(4)) .ct { max-width: 100%; overflow-wrap: anywhere; }
}
@media (orientation: landscape) and (max-height: 360px) {
  #levelup .mbox:has(#cards > :nth-child(4)) { gap: 6px; }
  #levelup .mbox:has(#cards > :nth-child(4)) h2 { margin-bottom: 0; }
  #cards:has(> :nth-child(4)) .card { padding-block: 6px; }
  #cards:has(> :nth-child(4)) .ci,
  #cards:has(> :nth-child(4)) .ci canvas { width: 40px; height: 40px; }
  #cards:has(> :nth-child(4)) .cn { font-size: 15px; gap: 2px 4px; }
  #cards:has(> :nth-child(4)) .cd { font-size: 12px; line-height: 1.3; }
}

.note .prog { color: var(--mut); font-weight: 600; font-size: 13px; }

.center { text-align: center; }
.swapnew { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; } .swapnew canvas { width: 96px; height: 96px; filter: drop-shadow(0 0 16px rgba(255,255,255,.35)); }
.swaplist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.swapb { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 14px; background: rgba(28,22,40,.9); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.swapb canvas { width: 64px; height: 64px; } .swapb b { font-size: 14px; } .swapb span { font-size: 12px; color: var(--mut); }
#btnRelease { min-height: 44px; }
.cageControl { min-height: 44px; padding: 8px 12px; border: 1px solid #826247; border-radius: 12px; background: #2a2028; color: #ffe4ae; font-weight: 750; }
#pauseBody { min-height: 0; overflow-y: auto; }
#pause .mbox > :not(#pauseBody), #swap .mbox > * { flex-shrink: 0; }
#swapSub, .cageHint, #cageStatus { margin: 0; text-align: center; font-size: 14px; line-height: 1.4; }
:is(#swap, #cage) { z-index: 36; }
:is(#swap, #cage).on { animation: none; }
:is(#swap, #cage) .mbox { padding: clamp(8px, 2vw, 16px); border: 1px solid #55404c; border-radius: 16px; background: #19141e; }
.cageHint { color: #e0d4e5; }
#cageStatus { color: #ffe4ae; }
#cageStatus:empty { display: none; }
.cageTeams { display: grid; gap: 14px; min-height: 0; overflow-y: auto; }
.cageTeams section { min-width: 0; }
.cageTeams h3 { margin: 0 4px 5px; font-size: 14px; color: var(--gold); }
.cageSlots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; }
.cageMember { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 48px; padding: 4px; text-align: left; background: #241e2d; border: 1px solid var(--c); border-radius: 10px; }
.cageMember canvas { flex: none; width: 38px; height: 38px; }
.cageMember > span { min-width: 0; overflow-wrap: anywhere; }
.cageMember b, .cageMember small { display: block; }
.cageMember b { font-size: 14px; } .cageMember small { font-size: 12px; color: #c8bdcf; }
.linkPreview i { display: block; font-style: normal; font-size: 12px; font-weight: 800; margin-top: 3px; }
.cageMember:disabled { opacity: .8; }
.cageMember[aria-pressed="true"] { background: #403044; box-shadow: inset 0 0 0 2px var(--c); }
@media (orientation: landscape) and (max-height: 500px) {
  #swap .mbox, #cage .mbox { gap: 6px; }
  #swapNew { flex-direction: row; justify-content: center; } #swapNew canvas { width: 44px; height: 44px; }
  #swapList { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #swapList .swapb { padding: 4px; } #swapList canvas { width: 40px; height: 40px; }
  .cageTeams { grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 8px; }
  #cageList { grid-template-columns: 1fr; }
  .cageMember canvas { width: 32px; height: 32px; }
  .cageMember b { font-size: 13px; }
  .cageMember small { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 380px) {
  #cage { padding-top: calc(env(safe-area-inset-top) + 6px); padding-bottom: calc(env(safe-area-inset-bottom) + 6px); }
  #cage .mbox { gap: 4px; }
  #cageTitle { margin-bottom: 0; font-size: 19px; }
  #cage .mbox:has(#cageStatus:not(:empty)) .cageHint { display: none; }
}
.swapb i { font-style: normal; font-size: 11px; font-weight: 800; margin-top: 3px; }
:is(.swapb, .linkPreview) .gain { color: #ffd84a; }
:is(.swapb, .linkPreview) .lose { color: #ff6b8a; }
.recs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; } .recs div { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 12px; background: rgba(28,22,40,.6); } .recs span { font-size: 10px; color: var(--mut); } .recs b { font-size: 15px; }
/* R84 開機畫面：不用等程式就出現標題與進度 */
#boot { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(ellipse at 50% 42%, #2a1610 0%, #0d0a12 62%); font-family: -apple-system, "PingFang TC", "Noto Sans TC", system-ui, sans-serif; }
#boot h1 { margin: 0; font-size: clamp(44px, 14vw, 84px); font-weight: 900; letter-spacing: 4px; background: linear-gradient(180deg, #ffe7b8, #ff9a3c 70%, #ff6a2a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#boot .en { margin: 0; color: #ffcf8a; font-weight: 800; letter-spacing: 10px; font-size: 15px; }
#boot .bootbar { width: min(220px, 60vw); height: 4px; margin-top: 18px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
#boot .bootbar i { display: block; width: 4%; height: 100%; background: linear-gradient(90deg, #ff9a3c, #ffd28a); transition: width .25s ease-out; }
#boot small { color: #b9aec4; font-size: 12px; font-weight: 600; letter-spacing: 1px; }
body.ready #boot { display: none; }

/* 契約爆發按鈕 */
.burstbtn { position: fixed; right: calc(env(safe-area-inset-right) + 16px); bottom: calc(env(safe-area-inset-bottom) + 44px); width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#ffb347 calc(var(--f, 0) * 360deg), rgba(30,24,40,.75) 0); border: 2px solid rgba(255,255,255,.18); box-shadow: 0 6px 20px rgba(0,0,0,.5); touch-action: none; }
.burstbtn i { position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2a2038, #120e1a); }
.burstbtn span { position: relative; font-weight: 900; font-size: 13px; color: #cfc6dc; letter-spacing: .02em; }
.burstbtn.ready { border-color: #ffd84a; animation: burstp 0.8s ease-in-out 3; } .burstbtn.ready i { background: radial-gradient(circle at 50% 35%, #ff9a3d, #b8340f); } .burstbtn.ready span { color: #fff; font-size: 15px; text-shadow: 0 1px 4px #000; }
body.calm .burstbtn.ready { animation: none; }
@keyframes burstp { 50% { box-shadow: 0 0 0 8px rgba(255,216,74,.25), 0 0 34px rgba(255,150,40,.8); transform: scale(1.06); } }
/* 大招演出 */
.cutin { position: fixed; left: 0; right: 0; top: 40%; height: 120px; display: flex; align-items: center; gap: 14px; padding-left: 8vw; pointer-events: none; z-index: 16; opacity: 0;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--c) 55%, #000) 20%, color-mix(in srgb, var(--c) 30%, #000) 70%, transparent); transform: skewY(-4deg) translateX(-100%); }
.cutin.show { animation: cut 1.3s cubic-bezier(.2,1,.3,1) forwards; }
.cutin img { width: 150px; height: 150px; margin-top: -30px; filter: drop-shadow(0 0 20px var(--c)); }
.cutin b { display: block; font-size: 38px; font-weight: 900; color: #fff; text-shadow: 0 0 24px var(--c), 0 3px 0 #000; letter-spacing: .1em; } .cutin span { color: #fff; font-weight: 700; opacity: .85; }
@keyframes cut { 0% { opacity: 0; transform: skewY(-4deg) translateX(-100%); } 18% { opacity: 1; transform: skewY(-4deg) translateX(0); } 78% { opacity: 1; transform: skewY(-4deg) translateX(3%); } 100% { opacity: 0; transform: skewY(-4deg) translateX(40%); } }

.heatrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .heatrow > span { font-size: 13px; color: var(--mut); font-weight: 700; margin-right: 4px; }
.heatrow .heat { min-height: 36px !important; padding: 0 10px; border-radius: 10px !important; font-size: 13px !important; } .heatrow .heat.sel { border-color: #ff9a3d !important; color: #ffb36a; box-shadow: 0 0 14px rgba(255,140,60,.35); }
.heatrow small { width: 100%; color: #ffb36a; font-size: 12px; }
#achList { display: flex; flex-direction: column; gap: 6px; }
.ach { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 14px; border-radius: 12px; background: rgba(28,22,40,.8); border: 1px solid var(--line); opacity: .65; }
.ach.got { opacity: 1; border-color: rgba(255,216,74,.45); } .ach b { font-size: 15px; } .ach span { grid-column: 1; font-size: 12px; color: var(--mut); } .ach i { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; color: #cfc0ff; font-weight: 800; }
#home .row { flex-wrap: nowrap; } #home .row button { font-size: 15px; }
#charList { grid-template-columns: repeat(4, 1fr); gap: 6px; } #charList .pick { min-height: 150px; padding: 8px 4px 10px; } #charList .pick img { width: 60px; height: 60px; } #charList .pick span { font-size: 10px; }

/* R5：衝刺鍵 */
.dashbtn { position: fixed; right: calc(env(safe-area-inset-right) + 104px); bottom: calc(env(safe-area-inset-bottom) + 50px); width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#9fe8ff calc(var(--f, 1) * 360deg), rgba(30,24,40,.75) 0); border: 2px solid rgba(255,255,255,.16); box-shadow: 0 6px 18px rgba(0,0,0,.5); touch-action: none; padding: 0; min-height: 0; }
.dashbtn i { position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #22303c, #0f141a); }
.dashbtn span { position: relative; font-weight: 900; font-size: 13px; color: #8fa3b3; }
.dashbtn.ready { border-color: #bff3ff; } .dashbtn.ready i { background: radial-gradient(circle at 50% 35%, #3fb6e0, #155d86); } .dashbtn.ready span { color: #fff; text-shadow: 0 1px 4px #000; }
.dashbtn:active { transform: scale(.92); }
/* 每日任務 */
.quests { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-color: rgba(159,232,255,.3) !important; }
.quests small { color: #9fe8ff; font-weight: 600; font-size: 12px; } .quests.alldone small { color: var(--gold); }
#questList { display: flex; flex-direction: column; gap: 8px; }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; border-radius: 12px; background: rgba(28,22,40,.8); border: 1px solid var(--line); }
.quest b { font-size: 15px; } .quest span { font-size: 12px; color: var(--mut); grid-column: 1; } .quest em { grid-row: 1 / 4; grid-column: 2; align-self: center; font-style: normal; color: #cfc0ff; font-weight: 800; }
.quest .qbar { grid-column: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; } .quest .qbar i { display: block; height: 100%; background: linear-gradient(90deg, #3fb6e0, #9fe8ff); border-radius: 3px; }
.quest.done { border-color: rgba(255,216,74,.45); } .quest.done .qbar i { background: linear-gradient(90deg, #ffb347, #ffd84a); }
.quest.bonus { background: rgba(48,36,20,.7); }
/* 契師等級 */
.plchip { position: fixed; top: calc(env(safe-area-inset-top) + 18px); left: calc(env(safe-area-inset-left) + 116px); color: #ffd9a8; font-weight: 700; font-size: 13px; text-shadow: 0 2px 8px #000; display: grid; grid-template-columns: max-content auto; align-items: baseline; gap: 3px 4px; }
.plchip b { font-size: 16px; color: #fff; } .plchip i { grid-column: 1 / -1; min-width: 92px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #ffb347 var(--w), rgba(255,255,255,.15) 0); }
@media (orientation: portrait) and (max-width: 360px) {
  .plchip { top: calc(env(safe-area-inset-top) + 37px); left: auto; right: calc(env(safe-area-inset-right) + 16px); }
  .logo { margin-top: max(8vh, 58px); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .plchip { top: calc(env(safe-area-inset-top) + 64px); left: calc(env(safe-area-inset-left) + 12px); grid-template-columns: 92px; }
}
.respl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; color: #ffd9a8; font-weight: 700; }
.respl b { font-size: 17px; color: #fff; display: inline-block; } .respl small { color: var(--mut); font-size: 12px; }
.respl .plbar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; } .respl .plbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9a3d, #ffd84a); box-shadow: 0 0 10px #ffb347; }
.respl.up b { animation: plup .5s ease-out; } @keyframes plup { 40% { transform: scale(1.6); color: #ffd84a; } }
@media (orientation: landscape) and (max-height: 500px) { .dashbtn { right: calc(env(safe-area-inset-right) + 102px); } }
/* R5：結算內容變多，橫式要能捲、不被擠壓；提示字讓開衝刺鍵 */
.result { justify-content: flex-start; } .result > * { flex-shrink: 0; } .result > :first-child { margin-top: auto; } .result > :last-child { margin-bottom: auto; }
.hint { bottom: calc(env(safe-area-inset-bottom) + 150px); }
/* 短橫式（568×320 等）首頁可以捲，設定不會被推出畫面 */
@media (orientation: landscape) and (max-height: 500px) { #home { overflow-y: auto; justify-content: flex-start; gap: 8px; padding-bottom: 12px; } #home > * { flex-shrink: 0; } .logo h1 { font-size: 40px; } }
/* R6：四張地圖 */
#mapList { grid-template-columns: repeat(2, 1fr); }
@media (orientation: landscape) and (max-height: 500px) { #mapList { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { #mapList { grid-template-columns: repeat(4, 1fr); } }

/* R7：新手提示 */
.tip { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 92px); transform: translate(-50%, -10px); max-width: min(92vw, 520px); display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 14px;
  background: rgba(18,14,26,.88); border: 1px solid rgba(255,216,74,.45); box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 14px; font-weight: 700; line-height: 1.4; color: #fff3d6; opacity: 0; pointer-events: none; z-index: 14; transition: opacity .25s, transform .25s; }
.tip.show { opacity: 1; transform: translate(-50%, 0); } .tip b { font-size: 16px; }
@media (orientation: portrait) and (max-width: 520px) {
  .tip { top: auto; bottom: calc(env(safe-area-inset-bottom) + 138px); }
  body:has(#tip.show:not(.hidden)) #hint { visibility: hidden; }
}
/* R7：頭目登場卡 */
.bosscard { position: fixed; inset: 0; pointer-events: none; z-index: 17; opacity: 0; display: flex; align-items: center; justify-content: center; gap: 4px; }
.bosscard.show { animation: bcfade 2.6s ease forwards; }
.bosscard .stripe { position: absolute; left: -10%; right: -10%; height: 34px; background: repeating-linear-gradient(-45deg, #ff2d55 0 18px, #1a0610 18px 36px); opacity: .85; }
.bosscard .stripe.top { top: 18%; } .bosscard .stripe.bot { bottom: 18%; }
.bosscard.show .stripe.top { animation: stripe 2.6s linear; } .bosscard.show .stripe.bot { animation: stripe 2.6s linear reverse; }
.bosscard img { width: min(46vw, 260px); height: auto; filter: drop-shadow(0 0 30px rgba(255,45,85,.7)); transform: translateX(60px); }
.bosscard.show img { animation: bcin 2.6s cubic-bezier(.2,1,.3,1) forwards; }
.bosscard div { display: flex; flex-direction: column; } .bosscard span { color: #ff8aa0; font-weight: 800; letter-spacing: .2em; font-size: 13px; }
.bosscard b { color: #fff; font-size: clamp(26px, 7vw, 44px); font-weight: 900; text-shadow: 0 0 24px #ff2d55, 0 3px 0 #000; }
@keyframes bcfade { 0% { opacity: 0; background: rgba(0,0,0,0); } 12% { opacity: 1; background: rgba(10,0,6,.45); } 80% { opacity: 1; background: rgba(10,0,6,.45); } 100% { opacity: 0; background: rgba(0,0,0,0); } }
@keyframes bcin { 0% { transform: translateX(120px); opacity: 0; } 20% { transform: translateX(0); opacity: 1; } 85% { transform: translateX(-10px); opacity: 1; } 100% { transform: translateX(-60px); opacity: 0; } }
@keyframes stripe { from { background-position: 0 0; } to { background-position: 200px 0; } }
@media (orientation: landscape) and (max-height: 500px) { .tip { top: calc(env(safe-area-inset-top) + 64px); } .bosscard img { width: 30vh; } }
.drow .dico { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-style: normal; color: #ffd84a; font-size: 16px; }
/* R7 修：提示在升級視窗之上、寬度依文字；頭目卡蓋過橫幅 */
.tip { z-index: 40; width: max-content; } .bosscard { z-index: 35; }
#charList { grid-template-columns: repeat(5, 1fr); gap: 5px; } #charList .pick { padding: 8px 2px 10px; } #charList .pick img { width: 52px; height: 52px; } #charList .pick b { font-size: 13px; }
@media (max-width: 360px) { #charList { grid-template-columns: repeat(3, 1fr); } #charList .pick b { font-size: 12px; word-break: break-word; } }
.vtitle { font-size: 30px !important; color: #ffd84a !important; letter-spacing: .1em; } #victory .mbox { display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: 420px; } #victoryQ { text-align: center; line-height: 1.5; }
.recs { grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); }
.dx .bond { display: block; font-style: normal; color: #ff8ab8; font-size: 11px; letter-spacing: 1px; } .bondnote { font-size: 12px; margin: 0 0 6px; }
/* 安靜模式（關掉晃動與閃光）：頭目卡、大招橫幅不滑動、不閃 */
body.calm .bosscard.show { animation: bcfadecalm 2.6s linear forwards; } body.calm .bosscard .stripe { animation: none !important; opacity: .5; } body.calm .bosscard.show img { animation: none; transform: none; opacity: 1; }
body.calm .cutin.show { animation: cutcalm 1.3s linear forwards; } body.calm .cutin { transform: skewY(-4deg); filter: brightness(.75); }
@keyframes bcfadecalm { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } } @keyframes cutcalm { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }
/* R14：契約手冊 */
#guideBody h3 { font-size: 13px; color: var(--mut); margin: 14px 0 6px; font-weight: 700; } .gtip { color: #ffd84a; font-size: 13px; margin: 0; }
.glist { display: flex; flex-direction: column; gap: 6px; } .gi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(28,22,40,.8); border: 1px solid var(--line); }
.gi b { font-size: 14px; } .gi span { font-size: 12px; color: var(--mut); } .gi i { font-style: normal; color: var(--mut); }
.gchip { display: inline-flex !important; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 99px; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c) !important; font-weight: 700; font-size: 12px !important; }
.gchip canvas { width: 20px; height: 20px; } .glist.evo canvas { width: 28px; height: 28px; } .glist.evo .gi { gap: 4px; } .gi .wn { color: var(--fg) !important; }
#home .menu .row .ghost { min-height: 40px; }
/* R16：橫向小手機——提示、橫幅移到角落，不擋中央戰場 */
@media (orientation: landscape) and (max-height: 500px) {
  .banner, .banner.small, .banner.big { left: auto; top: auto; right: calc(env(safe-area-inset-right) + 14px); bottom: calc(env(safe-area-inset-bottom) + 132px); transform: scale(.85); transform-origin: 100% 100%; padding: 6px 12px 6px 8px; gap: 8px; max-width: 26vw; white-space: normal; text-align: right;
    background: linear-gradient(90deg, rgba(10,6,16,0), rgba(10,6,16,.62) 22%); }
  .banner.show { transform: scale(1); opacity: .92; }
  .banner b, .banner.big b { font-size: 15px; line-height: 1.2; } .banner.small b { font-size: 13px; } .banner span { font-size: 11px; }
  .banner canvas, .banner.big canvas { width: 30px; height: 30px; flex: none; }
  .tip { left: calc(env(safe-area-inset-left) + 12px); top: auto; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateY(8px); max-width: 28vw; font-size: 12px; padding: 7px 10px; background: rgba(18,14,26,.72); }
  .tip.show { transform: none; } .tip b { font-size: 13px; }
  .hint { bottom: calc(env(safe-area-inset-bottom) + 40px); font-size: 13px; padding: 8px 14px; }
}
@media (orientation: landscape) and (max-height: 340px) {
  .result { gap: 8px; }
  .banner, .banner.small, .banner.big {
    bottom: calc(env(safe-area-inset-bottom) + 124px);
    max-width: 46.5vw;
  }
}
/* R16：手冊圖例 */
.gi .lg { width: 26px; height: 26px; flex: 0 0 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--c) !important; font-size: 15px !important; font-weight: 900; }
.gi .lg.gem { text-shadow: 0 0 8px var(--c); }
.gi .lg.ring { border: 2px dashed var(--c); }
.gi .lg.glow { background: radial-gradient(circle, color-mix(in srgb, var(--c) 80%, #fff) 0 22%, color-mix(in srgb, var(--c) 45%, transparent) 45%, transparent 70%); }
.gi .lg.mark { background: rgba(12,8,20,.85); border: 2px solid var(--c); font-size: 12px !important; }
/* R17：音效／配樂兩顆開關（關掉時加斜線、變暗） */
.sndrow { position: fixed; display: flex; gap: 6px; z-index: 6; }
.sndrow.home { top: calc(env(safe-area-inset-top) + 12px); left: calc(env(safe-area-inset-left) + 12px); }
.sndrow.hud { top: calc(env(safe-area-inset-top) + 138px); right: calc(env(safe-area-inset-right) + 10px); flex-direction: column; }
.sndbtn { position: relative; width: 40px; height: 40px; border-radius: 12px; background: rgba(18,14,26,.6); border: 1px solid rgba(255,216,74,.55); color: #ffe9a0; font-size: 17px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.sndrow.home .sndbtn { width: 44px; height: 44px; border-radius: 50%; background: rgba(28,22,40,.85); }
.sndbtn i { font-style: normal; line-height: 1; }
.sndbtn.off { border-color: var(--line); color: #8a8298; opacity: .8; } .sndbtn.off i { filter: grayscale(1) brightness(1.3); opacity: .75; }
.sndbtn.off::after { content: ''; position: absolute; left: 22%; right: 22%; top: 50%; height: 2.5px; background: #ff6b8a; transform: rotate(-40deg); border-radius: 2px; }
.sndrow.hud .sndbtn { width: 34px; height: 34px; font-size: 14px; }
@media (orientation: landscape) and (max-height: 500px) {
  .pausebtn, .sndrow.hud { top: calc(env(safe-area-inset-top) + 96px); }
  .sndrow.hud { right: calc(env(safe-area-inset-right) + 56px); flex-direction: row; }
}
#btnChestOk { width: min(340px, 100%); align-self: center; min-height: 52px; font-size: 18px; border-radius: 14px; }
/* R16：橫向小手機的大招橫幅縮成右下角小卡（在大招按鈕上方），不橫跨戰場中央 */
@media (orientation: landscape) and (max-height: 500px) {
  .cutin { left: auto; right: calc(env(safe-area-inset-right) + 10px); top: auto; bottom: calc(env(safe-area-inset-bottom) + 128px); width: 24vw; height: 64px; padding: 0 12px 0 0; gap: 8px; border-radius: 14px; justify-content: flex-end;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c) 50%, #000) 30%); }
  .cutin img { width: 64px; height: 64px; margin-top: -14px; }
  .cutin b { font-size: 20px; letter-spacing: .04em; } .cutin span { font-size: 11px; }
  @keyframes cut { 0% { opacity: 0; transform: translateX(40%); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(20%); } }
}
/* R17：手把——焦點框、按鍵提示徽章 */
.padfocus { outline: 3px solid #7fd8ff !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(127,216,255,.25), 0 0 22px rgba(127,216,255,.5) !important; }
body.pad .dashbtn::after, body.pad .burstbtn::after, body.pad .pausebtn::after { content: attr(data-pad); position: absolute; right: -4px; top: -6px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: #0d0a14; border: 1.5px solid #7fd8ff; color: #dff4ff; font: 900 12px/19px -apple-system, system-ui, sans-serif; text-align: center; letter-spacing: 0; }
body:not(.pad) .banner.pad-connected { visibility: hidden; }
body.pad .pausebtn { position: fixed; } body.pad .hint { display: none !important; }
.sndrow.pause { position: static; justify-content: center; gap: 12px; } .sndrow.pause .sndbtn { width: 48px; height: 48px; font-size: 20px; }
/* R102 選角卡固定等寬、長英文名不撐開；紀錄列標籤不換行、數字對齊 */
#charList { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
#charList .pick { min-width: 0; }
#charList .pick b { max-width: 100%; overflow-wrap: anywhere; line-height: 1.15; }
html[lang="en"] #charList .pick b { overflow-wrap: normal; }
html[lang="en"] #charList .pick b { font-size: 12px; }
@media (orientation: portrait) and (max-width: 600px) { html[lang="en"] #charList { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
html[lang="en"] #charList .pick span { font-size: 11px; }
.recs div { justify-content: space-between; min-width: 0; }
.recs div span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 360px) { #charList { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 360px) { html[lang="en"] #charList .pick b { font-size: 11px; letter-spacing: -.01em; } }
@media (max-width: 560px) { html[lang="en"] #charList { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
/* R104 桌機大螢幕：選單、子頁、彈窗、戰鬥按鍵放大，字不再只有10px */
@media (min-width: 1100px) and (min-height: 700px) {
  .panel > * { zoom: 1.22; }
  #home .logo, #home .menu { zoom: 1.18; }
  .modal .mbox { zoom: 1.15; }
  .dashbtn, .burstbtn { zoom: 1.2; } /* 暫停與聲音鍵不放大：會蓋到右上試煉倒數、首頁契師等級 */
}
/* R106 戰場卡的原獸小圖固定一排，卡片窄時縮小，不再掉一隻到第二排 */
.maps .pick span:has(img) { flex-wrap: nowrap; max-width: 100%; }
.maps .pick span img { flex: 0 1 26px; min-width: 0; width: auto; max-width: 26px; height: auto; aspect-ratio: 1; }
/* R108 新手視角第三次審查 */
.panel header .btnBack { padding-left: 0 !important; }
body:has(.modal.on) .dashbtn, body:has(.modal.on) .burstbtn { visibility: hidden; }
#home .menu .row .ghost { background: rgba(15,12,25,.62) !important; }
@media (orientation: landscape) and (max-height: 500px) {
  #setup #btnGo, #dailyIntro #btnDailyGo { position: fixed !important; top: calc(env(safe-area-inset-top) + 8px); right: calc(env(safe-area-inset-right) + 14px); bottom: auto; width: auto !important; min-width: 150px; min-height: 44px !important; padding: 0 26px; font-size: 17px !important; z-index: 6; box-shadow: 0 6px 18px rgba(255,110,40,.35); margin: 0; }
}

/* R110 設定頁署名（連回官網） */
#setCredit { display: block; width: max-content; max-width: 100%; margin: 10px auto 4px; padding: 6px 12px; min-height: 32px; box-sizing: border-box; line-height: 20px; color: var(--mut); font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; border-radius: 10px; opacity: .85; }
#setCredit:active, #setCredit:hover { opacity: 1; text-decoration: underline; }

/* R117 暫停畫面：四區、等寬格子、等級小徽章 */
#pauseBody { display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
#pauseBody .pi canvas { width: 30px; height: 30px; } #pauseBody .pi.sm canvas { width: 22px; height: 22px; }
#pauseBody .psec h3 { margin: 0 0 5px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #a99bb8; display: flex; align-items: center; gap: 8px; }
#pauseBody .psec h3::after { content: ''; flex: 1; height: 1px; background: #3a2f44; }
#pauseBody .pgrid { display: grid; gap: 6px; }
#pauseBody .pgrid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#pauseBody .pgrid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#pauseBody .pgrid.gflex { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#pauseBody .pi { min-width: 0; padding: 3px 7px 3px 4px; border-radius: 10px; background: #231c2c; border: 1px solid #30263a; }
#pauseBody .pi span { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
#pauseBody .pi span i { font-style: normal; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 只有名字會省略，等級徽章一定看得到 */
#pauseBody .pi span b { flex: none; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: #3a2f44; color: #ffd28a; }
#pauseBody .pi span b.evo { background: #ffd84a; color: #2a1a05; }
#pauseBody .plink { display: inline-block; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; border: 1px solid var(--c); color: color-mix(in srgb, var(--c) 70%, #fff); }
#pauseBody .pres { text-align: center; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 800; border: 1px solid var(--c); color: color-mix(in srgb, var(--c) 70%, #fff); background: color-mix(in srgb, var(--c) 10%, transparent); }
html[lang=en] #pauseBody .pgrid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* 英文名字長，被動一列兩個 */
@media (min-width: 900px) { #pauseBody .pgrid.g2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } #pauseBody .pgrid.g3 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#pauseBody { flex-wrap: nowrap; justify-content: flex-start; } /* R117 只往下排、超出就捲動（舊規則的 wrap 在橫式會把各區擠成一欄一欄；置中會讓超出的上半截被切掉、捲不上去） */
@media (orientation: landscape) and (max-height: 500px) {
  #pause .mbox { gap: 6px; }
  #pause .mbox h2 { font-size: 20px; margin: 0; }
  #pause .mbox { position: relative; }
  #pause .sndrow.pause { position: absolute; top: 10px; right: 14px; gap: 8px; } /* 橫式高度不夠：聲音鈕移到右上角跟標題同一列 */
  #pause .sndrow.pause .sndbtn { width: 40px; height: 40px; font-size: 17px; }
  #pauseBody .pgrid.g2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #pauseBody .pgrid.g3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html[lang=en] #pauseBody .pgrid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
