/* Game UI Glass V1. Same language as the glass login: frosted light
 * panels over a lo-fi scene, blue gradient for the active control. Game windows use the approved glass treatment; login and selection stay scoped separately. */
body:has(#game:not(.hidden)) {
  background:
    linear-gradient(rgb(12 20 36 / 18%), rgb(12 20 36 / 28%)),
    var(--game-bg-wide, url('/ro/client/ui/login-background-lofi-05-wide.webp')) center / cover fixed no-repeat !important;
}

@media (orientation: portrait) and (max-aspect-ratio: 4/5) {
  body:has(#game:not(.hidden)) {
    background:
      linear-gradient(rgb(12 20 36 / 18%), rgb(12 20 36 / 28%)),
      var(--game-bg-tall, url('/ro/client/ui/login-background-lofi-05-tall.webp')) center / cover fixed no-repeat !important;
  }
}

#game, #worldMapOverlay, #worldMapConfirm {
  --glass-fill: rgb(255 255 255 / 58%);
  --glass-line: rgb(255 255 255 / 62%);
  --glass-ink: #1c2a3a;
  --glass-icon-ink: #fff; /* glyph colour of the round glass icon buttons (top bar, chat dock): white like the bottom/side nav glyphs */
  --glass-icon-fill: rgb(12 20 38 / 58%); /* their dark glass disc: keeps the glyph >=3:1 on light and dark art alike (the level capsule's dark glass, lighter) */
  --glass-chip-fill: rgb(10 18 34 / 78%); /* the same dark glass for the capsules that carry text (top bar HP/SP, zeny, name, level): light inks keep >=4.5:1 on any art */
  --glass-blue: linear-gradient(#6f9ad6, #3f69a8);
  --glass-font: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
}

/* Shared liquid-glass surface (G8L-211 P1-0). Values are the approved bottom-nav glass, moved here unchanged
 * from mobile-nav.css; any surface that wants the same look adds class="glass-pane". */
.glass-pane {
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 30px;
  background: var(--glass-pane-fill, rgb(255 255 255 / 30%)); /* one value a surface may override (the lobby sets it for glass floating over the film) */
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  box-shadow: 0 12px 34px rgb(10 20 40 / 28%), inset 0 1px 0 rgb(255 255 255 / 70%);
}

/* Edge-hugging layout variables (DESIGN 6.3). P1-G reads them for the function pages: page edge, card gap, card radius, bottom reserve.
 * Right-side twin of --edge-x is --edge-x-right because one variable cannot follow both insets.
 * --bottom-reserve is the one bottom padding every phone page and the pet layer share: the bottom bar, the bottom edge gap (--bottom-edge, same 5px as the top bar; no Home-indicator inset by design) and one card gap
 * (P1-I: the keys have no panel, so the bar is exactly --bottom-bar-h tall above the inset). */
:root {
  --edge-x: 0px;
  --edge-x-right: 0px;
  --card-gap: 8px;
  --card-radius: 10px;
  --top-bar-h: 48px;
  --top-edge: max(5px, env(safe-area-inset-top));
  --bottom-edge: 5px;
  --bottom-bar-h: 60px;
  --bottom-reserve: calc(var(--bottom-bar-h) + var(--bottom-edge) + var(--card-gap));
}
@media (max-width: 720px) {
  :root {
    --edge-x: max(2px, env(safe-area-inset-left));
    --edge-x-right: max(2px, env(safe-area-inset-right));
    --card-gap: 4px;
    --card-radius: 8px;
    --top-bar-h: 44px;
    --bottom-bar-h: 64px;
  }
}

#game .brand {
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 10px;
  background: rgb(255 255 255 / 20%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 6px 20px rgb(10 20 40 / 22%);
  text-shadow: 0 1px 3px rgb(10 20 40 / 55%);
}

#game .brand b,
#game .window .titlebar {
  font-family: var(--glass-font);
}

#game .window:not(.ro-ui-primitive) {
  border: 1px solid var(--glass-line) !important;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--glass-fill) !important;
  background-image: none !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 28px rgb(10 20 40 / 24%), inset 0 1px 0 rgb(255 255 255 / 55%);
  color: var(--glass-ink);
}

#game .window:not(.ro-ui-primitive) > .titlebar {
  border-bottom: 1px solid rgb(255 255 255 / 40%);
  background: linear-gradient(rgb(90 130 190 / 62%), rgb(55 90 150 / 62%)) !important;
  color: #fff;
  text-shadow: 0 1px 2px rgb(10 20 40 / 45%);
  letter-spacing: 0.04em;
}

#game .window:not(.ro-ui-primitive) > :not(.titlebar),
#game .window:not(.ro-ui-primitive) .basic,
#game .window:not(.ro-ui-primitive) [class*='body'] {
  background-color: transparent;
  background-image: none;
}

/* Main and sub tabs */
#game .tabs:not(.glass-pane),
#game .ro-subtabs {
  gap: 6px;
  background: transparent !important;
  border: 0 !important;
}

#game .tabs > button,
#game .ro-subtabs > button,
#game .window:not(.ro-ui-primitive) [role='tab'],
#game .window:not(.ro-ui-primitive) .tab {
  border: 1px solid rgb(255 255 255 / 65%) !important;
  border-radius: 7px !important;
  background: rgb(255 255 255 / 45%) !important;
  background-image: none !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--glass-ink) !important;
  font-family: var(--glass-font);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(10 20 40 / 16%);
}

#game .tabs > button.active,
#game .tabs > button[aria-selected='true'],
#game .ro-subtabs > button.active,
#game .ro-subtabs > button[aria-selected='true'],
#game .window:not(.ro-ui-primitive) [role='tab'][aria-selected='true'],
#game .window:not(.ro-ui-primitive) .tab.active,
#game .window:not(.ro-ui-primitive) button.active {
  border-color: rgb(255 255 255 / 75%) !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgb(10 20 40 / 35%);
}

/* Buttons, fields. Buttons drawn from client bitmaps keep their skin. */
#game .window:not(.ro-ui-primitive) button:not([role='tab']):not(.tab):not(.active):not(.window-fold-button):not(.official-skin-button):not(.card-art-preview-close):not(.ro-ui-primitive),
#game .brand button:not(.quick-audio):not(.glass-pane) { /* r5: a glass-pane button (top bar Zeny capsule) keeps the shared glass */
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 6px !important;
  background: rgb(255 255 255 / 50%) !important;
  background-image: none !important;
  color: var(--glass-ink) !important;
  font-family: var(--glass-font);
  box-shadow: 0 2px 6px rgb(10 20 40 / 14%);
}

#game .window:not(.ro-ui-primitive) button.primary,
#game .window:not(.ro-ui-primitive) .hunt-action.primary {
  background: var(--glass-blue) !important;
  color: #fff !important;
}

#game .window:not(.ro-ui-primitive) button:disabled {
  opacity: 0.55;
}

