/* ===========================================================================
   MODULE KIT

   Shared tokens and components for every module. Loaded before the per-module
   stylesheets, so a module can still override anything locally - but it should
   not need to for the common things.

   Before this file each module invented its own palette and corner radius:
   eight different border-radius values across 64 stylesheets, plus hand-picked
   golds and greys per module. Use the tokens instead of literals.

   USAGE
     Heading      <div class="page-title"><span>Module name</span></div>
     Surface      <div class="bw-panel">…</div>
     Button       <button class="bw-btn">…</button>
                  <button class="bw-btn bw-btn--primary">…</button>
     Switch       <div class="bw-switch"><span class="bw-switch-label">FREE</span></div>
                  add .bw-switch--on to light it up
     Opt out of   add class="bw-skin-off" to a module root to stop the
     the blanket  site-wide colour pass from repainting its buttons and cards
     colour pass

   Modules that ship their own finished design carry .bw-skin-off; see
   module-skin.css for what that turns off.
   =========================================================================== */

:root {
    /* Surfaces */
    --bw-surface:       linear-gradient(180deg, rgba(9, 18, 27, .94), rgba(3, 8, 13, .92));
    --bw-surface-flat:  rgba(8, 18, 28, .48);
    --bw-surface-sunk:  rgba(5, 12, 20, .78);
    --bw-surface-head:  rgba(10, 25, 38, .62);

    /* Lines. The site keeps these deliberately quiet. */
    --bw-line:          rgba(86, 136, 174, .22);
    --bw-line-strong:   rgba(67, 142, 200, .44);
    --bw-line-faint:    rgba(86, 136, 174, .14);

    /* Type. Legacy brown/gold module palette. */
    --bw-gold:          #438ec8;
    --bw-gold-dim:      #3b6484;
    --bw-gold-bright:   #e2edf6;
    --bw-text:          #dce8f1;
    --bw-muted:         #184364;
    --bw-serif:         Georgia, 'Times New Roman', serif;

    /* Primary/active states. */
    --bw-accent:        linear-gradient(180deg, rgba(22, 55, 92, .96), rgba(8, 19, 36, .96));
    --bw-accent-hover:  linear-gradient(180deg, rgba(31, 80, 126, .98), rgba(12, 29, 52, .98));

    /* Geometry */
    --bw-radius:        2px;
    --bw-gutter:        30px;
}

/* --- Surface -------------------------------------------------------------- */





/* --- Buttons -------------------------------------------------------------- */

.bw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bw-surface-flat);
    border: 1px solid var(--bw-line);
    border-radius: var(--bw-radius);
    color: var(--bw-gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.bw-btn:hover {
    background: var(--bw-accent);
    border-color: var(--bw-line-strong);
    color: var(--bw-gold-bright);
}

.bw-btn--primary {
    background: var(--bw-accent);
    border-color: var(--bw-line-strong);
    color: var(--bw-gold-bright);
}

.bw-btn--primary:hover { background: var(--bw-accent-hover); }

.bw-btn:disabled,
.bw-btn[disabled] {
    background: var(--bw-surface-flat);
    border-color: var(--bw-line);
    color: var(--bw-muted);
    cursor: default;
}

/* --- Switch --------------------------------------------------------------- */
/* A chip with a status lamp rather than a sliding knob: it survives being
   squared off with everything else, which a pill track does not. */















/* --- Grid cell ------------------------------------------------------------ */
/* The inventory-style slot, shared by the warehouse and the web inventory. */





.swal2-container {
  backdrop-filter: none !important;
  transition: background-color .12s ease !important;
}

.swal2-container .swal2-popup.swal2-show {
  animation: bwSwalIn .14s ease-out !important;
}

.swal2-container .swal2-popup.swal2-hide {
  animation: bwSwalOut .1s ease-in forwards !important;
}

.swal2-container .swal2-icon.swal2-icon-show,
.swal2-container .swal2-icon.swal2-icon-show .swal2-icon-content {
  animation: none !important;
}

@keyframes bwSwalIn {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@keyframes bwSwalOut {
  to { opacity: 0; transform: scale(.98); }
}

.swal2-container.swal2-backdrop-show {
  background: rgba(2, 6, 12, .72) !important;
}

.swal2-container .swal2-popup {
  width: min(410px, calc(100vw - 32px)) !important;
  padding: 28px 30px 24px !important;
  border: 1px solid rgba(116, 179, 227, .42) !important;
  border-radius: 6px !important;
  background:
    linear-gradient(180deg, rgba(15, 22, 28, .98), rgba(5, 8, 12, .99)),
    radial-gradient(circle at 50% 0%, rgba(94, 164, 218, .18), transparent 52%) !important;
  color: #d0dee8 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .82), inset 0 1px 0 rgba(226, 237, 246, .08) !important;
}

.swal2-container .swal2-icon {
  width: 58px !important;
  height: 58px !important;
  margin: 0 auto 16px !important;
  border-width: 2px !important;
}

.swal2-container .swal2-icon .swal2-icon-content {
  font-size: 40px !important;
  line-height: 58px !important;
}

.swal2-container .swal2-icon.swal2-warning,
.swal2-container .swal2-icon.swal2-question {
  border-color: rgba(237, 197, 106, .74) !important;
  color: #ffcc78 !important;
}

.swal2-container .swal2-icon.swal2-info {
  border-color: rgba(96, 176, 232, .7) !important;
  color: #8ccaf2 !important;
}

.swal2-container .swal2-icon.swal2-error {
  border-color: rgba(239, 68, 68, .7) !important;
}

.swal2-container .swal2-icon.swal2-error [class^=swal2-x-mark-line] {
  background-color: #f87171 !important;
}

.swal2-container .swal2-icon.swal2-success {
  border-color: rgba(46, 204, 113, .7) !important;
}

.swal2-container .swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: #62e59a !important;
}

.swal2-container .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(46, 204, 113, .35) !important;
}

