
    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      min-height: 100%;
      margin: 0;
      font-family: Arial, Helvetica, sans-serif;
      background: #ffffff;
      color: #111111;
      overflow: hidden;
    }

    /* ---------- Persistent character HUD ---------- */

    .global-character-hud {
      position: fixed;
      inset: 0 0 auto 0;
      z-index: 1200;
      height: 64px;
      border-bottom: 3px solid #403628;
      background:
        radial-gradient(circle at 50% -120%, rgba(126, 103, 65, 0.17), transparent 48%),
        #090b0c;
      box-shadow:
        inset 0 -1px 0 rgba(123, 113, 92, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.26);
      color: #d7d0c2;
    }

    .global-character-hud-inner {
      width: min(1240px, calc(100vw - 48px));
      height: 100%;
      margin: 0 auto;
      display: grid;
      grid-template-columns: minmax(326px, 1fr) minmax(254px, 286px) minmax(326px, 1fr);
      align-items: center;
      column-gap: clamp(30px, 3.5vw, 44px);
    }

    .global-hud-left {
      /*
        Give resource labels breathing room before the bars and leave enough
        width for larger EXP progress values without wrapping.
      */
      width: min(422px, 100%);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: center;
      justify-self: end;
      gap: 5px;
      min-width: 0;
    }

    .global-hud-left .global-resource-inline {
      width: 100%;
      display: grid;
      grid-template-columns: 118px minmax(160px, 1fr) 94px;
      align-items: center;
      gap: 11px;
    }

    .global-hud-left .global-resource-label {
      text-align: left;
    }

    .global-hud-left .global-resource-value {
      padding-left: 5px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }

    .global-hud-left .global-bar {
      height: 6px;
    }

    .global-hud-right {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 15px;
      min-width: 0;
    }

    .global-character-identity {
      display: grid;
      justify-items: center;
      align-content: center;
      gap: 5px;
      width: 100%;
      min-width: 0;
      padding: 0 16px;
      text-align: center;
      pointer-events: none;
    }

    .global-character-label,
    .global-resource-label,
    .global-gold-label {
      color: #81786b;
      font-size: 10px;
      line-height: 1;
      font-weight: 900;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .global-character-name {
      max-width: 100%;
      overflow: hidden;
      color: #eee4d0;
      font-size: 18px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .global-character-meta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      color: #aa9671;
      font-size: 11px;
      line-height: 1;
      font-weight: 900;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .global-character-meta-divider {
      color: #514636;
      font-size: 10px;
    }

    .global-character-rank {
      display: inline-flex;
      align-items: center;
      min-height: 21px;
      padding: 4px 10px 3px;
      border: 1px solid rgba(201, 151, 60, 0.66);
      background:
        linear-gradient(180deg, rgba(204, 153, 59, 0.27), rgba(103, 73, 29, 0.1)),
        #11100d;
      color: #f1cf75;
      font-size: 12px;
      letter-spacing: 0.09em;
      box-shadow:
        inset 0 0 0 1px rgba(224, 177, 84, 0.12),
        0 0 13px rgba(182, 129, 41, 0.16);
    }

    .global-resource {
      display: grid;
      gap: 5px;
    }

    .global-resource-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .global-resource-value {
      color: #d8d0c0;
      font-size: 11px;
      line-height: 1;
      font-weight: 800;
    }

    .global-bar {
      height: 12px;
      overflow: hidden;
      border: 1px solid #4a4439;
      border-radius: 999px;
      background: #17191a;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55);
    }

    .global-bar-fill {
      height: 100%;
      width: 0%;
      border-radius: inherit;
      transition: width 0.24s ease;
    }

    .global-hp-fill {
      background: linear-gradient(180deg, #e42a2a 0%, #b51619 100%);
    }

    .global-mana-fill {
      background: linear-gradient(180deg, #5ba6ff 0%, #2756c6 100%);
    }

    .global-exp-fill {
      background: linear-gradient(180deg, #e5b528 0%, #bb8610 100%);
    }

    .global-wallet-resource {
      height: 42px;
      padding-left: 15px;
      border-left: 1px solid #332e25;
      display: grid;
      align-content: center;
      gap: 4px;
      min-width: 0;
    }

    .global-gold-resource {
      min-width: 112px;
      padding-left: 0;
      border-left: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
    }

    .global-gold-value {
      color: #dcaf3a;
      font-size: 19px;
      line-height: 1;
      font-weight: 900;
    }

    .global-gold-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-width: 0;
      padding-bottom: 0;
    }

    .global-gold-icon {
      display: inline-block;
      width: 18px;
      height: 18px;
      background: url("/images/icons/goldicon-ui.png") center / contain no-repeat;
      filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.42));
      transform: translateY(1px);
      flex: 0 0 auto;
    }


    .global-gold-icon::after {
      content: none;
    }

    .global-gold-change {
      position: fixed;
      z-index: 999999;
      left: 0;
      top: 0;
      opacity: 0;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: 18px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
      pointer-events: none;
      text-shadow: 0 2px 8px rgba(0, 0, 0, 0.82);
      transform: translate3d(0, 0, 0);
    }

    .global-gold-change.gain {
      color: #e5bf55;
    }

    .global-gold-change.loss {
      color: #d85b55;
    }

    .global-gold-change.visible {
      animation: globalGoldChangeDrop 2200ms ease-out forwards;
    }

    @keyframes globalGoldChangeDrop {
      0% {
        opacity: 0;
        transform: translate3d(0, -4px, 0);
      }

      16% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
      }

      72% {
        opacity: 1;
        transform: translate3d(0, 8px, 0);
      }

      100% {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
      }
    }

    .global-gold-float {
      display: none;
    }

    .global-energy-value {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: #d7c29a;
      font-size: 19px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
    }

    .global-energy-icon {
      font-size: 16px;
      line-height: 1;
    }

    .global-energy-resource {
      position: relative;
      padding-bottom: 2px;
    }

    .global-energy-progress {
      width: 100%;
      height: 4px;
      margin-top: 5px;
      overflow: hidden;
      border: 1px solid rgba(111, 85, 43, 0.65);
      border-radius: 999px;
      background: rgba(20, 18, 14, 0.92);
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
    }

    .global-energy-progress-fill {
      width: 0%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(180deg, #f0ad34 0%, #d97f12 100%);
      transition: width 0.8s linear, opacity 0.2s ease;
      opacity: 0;
    }

    .global-energy-gain {
      position: absolute;
      left: calc(100% + 8px);
      bottom: 2px;
      opacity: 0;
      color: #f2ce5a;
      font-size: 15px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
      pointer-events: none;
    }

    .global-energy-gain.visible {
      animation: globalEnergyGainFloat 950ms ease-out forwards;
    }

    @media (max-width: 1080px) {
      .global-character-hud-inner {
        width: calc(100vw - 28px);
        grid-template-columns: minmax(278px, 1fr) 218px minmax(286px, 1fr);
        column-gap: 13px;
      }

      .global-character-identity {
        padding: 0 8px;
      }

      .global-hud-left {
        width: min(308px, 100%);
        gap: 7px;
      }

      .global-hud-left .global-resource-inline {
        grid-template-columns: 88px minmax(112px, 1fr) 78px;
        gap: 8px;
      }

      .global-hud-right {
        gap: 9px;
      }

      .global-character-name {
        font-size: 16px;
      }

      .global-gold-resource {
        min-width: 94px;
        gap: 6px;
      }

      .global-wallet-resource:not(.global-gold-resource) {
        padding-left: 9px;
      }
    }

    @keyframes globalEnergyGainFloat {
      0% {
        opacity: 0;
        transform: translateY(8px) scale(0.92);
      }

      18% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }

      100% {
        opacity: 0;
        transform: translateY(-17px) scale(1);
      }
    }

    body.game-hud-active .global-character-hud {
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
      transform: translateY(-100%) !important;
    }

    body.game-hud-active #global-gold-float {
      display: none !important;
    }

    body.game-hud-active::before {
      inset: -34px -34px -34px -34px !important;
    }

    body.game-hud-active::after {
      inset: 0 !important;
    }

    body.game-hud-active .page-shell {
      width: 100vw !important;
      height: 100vh !important;
      min-height: 100vh !important;
      margin-top: 0 !important;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
    }

    /*
      The Inventory and Combat panels previously used most of the full viewport.
      Reduce them slightly now that the persistent HUD occupies the top edge.
    */
    body.game-hud-active .inventory-shell,
    body.game-hud-active .combat-log-shell {
      min-height: calc(100vh - 100px);
      max-height: calc(100vh - 100px);
    }

    /*
      Combat is already calculated by the server before its replay finishes.
      Hide newly rendered passive-tree UI until staged pre-fight data is applied.
    */
    body.combat-playback-pending form[action="/passive-tree"],
    body.pending-passive-tree-unlock form[action="/passive-tree"] {
      visibility: hidden;
    }

    
    .quest-reward-top-layer {
      position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
      width: 100%; height: 100%; max-width: none; max-height: none;
      overflow: visible; background: transparent; color: inherit;
    }
    .quest-reward-top-layer::backdrop { background: transparent; }
    

    .login-page {
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 32px;
    }

    .login-page.login-screen-background {
      position: relative;
      isolation: isolate;
      background-color: #000;
      background-image: url("/images/banners/login-background-optimised-1.0.webp");
      background-position: center top;
      background-size: cover;
      background-repeat: no-repeat;
    }

    .login-screen-background-video {
      position: fixed;
      inset: 0;
      z-index: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center top;
      pointer-events: none;
    }

    .login-screen-background-video[hidden] {
      display: none;
    }

    .login-screen-background .login-screen-shell {
      position: relative;
      z-index: 1;
    }

    .login-screen-background .scenario-mode-corner-control {
      z-index: 2;
    }

    .auth-build-label {
      position: fixed;
      z-index: 3;
      left: 18px;
      bottom: 15px;
      pointer-events: none;
      user-select: none;
      color: rgba(220, 211, 193, 0.62);
      font-family: "change", "Change", "Cinzel", Georgia, serif;
      font-size: 12px;
      font-weight: 500;
      line-height: 1;
      letter-spacing: 0.11em;
      text-transform: uppercase;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.72);
    }

    @media (max-width: 720px), (max-height: 680px) {
      .auth-build-label {
        left: 12px;
        bottom: 10px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .login-screen-background-video {
        display: none;
      }
    }

    .login-card {
      width: 340px;
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      padding: 22px;
      background: #fafafa;
    }

    .login-card h1 {
      margin: 0 0 8px;
      text-align: center;
      font-size: 30px;
    }

    .login-card p {
      margin: 0 0 20px;
      text-align: center;
      color: #555;
      font-size: 14px;
    }

    .auth-error { color: #e0a29a !important; }
    .auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #777; }
    .auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #3d4447; }
    .guest-login-button { width: 100%; }
    .scenario-mode-login-button { width: 100%; background: #202727; border-color: #55605f; }
    .guest-login-note { margin: 9px 0 0 !important; color: #858d8f !important; font-size: 12px !important; }

    .form-group {
      margin-bottom: 12px;
    }

    input {
      width: 100%;
      height: 42px;
      border: 1px solid #cccccc;
      border-radius: 8px;
      padding: 0 12px;
      font-size: 14px;
      background: #ffffff;
    }

    button {
      width: 100%;
      height: 44px;
      border: 1px solid #cccccc;
      border-radius: 8px;
      background: #ffffff;
      color: #111111;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
    }

    button:hover {
      background: #f0f0f0;
    }

    button:disabled {
      cursor: not-allowed;
      opacity: 0.55;
      background: #eeeeee;
    }

    .secondary {
      margin-top: 12px;
      font-size: 13px;
      text-align: center;
    }

    .secondary a {
      color: #111;
      font-weight: 700;
    }

    /* Login main menu: deliberately reuses the Inventory frame language. */
    .login-screen-background {
      min-height: 100vh;
      height: auto;
      box-sizing: border-box;
      overflow: auto;
      padding: 22px 32px 28px;
      color: #d8cfbd;
    }

    .login-screen-shell {
      width: min(650px, calc(100vw - 48px));
      margin: auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transform: translate(20px, -45px);
      font-family: "Change", "change", "Cinzel", Georgia, serif;
    }

    .login-screen-heading-art {
      position: relative;
      z-index: 3;
      display: block;
      width: min(552px, 85%);
      height: auto;
      margin: 0 auto;
      object-fit: contain;
      transform: translateY(-20px);
      filter: drop-shadow(0 9px 15px rgba(0, 0, 0, 0.82));
      pointer-events: none;
      user-select: none;
    }

    .login-screen-heading-art[data-heading-version="5"] {
      transform: translateY(10px) scale(1.15);
    }

    .login-main-menu-card {
      
        --character-main-frame-left-width: 92px;
        --character-main-frame-right-width: 94px;
        --character-main-frame-top-width: 80px;
        --character-main-frame-bottom-width: 82px;
        --character-main-frame-slice-top: 401;
        --character-main-frame-slice-right: 470;
        --character-main-frame-slice-bottom: 410;
        --character-main-frame-slice-left: 458;
        --character-main-frame-art-scale: 2;
        --character-main-frame-outset: 10px;
      --login-card-heading-overlap: 80px;
      --login-card-content-lift: 30px;
      position: relative;
      isolation: isolate;
      width: min(400px, calc(100vw - 88px));
      box-sizing: border-box;
      margin: calc(-12px - var(--login-card-heading-overlap)) auto 0;
      padding: calc(67.5px + var(--login-card-heading-overlap) - var(--login-card-content-lift)) 48px 63px;
      border: 0;
      border-radius: 0;
      background: transparent;
      color: #d8cfbd;
      font-family: "Change", "change", "Cinzel", Georgia, serif;
    }

    .scenario-mode-corner-control {
      position: fixed;
      z-index: 30;
      top: 20px;
      right: 20px;
      width: 46px;
      height: 46px;
      margin: 0;
    }

    .scenario-mode-corner-control button {
      display: grid;
      place-items: center;
      width: 46px;
      height: 46px;
      box-sizing: border-box;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: url("/images/ui-elements/clean-button-black-idle.png") center / 100% 100% no-repeat;
      color: #c9c0ae;
      font-family: "Change", "change", "Cinzel", Georgia, serif;
      font-size: 14px;
      line-height: 1;
      text-shadow: 0 2px 3px rgba(0, 0, 0, 0.94);
    }

    .scenario-mode-corner-control button:hover,
    .scenario-mode-corner-control button:focus-visible {
      background-image: url("/images/ui-elements/clean-button-black-hover.png");
      color: #e4dbc9;
    }

    .scenario-mode-corner-control button:active {
      background-image: url("/images/ui-elements/clean-button-black-pressed.png");
    }

    .login-main-menu-card::before {
      content: "";
      position: absolute;
      z-index: 0;
      inset: 6px;
      background:
        linear-gradient(rgba(3, 4, 4, 0.30), rgba(3, 4, 4, 0.30)),
        url("/images/ui-elements/ui-elements-optimised/frame-a-background.webp") center center / 520px 520px repeat,
        #030404;
      box-shadow:
        0 0 22px -2px rgba(0, 0, 0, 0.96),
        0 0 54px 2px rgba(0, 0, 0, 0.86);
      pointer-events: none;
    }

    .login-main-menu-card::before {
      -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.95) 100%
      );
      mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.95) 100%
      );
    }

    .login-main-menu-card::after {
      content: "";
      position: absolute;
      z-index: 8;
      inset: -8px;
      
        box-sizing: border-box;
        border-style: solid;
        border-color: transparent;
        border-width:
          var(--character-main-frame-top-width)
          var(--character-main-frame-right-width)
          var(--character-main-frame-bottom-width)
          var(--character-main-frame-left-width);
        border-image-source: url("/images/ui-elements/ui-elements-optimised/Border-4-9slice-1.webp");
        border-image-slice:
          var(--character-main-frame-slice-top)
          var(--character-main-frame-slice-right)
          var(--character-main-frame-slice-bottom)
          var(--character-main-frame-slice-left);
        border-image-width: var(--character-main-frame-art-scale);
        border-image-outset: var(--character-main-frame-outset);
        border-image-repeat: repeat;
        image-rendering: auto;
      filter: none;
      pointer-events: none;
    }

    .login-main-menu-card > * {
      position: relative;
      z-index: 10;
    }

    .auth-visually-hidden {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip: rect(0, 0, 0, 0) !important;
      white-space: nowrap !important;
      border: 0 !important;
    }

    .login-main-menu-card .login-card-intro {
      margin: 0 0 25px;
      padding-bottom: 14px;
      border-bottom: 1px solid rgba(154, 145, 126, 0.195);
      color: #d8cfbd;
      font-size: 16px;
      font-weight: 400;
      letter-spacing: 0.115em;
      line-height: 1;
      text-transform: uppercase;
      text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
    }

    .login-main-menu-card .account-details-form {
      padding-top: 30px;
    }

    .login-main-menu-card .form-group {
      margin-bottom: 19px;
    }

    .login-main-menu-card .auth-field-hint {
      margin: 7px 0 0;
      color: #817866;
      font-size: 12px;
      line-height: 1.35;
      text-align: left;
    }

    .login-main-menu-card label {
      display: block;
      margin: 0 0 8px;
      color: #aa9d84;
      font-size: 12px;
      font-weight: 400;
      letter-spacing: 0.115em;
      line-height: 1;
      text-transform: uppercase;
      text-shadow: 0 1px 0 #000;
    }

    .login-main-menu-card input {
      width: 100%;
      height: 46px;
      box-sizing: border-box;
      border: 1px solid rgba(118, 119, 112, 0.48);
      border-radius: 2px;
      padding: 0 14px;
      background: rgba(3, 4, 4, 0.78);
      box-shadow:
        inset 0 0 16px rgba(0, 0, 0, 0.72),
        0 1px 0 rgba(207, 197, 176, 0.04);
      color: #d8cfbd;
      font-family: "Change", "change", "Cinzel", Georgia, serif;
      font-size: 13px;
      font-weight: 400;
      letter-spacing: 0.04em;
      outline: none;
    }

    .login-main-menu-card input {
      color-scheme: dark;
      caret-color: #d8cfbd;
    }

    .login-main-menu-card input:-webkit-autofill,
    .login-main-menu-card input:-webkit-autofill:hover,
    .login-main-menu-card input:-webkit-autofill:focus,
    .login-main-menu-card input:autofill {
      -webkit-text-fill-color: #d8cfbd;
      caret-color: #d8cfbd;
      -webkit-box-shadow: inset 0 0 0 1000px #080909;
      box-shadow: inset 0 0 0 1000px #080909;
    }

    .login-main-menu-card input::placeholder {
      color: #68665e;
      font-size: 14px;
      opacity: 1;
    }

    .login-main-menu-card input:focus {
      border-color: rgba(173, 156, 119, 0.74);
      box-shadow:
        inset 0 0 16px rgba(0, 0, 0, 0.72),
        0 0 9px rgba(165, 142, 91, 0.13);
    }

    .login-main-menu-card .auth-entry-actions .login-primary-button,
    .login-main-menu-card button,
    .login-main-menu-card .google-auth-button {
      display: grid;
      place-items: center;
      width: 100%;
      height: 54px;
      box-sizing: border-box;
      border: 0;
      border-radius: 0;
      color: #d8cfbd;
      font-family: "Change", "change", "Cinzel", Georgia, serif;
      font-size: 14px;
      font-weight: 400;
      letter-spacing: 0.1em;
      line-height: 1;
      text-decoration: none;
      text-transform: uppercase;
      text-shadow: 0 2px 3px rgba(0, 0, 0, 0.94);
      box-shadow: none;
    }

    .login-main-menu-card .login-primary-button {
      margin-top: 25px;
      background: url("/images/ui-elements/clean-button-black-idle.png") center / 100% 100% no-repeat;
      color: #e1e9d3;
    }

    .login-main-menu-card .login-primary-button:hover,
    .login-main-menu-card .login-primary-button:focus-visible {
      background: url("/images/ui-elements/clean-button-black-hover.png") center / 100% 100% no-repeat;
      color: #f1f7e5;
    }

    .login-main-menu-card .login-primary-button:active {
      background: url("/images/ui-elements/clean-button-black-pressed.png") center / 100% 100% no-repeat;
    }

    .login-main-menu-card .login-entry-promise {
      margin: 0 0 21px;
      color: #bdb29d;
      font-family: Georgia, serif;
      font-size: 13px;
      letter-spacing: 0.04em;
      text-align: center;
    }

    .login-main-menu-card .play-now-button {
      margin-top: 0;
      font-size: 16px;
    }

    .login-main-menu-card .google-auth-button {
      position: relative;
      grid-template-columns: 20px auto;
      justify-content: center;
      gap: 10px;
      width: calc(100% - 30px);
      min-width: 0;
      height: 42px;
      margin: 0 auto;
      padding: 0 16px;
      border: 1px solid rgba(154, 145, 126, 0.34);
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.025);
      color: #aaa7ae;
      font-family: "Google Sans", Roboto, Arial, sans-serif;
      font-size: 14px;
      font-weight: 600;
      letter-spacing: normal;
      text-shadow: none;
      text-transform: none;
    }

    .login-main-menu-card .google-auth-button:hover,
    .login-main-menu-card .google-auth-button:focus-visible {
      border-color: rgba(201, 178, 126, 0.72);
      background: rgba(255, 255, 255, 0.065);
      color: #e1d9ca;
      box-shadow: 0 0 10px rgba(172, 139, 75, 0.12);
    }

    .login-main-menu-card .google-auth-button:active {
      background: rgba(255, 255, 255, 0.035);
      box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
    }

    .login-main-menu-card .google-auth-button.google-auth-failed {
      animation: google-auth-failure-flash 520ms ease-out;
    }

    @keyframes google-auth-failure-flash {
      0%, 100% {
        border-color: rgba(154, 145, 126, 0.34);
        background: rgba(255, 255, 255, 0.025);
        color: #aaa7ae;
        box-shadow: none;
      }
      35%, 72% {
        border-color: rgba(224, 68, 58, 0.94);
        background: rgba(126, 18, 15, 0.4);
        color: #ffc0b9;
        box-shadow: 0 0 15px rgba(205, 42, 34, 0.38);
      }
    }

    .login-main-menu-card .google-auth-mark {
      display: block;
      width: 20px;
      height: 20px;
      object-fit: contain;
    }

    .login-entry-card {
      transform: translateY(-18px);
    }

    .login-main-menu-card .auth-entry-actions .login-primary-button {
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      box-sizing: border-box;
    }

    .login-main-menu-card .auth-registration-note {
      margin: 16px 0 9px;
      color: #c7bdab;
      font-size: 16px;
      line-height: 1.5;
      text-align: center;
    }

    .login-main-menu-card .auth-entry-actions .auth-registration-note {
      margin-bottom: 0;
    }

    .login-main-menu-card .auth-entry-actions .login-primary-button {
      margin-top: 12.5px;
    }

    .login-main-menu-card .auth-entry-actions .login-primary-button + .auth-registration-note {
      margin-top: 32px;
    }

    .login-main-menu-card .auth-entry-actions .play-now-form {
      margin: 0;
    }

    .login-main-menu-card .auth-entry-actions a[href="/login?signin=1"] {
      transform: translateY(15px);
    }

    .login-entry-card .auth-entry-actions > :nth-child(-n + 4) {
      transform: translateY(15px);
    }

    .login-screen-shell:has(.auth-entry-actions) .login-screen-heading-art[data-heading-version="5"] {
      transform: translateY(25px) scale(1.15);
    }

    .login-main-menu-card .auth-entry-actions .auth-guest-divider {
      height: 1px;
      margin: 16px 0 15px;
      background: linear-gradient(90deg, transparent, rgba(157, 163, 166, 0.4), transparent);
    }

    .login-main-menu-card .auth-entry-actions .auth-guest-divider + .auth-registration-note {
      margin-top: 0;
    }

    .login-main-menu-card .play-now-button {
      background-image: url("/images/ui-elements/clean-button-green-idle.png");
    }

    .login-main-menu-card .play-now-button:hover,
    .login-main-menu-card .play-now-button:focus-visible {
      background-image: url("/images/ui-elements/clean-button-green-hover.png");
    }

    .login-main-menu-card .play-now-button:active {
      background-image: url("/images/ui-elements/clean-button-green-pressed.png");
    }

    .login-main-menu-card .returning-player-panel {
      margin-top: 23px;
      padding-top: 18px;
      border-top: 1px solid rgba(154, 145, 126, 0.2);
    }

    .login-main-menu-card .returning-player-panel summary {
      color: #a99e89;
      font-size: 12px;
      letter-spacing: 0.07em;
      text-align: center;
      text-transform: uppercase;
      cursor: pointer;
      list-style-position: inside;
    }

    .login-main-menu-card .returning-player-action {
      display: inline-block;
      margin-left: 4px;
      color: #d9ad52;
      font-weight: 700;
      text-decoration: underline;
      text-decoration-color: rgba(217, 173, 82, 0.72);
      text-decoration-thickness: 1px;
      text-underline-offset: 3px;
      text-shadow: 0 0 7px rgba(217, 173, 82, 0.2);
      transition: color 120ms ease, text-shadow 120ms ease;
    }

    .login-main-menu-card .returning-player-panel summary:hover .returning-player-action,
    .login-main-menu-card .returning-player-panel summary:focus-visible .returning-player-action {
      color: #ffe09a;
      text-shadow: 0 0 9px rgba(230, 184, 87, 0.5);
    }

    .login-main-menu-card .returning-player-panel[open] summary {
      display: none;
    }

    .login-main-menu-card .password-sign-in-title,
    .login-main-menu-card .password-sign-in-divider {
      display: none;
    }

    .login-main-menu-card:has(.returning-player-panel[open]) .login-entry-promise,
    .login-main-menu-card:has(.returning-player-panel[open]) .play-now-form,
    .login-main-menu-card:has(.returning-player-panel[open]) .guest-entry-divider {
      display: none;
    }

    .login-main-menu-card:has(.returning-player-panel[open]) .password-sign-in-title {
      display: block;
    }

    .login-main-menu-card:has(.returning-player-panel[open]) .password-sign-in-divider {
      display: flex;
    }

    .login-main-menu-card .returning-player-panel[open] {
      margin-top: 0;
      padding-top: 0;
      border-top: 0;
    }

    .login-main-menu-card .password-login-button {
      height: 54px;
      margin-top: 25px;
    }

    .login-main-menu-card .password-register-prompt {
      margin-top: 16px;
      color: #8f8573;
      font-family: Georgia, serif;
      font-size: 12px;
      text-align: center;
    }

    .login-main-menu-card .password-register-link {
      display: inline-block;
      margin-left: 3px;
      color: #d9ad52;
      font-weight: 700;
      text-decoration: underline;
      text-decoration-color: rgba(217, 173, 82, 0.72);
      text-underline-offset: 3px;
    }

    .login-main-menu-card .password-register-link:hover,
    .login-main-menu-card .password-register-link:focus-visible {
      color: #ffe09a;
      text-shadow: 0 0 9px rgba(230, 184, 87, 0.5);
    }

    .login-main-menu-card .guest-login-button,
    .login-main-menu-card .scenario-mode-login-button {
      background: url("/images/ui-elements/clean-button-black-idle.png") center / 100% 100% no-repeat;
      color: #c9c0ae;
    }

    .login-main-menu-card .guest-login-button:hover,
    .login-main-menu-card .guest-login-button:focus-visible,
    .login-main-menu-card .scenario-mode-login-button:hover,
    .login-main-menu-card .scenario-mode-login-button:focus-visible {
      background: url("/images/ui-elements/clean-button-black-hover.png") center / 100% 100% no-repeat;
      color: #e4dbc9;
    }

    .login-main-menu-card .guest-login-button:active,
    .login-main-menu-card .scenario-mode-login-button:active {
      background: url("/images/ui-elements/clean-button-black-pressed.png") center / 100% 100% no-repeat;
    }

    .login-main-menu-card .auth-divider {
      margin: 20px 0;
      color: #8d826f;
      font-size: 12px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }

    .login-main-menu-card .auth-divider::before,
    .login-main-menu-card .auth-divider::after {
      background: linear-gradient(90deg, transparent, rgba(154, 145, 126, 0.34));
    }

    .login-main-menu-card .auth-divider::after {
      transform: scaleX(-1);
    }

    .login-main-menu-card .guest-login-note {
      margin: 7px 0 0 !important;
      color: #746f63 !important;
      font-family: Georgia, serif;
      font-size: 12px !important;
      line-height: 1.35;
    }

    .login-main-menu-card .scenario-mode-login-button {
      height: 44px;
      opacity: 0.78;
      font-size: 12px;
    }

    .login-main-menu-card .register-return-prompt {
      margin-top: 16px;
      color: #8f8573;
      font-family: Georgia, serif;
      font-size: 12px;
      text-align: center;
    }

    .login-main-menu-card .register-return-link {
      display: inline-block;
      margin-left: 3px;
      color: #d9ad52;
      font-weight: 700;
      text-decoration: underline;
      text-decoration-color: rgba(217, 173, 82, 0.72);
      text-underline-offset: 3px;
    }

    .login-main-menu-card .register-return-link:hover,
    .login-main-menu-card .register-return-link:focus-visible {
      color: #ffe09a;
      text-shadow: 0 0 9px rgba(230, 184, 87, 0.5);
    }

    .login-main-menu-card.secure-guest-account-card {
      width: min(450px, calc(100vw - 88px));
      padding-right: 46px;
      padding-left: 46px;
    }

    .secure-guest-account-context {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr);
      align-items: center;
      gap: 13px;
      margin: -7px 0 15px;
      padding: 13px 14px;
      border: 1px solid rgba(159, 132, 75, 0.3);
      border-left: 2px solid rgba(211, 167, 77, 0.7);
      background:
        linear-gradient(90deg, rgba(91, 65, 22, 0.22), rgba(8, 9, 8, 0.46)),
        url("/images/ui-elements/ui-elements-optimised/frame-a-background.webp") center / 390px 390px repeat;
      box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.44);
      text-align: left;
    }

    .secure-guest-account-emblem {
      display: grid;
      place-items: center;
      width: 44px;
      height: 44px;
      border: 1px solid rgba(191, 153, 73, 0.42);
      border-radius: 50%;
      background: radial-gradient(circle, rgba(105, 76, 27, 0.42), rgba(5, 6, 6, 0.82) 72%);
      box-shadow: 0 0 12px rgba(188, 143, 50, 0.12);
    }

    .secure-guest-account-emblem svg {
      width: 24px;
      height: 24px;
      fill: #d4b56b;
      filter: drop-shadow(0 1px 1px #000);
    }

    .secure-guest-account-context strong {
      display: block;
      margin-bottom: 5px;
      color: #dccb9f;
      font-size: 12px;
      letter-spacing: 0.09em;
      text-transform: uppercase;
    }

    .secure-guest-account-context p {
      margin: 0;
      color: #a99f8d;
      font-family: Georgia, serif;
      font-size: 12px;
      line-height: 1.42;
      text-align: left;
    }

    .login-main-menu-card .secure-guest-account-warning {
      margin: 0 0 16px;
      color: #bba98c;
      font-family: Georgia, serif;
      font-size: 12px;
      line-height: 1.45;
      text-align: left;
    }

    .secure-guest-account-warning strong {
      color: #d2a86d;
      font-weight: 700;
    }

    .login-main-menu-card .secure-guest-account-back-button {
      display: grid;
      place-items: center;
      width: calc(100% - 42px);
      height: 44px;
      margin: 12px auto 0;
      box-sizing: border-box;
      background: url("/images/ui-elements/clean-button-black-idle.png") center / 100% 100% no-repeat;
      color: #bdb4a2;
      font-family: "Change", "change", "Cinzel", Georgia, serif;
      font-size: 12px;
      letter-spacing: 0.1em;
      text-decoration: none;
      text-transform: uppercase;
      text-shadow: 0 2px 3px rgba(0, 0, 0, 0.94);
    }

    .login-main-menu-card .secure-guest-account-back-button:hover,
    .login-main-menu-card .secure-guest-account-back-button:focus-visible {
      background-image: url("/images/ui-elements/clean-button-black-hover.png");
      color: #e3dac8;
      outline: none;
    }

    .login-main-menu-card .secure-guest-account-back-button:active {
      background-image: url("/images/ui-elements/clean-button-black-pressed.png");
    }

    .login-main-menu-card .secure-guest-account-back-note {
      margin: 7px auto 0;
      color: #7f7769;
      font-family: Georgia, serif;
      font-size: 11px;
      line-height: 1.35;
      text-align: center;
    }

    .login-main-menu-card .auth-error {
      margin: 0 0 18px;
      color: #d59a90 !important;
      font-family: Georgia, serif;
      font-size: 12px;
      line-height: 1.35;
    }

    @media (max-height: 820px) {
      .login-screen-background {
        align-items: flex-start;
        padding-top: 8px;
        padding-bottom: 12px;
      }
      .login-screen-heading-art {
        width: min(425px, 75%);
      }
      .login-main-menu-card {
        padding: calc(51px + var(--login-card-heading-overlap) - var(--login-card-content-lift)) 42px 57px;
      }
      .login-main-menu-card .login-card-intro {
        margin-bottom: 16px;
        padding-bottom: 10px;
      }
      .login-main-menu-card .form-group { margin-bottom: 10px; }
      .login-main-menu-card input { height: 40px; }
      .login-main-menu-card .login-primary-button {
        height: 46px;
        margin-top: 14px;
      }
      .login-main-menu-card .password-login-button {
        height: 46px;
        margin-top: 14px;
      }
      .login-main-menu-card .guest-login-button,
      .login-main-menu-card .google-auth-button {
        height: 46px;
      }
      .login-main-menu-card .google-auth-button { height: 42px; }
      .login-main-menu-card .guest-login-note { display: none; }
      .login-main-menu-card .auth-divider { margin: 14px 0; }
      .login-main-menu-card .scenario-mode-login-button { height: 38px; }
      .login-main-menu-card .password-register-prompt,
      .login-main-menu-card .register-return-prompt { margin-top: 12px; }
      .login-main-menu-card.secure-guest-account-card {
        padding-top: calc(47px + var(--login-card-heading-overlap) - var(--login-card-content-lift));
        padding-bottom: 48px;
      }
      .secure-guest-account-context {
        margin-bottom: 10px;
        padding-top: 9px;
        padding-bottom: 9px;
      }
      .login-main-menu-card .secure-guest-account-warning { margin-bottom: 10px; }
      .login-main-menu-card .secure-guest-account-back-button {
        height: 40px;
        margin-top: 9px;
      }
    }

    .page-shell {
      height: 100vh;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 48px 24px;
    }

    .game-layout {
      display: flex;
      align-items: stretch;
      justify-content: center;
      gap: 42px;
    }

    body:not(.game-hud-active) .side-menu {
      width: 190px;
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      padding: 14px;
      background: #fafafa;
    }

    body:not(.game-hud-active) .menu-form {
      margin-bottom: 10px;
    }

    body:not(.game-hud-active) .menu-button {
      width: 100%;
      height: 44px;
    }

    body:not(.game-hud-active) .menu-button.active {
      background: #e8e8e8;
    }

    body:not(.game-hud-active) .menu-button.unlock-highlight {
      border-color: #9a7130;
      background: linear-gradient(180deg, rgba(197, 147, 52, 0.22), rgba(197, 147, 52, 0.08));
      box-shadow: inset 0 0 0 1px rgba(217, 172, 80, 0.38), 0 0 14px rgba(156, 107, 29, 0.18);
      color: #6b4c14;
    }

    body:not(.game-hud-active) .menu-button {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    body:not(.game-hud-active) .menu-badge {
      position: absolute;
      top: -7px;
      right: -7px;
      min-width: 24px;
      height: 24px;
      padding: 0 6px;
      border-radius: 999px;
      background: #d02020;
      color: #ffffff;
      border: 2px solid #ffffff;
      font-size: 12px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    }

    body:not(.game-hud-active) .menu-badge.hidden {
      display: none;
    }

    .character-card {
      width: 310px;
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      padding: 14px 16px 18px;
      background: #fafafa;
    }

    .character-name {
      margin: 0 0 12px;
      text-align: center;
      font-size: 24px;
      line-height: 1.1;
    }

    .avatar-frame {
      width: 100%;
      aspect-ratio: 4 / 5;
      border: 1px solid #d0d0d0;
      border-radius: 10px;
      overflow: hidden;
      background: #eeeeee;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #777;
      font-weight: 700;
      font-size: 18px;
    }

    .level-block {
      margin-top: 12px;
      text-align: center;
    }

    .level-title {
      margin-bottom: 7px;
      font-size: 16px;
      font-weight: 700;
    }

    .bar {
      width: 100%;
      height: 10px;
      border-radius: 999px;
      overflow: hidden;
      background: #e4e0d8;
      border: 1px solid #cfc8bd;
    }

    .bar-fill {
      height: 100%;
      border-radius: 999px;
    }

    .exp-fill {
      background: #d6a31d;
    }

    .hp-fill {
      background: #e02020;
    }

    .mana-fill {
      background: #1d65e8;
    }

    .bar-text {
      margin-top: 6px;
      font-size: 13px;
      color: #555555;
    }

    .resource-block {
      margin-top: 12px;
    }

    .resource-top {
      display: flex;
      justify-content: space-between;
      margin-bottom: 5px;
      font-size: 14px;
      font-weight: 600;
    }

    .stats-box {
      margin-top: 16px;
      border: 1px solid #d0d0d0;
      border-radius: 10px;
      overflow: hidden;
      background: #ffffff;
    }

    .stats-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      border-bottom: 1px solid #d0d0d0;
    }

    .stats-tab {
      height: 36px;
      border: none;
      border-right: 1px solid #d0d0d0;
      border-radius: 0;
      background: #eeeeee;
      font-size: 13px;
      font-weight: 700;
    }

    .stats-tab:last-child {
      border-right: none;
    }

    .stats-tab.active {
      background: #ffffff;
    }

    .stats-panel.hidden {
      display: none;
    }

    .stat-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 12px;
      border-bottom: 1px solid #e0e0e0;
      font-size: 14px;
    }

    .stat-row:last-child {
      border-bottom: none;
    }

    .inventory-shell {
      width: 464px;
      display: flex;
      flex-direction: column;
    }

    .inventory-tabs,
    .area-tabs {
      height: 40px;
      display: flex;
      align-items: flex-end;
      gap: 0;
      padding-left: 14px;
    }

    .inventory-tab,
    .area-tab {
      width: 130px;
      height: 34px;
      border: 1px solid #d0d0d0;
      border-bottom: none;
      border-radius: 10px 10px 0 0;
      background: #eeeeee;
      color: #777777;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      position: relative;
      top: 1px;
      z-index: 1;
      text-decoration: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .inventory-tab.active,
    .area-tab.active {
      height: 40px;
      background: #fafafa;
      color: #111111;
      top: 1px;
      z-index: 3;
    }

    .inventory-panel {
      flex: 1;
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      padding: 14px;
      background: #fafafa;
      display: flex;
      flex-direction: column;
    }

    .inventory-grid {
      display: grid;
      grid-template-columns: repeat(5, 86px);
      grid-auto-rows: 86px;
      gap: 0;
      align-content: start;
      justify-content: center;
      overflow: hidden;
    }

    .inventory-slot {
      width: 86px;
      height: 86px;
      border: 1px solid #d0d0d0;
      background: #ffffff;
    }

    .inventory-grid.hidden {
      display: none;
    }

    .content-shell {
      width: 760px;
      display: flex;
      flex-direction: column;
    }

    .content-panel {
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      padding: 18px;
      background: #fafafa;
    }

    .area-banner {
      width: 100%;
      aspect-ratio: 5 / 2;
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      background: #eeeeee;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .area-banner-name {
      min-width: 180px;
      padding: 10px 18px;
      border: 1px solid #d0d0d0;
      border-radius: 10px;
      background: #ffffff;
      text-align: center;
      font-size: 24px;
      font-weight: 700;
    }

    .monster-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
    }

    .monster-card {
      border: 1px solid #d0d0d0;
      border-radius: 12px;
      background: #ffffff;
      padding: 12px;
      text-align: center;
    }

    .monster-name {
      margin: 0 0 10px;
      font-size: 18px;
    }

    .monster-avatar {
      width: 100%;
      aspect-ratio: 4 / 5;
      border: 1px solid #d0d0d0;
      border-radius: 10px;
      background: #eeeeee;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #777777;
      font-weight: 700;
      margin-bottom: 10px;
    }

    .monster-level {
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 700;
    }

    .monster-description {
      min-height: 60px;
      margin: 0 0 12px;
      font-size: 13px;
      line-height: 1.35;
      color: #555555;
    }

    .attack-button {
      height: 38px;
    }
  

    /* ---------- 6.51 Expedition sidebar first-paint stability without hiding ---------- */
    /*
      Do not hide the sidebar or Expedition shell during navigation. Instead, lock
      the sidebar to stable font metrics on Expedition pages so the custom font
      cannot visibly resize the menu/borders after first paint.
    */
    body.expedition-first-paint-guard .side-menu.sidebar-v6,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 * {
      font-family: "change", "Change", "Cinzel", Georgia, serif !important;
      font-synthesis: none !important;
      text-size-adjust: 100% !important;
      -webkit-text-size-adjust: 100% !important;
    }

    body.expedition-first-paint-guard .side-menu.sidebar-v6,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 .sidebar-section-frame,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 .sidebar-section-frame::before,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 .sidebar-section-frame::after,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 .menu-button,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 .sidebar-avatar-frame,
    body.expedition-first-paint-guard .side-menu.sidebar-v6 .sidebar-avatar-frame::before {
      transition: none !important;
      animation-duration: 0s !important;
    }

    /*
      Sidebar geometry and raster artwork are stable on every game view, not
      only Expedition. Prevent first-paint animation/compositor promotion from
      softening its frame art while the new document settles.
    */
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-section-frame,
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-section-frame::before,
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-section-frame::after,
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-avatar-frame,
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-avatar-frame::before,
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-scrollbar,
    body.game-hud-active .side-menu.sidebar-v6 .sidebar-scrollbar-thumb {
      transition: none !important;
      animation-duration: 0s !important;
    }


