/* ========================================================================
   Player theme contract — 0.7.539
   ------------------------------------------------------------------------
   Theme packages set semantic custom properties on their scoped BPW wrapper.
   These shared rules map the properties to stable core/module components so a
   new theme can be deployed without copying gameplay templates.
   ======================================================================== */
.bpw-wrap{
    --bpw-theme-canvas:#fff;
    --bpw-theme-surface:#fafafa;
    --bpw-theme-surface-alt:#f0f0f1;
    --bpw-theme-surface-raised:#fff;
    --bpw-theme-text:#1d2327;
    --bpw-theme-muted:#646970;
    --bpw-theme-heading:#1d2327;
    --bpw-theme-border:#dcdcde;
    --bpw-theme-border-strong:#8c8f94;
    --bpw-theme-accent:#2271b1;
    --bpw-theme-accent-hover:#135e96;
    --bpw-theme-accent-contrast:#fff;
    --bpw-theme-success:#15803d;
    --bpw-theme-success-bg:#eef7ee;
    --bpw-theme-warning:#9a6700;
    --bpw-theme-warning-bg:#fff8e5;
    --bpw-theme-danger:#b91c1c;
    --bpw-theme-danger-bg:#fff1f0;
    --bpw-theme-shadow:0 2px 6px rgba(0,0,0,.08);
    --bpw-theme-radius:4px;
    color:var(--bpw-theme-text);
    background-color:var(--bpw-theme-canvas);
    border-color:var(--bpw-theme-border);
    box-shadow:var(--bpw-theme-shadow);
}
.bpw-wrap h1,.bpw-wrap h2,.bpw-wrap h3,.bpw-wrap h4,.bpw-wrap h5,.bpw-wrap h6,
.bpw-wrap summary,.bpw-wrap legend,.bpw-wrap strong{color:var(--bpw-theme-heading);}
.bpw-wrap a{color:var(--bpw-theme-accent);}
.bpw-wrap a:hover,.bpw-wrap a:focus{color:var(--bpw-theme-accent-hover);}
.bpw-wrap .description,.bpw-wrap small,.bpw-wrap .bpw-theme-choice-description,
.bpw-wrap [class*="-meta"],.bpw-wrap [class*="-note"]{color:var(--bpw-theme-muted);}
.bpw-wrap .bpw-card,
.bpw-wrap .bpw-player-subsection,
.bpw-wrap .bpw-player-subsection-body,
.bpw-wrap .bpw-notifications-panel,
.bpw-wrap .bpw-notification-item,
.bpw-wrap .bpw-modal-content,
.bpw-wrap .bpw-modal-card,
.bpw-wrap fieldset,
.bpw-wrap details.bpw-card{
    color:var(--bpw-theme-text);
    background-color:var(--bpw-theme-surface);
    border-color:var(--bpw-theme-border);
    border-radius:var(--bpw-theme-radius);
}
.bpw-wrap .bpw-card .bpw-card,
.bpw-wrap .bpw-player-subsection-body,
.bpw-wrap .bpw-notification-item,
.bpw-wrap [class*="-summary-card"],
.bpw-wrap [class*="-status-item"]{
    background-color:var(--bpw-theme-surface-alt);
    border-color:var(--bpw-theme-border);
}
.bpw-wrap table{color:var(--bpw-theme-text);background:var(--bpw-theme-surface);border-color:var(--bpw-theme-border);}
.bpw-wrap th{color:var(--bpw-theme-heading);background:var(--bpw-theme-surface-alt);border-color:var(--bpw-theme-border);}
.bpw-wrap td{color:var(--bpw-theme-text);border-color:var(--bpw-theme-border);}
.bpw-wrap tr:nth-child(even) td{background-color:color-mix(in srgb,var(--bpw-theme-surface-alt) 55%,transparent);}
.bpw-wrap input:not([type="checkbox"]):not([type="radio"]),
.bpw-wrap select,.bpw-wrap textarea{
    color:var(--bpw-theme-text);
    background-color:var(--bpw-theme-surface-raised);
    border-color:var(--bpw-theme-border-strong);
    border-radius:var(--bpw-theme-radius);
}
.bpw-wrap input::placeholder,.bpw-wrap textarea::placeholder{color:var(--bpw-theme-muted);opacity:.82;}
.bpw-wrap input:focus,.bpw-wrap select:focus,.bpw-wrap textarea:focus{
    border-color:var(--bpw-theme-accent);
    box-shadow:0 0 0 1px var(--bpw-theme-accent);
    outline:0;
}
.bpw-wrap .button,
.bpw-wrap button:not(.bpw-notifications-real-button),
.bpw-wrap input[type="submit"]{
    color:var(--bpw-theme-accent-contrast);
    background:var(--bpw-theme-accent);
    border-color:var(--bpw-theme-accent);
    border-radius:var(--bpw-theme-radius);
}
.bpw-wrap .button:hover,.bpw-wrap .button:focus,
.bpw-wrap button:not(.bpw-notifications-real-button):hover,
.bpw-wrap button:not(.bpw-notifications-real-button):focus,
.bpw-wrap input[type="submit"]:hover,.bpw-wrap input[type="submit"]:focus{
    color:var(--bpw-theme-accent-contrast);
    background:var(--bpw-theme-accent-hover);
    border-color:var(--bpw-theme-accent-hover);
}