#game .window:not(.ro-ui-primitive) input:not([type='checkbox']):not([type='radio']):not([type='range']),
#game .window:not(.ro-ui-primitive) select,
#game .window:not(.ro-ui-primitive) textarea {
  border: 1px solid rgb(255 255 255 / 75%) !important;
  border-radius: 6px !important;
  background: rgb(255 255 255 / 60%) !important;
  background-image: none !important;
  color: var(--glass-ink);
}

/* The combat log stays dark, as smoked glass. */
#game .combat-window,
#game .combat-window > :not(.titlebar, .damage-float-layer) {
  background: rgb(12 18 30 / 62%) !important;
  color: #e8eef6;
}

#game .combat-window > :not(.titlebar) * {
  background-color: transparent;
}

/* G8L-117: log text colours sit on a bright-on-dark scheme; the right edge keeps the original 38%/35% stop. */
#game .combat-window .console .event { text-shadow: 0 1px 2px #000; }
#game .combat-window .console .event small { color: #cdd3cf; }
#game .combat-window .console .event.route { color: #91e3b3; }
#game .combat-window .console .event.active-skill { color: #81deff; }
#game .combat-window .console .event.hurt { color: #ffc2c2; }
#game .combat-window .console .event.loot { color: #dfc8ff; }
#game .combat-window .console .event.system { color: #cbd4cf; }
#game .combat-window .console .event.drop-event { color: #e1c7ff; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #game { --glass-fill: rgb(255 255 255 / 86%); }
}

@media (max-width: 720px) {
  #game .tabs > button {
    background: rgb(255 255 255 / 72%) !important;
  }
  #game .tabs > button.active,
  #game .tabs > button[aria-selected='true'] {
    background: var(--glass-blue) !important;
  }
}


/* Hunt toolbar (監控 / 設定 + 玩家狩獵 / 角色自主 / 彩虹橋) sits outside any
 * .window, so it needs its own glass treatment. */
#game .hunt-toolbar {
  gap: 6px;
  padding: 6px !important;
  border: 1px solid var(--glass-line) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 42%) !important;
  background-image: none !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 6px 18px rgb(10 20 40 / 18%);
}
@media (max-width: 720px) {
  #game .hunt-toolbar { border-radius: var(--card-radius) !important; }
}
#game .hunt-toolbar .ro-subtabs > button,
#game .hunt-toolbar .hunt-action {
  min-height: 34px;
  padding: 0 14px !important;
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 17px !important;
  background: rgb(255 255 255 / 55%) !important;
  background-image: none !important;
  color: var(--glass-ink) !important;
  font: 600 14px var(--glass-font);
  box-shadow: 0 2px 6px rgb(10 20 40 / 12%) !important;
  transition: transform 0.15s ease, background 0.2s ease;
}
#game .hunt-toolbar .ro-subtabs > button:active,
#game .hunt-toolbar .hunt-action:active { transform: scale(0.95); }
#game .hunt-toolbar .ro-subtabs > button.active,
#game .hunt-toolbar .ro-subtabs > button[aria-selected='true'],
#game .hunt-toolbar .hunt-action[aria-pressed='true'],
#game .hunt-toolbar .hunt-action.active {
  border-color: rgb(255 255 255 / 80%) !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgb(10 20 40 / 30%);
}
/* The start action keeps its green meaning, in glass form. */
#game .hunt-toolbar .hunt-action.primary {
  background: linear-gradient(#5fcf8d, #2f9e62) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgb(10 40 20 / 30%);
}
#game .hunt-toolbar .hunt-action:disabled,
#game .hunt-toolbar .hunt-action[aria-disabled='true'] {
  opacity: 0.5;
  box-shadow: none !important;
}


@media (max-width: 720px) {
  #game .hunt-toolbar { flex-wrap: nowrap !important; align-items: center; gap: 4px; }
  #game .hunt-toolbar .ro-subtabs { flex: 0 0 auto; gap: 4px; }
  #game .hunt-toolbar .hunt-actions { flex: 1 1 auto; justify-content: flex-end; gap: 4px; margin-left: auto; }
  #game .hunt-toolbar .ro-subtabs > button,
  #game .hunt-toolbar .hunt-action {
    min-height: 32px;
    padding: 0 10px !important;
    font-size: 13px;
    white-space: nowrap;
  }
}


/* Service pages (精煉 / 商店 / 倉庫): drop the dark stage so the scene shows. */
#game .service-entry-host,
#game .town-service-surface,
#game .town-service-scene,
#game .service-entry-transition {
  background: transparent !important;
  background-image: none !important;
}
#game .service-entry-transition {
  margin: 8px 0;
  padding: 18px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgb(255 255 255 / 45%) !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--glass-ink);
}
#game .service-entry-transition .service-entry-status { color: var(--glass-ink); text-shadow: none; }
#game .service-entry-retry {
  border: 0 !important;
  border-radius: 16px !important;
  padding: 6px 18px !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
}
#game .town-service-window { color: var(--glass-ink) !important; }
#game .town-service-window .town-service-foot {
  border-top: 1px solid rgb(255 255 255 / 55%) !important;
  color: var(--glass-ink) !important;
}
#game .town-service-window .town-service-foot * { color: inherit; }
#game .town-service-window .town-service-foot b,
#game .town-service-window .town-service-foot strong { color: #1f5fbf; }
#game .town-service-window [class*='price'],
#game .town-service-window [class*='zeny'] { color: #9a5a00 !important; }
#game .town-service-storage-tabs { background: rgb(255 255 255 / 25%) !important; border-radius: 8px; }
#game .town-service-storage-row,
#game .town-service-slot,
#game .forge-list-row,
#game .forge-list-toggle { border-radius: 10px !important; }
#game .town-service-window .town-service-foot button,
#game .town-service-window button.primary {
  border: 0 !important;
  border-radius: 12px !important;
  padding: 2px 14px !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
}
#game .forge-sound {
  border: 1px solid rgb(255 255 255 / 60%) !important;
  border-radius: 50% !important;
  background: rgb(255 255 255 / 55%) !important;
  color: #263954 !important;
}
#game .forge-window .forge-stage { border-radius: 0 0 10px 10px; }
#game .forge-list {
  border: 1px solid rgb(255 255 255 / 45%) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 22%) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#game .forge-window .refine-button {
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
  font: 700 18px var(--glass-font);
}

