:is(#stages, .expedition-dialog, .expedition-tip) {
  --exp-zoom: 1;
  --exp-ink: #24304f;
  --exp-muted: #6c7896;
  --exp-blue: #3a5bb4;
  --exp-dark-blue: #24418e;
  --exp-edge: #6b7ba8;
  --exp-line: #d3dbef;
  --exp-pale: #eaeff9;
  --exp-title: linear-gradient(180deg,#97b1e6,#7d9ad6 45%,#5f7fc0 55%,#3a559a);
  font: 600 12px/normal 'RO Nunito','Segoe UI',Tahoma,Verdana,'Microsoft JhengHei','PingFang TC','Noto Sans TC',sans-serif;
  font-synthesis: initial;
  color: var(--exp-ink);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
@media (min-width:1280px) and (min-height:760px) and (pointer:fine) {
  :is(#stages,.expedition-dialog,.expedition-tip) { --exp-zoom: 1.15; }
}
@media (min-width:1600px) and (min-height:880px) and (pointer:fine) {
  :is(#stages,.expedition-dialog,.expedition-tip) { --exp-zoom: 1.35; }
}
@media (min-width:2200px) and (min-height:1200px) and (pointer:fine) {
  :is(#stages,.expedition-dialog,.expedition-tip) { --exp-zoom: 1.55; }
}
@media (min-width:2800px) and (min-height:1500px) and (pointer:fine) {
  :is(#stages,.expedition-dialog,.expedition-tip) { --exp-zoom: 1.85; }
}
:is(#stages,.expedition-dialog) {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right))
    max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  background: #00000080;
  animation: expedition-fade .18s ease-out;
}
:is(#stages,.expedition-dialog,.expedition-tip) :is(b,strong) { font-weight: 800; }
#npc-dialog.expedition-dialog { z-index: 15; }
@keyframes expedition-fade { from { opacity: 0; } }
@keyframes expedition-open { from { opacity: 0; transform: translateY(10px) scale(.97); } }
:is(#stages,.expedition-dialog) .ro-window {
  zoom: var(--exp-zoom);
  display: flex;
  flex-flow: column;
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc((100dvh - 16px) / var(--exp-zoom));
  overflow: hidden;
  border: 1px solid var(--exp-edge);
  border-radius: 12px;
  background: linear-gradient(180deg,#fdfdff,#f6f8fd 60%,#eef2fa);
  box-shadow: 0 0 0 3px #ffffff59, 0 12px 32px #00000073;
  animation: expedition-open .22s cubic-bezier(.2,1.3,.4,1);
}
#stages .stages-window { width: min(920px,calc(100vw - 24px)); height: min(640px,calc(100vh - 24px)); }
.expedition-dialog .npc-window { width: min(420px,calc(100vw - 24px)); }
:is(#stages,.expedition-dialog) .ro-title {
  position: relative;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .3px;
  color: white;
  text-shadow: 1px 1px #1d2d57;
  background: var(--exp-title);
  border-bottom: 1px solid #2f4a8a;
  box-shadow: inset 0 1px #ffffff8c;
}
:is(#stages,.expedition-dialog) .ro-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  vertical-align: 1px;
  transform: rotate(45deg);
  background: white;
  box-shadow: 0 0 4px #ffffffe6;
}
:is(#stages,.expedition-dialog) .ro-body { padding: 12px; overflow: auto; -webkit-overflow-scrolling: touch; }
:is(#stages,.expedition-dialog) .btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--exp-line);
  background: #eaeff999;
}
:is(#stages,.expedition-dialog) .spacer { flex: 1; }
:is(#stages,.expedition-dialog) .ro-btn {
  font: inherit;
  font-weight: 800;
  margin: 4px;
  padding: 7px 18px;
  color: #2a3a6a;
  border: 1px solid #a3b2db;
  border-radius: 10px;
  background: linear-gradient(white,#e2e8f7);
  box-shadow: 0 2px #bcc7e6, inset 0 1px white;
  cursor: pointer;
  transition: transform .08s, filter .15s, box-shadow .15s, border-color .15s;
}
:is(#stages,.expedition-dialog) .ro-btn.primary {
  color: white;
  border-color: #2f4a8a;
  background: linear-gradient(#a6c2f7,#6f92e0 50%,#4d6fbf);
  box-shadow: 0 2px #2f4a8a, inset 0 1px #ffffff8c;
  text-shadow: 1px 1px #1d2d57;
}
:is(#stages,.expedition-dialog) .ro-btn:hover:not(:disabled) { filter: brightness(1.04); border-color: #6f8fd8; }
:is(#stages,.expedition-dialog) button:focus-visible { outline: revert; outline-offset: revert; }
:is(#stages,.expedition-dialog) .ro-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px white; }
:is(#stages,.expedition-dialog) .ro-btn:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
#stages .ro-btn.small { padding: 4px 10px; margin: 2px; border-radius: 8px; white-space: nowrap; }
#stages .ro-btn.stg-go { min-width: 160px; font-size: 14px; }
#stages .ro-btn.stg-go:disabled { opacity: .5; }
:is(#stages,.expedition-dialog,.expedition-tip).hidden,
:is(#stages,.expedition-dialog) :is(.hidden,[hidden]) { display: none !important; }

#stages .stages-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 10px; }
#stages .stg-side, #stages .stg-detail, #stages .stg-list { display: flex; flex-direction: column; gap: 10px; }
#stages .stg-side, #stages .stg-detail { min-height: 0; }
#stages .stg-detail, #stages .stg-list { overflow-y: auto; padding: 2px; }
#stages .stg-gs { color: var(--exp-muted); padding: 0 4px; font-size: 11px; }
#stages .stg-gs b { color: var(--exp-blue); font-size: 12px; }
#stages #lap-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
#stages .stg-card {
  position: relative;
  display: grid;
  align-items: center;
  grid-template: auto auto / 64px 1fr;
  gap: 2px 10px;
  min-height: 78px;
  padding: 8px 10px 8px 6px;
  border: 1px solid var(--exp-line);
  border-radius: 14px;
  font: inherit;
  text-align: left;
  color: var(--exp-ink);
  background: linear-gradient(100deg,#f4f8ff,#dfe9fb);
  box-shadow: inset 0 1px white, 0 1px 3px #24304f26;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
#stages .stg-card:hover { transform: translateX(2px); border-color: #6f8fd8; }
#stages .stg-card.sel { border-color: var(--exp-blue); background: linear-gradient(100deg,white,#d3e2fb); box-shadow: 0 0 0 2px #3a5bb459,inset 0 1px white; }
#stages .stg-card:is(.locked,.soon) { background: linear-gradient(100deg,#f2f4f9,#e3e8f2); }
#stages .stg-face {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 60%,white,#c6d7f5);
  color: #a9b4d2;
  font-size: 18px;
  font-weight: 900;
}
#stages .stg-face img { max-width: 60px; max-height: 60px; image-rendering: pixelated; }
#stages .stg-card:is(.locked,.soon) .stg-face img { filter: grayscale(.6); opacity: .75; }
#stages .stg-card-info b { display: block; font-size: 14px; color: var(--exp-dark-blue); }
#stages .stg-card-info small { display: block; font-size: 11px; color: var(--exp-muted); }
#stages .stg-lv, #stages .stg-banner-lv {
  position: absolute; background: var(--exp-title); color: white; text-shadow: 1px 1px #1d2d57; font-weight: 900;
}
#stages .stg-lv { left: 8px; bottom: 6px; padding: 0 6px; border-radius: 8px; font-size: 10px; }
#stages .stg-state { justify-self: start; font-size: 10px; font-weight: 900; padding: 1px 8px; border-radius: 8px; border: 1px solid var(--exp-line); color: var(--exp-muted); background: white; }
#stages .stg-card.open .stg-state, #stages .stg-req.ok { color: #2f5fbf; border-color: #bccdf2; }
#stages .stg-card.cleared .stg-state { color: white; background: var(--exp-blue); border-color: var(--exp-dark-blue); }
#stages .stg-card.locked .stg-state, #stages .stg-req.no { color: #c0392b; border-color: #f2c2bb; }
#stages .stg-secret {
  position: absolute; right: 8px; top: 8px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  font-size: 10px; font-weight: 900; color: white; background: radial-gradient(circle at 35% 30%,#b49af0,#7a5cc8);
  box-shadow: 0 0 0 2px white,0 0 8px #7a5cc899;
}
#stages .stg-secret.found { width: 26px; height: 26px; right: 6px; top: 6px; background: radial-gradient(circle,white 40%,#e6ddfb); box-shadow: 0 0 0 2px #9b7fe0,0 0 8px #7a5cc880; }
#stages .stg-secret.found img { width: 20px; height: 20px; }
#stages .stg-new, #stages .stg-banner-new {
  position: absolute; white-space: nowrap; padding: 1px 9px; border-radius: 9px; color: white; font-weight: 900; letter-spacing: .4px;
  background: linear-gradient(135deg,#ff7aa0,#ff4f7e); text-shadow: 0 1px 1px #0005;
  box-shadow: 0 0 0 2px white,0 0 10px #ff4f7e99; animation: expedition-new 1.2s ease-in-out infinite alternate;
}
#stages .stg-new { right: 8px; bottom: 8px; font-size: 10px; }
#stages .stg-banner-new { left: 50%; top: 10px; translate: -50% 0; font-size: 11px; }
@keyframes expedition-new { to { transform: scale(1.08); box-shadow: 0 0 0 2px white,0 0 16px #ff4f7ed9; } }

#stages .stg-banner {
  position: relative; flex: none; height: 190px; overflow: hidden; border-radius: 16px; border: 1px solid var(--exp-edge);
  background: linear-gradient(180deg,#f0f6ff00 45%,#1d2d5799), var(--art,none) center 60% / cover, linear-gradient(160deg,#cfe0fa,#8fa8de);
  box-shadow: inset 0 0 0 2px #ffffff80,0 3px 10px #24304f40;
}
#stages .stg-banner-mvp { position: absolute; right: 24px; bottom: 6px; display: flex; align-items: flex-end; filter: drop-shadow(0 4px 6px #00000059); }
#stages .stg-banner-mvp img { max-height: 176px; image-rendering: pixelated; }
#stages .stg-banner.nomap .stg-banner-mvp img { filter: brightness(.25) saturate(0); opacity: .6; }
#stages .stg-banner-lv { left: 12px; top: 10px; padding: 2px 10px; border-radius: 10px; }
#stages .stg-banner-state { position: absolute; left: 12px; top: 38px; padding: 1px 9px; border-radius: 9px; font-weight: 900; font-size: 11px; background: #ffffffe6; color: var(--exp-muted); }
#stages .stg-banner-state.open { color: #2f5fbf; }
#stages .stg-banner-state.cleared { background: var(--exp-blue); color: white; }
#stages .stg-banner-state.locked { color: #c0392b; }
#stages .stg-banner-secret { position: absolute; left: 12px; top: 64px; padding: 1px 9px; border-radius: 9px; font-size: 11px; font-weight: 900; color: white; background: linear-gradient(135deg,#a58aea,#7a5cc8); box-shadow: 0 0 10px #7a5cc88c; }
#stages .stg-banner-secret.found { display: flex; align-items: center; gap: 4px; padding-left: 3px; }
#stages .stg-banner-secret img { width: 18px; height: 18px; border-radius: 50%; background: white; }
#stages .stg-banner-text { position: absolute; left: 14px; bottom: 10px; color: white; text-shadow: 0 1px 2px #0009,0 1px 1px black,0 0 2px black,0 0 3px #000c; }
#stages .stg-banner-text b { display: block; font-size: 18px; }
#stages .stg-banner-text small { font-size: 11px; color: #e3ecff; font-weight: 700; }
#stages .stg-sec { flex: none; padding: 10px; border-radius: 12px; border: 1px solid var(--exp-line); background: white; }
#stages .box-title { margin-bottom: 8px; color: var(--exp-blue); font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; }
#stages :is(.stg-bosses,.stg-mobs,.stg-loots,.stg-reqs) { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
#stages :is(.stg-bosses,.stg-mobs,.stg-loots,.stg-reqs)>* { flex: none; }
#stages .stg-boss { width: 92px; display: flex; flex-direction: column; align-items: center; text-align: center; }
#stages .stg-boss-face, #stages .stg-mob, #stages .stg-loot { display: grid; place-items: center; border: 1px solid var(--exp-line); }
#stages .stg-boss-face { width: 72px; height: 64px; overflow: hidden; border-radius: 12px; background: radial-gradient(circle at 50% 60%,white,#dbe6f8); }
#stages .stg-boss.mvp .stg-boss-face { border-color: #f08a20; background: radial-gradient(circle at 50% 60%,#fffaf2,#fde0bd); box-shadow: 0 0 6px #f08a2073; }
#stages .stg-boss-face img { max-width: 68px; max-height: 60px; image-rendering: pixelated; }
#stages .stg-boss b { margin-top: 3px; font-size: 11px; line-height: 1.2; }
#stages .stg-boss small { font-size: 10px; color: var(--exp-muted); }
#stages .stg-boss.mvp small { color: #c76a10; font-weight: 800; }
#stages .stg-mob, #stages .stg-loot { width: 44px; height: 44px; border-radius: 10px; }
#stages .stg-mob { overflow: hidden; background: var(--exp-pale); }
#stages .stg-mob img { max-width: 40px; max-height: 40px; image-rendering: pixelated; }
#stages .stg-loot { background: linear-gradient(#f8faff,#e6ebf7); cursor: help; }
#stages .stg-loot img { width: 24px; height: 24px; image-rendering: pixelated; }
#stages .stg-loot.card { width: 33px; padding: 0; overflow: hidden; border-color: #c95cc9; background: linear-gradient(#fcf6fd,#f0dcf3); }
#stages .stg-loot.card img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
#stages .stg-empty { font-size: 11px; color: var(--exp-muted); }
#stages .stg-req { padding: 1px 8px; border: 1px solid var(--exp-line); border-radius: 8px; background: white; font-size: 11px; font-weight: 800; }

.expedition-dialog .npc-text { line-height: 1.6; font-size: 14px; }
.expedition-dialog .npc-text b { color: var(--exp-blue); }
.expedition-dialog .diff { display: flex; flex-direction: column; gap: 8px; }
.expedition-dialog .diff-row { display: grid; grid-template-columns: 1fr 110px 44px; align-items: center; gap: 8px; font-size: 12px; }
.expedition-dialog .diff-row input { width: 100%; accent-color: var(--exp-blue); }
.expedition-dialog .diff-row b { text-align: right; }
.expedition-dialog .diff-reward { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: var(--exp-pale); border: 1px solid var(--exp-line); text-align: center; }
.expedition-dialog .lap-info { font-size: 13px; margin: 0 0 10px; padding: 6px 8px; border-radius: 6px; background: #b4530914; }

#skill-tip.expedition-tip {
  zoom: var(--exp-zoom); position: fixed; z-index: 30; min-width: 170px; width: auto; max-width: calc(100vw - 16px); overflow: hidden;
  font-size: 11px; line-height: 1.45; color: var(--exp-ink); pointer-events: none;
  border: 1px solid var(--exp-edge); border-radius: 10px; background: linear-gradient(white,#f1f4fb); box-shadow: 0 6px 18px #00000059;
}
.expedition-tip .tip-item b { color: var(--exp-blue); }
.expedition-tip .tip-item:has(.tip-icon) b { color: inherit; }
.expedition-tip .muted { font-size: 11px; color: var(--exp-muted); }
.expedition-tip .bon-list { margin: 3px 0; padding-left: 16px; color: #2f5fbf; }
.expedition-tip .hst-note { margin-top: 6px; font-size: 10px; opacity: .75; }
.expedition-tip .st-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--exp-title); color: white; text-shadow: 1px 1px #1d2d57; }
.expedition-tip .st-head img { width: 24px; height: 24px; padding: 3px; border-radius: 7px; border: 1px solid #8b96b8; background: linear-gradient(#f7f8fc,#e3e7f2); image-rendering: pixelated; }
.expedition-tip .st-head b { display: block; font-size: 12px; color: white; }
.expedition-tip .st-head small { display: block; font-size: 10px; color: #e3ecff; }
.expedition-tip .st-tags { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 10px 0; }
.expedition-tip .st-tags span { font-size: 10px; font-weight: 800; padding: 1px 6px; color: var(--exp-blue); background: var(--exp-pale); border: 1px solid var(--exp-line); border-radius: 7px; }
.expedition-tip .st-desc { padding: 7px 10px 4px; }
.expedition-tip .st-rows { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 5px 0; margin: 2px 10px 0; border-top: 1px solid var(--exp-line); }
.expedition-tip .st-rows span, .expedition-tip .st-note { color: var(--exp-muted); }
.expedition-tip .st-rows b { color: var(--exp-dark-blue); text-align: right; }
.expedition-tip .st-note { margin: 0 10px; padding: 0 0 7px; font-size: 10px; }
.expedition-tip .st-sub { margin: 0 10px; border-top: 1px solid var(--exp-line); padding-top: 5px; font-weight: 900; font-size: 10px; color: var(--exp-blue); letter-spacing: .5px; text-transform: uppercase; }
.expedition-tip .st-drops-sub { margin-top: 6px; }
.expedition-tip .st-drops { list-style: none; display: grid; gap: 3px; margin: 4px 0 8px; padding: 0 10px; }
.expedition-tip .st-drops li { display: flex; align-items: center; gap: 7px; }
.expedition-tip .st-drops img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; flex: none; }
.expedition-tip .st-drops .card { color: #a03ca0; font-weight: 800; }
.expedition-tip .st-drops .card img { height: 30px; border-radius: 3px; }
.expedition-tip .st-drops-none { padding-top: 5px; }

:is(#stages,.expedition-dialog) ::-webkit-scrollbar { width: 14px; height: 14px; }
:is(#stages,.expedition-dialog) ::-webkit-scrollbar-track, :is(#stages,.expedition-dialog) ::-webkit-scrollbar-corner { background: transparent; }
:is(#stages,.expedition-dialog) ::-webkit-scrollbar-thumb { background: #9fb6e4; border: 5px solid transparent; border-radius: 7px; background-clip: padding-box; }
:is(#stages,.expedition-dialog) ::-webkit-scrollbar-thumb:hover { background-color: #6f8fd8; }
@supports not selector(::-webkit-scrollbar) {
  :is(#stages,.expedition-dialog) * { scrollbar-width: thin; scrollbar-color: #9fb6e4 transparent; }
}
@media (max-width:720px), (max-height:500px) {
  :is(#stages,.expedition-dialog) .ro-body { padding: 8px; }
  :is(#stages,.expedition-dialog) .ro-title { padding: 7px 12px; font-size: 12px; }
  :is(#stages,.expedition-dialog) .btn-row { padding: 8px; }
  :is(#stages,.expedition-dialog) .ro-btn:not(.small) { padding: 7px 12px; }
}
@media (max-width:720px) {
  #stages .stages-window { height: calc(100vh - 16px); }
  #stages .stages-body { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  #stages .stg-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  #stages .stg-card { flex: none; width: 200px; min-height: 70px; grid-template-columns: 52px 1fr; }
  #stages .stg-face { width: 52px; height: 52px; }
  #stages .stg-face img { max-width: 48px; max-height: 48px; }
  #stages .stg-banner { height: 150px; }
  #stages .stg-banner-mvp img { max-height: 136px; }
}
@media (max-width:420px) {
  .expedition-dialog .diff-row { grid-template-columns: 1fr 44px; }
  .expedition-dialog .diff-row input { grid-column: 1 / -1; grid-row: 2; }
}