/* Anchor-based Command Center actions must receive the same contrast contract as
   ordinary buttons. Their older inline styles intentionally remain a fallback,
   but the selected player theme is authoritative while it is active. */
.bpw-wrap a.bpw-profile-button{
    color:var(--bpw-theme-accent-contrast);
    background:var(--bpw-theme-accent);
    border-color:var(--bpw-theme-accent);
}
.bpw-wrap a.bpw-profile-button:hover,
.bpw-wrap a.bpw-profile-button:focus,
.bpw-wrap a.bpw-profile-button.is-active{
    color:var(--bpw-theme-accent-contrast);
    background:var(--bpw-theme-accent-hover);
    border-color:var(--bpw-theme-accent-hover);
}

/* Some gameplay actions are intentionally presented like hyperlinks even though
   their accessible control is a <button>. Use bpw-theme-text-action for new
   controls. The two legacy selectors keep Research and convoy Rename compatible
   until their renderers can adopt the semantic class during ordinary module work. */
.bpw-wrap button.bpw-theme-text-action,
.bpw-wrap button.bpw-research-link,
.bpw-wrap button.bpw-ru-convoy-rename-toggle{
    appearance:none;
    color:var(--bpw-theme-accent)!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    text-transform:none!important;
    letter-spacing:normal!important;
    text-decoration:underline;
    text-decoration-thickness:1px;
    text-underline-offset:2px;
}
.bpw-wrap button.bpw-theme-text-action:hover,
.bpw-wrap button.bpw-theme-text-action:focus,
.bpw-wrap button.bpw-research-link:hover,
.bpw-wrap button.bpw-research-link:focus,
.bpw-wrap button.bpw-ru-convoy-rename-toggle:hover,
.bpw-wrap button.bpw-ru-convoy-rename-toggle:focus{
    color:var(--bpw-theme-accent-hover)!important;
    background:transparent!important;
    border-color:transparent!important;
    text-decoration:none;
}
.bpw-wrap button.bpw-research-link strong{color:inherit!important;}

/* Icon-only controls are not filled action buttons. New icon controls should use
   bpw-theme-icon-action; the Research close control is the compatibility bridge. */
.bpw-wrap button.bpw-theme-icon-action,
.bpw-wrap button.bpw-research-modal-close{
    color:var(--bpw-theme-heading)!important;
    background:transparent!important;
    border-color:transparent!important;
    box-shadow:none!important;
    text-transform:none!important;
    letter-spacing:normal!important;
}
.bpw-wrap button.bpw-theme-icon-action:hover,
.bpw-wrap button.bpw-theme-icon-action:focus,
.bpw-wrap button.bpw-research-modal-close:hover,
.bpw-wrap button.bpw-research-modal-close:focus{
    color:var(--bpw-theme-accent-hover)!important;
    background:color-mix(in srgb,var(--bpw-theme-accent) 10%,transparent)!important;
}
.bpw-wrap .button[disabled],.bpw-wrap button[disabled],.bpw-wrap input[disabled]{opacity:.58;}
.bpw-wrap hr{border-color:var(--bpw-theme-border);}
.bpw-wrap .bpw-message,.bpw-wrap .notice-success{
    color:var(--bpw-theme-text);
    background:var(--bpw-theme-success-bg);
    border-color:var(--bpw-theme-success);
}
.bpw-wrap .bpw-error,.bpw-wrap .notice-error{
    color:var(--bpw-theme-text);
    background:var(--bpw-theme-danger-bg);
    border-color:var(--bpw-theme-danger);
}
.bpw-wrap .notice-warning,.bpw-wrap [class*="warning"]:not(.bpw-notifications-button-has-unread){
    border-color:var(--bpw-theme-warning);
}
.bpw-wrap .bpw-notification-item.is-read{background:var(--bpw-theme-success-bg);border-left-color:var(--bpw-theme-success);}
.bpw-wrap .bpw-notification-item.is-unread{background:var(--bpw-theme-danger-bg);border-left-color:var(--bpw-theme-danger);}
.bpw-wrap .bpw-command-center-actions a.is-active,
.bpw-wrap .bpw-profile-button.is-active,
.bpw-wrap [class*="tab"] a.is-active{
    box-shadow:inset 0 -3px 0 var(--bpw-theme-accent);
}