/* Status and equipment windows drop the client bitmaps for the glass skin. */
#game .ro-status-window,
#game .ro-equipment-window {
  border: 1px solid var(--glass-line) !important;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--glass-fill) !important;
  background-image: none !important;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 28px rgb(10 20 40 / 24%), inset 0 1px 0 rgb(255 255 255 / 55%);
  color: var(--glass-ink);
}
#game .ro-status-window > .titlebar,
#game .ro-equipment-window > .titlebar {
  background: linear-gradient(rgb(90 130 190 / 62%), rgb(55 90 150 / 62%)) !important;
  color: #fff;
  font-family: var(--glass-font);
}
#game .ro-status-window .status-layout,
#game .ro-equipment-window .paperdoll-layout,
#game .ro-status-window .stat-actions {
  background-color: transparent !important;
  background-image: none !important;
}
#game .ro-equipment-window .paperdoll-layout button {
  background-image: none !important;
}
#game .window-fold-button {
  width: 22px !important;
  height: 18px !important;
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 6px !important;
  background: rgb(255 255 255 / 55%) !important;
  background-image: none !important;
  position: relative;
}
#game .window-fold-button::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-left: 2px solid #3a5f93;
  border-top: 2px solid #3a5f93;
  transform: translateY(2px) rotate(45deg);
}
#game .window.folded .window-fold-button::after,
#game .window-fold-button[aria-expanded='false']::after { transform: translateY(-2px) rotate(225deg); }


/* Service windows were tuned for a dark stage; switch their text to the glass ink. */
#game .town-service-window :is(.town-service-trade-row, .town-service-trade-row *, .town-service-preview-tag, .town-service-total, .town-service-notice, .forge-list-row, .forge-list-toggle, .forge-list .town-service-empty):not(input) {
  color: var(--glass-ink) !important;
  text-shadow: none !important;
}
#game .town-service-window .town-service-trade-row small { color: #5a6a7c !important; }
#game .town-service-window .town-service-total b,
#game .town-service-window .town-service-price { color: #b36b00 !important; }
#game .town-service-window .town-service-trade-row { border-bottom-color: rgb(255 255 255 / 45%) !important; }
#game .town-service-slot b { color: #1c2a3a !important; text-shadow: 0 0 2px #fff, 0 0 2px #fff !important; }
#game .forge-list-row.selected { background: rgb(111 154 214 / 45%) !important; border-color: #6f9ad6 !important; }

/* 能力: rebuild the pixel-placed status sheet as glass rows. */
#game .ro-status-scale-shell { height: auto !important; overflow: visible !important; }
#game .ro-status-scale-content { width: auto !important; height: auto !important; transform: none !important; }
#game .ro-status-window .status-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: auto !important;
  height: auto !important;
  padding: 12px;
  overflow: visible !important;
  background: none !important;
}
#game .ro-status-window .base-stats,
#game .ro-status-window .derived-stats {
  position: static !important;
  display: grid !important;
  gap: 6px;
  align-content: start;
}
#game .ro-status-window .derived-stats { grid-template-columns: 1fr 1fr; }
#game .ro-status-window .base-stats > [data-stat-row],
#game .ro-status-window .derived-stats > [data-derived-row] {
  position: static !important;
  display: grid !important;
  align-items: center;
  width: auto !important;
  height: auto !important;
  min-height: 34px;
  padding: 0 6px 0 12px !important;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 10px;
  background: rgb(255 255 255 / 55%) !important;
}
#game .ro-status-window .derived-stats > [data-derived-row] { grid-template-columns: auto 1fr; gap: 6px; padding-right: 12px !important; }
#game .ro-status-window :is(.ro-status-label, .ro-derived-label) {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  color: #3a5f93;
  font: 700 13px var(--glass-font);
  text-transform: uppercase;
}
#game .ro-status-window :is(.ro-status-value, .ro-derived-value) {
  position: static !important;
  width: auto !important;
  height: auto !important;
  color: var(--glass-ink) !important;
  font: 700 16px/1.2 var(--glass-font) !important;
  text-align: right;
}
#game .ro-status-window .ro-derived-value { font-size: 14px !important; }
#game .ro-status-window .ro-status-bonus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  color: #2f9e62 !important;
  font: 700 12px var(--glass-font) !important;
}
#game .ro-status-window .ro-status-increase {
  position: static !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: var(--glass-blue) !important;
  color: transparent !important;
  font-size: 0 !important;
  display: grid;
  place-items: center;
}
#game .ro-status-window .ro-status-increase::before { content: '+'; color: #fff; font: 700 18px/1 var(--glass-font); }
#game .ro-status-window .ro-status-increase:disabled { background: rgb(255 255 255 / 55%) !important; }
#game .ro-status-window .ro-status-increase:disabled::before { color: #9aa7b6; }
#game .ro-status-window .ro-status-point-value {
  position: static !important;
  grid-column: 1 / -1;
  width: auto !important;
  height: auto !important;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgb(111 154 214 / 22%);
  color: var(--glass-ink) !important;
  font: 700 15px var(--glass-font) !important;
  text-align: right;
}
#game .ro-status-window .ro-status-point-value::before { content: '剩餘能力點數'; float: left; color: #3a5f93; font-size: 13px; }
#game .ro-status-window .stat-actions {
  width: auto !important;
  min-height: 0 !important;
  grid-template-columns: auto 1fr !important;
  gap: 12px !important;
  padding: 0 12px 12px !important;
  background: none !important;
}
#game .ro-status-window #resetStats {
  width: auto !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
  font: 700 14px var(--glass-font);
}
#game .ro-status-window #resetStats:disabled { opacity: 0.5; }
#game .ro-status-window .reset-copy,
#game .ro-status-window .stat-actions .notice { color: #4b5b6e; font: 12px/1.4 var(--glass-font); }

/* 裝備: glass slot cards around the paper doll. */
#game .ro-equipment-scale-shell { height: auto !important; overflow: visible !important; }
#game .ro-equipment-window .ro-equipment-scale-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) minmax(0, 1fr);
  gap: 10px;
  width: auto !important;
  height: auto !important;
  padding: 12px;
  overflow: visible !important;
  transform: none !important;
  background: none !important;
}
#game .ro-equipment-window .equip-column {
  position: static !important;
  display: grid !important;
  gap: 6px;
  width: auto !important;
  height: auto !important;
}
#game .ro-equipment-window .equip-column-right { order: 3; }
#game .ro-equipment-window .equip-slot {
  position: static !important;
  display: grid !important;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  width: auto !important;
  height: auto !important;
  min-height: 46px !important;
  padding: 5px 10px !important;
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 55%) !important;
}
#game .ro-equipment-window .equip-slot[data-side='right'] { grid-template-columns: 1fr 32px; text-align: right; }
#game .ro-equipment-window .equip-slot span {
  position: static !important;
  grid-row: 1;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  color: #3a5f93;
  font: 700 11px var(--glass-font);
}
#game .ro-equipment-window .equip-slot b {
  position: static !important;
  grid-row: 2;
  width: auto !important;
  height: auto !important;
  color: var(--glass-ink) !important;
  font: 600 13px/1.3 var(--glass-font) !important;
  text-align: inherit !important;
}
#game .ro-equipment-window .equip-slot[data-side='left'] :is(span, b) { grid-column: 2; }
#game .ro-equipment-window .equip-slot[data-side='right'] :is(span, b) { grid-column: 1; }
#game .ro-equipment-window .equip-slot img {
  position: static !important;
  grid-row: 1 / span 2;
  width: 28px !important;
  height: 28px !important;
}
#game .ro-equipment-window .equip-slot[data-side='left'] img { grid-column: 1; }
#game .ro-equipment-window .equip-slot[data-side='right'] img { grid-column: 2; }
#game .ro-equipment-window .equip-slot:not(.equipped) b { color: #8a97a8 !important; font-weight: 400 !important; }
#game .ro-equipment-window .equip-costumes { padding: 0 12px 12px; }
#game .ro-equipment-window .equip-costumes h3 {
  margin: 0 0 8px;
  color: var(--glass-ink);
  font: 700 13px var(--glass-font);
}
#game .ro-equipment-window .equip-costume-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
#game .ro-equipment-window .equip-costume-grid .equip-slot {
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 64px !important;
  touch-action: manipulation;
}
#game .ro-equipment-window .equip-costume-grid .equip-slot::before { content: none; }
#game .ro-equipment-window .equip-costume-grid .equip-slot :is(span, b) {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
#game .ro-equipment-window .equip-costume-grid .equipped { cursor: pointer; }
#game .ro-equipment-window .equip-costume-grid .equipped:focus-visible {
  outline: 2px solid var(--glass-ink);
  outline-offset: 2px;
}
@media (max-width: 720px) {
  #game .ro-equipment-window .equip-costume-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#game .ro-equipment-window #paperdollStage {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  min-height: 250px;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 16px;
  order: 2;
}
#game .ro-equipment-window .paperdoll-fallback:not([src]),
#game .ro-equipment-window .paperdoll-fallback[src=''] { display: none; }
#game .ro-equipment-window .paperdoll-rotation-controls button {
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 50% !important;
  background: rgb(255 255 255 / 60%) !important;
}