.swal2-container .swal2-icon.swal2-success [class^=swal2-success-circular-line],
.swal2-container .swal2-icon.swal2-success .swal2-success-fix {
  background: transparent !important;
}

.swal2-container .swal2-title {
  margin: 2px 0 12px !important;
  padding: 0 !important;
  color: #e2edf6 !important;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: .10em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8) !important;
}

.swal2-container .swal2-html-container,
.swal2-container .swal2-content {
  margin: 0 auto !important;
  padding: 0 !important;
  color: #cfd9dc !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.swal2-container .swal2-html-container b,
.swal2-container .swal2-html-container strong {
  color: #e2edf6 !important;
}

.swal2-container .swal2-input,
.swal2-container .swal2-select,
.swal2-container .swal2-textarea {
  color: #d0dee8 !important;
  background: rgba(5, 12, 20, .9) !important;
  border: 1px solid rgba(86, 136, 174, .3) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

.swal2-container .swal2-validation-message {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, .1) !important;
}

.swal2-container .swal2-actions {
  gap: 10px !important;
  margin-top: 22px !important;
}

.swal2-container .swal2-styled {
  min-width: 92px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .44), inset 0 1px 0 rgba(226, 237, 246, .13) !important;
}

.swal2-container .swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(67, 142, 200, .25) !important;
}

.swal2-container .swal2-confirm {
  border: 1px solid rgba(116, 179, 227, .58) !important;
  background: var(--bw-accent) !important;
  color: #e2edf6 !important;
}

.swal2-container .swal2-cancel,
.swal2-container .swal2-deny {
  border: 1px solid rgba(86, 136, 174, .30) !important;
  background: linear-gradient(180deg, rgba(8, 18, 28, .96), rgba(4, 8, 13, .98)) !important;
  color: #b4cfe4 !important;
}

.swal2-container .swal2-styled:hover {
  transform: none !important;
  filter: brightness(1.10) !important;
}

.swal2-container .swal2-loader {
  border-color: #438ec8 transparent #438ec8 transparent !important;
}

.swal2-container .swal2-close {
  color: #8a96a3 !important;
}