/* Compatibility bridge for legacy inline presentation. Future templates should
   use semantic classes and the variables above instead of adding new colors. */
.bpw-wrap [style*="color:#646970"],.bpw-wrap [style*="color: #646970"],
.bpw-wrap [style*="color:#50575e"],.bpw-wrap [style*="color: #50575e"],
.bpw-wrap [style*="color:#666"],.bpw-wrap [style*="color: #666"]{color:var(--bpw-theme-muted)!important;}
.bpw-wrap [style*="background:#f6f7f7"],.bpw-wrap [style*="background: #f6f7f7"],
.bpw-wrap [style*="background:#fafafa"],.bpw-wrap [style*="background: #fafafa"],
.bpw-wrap [style*="background:#f8fafc"],.bpw-wrap [style*="background: #f8fafc"]{background-color:var(--bpw-theme-surface-alt)!important;}
.bpw-wrap [style*="background:#fff"],.bpw-wrap [style*="background: #fff"]{background-color:var(--bpw-theme-surface-raised)!important;}
.bpw-wrap [style*="border:1px solid #dcdcde"],.bpw-wrap [style*="border: 1px solid #dcdcde"],
.bpw-wrap [style*="border:1px solid #ddd"],.bpw-wrap [style*="border: 1px solid #ddd"]{border-color:var(--bpw-theme-border)!important;}

/* Player Profile theme selector. */
.bpw-player-theme-panel{margin-top:12px;}
.bpw-theme-panel-intro{margin-top:0;color:var(--bpw-theme-muted);}
.bpw-theme-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px;}
.bpw-theme-choice{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px;border:1px solid var(--bpw-theme-border);border-radius:var(--bpw-theme-radius);background:var(--bpw-theme-surface-alt);cursor:pointer;box-sizing:border-box;}
.bpw-theme-choice:hover,.bpw-theme-choice:focus-within{border-color:var(--bpw-theme-accent);box-shadow:0 0 0 1px var(--bpw-theme-accent);}
.bpw-theme-choice.is-selected{border-color:var(--bpw-theme-accent);box-shadow:inset 0 0 0 2px var(--bpw-theme-accent);}
.bpw-theme-choice-control{display:flex;align-items:center;gap:7px;}
.bpw-theme-access-badge{display:inline-flex;align-items:center;margin-left:auto;padding:2px 7px;border:1px solid var(--bpw-theme-border-strong);border-radius:999px;color:var(--bpw-theme-muted);background:var(--bpw-theme-surface);font-size:10px;font-weight:700;line-height:1.3;white-space:nowrap;}
.bpw-theme-swatches{display:flex;height:26px;overflow:hidden;border:1px solid var(--bpw-theme-border-strong);border-radius:3px;}
.bpw-theme-swatches>span{flex:1;background:var(--bpw-theme-swatch);}
.bpw-theme-choice-description{font-size:12px;line-height:1.4;}
.bpw-theme-save-row{display:flex;align-items:center;gap:10px;margin:12px 0 0;}
.bpw-theme-save-status{font-size:13px;color:var(--bpw-theme-muted);}
.bpw-theme-save-status.is-error{color:var(--bpw-theme-danger);}
@media(max-width:760px){.bpw-theme-choice-grid{grid-template-columns:1fr;}}
.bpw-wrap .button-link-delete,
.bpw-wrap button.button-link-delete{
    color:var(--bpw-theme-accent-contrast)!important;
    background:var(--bpw-theme-danger)!important;
    border-color:var(--bpw-theme-danger)!important;
}
.bpw-wrap .button-link-delete:hover,.bpw-wrap .button-link-delete:focus,
.bpw-wrap button.button-link-delete:hover,.bpw-wrap button.button-link-delete:focus{
    filter:brightness(1.08);
}