/* G8L-203: this breakpoint is the phone layout; RoPaperdollFit.PHONE_QUERY mirrors it to pick the 1.7x paper-doll scale. */
@media (max-width: 720px) {
  #game .ro-status-window .status-layout { grid-template-columns: 1fr; }
  #game .ro-equipment-window .ro-equipment-scale-content {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'stage stage' 'left right';
  }
  #game .ro-equipment-window #paperdollStage { grid-area: stage; }
  #game .ro-equipment-window .equip-column-left { grid-area: left; }
  #game .ro-equipment-window .equip-column-right { grid-area: right; }
}


/* Responsive controls */
#game .ro-status-window .base-stats > [data-stat-row] { grid-template-columns: 38px minmax(0, 1fr) auto 28px !important; gap: 4px !important; padding-left: 10px !important; }
#game .ro-status-window .ro-status-increase {
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  justify-self: end;
}
#game .ro-equipment-window #paperdollStage { background: rgb(255 255 255 / 30%) !important; }
#game .ro-equipment-window .paperdoll-viewport {
  width: 100%;
  height: 100%;
}
#game .ro-equipment-window .paperdoll-sprite {
  left: calc(50% - 48px);
  top: calc(82% - 92px);
  transform-origin: 50% 0;
}
/* G8L-203: ground shadow placed by RoPaperdollFit.applyFit under the scaled feet. */
#game .ro-equipment-window .paperdoll-shadow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(20 30 45 / 45%), rgb(20 30 45 / 0%));
  pointer-events: none;
}
#game .ro-equipment-window .showcase-fallback .paperdoll-shadow { display: none; }
#game .ro-equipment-window .paperdoll-rotation-controls button {
  width: 32px !important;
  height: 32px !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  color: #3a5f93 !important;
}
#game .ro-equipment-window .paperdoll-rotation-controls button img { display: none !important; }
#game .ro-equipment-window #paperdollRotateLeft::before { content: '↺'; font: 700 18px/1 var(--glass-font); }
#game .ro-equipment-window #paperdollRotateRight::before { content: '↻'; font: 700 18px/1 var(--glass-font); }
@media (max-width: 720px) {
  #game .ro-status-window .base-stats { grid-template-columns: 1fr 1fr !important; }
  #game .ro-status-window :is(.ro-status-value) { font-size: 15px !important; }
  #game .ro-equipment-window #paperdollStage { min-height: 170px !important; }
}


#game .ro-equipment-window .paperdoll-rotation-controls {
  position: absolute !important;
  left: 10px !important;
  right: 10px !important;
  top: auto !important;
  bottom: 10px !important;
  width: auto !important;
  display: flex !important;
  justify-content: space-between;
  pointer-events: none;
}
#game .ro-equipment-window .paperdoll-rotation-controls button { position: static !important; pointer-events: auto; }


/* Window controls and panels */
#game .eden-milestones {
  background: rgb(255 255 255 / 35%) !important;
  border-radius: 10px;
}
#game .window .titlebar img {
  background-image: none !important;
}
#game .window .notice { color: #4b5b6e !important; }

/* HP / SP / EXP bars */
#game .bar {
  height: 12px !important;
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 6px !important;
  overflow: hidden;
  background: rgb(20 30 45 / 14%) !important;
  box-shadow: inset 0 1px 2px rgb(10 20 40 / 18%);
}
#game .bar > i { border-radius: 6px; }
#game .bar > i.hp { background: linear-gradient(#ff8a8a, #e24c4c) !important; }
#game .bar > i.sp { background: linear-gradient(#8ccaff, #3b8fe0) !important; }
#game .bar.exp-bar > i { background: linear-gradient(#ffd98a, #e2a23b) !important; }
#game .bar :is(span, small, b) { color: var(--glass-ink) !important; text-shadow: 0 0 2px #fff; font-family: var(--glass-font); }

/* Native checkbox / radio in glass blue instead of the client bitmap. */
#game input[type='checkbox'],
#game input[type='radio'] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  width: 16px !important;
  height: 16px !important;
  background: none !important;
  accent-color: #3f69a8;
}
#game input[type='range'] { accent-color: #3f69a8; }

/* Skill reset uses a client bitmap button. */
#game #resetSkills {
  width: auto !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
  font: 700 14px var(--glass-font) !important;
  text-indent: 0 !important;
}
#game #resetSkills:disabled { opacity: 0.5; }

/* Tables (rankings and similar) */
#game .window table { border-collapse: separate; border-spacing: 0; }
#game .window th {
  background: rgb(111 154 214 / 28%) !important;
  color: #1c2a3a !important;
  font-family: var(--glass-font);
  border: 0 !important;
}
#game .window td { border-color: rgb(255 255 255 / 45%) !important; background: transparent !important; }
#game .window tr:nth-child(even) td { background: rgb(255 255 255 / 20%) !important; }


/* Client bitmap buttons (傳送, 確定, 取消 ...) become glass buttons too. */
#game .official-skin-button {
  width: auto !important;
  min-width: 56px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 14px !important;
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-radius: 15px !important;
  background: rgb(255 255 255 / 55%) !important;
  background-image: none !important;
  color: var(--glass-ink) !important;
  text-indent: 0 !important;
  font: 600 13px var(--glass-font) !important;
  box-shadow: 0 2px 6px rgb(10 20 40 / 12%) !important;
}
#game .official-skin-button:is(.official-ok, .official-send, .official-use, .primary) {
  border-color: rgb(255 255 255 / 80%) !important;
  background: var(--glass-blue) !important;
  color: #fff !important;
}
#game .official-skin-button:disabled { opacity: 0.5; }
#game .chat-compose :is(button, input) { height: 34px !important; border-radius: 17px !important; }


