/* Desktop HUD. Load after desktop-hud-20261111.css and quickbar-desktop-row2.css. */
@media (min-width: 820px) {
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) {
    --hud2-width: 790px;
    --hud2-height: 94px;
    --hud2-wood: url("/assets/ui/desktop-hud-v2/walnut.webp?v=20261111T1300uiart");
    --hud2-bronze: #8c7249;
    --hud2-gold: #f1d79f;
    --hud2-cream: #eee4cc;
    --hud2-slot: linear-gradient(#12110f, #252018);
    --hud2-surface:
      linear-gradient(180deg, #251f1580, #110e0bb3),
      var(--hud2-wood) center / cover no-repeat #211811;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar {
    left: 50%;
    bottom: 0;
    width: var(--hud2-width);
    height: var(--hud2-height);
    box-sizing: border-box;
    border: 0;
    background: none !important;
    transform: translateX(-50%) !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    width: auto;
    height: auto;
    pointer-events: none;
    border: 1px solid var(--hud2-bronze);
    border-radius: 9px 9px 4px 4px;
    background: var(--hud2-surface);
    box-shadow: inset 0 1px #f3d6a056, inset 0 0 0 3px #100c0977, 0 2px 12px #080603b3;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar::after {
    content: none;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group {
    left: 134px;
    bottom: 8px;
    height: 30px;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group > button.action {
    border: 1px solid #816a45;
    border-radius: 4px;
    background: var(--hud2-slot);
    box-shadow: inset 0 1px 2px #000c, 0 1px #0009;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group > button.action:hover {
    background: linear-gradient(#32291b, #483921);
    border-color: #e0be7e;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action kbd {
    left: 0;
    right: 0;
    top: -10px;
    text-align: center;
    color: var(--hud2-gold);
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group .skill-page-toggle {
    left: -52px !important;
    top: 0 !important;
    width: 41px !important;
    height: 30px !important;
    border: 1px solid #88714c !important;
    border-radius: 4px !important;
    color: #fff7df;
    background: #0d0c0a !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group .skill-page-toggle:hover {
    background: #292115 !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .bottom-nav {
    left: 14px !important;
    top: 20px !important;
    width: 108px !important;
    height: 24px !important;
    display: flex;
    align-items: center;
    text-align: left !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .bottom-nav .gold {
    display: flex;
    align-items: center;
    gap: 6px;
    height: auto;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .gold > span {
    display: inline;
    color: #d3a859;
    font-size: 12px;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .gold b {
    color: var(--hud2-gold) !important;
    font-size: 12px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .desktop-level-readout:not([hidden]) {
    left: 14px;
    top: 56px;
    width: 58px;
    height: 30px;
    border: 1px solid #816a45;
    border-radius: 4px;
    box-sizing: border-box;
    background: var(--hud2-slot);
    color: var(--hud2-gold);
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .desktop-level-readout::before {
    content: "Lv";
    color: #be9f71;
    font: 700 9px/1 var(--font, sans-serif);
    margin-right: 3px;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > #quick-edit {
    left: 532px !important;
    top: 57px !important;
    width: 45px !important;
    height: 27px !important;
    line-height: 25px !important;
    border: 1px solid #88714c;
    border-radius: 4px !important;
    background: linear-gradient(#413421, #272016);
    color: var(--hud2-cream);
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > #quick-edit:is(:hover, [aria-pressed="true"]) {
    background: #5a472b;
    border-color: #e0be7e;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > :is(.desktop-shortcut-settings, #element-gear-toggle, #guardian-quick-toggle),
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > :is(#soul-quick-toggle, #spirit-quick-toggle) {
    box-sizing: border-box !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 50% !important;
    padding: 0;
    white-space: nowrap;
    font-size: 11px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > :is(.desktop-shortcut-settings, #element-gear-toggle, #guardian-quick-toggle) {
    top: 14px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > .desktop-shortcut-settings {
    left: 549px;
    border: 0;
    /* 2026-11-11 齒輪與右側功能列「設定」同一張圖（rail-v2-settings；Codex 的 desktop-hud-v2/settings.png 與 @2x 逐位元相同） */
    background: url("/assets/ui/rail-v2/rail-v2-settings@2x.png?v=20261111T1300uiart") center / 36px 39px no-repeat;
    background: image-set(url("/assets/ui/rail-v2/rail-v2-settings.png?v=20261111T1300uiart") .9x, url("/assets/ui/rail-v2/rail-v2-settings@2x.png?v=20261111T1300uiart") 1.8x) center / 36px 39px no-repeat;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > .desktop-shortcut-settings:is(:hover, :focus-visible) {
    background: url("/assets/ui/rail-v2/rail-v2-settings-hover@2x.png?v=20261111T1300uiart") center / 36px 39px no-repeat;
    background: image-set(url("/assets/ui/rail-v2/rail-v2-settings-hover.png?v=20261111T1300uiart") .9x, url("/assets/ui/rail-v2/rail-v2-settings-hover@2x.png?v=20261111T1300uiart") 1.8x) center / 36px 39px no-repeat;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > #element-gear-toggle {
    left: 595px !important;
    background: radial-gradient(circle at 33% 25%, #574936, #201a14 78%);
    border: 2px solid #c6a776;
    box-shadow: 0 2px 4px #0009, inset 0 0 0 1px #e5c7893b;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar > #guardian-quick-toggle {
    left: 641px !important;
    border-width: 2px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > :is(#soul-quick-toggle, #spirit-quick-toggle) {
    position: fixed !important;
    top: auto !important;
    bottom: calc(var(--hud2-height) - 50px) !important;
    z-index: 15 !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > #soul-quick-toggle {
    left: calc(50% - var(--hud2-width) / 2 + 687px) !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > #spirit-quick-toggle {
    left: calc(50% - var(--hud2-width) / 2 + 733px) !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > #spirit-quick-toggle > span {
    clip-path: circle(46%);
    transform: scale(.84) !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > #spirit-quick-toggle > small {
    bottom: 1px !important;
    padding: 0 2px !important;
    background: #1d150bdf !important;
    border-radius: 6px !important;
    font-size: 8px !important;
    line-height: 9px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .experience {
    left: 589px !important;
    top: 61px !important;
    width: 180px !important;
    height: 21px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .experience > div:first-child {
    inset: 0 34px auto 0 !important;
    height: 11px !important;
    gap: 4px;
  }

  /* 2026-11-11 整合：正式版 #xp-pct 在 .xp-track 裡（離線預覽是在 .experience 下），且 xp-visibility.css 有 translateY(-50%)；
     改以經驗條為基準往上 16px，回到「經驗／數字」同一行的右側。 */
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .experience #xp-pct {
    right: 0 !important;
    left: auto !important;
    top: -16px !important;
    bottom: auto !important;
    transform: none !important;
    line-height: 11px !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .experience .xp-track {
    inset: auto 0 0 !important;
    height: 5px !important;
    border: 1px solid #76623e !important;
    box-sizing: border-box;
    overflow: visible !important; /* 2026-11-11 整合：#xp-pct 在經驗條裡、畫在條上方，v1 的 overflow:hidden 會把它切掉 */
    background: #0a0908 !important;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) #chat-box.chat-box {
    translate: 0 -4px;
    border: 1px solid var(--hud2-bronze);
    border-image: none;
    border-radius: 7px;
    background: var(--hud2-surface);
    box-shadow: inset 0 1px #f3d6a03b, 0 2px 8px #0008;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) #chat-box .chat-header {
    border-radius: 6px 6px 0 0;
    background: none;
    box-shadow: none;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) #chat-box .chat-header button {
    border-radius: 50%;
  }

  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar button:focus-visible,
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) > :is(#soul-quick-toggle, #spirit-quick-toggle):focus-visible {
    outline: 2px solid #ffe2a6;
    outline-offset: 2px;
  }
}


/* HOTBAR20261111（使用者：電腦網頁版的快捷列可以透明一點嗎？可以看過去畫面）：底板與空格半透明，圖示、數字、文字不變 */
@media (min-width: 820px) {
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar::before { opacity: .45; }
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group > button.action { background: linear-gradient(#12110f99, #25201899); }
  html:not([data-portrait="true"]) body.desktop-client:not(.touch-client) .actionbar .action-group > button.action:hover { background: linear-gradient(#32291bcc, #483921cc); }
}