.swal2-container .swal2-close:hover {
  color: #e2edf6 !important;
}
[data-bw-tip] { position: relative; }
[data-bw-tip]::after {
  content: attr(data-bw-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 60;
  padding: 4px 9px;
  color: #96c6ea;
  font: 700 11px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif;
  letter-spacing: .03em;
  white-space: nowrap;
  text-transform: none;
  background: linear-gradient(180deg, #13202e, #070d14);
  border: 1px solid rgba(67, 142, 200, .55);
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity .12s ease, transform .12s ease;
}
[data-bw-tip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 61;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-bottom: 0;
  border-top-color: rgba(67, 142, 200, .75);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .12s ease;
}
[data-bw-tip]:hover::after,
[data-bw-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
[data-bw-tip]:hover::before,
[data-bw-tip]:focus-visible::before { opacity: 1; }



/* Shared Game Master identity across character services. */
.content-wrapper .bw-gm-card {
    --bw-gold-dim: #9aaebe;
    --bw-muted: #8299ac;
    background: linear-gradient(180deg, rgba(14,22,32,.96), rgba(5,9,15,.96)) padding-box,
                linear-gradient(160deg, rgba(110,190,245,.3), rgba(116, 179, 227,.16)) border-box !important;
    border-color: rgba(110,160,194,.35) !important;
    box-shadow: inset 2px 0 0 #637f94, 0 2px 10px #0004 !important;
}
.content-wrapper .bw-gm-card:hover { border-color: #8faabd !important; }
.content-wrapper .bw-gm-card .bw-gm-avatar { background: rgba(0,0,0,.3); }
.content-wrapper .bw-gm-card .bw-gm-portrait { position: relative; border-color: #637f94; overflow: visible; }
.content-wrapper .bw-gm-portrait > img { border-radius: var(--bw-radius); }
.content-wrapper .bw-gm-ribbon {
    position: absolute; top: auto; bottom: -3px; right: -3px;
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: auto; padding: 2px 4px;
    border: 1px solid #7c96a9; border-radius: 2px;
    background: #19354e; color: #eef2f5; font: 900 8px/1 Arial, sans-serif;
    box-shadow: 0 1px 4px #0009;
}
.content-wrapper .bw-gm-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 3px; }
.content-wrapper .bw-gm-label {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px;
    background: linear-gradient(180deg, #19354e, #0a1623) !important;
    color: #d5e4ef !important; border: 1px solid #637586 !important;
    border-radius: 3px !important; font: 800 9px/1 Arial, sans-serif !important;
    letter-spacing: .7px; white-space: nowrap;
}

.content-wrapper .bw-gm-card [class$="-lbl"] { color: #9aaebe !important; }
.content-wrapper :is(.hs-action, .hi-action, .brs-action, .gr-action) .bw-character-action {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px;
    min-height: 34px !important;
    height: auto !important;
    max-width: 100% !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    background: linear-gradient(180deg, #19354e, #0a1623) !important;
    color: #eef2f5 !important;
    border: 1px solid #637586 !important;
    border-radius: 3px !important;
    font: 700 10px/1.3 Georgia, 'Times New Roman', serif !important;
    letter-spacing: .4px !important;
    white-space: normal !important;
    text-align: center !important;
    cursor: pointer !important;
}
.content-wrapper :is(.hs-action, .hi-action, .brs-action, .gr-action) .bw-character-action:hover:not(:disabled) {
    background: linear-gradient(180deg, #274e6c, #11283b) !important;
    border-color: #9bb0bf !important;
}
.content-wrapper :is(.hs-action, .hi-action, .brs-action, .gr-action) .bw-character-action:disabled {
    background: linear-gradient(180deg, #24313d, #131d27) !important;
    color: #b3c0cc !important;
    border-color: #485b6a !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}
.content-wrapper .hi-action .hi-btn-disabled {
    background: #162330 !important;
    color: #b3c0cc !important;
    border: 1px solid #485b6a !important;
}

.bw-action-hint { display: inline-flex; max-width: 100%; cursor: help; }
.bw-action-hint > button:disabled { pointer-events: none; }
.bw-action-hint:focus-visible { outline: 2px solid #9cbfd8; outline-offset: 3px; border-radius: 3px; }
.bw-service-tip {
    position: fixed; z-index: 2147483000; box-sizing: border-box;
    width: max-content; max-width: min(250px, calc(100vw - 16px));
    padding: 10px 12px; border: 1px solid #637f94; border-radius: 4px;
    background: linear-gradient(180deg, #142a3d, #09131e);
    color: #dce8f1; font: 12px/1.5 Arial, sans-serif; text-align: center;
    box-shadow: inset 0 1px 0 #ffffff10, 0 8px 22px #0009;
    pointer-events: none;
}
.bw-service-tip[hidden] { display: none; }
.bw-service-tip::after {
    content: ''; position: absolute; top: -6px; left: var(--tip-arrow-x, 50%);
    transform: translateX(-50%); border-left: 6px solid transparent;
    border-right: 6px solid transparent; border-bottom: 6px solid #637f94;
}
.bw-service-tip.tooltip-above::after { top: auto; bottom: -6px; border-bottom: 0; border-top: 6px solid #637f94; }
.bw-service-tip.tooltip-noarrow::after { display: none; }

/* Character portraits and names share a wider, readable identity column. */
.content-wrapper div.bw-character-card {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: 84px minmax(0, 1fr) auto !important;
}
.content-wrapper .bw-character-avatar {
    min-width: 0; padding: 10px 6px !important; gap: 7px !important;
}
.content-wrapper .bw-character-card .bw-character-portrait {
    width: 56px !important; height: 56px !important; flex-shrink: 0;
}
.content-wrapper .bw-character-name {
    width: 100%; max-width: 100% !important; min-width: 0;
    color: #e7edf3 !important; font-size: 12px !important;
    font-weight: 800; line-height: 1.4 !important; text-align: center;
    white-space: normal !important; word-break: normal !important;
    overflow-wrap: anywhere; overflow: visible !important;
}
.content-wrapper .bw-character-card :is(.btw-row, .hs-row, .hi-row, .brs-row, .gr-detail) > :is(.btw-val, .hs-val, .hi-val, .brs-val) {
    font-size: 13px;
}
@media (max-width: 640px) {
    .content-wrapper div.bw-character-card { grid-template-columns: 72px minmax(0, 1fr) !important; }
    .content-wrapper .bw-character-card .bw-character-portrait { width: 52px !important; height: 52px !important; }
    .content-wrapper .bw-character-card > :is(.btw-action, .hs-action, .hi-action, .brs-action, .gr-action) {
        grid-column: 1 / -1; min-width: 0 !important; max-width: none !important;
        border-left: 0 !important; border-top: 1px solid rgba(100,178,232,.16);
    }
}





/* Saved-account menu follows the same blue steel controls as the User CP. */

.widget.login-block.bw-ucp-panel form.lk-form { position:relative !important; z-index:1 !important; }

.widget.login-block.bw-ucp-panel:has(.bw-account-switch.is-open) { overflow:visible !important; z-index:50; }
.bw-ucp-panel .bw-account-trigger {
    display:flex !important; align-items:center; gap:9px; width:100%; min-height:38px; margin:0 !important; padding:9px 12px !important;
    box-sizing:border-box; border:1px solid #496274 !important; border-radius:2px !important;
    background:linear-gradient(180deg,#15334a,#0a1722) !important; color:#e8edf2 !important;
    font-family:inherit; font-size:12px; text-align:left; cursor:pointer;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.bw-ucp-panel .bw-account-trigger span { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-ucp-panel .bw-account-trigger i { color:#6698be; font-size:13px; }
.bw-ucp-panel .bw-account-trigger i:last-child { font-size:10px; transition:transform .15s; }
.bw-ucp-panel .bw-account-trigger[aria-expanded="true"] i:last-child { transform:rotate(180deg); }
.bw-ucp-panel .bw-account-trigger:hover, .bw-ucp-panel .bw-account-trigger:focus-visible { border-color:#6698be !important; outline:1px solid #6698be !important; outline-offset:2px; }
.bw-ucp-panel .bw-account-options {
    position:absolute; top:calc(100% - 12px); left:0; right:0; z-index:100;
    max-height:220px; overflow-y:auto; padding:5px; box-sizing:border-box;
    background:linear-gradient(180deg,#101f2c,#080f17); border:1px solid #496274; border-top:2px solid #5c8cb1;
    border-radius:2px; box-shadow:0 12px 24px rgba(0,0,0,.65);
}
.bw-ucp-panel .bw-account-options[hidden] { display:none !important; }
.bw-ucp-panel .opens-up .bw-account-options { top:auto; bottom:calc(100% - 14px); }
.bw-ucp-panel .bw-account-option {
    display:flex !important; align-items:center; gap:10px; width:100%; min-height:36px; margin:0 !important; padding:8px 10px !important;
    background:transparent !important; color:#dce6ed !important; border:1px solid transparent !important; border-radius:1px !important;
    font-family:inherit; font-size:12px; text-align:left; cursor:pointer;
}
.bw-ucp-panel .bw-account-option span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-ucp-panel .bw-account-option i { color:#5c8cb1; }
.bw-ucp-panel .bw-account-option:hover, .bw-ucp-panel .bw-account-option:focus-visible {
    outline:none !important; color:#95c6ec !important; border-color:#3f5a6d !important;
    background:linear-gradient(180deg,#17374f,#112637) !important;
}