/* UI themes (ui-theme.js) on top of glass: the heroine colour tints title bars
 * and every blue accent, and the heroine art shows on the right of the listed
 * windows behind a frosted fade. The 預設 theme keeps the glass blue. */
:root[data-ui-theme]:not([data-ui-theme='default']) #game {
  --glass-blue: linear-gradient(var(--ui-theme-bar-top), var(--ui-theme-bar-bottom));
}
:root[data-ui-theme]:not([data-ui-theme='default']) #game .window > .titlebar {
  background: linear-gradient(
    color-mix(in srgb, var(--ui-theme-bar-top) 72%, transparent),
    color-mix(in srgb, var(--ui-theme-bar-bottom) 72%, transparent)) !important;
}
:root[data-ui-theme]:not([data-ui-theme='default']) #game .window:not(.ro-ui-primitive),
:root[data-ui-theme]:not([data-ui-theme='default']) #game :is(.ro-status-window, .ro-equipment-window) {
  border-color: color-mix(in srgb, var(--ui-theme-bar-top) 45%, white) !important;
}
/* Theme picker cards in the glass look. */
#game .ui-theme-card {
  border: 1px solid rgb(255 255 255 / 70%) !important;
  border-top: 5px solid var(--ui-theme-card-bottom, #3f69a8) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 50%) !important;
  overflow: hidden;
}
#game .ui-theme-card .ui-theme-thumb { border-radius: 8px; }
#game .ui-theme-card.is-selected {
  background: rgb(255 255 255 / 85%) !important;
  box-shadow: 0 0 0 2px var(--ui-theme-card-bottom, #3f69a8), 0 6px 16px rgb(10 20 40 / 20%) !important;
}
#game .ui-theme-card[data-theme-id='default'] .ui-theme-thumb {
  background: linear-gradient(#6f9ad6, #3f69a8) 0 0 / 100% 24% no-repeat, rgb(255 255 255 / 70%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 70%);
}


/* Theme colour also reaches the top cluster, the bottom nav and fold arrows. */
:root[data-ui-theme]:not([data-ui-theme='default']) #game .brand #logout {
  background: linear-gradient(var(--ui-theme-bar-top), var(--ui-theme-bar-bottom)) !important;
}
:root[data-ui-theme]:not([data-ui-theme='default']) #game .window-fold-button::after {
  border-color: var(--ui-theme-bar-bottom);
}
:root[data-ui-theme]:not([data-ui-theme='default']) #game .ro-status-window :is(.ro-status-label, .ro-derived-label),
:root[data-ui-theme]:not([data-ui-theme='default']) #game .ro-equipment-window .equip-slot span {
  color: var(--ui-theme-bar-bottom);
}


:root[data-ui-theme]:not([data-ui-theme='default']) #game { --glass-fill: rgb(255 255 255 / 50%); }

/* One character image shared by every
 * window. The art is pinned to the viewport (background-attachment: fixed), so
 * each window shows its own slice of the same image and the head appears once. */
:root[data-ui-theme]:not([data-ui-theme='default']) body:has(#game:not(.hidden)) {
  background:
    linear-gradient(rgb(12 20 36 / 18%), rgb(12 20 36 / 28%)) fixed,
    var(--game-bg-wide, url('/ro/client/ui/login-background-lofi-05-wide.webp')) center / cover fixed no-repeat !important;
}
@media (orientation: portrait) and (max-aspect-ratio: 4/5) {
  :root[data-ui-theme]:not([data-ui-theme='default']) body:has(#game:not(.hidden)) {
    background:
      linear-gradient(rgb(12 20 36 / 18%), rgb(12 20 36 / 28%)) fixed,
      var(--game-bg-tall, url('/ro/client/ui/login-background-lofi-05-tall.webp')) center / cover fixed no-repeat !important;
  }
}
:root[data-ui-theme]:not([data-ui-theme='default'])
  :is(#game > .social-window,
    #game .hunt-toolbar, #hunt > .window:not(.map-window, .combat-window), #system > .window) {
  background:
    linear-gradient(90deg, rgb(255 255 255 / 72%) 0%, rgb(255 255 255 / 42%) 38%, rgb(255 255 255 / 0%) 68%),
    var(--ui-theme-panel) right var(--theme-art-x, 12vw) top var(--theme-art-y, 0px) / auto 100vh fixed no-repeat,
    rgb(255 255 255 / 26%) !important;
}
:root[data-ui-theme]:not([data-ui-theme='default']) #game .combat-window .console {
  background:
    linear-gradient(90deg, rgb(12 18 30 / 90%) 0%, rgb(12 18 30 / 70%) 45%, rgb(12 18 30 / 20%) 100%),
    var(--ui-theme-panel) right var(--theme-art-x, 12vw) top var(--theme-art-y, 0px) / auto 100vh fixed no-repeat,
    rgb(12 18 30 / 55%) !important;
}
/* Desktop: keep the figure over the right half of the content column. */
/* G8L-269: themed character art is top-aligned; these tune its vertical offset and phone horizontal offset. */
:root { --theme-art-y: 0px; --theme-art-x-phone: -6vw; }
/* G8L-269: red-dress art is a close-up with the face at the very top, under the 基本訊息 window; shift it down so the face lands in the chat window on desktop and phone. */
:root[data-ui-theme='heroine-red-dress'] { --theme-art-y: 16vh; }
/* G8L-269: on phones the red-dress close-up is too large and its winking eye sits off the left edge; shrink it and shift it right so the whole face shows in the chat window. Desktop is unchanged. */
@media (max-width: 720px) { :root[data-ui-theme='heroine-red-dress'] { --theme-art-x-phone: -22vw; --theme-art-y-phone: 15vh; --theme-art-h-phone: 64vh; } }
@media (min-width: 1200px) { :root { --theme-art-x: calc((100vw - 960px) / 2); } }
@media (max-width: 720px) {
  :root { --theme-art-x: 0px; }
  :root[data-ui-theme]:not([data-ui-theme='default'])
    :is(#game > .social-window,
      #game .hunt-toolbar, #hunt > .window:not(.map-window, .combat-window), #system > .window) {
    background:
      linear-gradient(90deg, rgb(255 255 255 / 76%) 0%, rgb(255 255 255 / 46%) 34%, rgb(255 255 255 / 0%) 66%),
      var(--ui-theme-panel) right var(--theme-art-x-phone, -6vw) top var(--theme-art-y-phone, var(--theme-art-y, 0px)) / auto var(--theme-art-h-phone, 100vh) fixed no-repeat,
      rgb(255 255 255 / 26%) !important;
  }
  :root[data-ui-theme]:not([data-ui-theme='default']) #game .combat-window .console {
    background:
      linear-gradient(90deg, rgb(12 18 30 / 90%) 0%, rgb(12 18 30 / 70%) 35%, rgb(12 18 30 / 20%) 100%),
      var(--ui-theme-panel) right var(--theme-art-x-phone, -6vw) top var(--theme-art-y-phone, var(--theme-art-y, 0px)) / auto var(--theme-art-h-phone, 100vh) fixed no-repeat,
      rgb(12 18 30 / 55%) !important;
  }
}
/* G8L-111: Rainbow map shares the homepage glass and theme background. */
#worldMapOverlay{padding:10px;background:linear-gradient(rgb(12 20 36 / 18%),rgb(12 20 36 / 28%)),var(--game-bg-wide,url('/ro/client/ui/login-background-lofi-05-wide.webp')) center/cover fixed no-repeat}
#worldMapOverlay .world-map-shell{width:100%;border:1px solid var(--glass-line);border-radius:10px;overflow:hidden;background:transparent;color:var(--glass-ink);font-family:var(--glass-font)}
#worldMapOverlay .world-map-header,#worldMapOverlay .world-map-detail-heading{background:linear-gradient(rgb(90 130 190 / 62%),rgb(55 90 150 / 62%));color:white;backdrop-filter:blur(16px) saturate(140%)}
#worldMapOverlay .world-map-layout{grid-template-rows:minmax(0,1fr) 220px;gap:8px;padding:8px;overflow:hidden}
#worldMapOverlay .world-map-stage{display:grid;place-items:center;overflow:hidden;padding:0;container-type:size;background:rgb(255 255 255 / 12%);border-radius:10px}
#worldMapOverlay .world-map-canvas{width:min(100cqw,125cqh);height:auto;max-width:none;aspect-ratio:5/4;margin:0;overflow:visible;background:transparent;box-shadow:none}
#worldMapOverlay .world-map-image{height:auto;aspect-ratio:5/4;object-fit:contain;pointer-events:none}
#worldMapOverlay .rainbow-cell{position:absolute;z-index:1!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-sizing:border-box;min-height:0;min-width:0;padding:3px;border:1px solid rgb(255 255 255 / 65%);border-radius:0;background:rgb(15 32 52 / 20%);color:white;font-size:clamp(7px,1.05vw,14px);line-height:1.2;overflow:visible;cursor:pointer;transform:none;box-shadow:none}
#worldMapOverlay .rainbow-cell:hover,#worldMapOverlay .rainbow-cell:focus-visible,#worldMapOverlay .rainbow-cell.selected{z-index:2!important;border:2px solid white;background:rgb(71 115 167 / 45%);box-shadow:inset 0 0 12px #92bbef;outline:0}
.rainbow-name{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:center;text-shadow:0 1px 2px #000;background:rgb(21 42 63 / 75%);border-radius:4px;padding:2px}
.rainbow-level{font-size:.8em;background:var(--glass-blue);border-radius:4px;padding:1px 3px;white-space:normal}
.rainbow-extension{position:absolute;bottom:0;right:0;font-size:.65em;line-height:1.1;background:#b92934;color:white;padding:1px 3px;pointer-events:none}
#worldMapOverlay .world-map-destinations,#worldMapOverlay .world-map-detail{border:1px solid var(--glass-line);border-radius:10px;background:var(--glass-fill);color:var(--glass-ink);backdrop-filter:blur(16px) saturate(140%)}
#worldMapOverlay .world-map-destinations{min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:10px;gap:5px}
#worldMapOverlay .world-map-region-index-list{min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:max-content;gap:6px;align-content:start}
#worldMapOverlay .world-map-destination{height:auto;min-height:42px;white-space:normal;text-overflow:clip;overflow:visible;padding:8px;background:rgb(255 255 255 / 50%);border:1px solid var(--glass-line);border-radius:6px;color:var(--glass-ink)}
#worldMapOverlay .world-map-destination span{white-space:normal;text-overflow:clip;overflow:visible;overflow-wrap:anywhere;display:block}
#worldMapOverlay .world-map-category-tabs button{border-radius:7px;background:rgb(255 255 255 / 50%);color:var(--glass-ink)}
#worldMapOverlay .world-map-category-tabs button[aria-selected=true]{background:var(--glass-blue);color:white}
#worldMapOverlay .world-map-detail{width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 32px)}
.rainbow-choice{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;width:100%;padding:12px;margin:6px 0;border:1px solid var(--glass-line);border-radius:6px;background:rgb(255 255 255 / 50%);color:var(--glass-ink);white-space:normal;text-align:left}
.rainbow-choice small{color:#a12d39}.rainbow-choice:hover{background:rgb(255 255 255 / 80%)}
.rainbow-choice .rainbow-maps{flex-basis:100%;overflow-wrap:anywhere}
#worldMapConfirm .world-map-confirm-card{border:1px solid var(--glass-line);border-radius:10px;background:var(--glass-fill);color:var(--glass-ink);backdrop-filter:blur(16px) saturate(140%)}
@media(max-width:600px){
 #worldMapOverlay{padding:5px;background-image:linear-gradient(rgb(12 20 36 / 18%),rgb(12 20 36 / 28%)),var(--game-bg-tall,url('/ro/client/ui/login-background-lofi-05-tall.webp'))}
 #worldMapOverlay .world-map-layout{grid-template-rows:auto minmax(0,1fr);padding:4px;gap:4px}
 #worldMapOverlay .world-map-stage{display:block;container-type:normal;align-self:start}
 #worldMapOverlay .world-map-canvas{width:100%;aspect-ratio:auto}
 #worldMapOverlay .world-map-image{display:block;aspect-ratio:auto}
 #worldMapOverlay .world-map-region-index-list{grid-template-columns:repeat(2,minmax(0,1fr))}
 #worldMapOverlay .rainbow-cell{padding:1px;font-size:7px;gap:1px}
 #worldMapOverlay .rainbow-name{padding:1px}
 #worldMapOverlay .world-map-detail-heading{flex-wrap:wrap}
}
@media(min-width:901px){
 #worldMapOverlay .world-map-layout{grid-template-columns:minmax(0,1fr) 320px}
 #worldMapOverlay .world-map-stage{grid-column:1;grid-row:1}
 #worldMapOverlay .world-map-destinations{grid-column:1 / -1;grid-row:2}
 #worldMapOverlay .world-map-detail{position:relative;grid-column:2;grid-row:1;left:auto;top:auto;transform:none;width:auto;max-height:100%;min-height:0}
 #worldMapOverlay .world-map-detail-backdrop{display:none}
}
#worldMapOverlay .world-map-destination,#worldMapOverlay .world-map-detail{text-shadow:none}
/* G8L-236 Rainbow Bridge item search: one column, wraps within phone width. */
#worldMapOverlay .world-map-region-index-list[data-mode=items]{grid-template-columns:minmax(0,1fr);gap:8px}
#worldMapOverlay .world-map-destinations input{font-size:16px}
#worldMapOverlay .rainbow-item-result{display:grid;gap:4px;min-width:0}
#worldMapOverlay .rainbow-item-result h4{margin:0;font-size:14px;overflow-wrap:anywhere}
#worldMapOverlay .rainbow-item-result h4 small{font-weight:normal;opacity:.75}
#worldMapOverlay .rainbow-item-card{padding:0 4px;border-radius:4px;background:#a12d39;color:#fff;font-size:11px}
#worldMapOverlay .rainbow-item-drop{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;width:100%;min-width:0;height:auto;padding:6px 8px;text-align:left;white-space:normal;background:rgb(255 255 255 / 50%);border:1px solid var(--glass-line);border-radius:6px;color:var(--glass-ink);text-shadow:none}
#worldMapOverlay .rainbow-item-map,#worldMapOverlay .rainbow-item-mob{min-width:0;overflow-wrap:anywhere}
#worldMapOverlay .rainbow-item-map{font-weight:bold}
#worldMapOverlay .rainbow-item-mob{display:flex;justify-content:space-between;gap:8px;font-size:12px}
#worldMapOverlay .rainbow-item-mob>span{min-width:0;overflow-wrap:anywhere;opacity:.8}
#worldMapOverlay .rainbow-item-rate{flex:none;white-space:nowrap}
#worldMapOverlay .rainbow-item-reward{color:#8a4b00}
#worldMapOverlay .rainbow-item-note{margin:0;font-size:12px;overflow-wrap:anywhere}

/* G8L-201: the mobile 道具說明 popup joins the glass window language (same
 * fill, line, blur, title gradient and pills as #game .window). Only the
 * .mobile sheet changes; the desktop hover tooltip keeps its sysbox frame. */
#game .card-art-preview.mobile { background: rgb(12 20 36 / 38%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#game .card-art-preview.mobile .card-art-preview-panel {
  width: min(360px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 28px rgb(10 20 40 / 24%), inset 0 1px 0 rgb(255 255 255 / 55%);
  color: var(--glass-ink);
  font-family: var(--glass-font);
  image-rendering: auto;
}
#game .card-art-preview.mobile .card-art-preview-titlebar {
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid rgb(255 255 255 / 40%);
  background: linear-gradient(rgb(90 130 190 / 62%), rgb(55 90 150 / 62%));
  color: #fff;
  font: 700 15px var(--glass-font);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgb(10 20 40 / 45%);
}
:root[data-ui-theme]:not([data-ui-theme='default']) #game .card-art-preview.mobile .card-art-preview-titlebar {
  background: linear-gradient(
    color-mix(in srgb, var(--ui-theme-bar-top) 72%, transparent),
    color-mix(in srgb, var(--ui-theme-bar-bottom) 72%, transparent));
}
#game .card-art-preview.mobile .card-art-preview-close {
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
  background: rgb(255 255 255 / 55%);
  color: var(--glass-ink);
  box-shadow: 0 2px 6px rgb(10 20 40 / 12%);
}
#game .card-art-preview.mobile .card-art-preview-close::before { content: '✕'; font: 600 14px/1 var(--glass-font); }
#game .card-art-preview.mobile .card-art-preview-close:active { background: rgb(255 255 255 / 80%); }
#game .card-art-preview.mobile .ro-item-detail-body { gap: 8px; padding: 12px 14px 4px; }
#game .card-art-preview.mobile .ro-item-detail-image { border-radius: 10px; }
#game .card-art-preview.mobile .ro-item-detail-art--fallback .ro-item-detail-image { background: rgb(255 255 255 / 55%); }
#game .card-art-preview.mobile .ro-item-detail-name { color: var(--glass-ink); font: 700 16px/1.35 var(--glass-font); }
#game .card-art-preview.mobile :is(.ro-item-detail-stats, .ro-item-detail-requirements, .item-detail-description, small) {
  font-family: var(--glass-font);
  font-size: 13px;
}
#game .card-art-preview.mobile .ro-item-detail-stats { color: var(--glass-ink); }
#game .card-art-preview.mobile .ro-item-detail-stats li > span { color: rgb(28 42 58 / 68%); }
#game .card-art-preview.mobile .item-detail-description {
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 10px;
  background: rgb(255 255 255 / 40%);
  color: var(--glass-ink);
}
#game .card-art-preview.mobile .ro-item-detail-meta { padding: 4px 14px 0; }
#game .card-art-preview.mobile #cardArtPreviewAction {
  width: calc(100% - 28px) !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 10px 14px 14px;
  border-radius: 22px !important;
  font: 700 15px var(--glass-font) !important;
  /* keep the glass pill's white label above PR #116's mobile label colour */
  color: #fff !important;
  letter-spacing: 0.08em;
}

/* G8L-211 town explore (odin-explore.mjs; g211-town-explore DESIGN §3, §16-5..8). Stick: .glass-pane plus a highlight and an edge light, no
 * refraction (iOS Safari has no SVG displacement inside backdrop-filter). Enter card B3: a slanted glass slab whose thickness, energy bar and
 * pressed tint read the UI theme's title-bar colours (the 預設 theme falls back to --glass-blue's two stops), so it follows a theme switch at once. */
html.odin-explore-lock, html.odin-explore-lock body { overscroll-behavior: none; overflow: hidden; }
html.odin-explore-lock body { position: fixed; left: 0; right: 0; }
/* 12/06 camera drag (odin-explore.mjs, full screen only): a finger on the picture turns the camera, so #log (a scroll box: its own touch-action
 * decides, not the window's none in odin-eye.css) must not take it for a pan. */
html.odin-fs #game .combat-window.odin-eye-full > #log { touch-action: none; }
.odin-explore { --top: var(--ui-theme-bar-top, #6f9ad6); --bot: var(--ui-theme-bar-bottom, #3f69a8); position: fixed; inset: 0; z-index: 40; pointer-events: none; font-family: var(--glass-font); }
.odin-explore[hidden], .odin-explore-enter[hidden] { display: none; }
.odin-explore-zone { position: absolute; left: calc(24px + env(safe-area-inset-left)); bottom: calc(var(--bottom-reserve, 0px) + 28px); width: 120px; height: 120px; border-radius: 50%;
  pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* 12/05 user (odin_joystick_c_floating_ghost_v2, fixed): a 1 px white ring and knob, nothing behind them; .6 at rest, 1 while held. */
.odin-explore-stick { position: absolute; inset: 0; box-sizing: border-box; border-radius: 50%; border: 1px solid rgb(255 255 255 / 38%); opacity: 0.6; transition: opacity 180ms ease; }
.odin-explore-stick.is-active { opacity: 1; transition: none; }
.odin-explore-knob { position: absolute; left: 37px; top: 37px; width: 44px; height: 44px; box-sizing: border-box; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 55%); background: rgb(255 255 255 / 6%); transition: transform 180ms ease; }
.odin-explore-stick.is-active .odin-explore-knob { transition: none; }
.odin-explore-hint { position: absolute; left: 0; bottom: 132px; white-space: nowrap; padding: 4px 10px; border-radius: 12px; background: var(--glass-chip-fill); color: #fff; font-size: 13px; pointer-events: none; }
.odin-explore-hint[hidden] { display: none; }
.odin-explore-enter { position: absolute; right: calc(18px + env(safe-area-inset-right)); bottom: calc(var(--bottom-reserve, 0px) + 56px); width: 236px; height: 74px;
  padding: 0; border: 0; background: none; perspective: 300px; pointer-events: auto; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.odin-explore-enter > span { position: absolute; inset: 0; }
.odin-explore-slab { transform-style: preserve-3d; transform: rotateY(-48deg) rotateX(16deg) rotateZ(-3deg); transform-origin: 85% 50%; transition: transform 120ms ease; }
.odin-explore-edge { position: absolute; left: 0; top: 0; right: -9px; bottom: -9px; }
.odin-explore-edge.r { clip-path: polygon(calc(100% - 9px) 0, 100% 9px, 100% 100%, calc(100% - 9px) calc(100% - 9px)); background: linear-gradient(90deg, color-mix(in srgb, var(--top) 55%, transparent), color-mix(in srgb, var(--bot) 70%, transparent)); }
.odin-explore-edge.b { clip-path: polygon(0 calc(100% - 9px), calc(100% - 9px) calc(100% - 9px), 100% 100%, 9px 100%); background: linear-gradient(180deg, color-mix(in srgb, var(--top) 55%, transparent), color-mix(in srgb, var(--bot) 70%, transparent)); }
.odin-explore-face { position: absolute; inset: 0; clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  background: linear-gradient(180deg, rgb(255 255 255 / 85%) 0 1.5px, transparent 1.5px), linear-gradient(110deg, transparent 38%, rgb(255 255 255 / 28%) 47%, transparent 56%),
    radial-gradient(120% 140% at 15% 0%, rgb(255 255 255 / 22%), transparent 50%), rgb(255 255 255 / 10%);
  -webkit-backdrop-filter: blur(6px) saturate(160%); backdrop-filter: blur(6px) saturate(160%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 60%), inset 0 -10px 18px rgb(20 60 140 / 18%); }
.odin-explore-face::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 0; width: 6px; background: linear-gradient(var(--top), var(--bot)); }
.odin-explore-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 6px; }
.odin-explore-blk { display: flex; flex-direction: column; text-align: left; }
.odin-explore-t1 { font-size: 11px; font-weight: 800; letter-spacing: 3px; color: color-mix(in srgb, var(--bot) 85%, black); text-shadow: 0 1px 0 rgb(255 255 255 / 70%); }
.odin-explore-t2 { font-size: 22px; font-weight: 900; letter-spacing: 1px; color: #0d1c38; text-shadow: 0 0 3px rgb(255 255 255 / 95%), 0 0 8px rgb(255 255 255 / 70%); white-space: nowrap; }
.odin-explore-enter > .odin-explore-shadow { inset: auto 6px -26px auto; width: 190px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / 40%), transparent); filter: blur(2px); transition: opacity 120ms ease, transform 120ms ease; }
.odin-explore-enter.is-pressed .odin-explore-slab { transform: rotateY(-48deg) rotateX(16deg) rotateZ(-3deg) translateZ(-7px); }
.odin-explore-enter.is-pressed .odin-explore-edge { right: -4px; bottom: -4px; }
.odin-explore-enter.is-pressed .odin-explore-edge.r { clip-path: polygon(calc(100% - 4px) 0, 100% 4px, 100% 100%, calc(100% - 4px) calc(100% - 4px)); }
.odin-explore-enter.is-pressed .odin-explore-edge.b { clip-path: polygon(0 calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), 100% 100%, 4px 100%); }
.odin-explore-enter.is-pressed .odin-explore-face { background: radial-gradient(120% 140% at 15% 0%, color-mix(in srgb, var(--top) 50%, transparent), transparent 55%), color-mix(in srgb, var(--top) 38%, transparent); }
.odin-explore-enter.is-pressed .odin-explore-shadow { opacity: 0.5; transform: scale(0.94); }
.odin-explore-enter:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* G8L-211 explore minimap (odin-minimap.mjs): Legacy's MiniMap (UI/Components/MiniMap/MiniMap.html:1-5, MiniMap.css:6-22: a 128 px canvas, + at 4 px
 * and - at 18 px from its top-left) in the game screen's top-left corner under the LOG title bar (29 px, .damage-float-layer), only while fully open.
 * Folded (12/05 user): a small chip in the same corner. The buttons are 16 px for a finger (Legacy's are 12 px for a mouse). */
#game .combat-window > .odin-minimap { position: absolute; z-index: 4; left: 6px; top: 6px; width: 128px; height: 128px; box-shadow: none;
  background: none !important; /* 12/06 no frame: Legacy MiniMapCommon.js:478-482 only clearRect + drawImage, no backdrop or border */ user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#game .combat-window > .odin-minimap[hidden] { display: none; }
/* 12/06 使用者：全開時左上不要 LOG 字樣，小地圖貼左上角（上面 top: 6px）。 */
#game .combat-window.odin-eye-full > .log-titlebar > span:first-child { visibility: hidden; }
.odin-minimap > canvas { display: block; width: 128px; height: 128px; }
#game .combat-window > .odin-minimap > button { position: absolute; top: 4px; width: 16px; height: 16px; padding: 0; border: 1px solid rgb(255 255 255 / 70%); border-radius: 3px;
  background: rgb(20 30 50 / 70%) !important; color: #fff; font: bold 13px/14px sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.odin-minimap > .odin-minimap-plus { left: 4px; }
.odin-minimap > .odin-minimap-minus { left: 22px; }
.odin-minimap > .odin-minimap-fold { right: 4px; }
.odin-minimap > .odin-minimap-fold::before { content: '▲'; font-size: 9px; vertical-align: top; }
#game .combat-window > .odin-minimap.is-folded { width: auto; height: auto; background: none !important; box-shadow: none; }
.odin-minimap.is-folded > canvas, .odin-minimap.is-folded > .odin-minimap-plus, .odin-minimap.is-folded > .odin-minimap-minus { display: none; }
#game .combat-window > .odin-minimap.is-folded > .odin-minimap-fold { position: static; width: auto; height: 22px; padding: 0 8px; font-size: 12px; line-height: 20px; }
.odin-minimap.is-folded > .odin-minimap-fold::before { content: '小地圖'; }
/* Full screen (odin-fullscreen.mjs, html.odin-fs): the eye's window is the screen and its LOG title bar is hidden; the minimap, inside that window,
 * goes up to the screen's top-left corner inside the safe area (the close / turn buttons hold the top-right, odin-eye.css .odin-fs-bar). */
html.odin-fs #game .combat-window > .odin-minimap { top: calc(8px + env(safe-area-inset-top)); left: calc(6px + env(safe-area-inset-left)); }
