:root {
    --bg: #0d0f12;
    --panel: #171a1f;
    --panel-light: #20252c;
    --panel-hover: #282e36;

    --border: #3a4049;
    --border-light: #505762;

    --text: #eeeae0;
    --muted: #aaa69d;

    --gold: #c49a52;
    --gold-light: #f0c978;
    --gold-dark: #8e6b32;

    --red: #8d3c35;
    --red-light: #c75b50;

    --green: #587653;
    --green-light: #76a66b;

    --danger: #a94b42;
    --danger-light: #d4675d;

    --focus: #e1bd78;

    --radius: 8px;
    --radius-large: 12px;

    --shadow:
        0 8px 25px rgba(0, 0, 0, .35);

    --shadow-hover:
        0 12px 30px rgba(0, 0, 0, .5);
}


/* ============================================================
   RESET / BASE
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #292d33 0,
            #17191d 30%,
            var(--bg) 70%
        );

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.45;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/*
 * Baseline so a <select> dropped somewhere without a wrapping
 * .mm-field/.mm-injury-add (or similar) still matches the theme
 * instead of falling back to the browser default - a more
 * specific rule elsewhere still wins where one exists.
 */

select {
    min-height: 44px;

    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: #101216;

    color: var(--text);

    outline: none;
}

select:hover {
    border-color: var(--border-light);
}

/*
 * Chrome/Edge/Safari render the number spin buttons as a plain
 * white/grey OS-native widget that clashes hard with the dark
 * theme - tint them to match instead of hiding them. Firefox's
 * spinner isn't stylable this way (-moz-appearance: textfield
 * would remove it entirely, which isn't what was asked for), so
 * it keeps its own native look there.
 */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;

    filter:
        invert(72%)
        sepia(11%)
        saturate(573%)
        hue-rotate(358deg)
        brightness(92%);

    cursor: pointer;
}

a {
    color: var(--gold-light);
}

#app {
    min-height: 100vh;
    display: flex;
}


/* ============================================================
   VALIDATION
   ============================================================ */

.mm-validation {
    display: flex;
    gap: 1rem;

    padding: 0.85rem 1rem;

    margin-bottom: 1rem;

    border: 1px solid;

    border-radius: var(--radius);
}

.mm-validation-valid {
    border-color: #4b8f5a;
    background: rgba(75, 143, 90, 0.12);
}

.mm-validation-warning {
    border-color: #c9962c;
    background: rgba(201, 150, 44, 0.12);
}

.mm-validation-error {
    color: #ffd0d0;
    border-color: #a94444;
    background: rgba(140, 30, 30, 0.18);
}

.mm-validation-icon {
    font-size: 1.4rem;
    font-weight: bold;
}

.mm-validation-content {
    flex: 1;
}

.mm-validation-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.mm-validation-content p {
    margin: 0;
    opacity: 0.75;
}

.mm-validation-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.mm-validation-list {
    flex: 1;
}

.mm-validation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.mm-validation-item-icon {
    width: 1.25rem;
    text-align: center;
}

.mm-validation-message {
    flex: 1;
}


/* ============================================================
   TESTING / FIGHTER SELECTION
   ============================================================ */

/*
 * Fighter type buttons are deliberately very obvious
 * while we are testing the add-fighter system.
 */

.mm-fighter-type-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 1fr)
        );

    gap: 12px;

    margin-top: 20px;
}

.mm-fighter-type-option {
    position: relative;

    min-height: 120px;

    display: flex;
    flex-direction: column;

    justify-content: space-between;

    text-align: left;

    padding: 16px;

    background:
        linear-gradient(
            145deg,
            #20252b,
            #171a1e
        );

    border: 2px solid var(--border);

    border-radius: 10px;

    color: var(--text);

    cursor: pointer;

    transition:
        transform .15s ease,
        border-color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

.mm-fighter-type-option:hover:not(:disabled) {
    transform: translateY(-2px);

    border-color: var(--gold);

    background:
        linear-gradient(
            145deg,
            #2b3037,
            #1b1f24
        );

    box-shadow:
        0 8px 20px rgba(0, 0, 0, .4),
        0 0 0 1px rgba(196, 154, 82, .15);
}

.mm-fighter-type-option:active:not(:disabled) {
    transform: translateY(0);

    border-color: var(--gold-light);
}

.mm-fighter-type-option:focus-visible {
    border-color: var(--gold-light);

    box-shadow:
        0 0 0 3px
        rgba(225, 189, 120, .2);
}

.mm-fighter-type-option.is-disabled,
.mm-fighter-type-option:disabled {
    opacity: .4;

    cursor: not-allowed;

    filter: grayscale(.5);
}

.mm-fighter-type-option h3 {
    margin:
        8px 0 0;

    color: var(--text);

    font-size: 17px;
}

.mm-fighter-type-details {
    display: flex;

    justify-content: space-between;

    margin-top: 15px;

    padding-top: 10px;

    border-top:
        1px solid var(--border);

    color: var(--gold-light);

    font-size: 13px;

    font-weight: 600;
}


/* ============================================================
   MORDERMANAGER COMPONENTS
   ============================================================ */

.mm-app {
    width: 100%;
}

.mm-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 20px 30px;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(13, 15, 18, .8);

    backdrop-filter:
        blur(8px);
}

.mm-logo {
    font-weight: 800;

    letter-spacing: 2px;

    color: var(--gold-light);
}

.mm-subtitle {
    color: var(--muted);

    font-size: 13px;

    margin-top: 3px;
}

.mm-header-actions {
    display: flex;

    align-items: center;
    flex-wrap: wrap;

    gap: 12px;
}

.mm-error-page {
    max-width: 560px;

    margin: 80px auto;
    padding: 30px;

    text-align: center;
}

.mm-error-page p {
    color: var(--muted);
}

.mm-source {
    margin-top: 20px;
    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .15);
}

.mm-source strong {
    display: block;

    margin-bottom: 4px;

    color: var(--gold-light);

    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mm-source p {
    margin: 0 0 6px;

    color: var(--muted);

    font-size: 13px;
}

.mm-acknowledgement {
    max-width: 1500px;

    margin: 40px auto 0;
    padding: 24px 30px 40px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.7;
}

.mm-acknowledgement p {
    margin: 0 0 6px;
}

.mm-main {
    width: 100%;

    max-width: 1500px;

    margin: 0 auto;

    padding: 30px;
}


/* ============================================================
   PAGE / SECTION LAYOUT

   .mm-section wraps every named block on a page (Fighters,
   Stash, Games, Settlements, etc.) - used 30+ times across the
   app but never actually had a rule, so sections had no space
   between them at all. .mm-section-header lays out a section's
   title/description against its optional action button.
   ============================================================ */

.mm-page-title {
    margin-bottom: 32px;
}

.mm-page-title h1 {
    margin: 0 0 6px;
}

.mm-page-title p {
    margin: 0;

    color: var(--muted);
}

.mm-section {
    margin-bottom: 40px;
}

.mm-section:last-child {
    margin-bottom: 0;
}

.mm-section-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;

    gap: 16px;

    margin-bottom: 18px;
}

.mm-section-header h2 {
    margin: 0 0 6px;
}

.mm-section-header p {
    margin: 0;

    color: var(--muted);
}

.mm-editor-section {
    margin-bottom: 28px;

    padding-bottom: 28px;

    border-bottom: 1px solid var(--border);
}

.mm-editor-section:last-of-type {
    margin-bottom: 0;

    padding-bottom: 0;

    border-bottom: 0;
}

.mm-editor-section h3 {
    margin: 0 0 6px;
}

.mm-editor-section > p {
    margin: 0 0 14px;

    color: var(--muted);
}


.mm-button {
    min-height: 42px;

    padding:
        9px 15px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background: var(--panel);

    color: var(--text);

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.mm-button:hover {
    background: var(--panel-hover);

    border-color: var(--gold);

    transform: translateY(-1px);
}

.mm-button:active {
    transform: translateY(0);
}

.mm-button-primary {
    background: var(--gold);

    border-color: var(--gold);

    color: #181510;

    font-weight: 700;
}

.mm-button-primary:hover {
    background: var(--gold-light);

    border-color: var(--gold-light);

    color: #15120d;
}

.mm-button-danger {
    border-color: var(--danger);

    color: var(--danger-light);
}

.mm-button-danger:hover {
    background:
        rgba(169, 75, 66, .15);

    border-color:
        var(--danger-light);
}

.mm-button-small {
    min-height: 34px;

    padding:
        6px 10px;

    font-size: 13px;
}

.mm-back-button {
    display: inline-flex;
    align-items: center;

    min-height: 34px;

    padding: 6px 12px;
    margin-bottom: 10px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: transparent;

    color: var(--muted);

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}

.mm-back-button:hover {
    background: var(--panel-hover);

    border-color: var(--border-light);

    color: var(--text);
}

.mm-modal-back {
    min-height: 30px;

    padding: 5px 10px;

    margin-bottom: 8px;

    font-size: 12px;
}


/* ============================================================
   BADGES
   ============================================================ */

.mm-badge {
    display: inline-flex;

    align-items: center;

    min-height: 22px;

    padding:
        3px 8px;

    border-radius: 5px;

    background:
        rgba(196, 154, 82, .12);

    border:
        1px solid
        rgba(196, 154, 82, .35);

    color:
        var(--gold-light);

    font-size: 11px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .5px;
}

.mm-badge-highlight {
    margin-left: 8px;

    background:
        rgba(90, 168, 104, .16);

    border-color:
        rgba(90, 168, 104, .45);

    color:
        var(--success, #5aa868);
}

.mm-badge-danger {
    background:
        rgba(169, 75, 66, .16);

    border-color:
        rgba(169, 75, 66, .45);

    color:
        var(--danger-light);
}

.mm-badge-muted {
    background:
        rgba(255, 255, 255, .04);

    border-color:
        var(--border-light);

    color:
        var(--muted);
}


/* ============================================================
   WARBAND / FIGHTER CARDS
   ============================================================ */

.mm-card,
.mm-fighter-card {
    background:
        linear-gradient(
            145deg,
            var(--panel),
            #14171b
        );

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

    box-shadow:
        0 3px 12px rgba(0, 0, 0, .25);
}

.mm-card:hover,
.mm-fighter-card:hover {
    border-color:
        var(--border-light);
}

.mm-warband-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(280px, 1fr)
        );

    gap: 15px;
}

.mm-card {
    padding: 20px;
}

.mm-card-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;

    gap: 16px;
}

.mm-card-header h2 {
    margin:
        10px 0 4px;
}

.mm-card-header p {
    margin: 0;

    color: var(--muted);
}

.mm-muted {
    color: var(--muted);
}


/* ============================================================
   FIGHTER ROSTER

   Every fighter card was missing its internal layout entirely -
   .mm-fighter-card never got .mm-card's padding, and none of
   main/name/type/equipment/footer had any spacing rules, so
   everything (including the Edit/Remove buttons) touched its
   neighbours directly.
   ============================================================ */

.mm-fighter-group {
    margin-bottom: 32px;
}

.mm-fighter-group:last-child {
    margin-bottom: 0;
}

.mm-fighter-group h3 {
    margin: 0 0 14px;
}

.mm-fighter-list {
    display: flex;
    flex-direction: column;

    gap: 16px;
}

.mm-fighter-main {
    padding: 18px 18px 0;
}

.mm-fighter-name {
    display: flex;

    align-items: center;
    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 4px;
}

.mm-fighter-type {
    color: var(--muted);

    font-size: 13px;
}

.mm-fighter-equipment {
    padding: 16px 18px;
}

.mm-fighter-equipment > strong {
    display: block;

    margin-bottom: 10px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .5px;
}

.mm-equipment-tags {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.mm-fighter-game-summary {
    margin: 0;

    padding: 0 18px 14px;

    font-size: 12px;
}

.mm-fighter-footer {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 12px;

    padding: 14px 18px;

    border-top: 1px solid var(--border);
}

.mm-fighter-footer > span {
    color: var(--gold-light);

    font-weight: 700;
}

.mm-fighter-footer > div {
    display: flex;

    gap: 8px;
}


/* ============================================================
   DETAIL MODALS

   .mm-detail-section is the same stacked-with-divider pattern
   as .mm-editor-section, used in the read-only fighter detail
   modal (Profile/Special Rules/Summary/Equipment/Skills/
   Injuries/Notes) - also had no rule at all.
   ============================================================ */

.mm-detail-section {
    margin-bottom: 28px;

    padding-bottom: 28px;

    border-bottom: 1px solid var(--border);
}

.mm-detail-section:last-of-type {
    margin-bottom: 0;

    padding-bottom: 0;

    border-bottom: 0;
}

.mm-detail-section h3 {
    margin: 0 0 6px;
}

.mm-detail-section > p {
    margin: 0 0 14px;

    color: var(--muted);
}

.mm-detail-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(140px, 1fr));

    gap: 10px;
}

.mm-detail-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.mm-detail-row {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 12px;

    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .15);
}

.mm-detail-row strong {
    display: block;
}

.mm-detail-row-button {
    width: 100%;

    color: inherit;

    font: inherit;
    text-align: left;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.mm-detail-row-button:hover {
    border-color: var(--gold-dark);

    background: rgba(196, 154, 82, .06);
}

.mm-notes-display {
    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .15);

    white-space: pre-wrap;
}


/* ============================================================
   FIGHTER NAME BUTTON
   ============================================================ */

.mm-fighter-name-button {
    display: block;

    padding: 0;

    border: 0;

    background: transparent;

    color: inherit;

    text-align: left;

    cursor: pointer;
}

.mm-fighter-name-button h3 {
    margin:
        6px 0 0;

    color: var(--text);

    transition:
        color .15s ease;
}

.mm-fighter-name-button:hover h3 {
    color: var(--gold-light);

    text-decoration:
        underline;
}


/* ============================================================
   PROFILE
   ============================================================ */

.mm-profile {
    display: grid;

    grid-template-columns:
        repeat(9, minmax(45px, 1fr));

    margin-top: 15px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;
}

.mm-stat {
    padding:
        8px 5px;

    text-align: center;

    border-right:
        1px solid var(--border);

    background:
        rgba(0, 0, 0, .12);
}

.mm-stat:last-child {
    border-right: 0;
}

.mm-stat span {
    display: block;

    color: var(--muted);

    font-size: 10px;
}

.mm-stat strong {
    display: block;

    margin-top: 3px;

    color: var(--text);
}

.mm-profile-editor {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(70px, 1fr));

    gap: 8px;
}

.mm-stat-editor {
    padding: 8px 5px;

    text-align: center;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .12);
}

.mm-stat-editor span {
    display: block;

    color: var(--muted);

    font-size: 10px;
}

.mm-stat-editor strong {
    display: block;

    margin-top: 3px;

    color: var(--text);
}


/* ============================================================
   MODERN MODAL SYSTEM
   ============================================================ */

.mm-modal-backdrop {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, .82);

    backdrop-filter:
        blur(4px);
}

.mm-modal {
    position: relative;

    width:
        min(600px, 95vw);

    max-height:
        90vh;

    overflow-y:
        auto;

    background:
        linear-gradient(
            145deg,
            #1b1f24,
            #131619
        );

    border:
        1px solid var(--border-light);

    border-radius:
        var(--radius-large);

    box-shadow:
        0 25px 70px
        rgba(0, 0, 0, .7);
}


/*
 * Custom scrollbar for anything that scrolls inside a modal
 * (the modal body itself, and the equipment picker's own
 * scroll area) - the default browser scrollbar looks out of
 * place against the dark theme otherwise.
 */

.mm-modal,
.mm-equipment-selection {
    scrollbar-width: thin;

    scrollbar-color:
        var(--border-light)
        transparent;
}

.mm-modal::-webkit-scrollbar,
.mm-equipment-selection::-webkit-scrollbar {
    width: 8px;
}

.mm-modal::-webkit-scrollbar-track,
.mm-equipment-selection::-webkit-scrollbar-track {
    background: transparent;
}

.mm-modal::-webkit-scrollbar-thumb,
.mm-equipment-selection::-webkit-scrollbar-thumb {
    background: var(--border-light);

    border-radius: 4px;
}

.mm-modal::-webkit-scrollbar-thumb:hover,
.mm-equipment-selection::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

.mm-modal-large {
    width:
        min(850px, 95vw);
}

.mm-modal-header {
    display: flex;

    justify-content:
        space-between;

    align-items:
        flex-start;

    gap: 20px;

    padding:
        20px 22px;

    border-bottom:
        1px solid var(--border);
}

.mm-modal-header h2 {
    margin: 0;

    color:
        var(--gold-light);
}

.mm-modal-body {
    padding:
        22px;
}

.mm-modal-footer {
    display: flex;

    justify-content:
        flex-end;

    gap: 10px;

    padding:
        16px 22px;

    border-top:
        1px solid var(--border);
}

.mm-modal-close {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border:
        1px solid transparent;

    border-radius: var(--radius);

    background:
        transparent;

    color:
        var(--muted);

    font-size:
        26px;

    cursor: pointer;
}

.mm-modal-close:hover {
    background:
        var(--panel-light);

    border-color:
        var(--border);

    color:
        var(--text);
}


/* ============================================================
   FORMS
   ============================================================ */

.mm-field {
    display: flex;

    flex-direction: column;

    gap: 7px;

    margin-bottom: 18px;
}

.mm-field > span {
    color: var(--muted);

    font-size: 12px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: .5px;
}

.mm-field input,
.mm-field select,
.mm-field textarea {
    width: 100%;

    min-height: 44px;

    padding:
        9px 12px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background:
        #101216;

    color:
        var(--text);

    outline: none;
}

.mm-field textarea {
    resize: vertical;
    font-family: inherit;
}

.mm-field input:hover,
.mm-field select:hover,
.mm-field textarea:hover {
    border-color:
        var(--border-light);
}

.mm-field input:focus,
.mm-field select:focus,
.mm-field textarea:focus {
    border-color:
        var(--gold);

    box-shadow:
        0 0 0 2px
        rgba(196, 154, 82, .12);
}

.mm-cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: rgba(255, 255, 255, .02);
}

.mm-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mm-cost-row span {
    color: var(--muted);
    font-size: 13px;
}

.mm-cost-row strong {
    font-weight: 600;
}

.mm-cost-total {
    padding-top: 8px;
    margin-top: 2px;

    border-top: 1px solid var(--border);
}

.mm-cost-total span {
    color: var(--text);
    font-weight: 600;
}

.mm-cost-total strong {
    color: var(--gold-light);
    font-size: 16px;
}


/* ============================================================
   EQUIPMENT
   ============================================================ */

.mm-equipment-option {
    display: flex;

    align-items: center;

    gap: 12px;

    padding:
        12px;

    margin-bottom:
        8px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background:
        rgba(0, 0, 0, .15);

    transition:
        border-color .15s ease,
        background .15s ease;
}

/*
 * This class is reused for plain display rows (friend requests,
 * stash items) as well as the actual clickable checkbox label in
 * the equipment picker - only the <label> case should look and
 * feel clickable, so the pointer cursor and hover highlight are
 * scoped to it specifically rather than the shared class.
 */

label.mm-equipment-option {
    cursor: pointer;
}

label.mm-equipment-option:hover {
    border-color:
        var(--gold-dark);

    background:
        rgba(196, 154, 82, .06);
}

.mm-equipment-option input {
    width: 18px;
    height: 18px;

    accent-color:
        var(--gold);
}

.mm-equipment-option strong {
    display: block;
}

.mm-equipment-option small {
    color:
        var(--muted);
}

.mm-equipment-option-stash {
    border-color:
        var(--green-light);
}

.mm-equipment-option-stash small {
    color:
        var(--green-light);
}

.mm-weapon-profile {
    display: block;

    margin-top: 4px;

    color: var(--muted);
}

.mm-equipment-selection {
    max-height: 340px;

    overflow-y: auto;

    padding-right: 4px;
}

/* ============================================================
   EQUIPMENT / SKILL CHIPS

   .mm-equipment-tag and .mm-skill-tag are the same clickable
   pill shape everywhere they appear (fighter cards, the skills
   list) - shared here instead of redefined twice. Equipment used
   to carry a separate "traits" system alongside its weapon/armour
   special-rules text, which just duplicated the same information
   in two conflicting places - removed, keeping the special-rules
   text as the single source (matches Mordheim's own "Special
   Rules" terminology, confirmed against Broheim's rules text).
   ============================================================ */

.mm-equipment-tag,
.mm-skill-tag {
    display: inline-flex;

    align-items: center;
    gap: 6px;

    padding: 6px 12px;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: var(--panel);

    color: var(--text);

    font-size: 13px;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.mm-equipment-tag:hover,
.mm-skill-tag:hover {
    border-color: var(--gold);

    background: var(--panel-hover);
}

/*
 * Underlined inline text button - used where a list row's own
 * title needs to open a detail modal (spells, mutations), unlike
 * .mm-skill-tag's pill shape which assumes it's the row itself.
 */

.mm-link-button {
    padding: 0;

    border: none;
    background: none;

    color: var(--text);

    font: inherit;
    font-weight: inherit;

    text-decoration: underline;
    text-decoration-color: var(--border);

    cursor: pointer;
}

.mm-link-button:hover {
    color: var(--gold);
    text-decoration-color: var(--gold);
}

.mm-trait-list {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.mm-rule-stat {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 12px;

    padding: 10px 14px;

    margin-bottom: 8px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .15);
}

.mm-rule-stat:last-child {
    margin-bottom: 0;
}

.mm-rule-stat span {
    color: var(--muted);

    font-size: 13px;
}

.mm-rule-stat strong {
    color: var(--text);
}

.mm-rule-block {
    margin-top: 16px;
}

.mm-rule-block h3 {
    margin: 0 0 8px;

    color: var(--gold-light);
}

.mm-rule-description {
    margin: 0;

    color: var(--text);

    line-height: 1.6;
}

.mm-rules-card {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.mm-restrictions {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 8px;
}

.mm-restrictions > div {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 12px;

    padding: 10px 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .15);
}

.mm-restrictions span {
    color: var(--muted);

    font-size: 13px;
}

.mm-badge-count {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 18px;
    height: 18px;

    margin-left: 6px;
    padding: 0 5px;

    border-radius: 9px;

    background: var(--gold);

    color: #101216;

    font-size: 11px;
    font-weight: 700;
}

.mm-injury-list {
    list-style: none;

    margin: 0 0 12px;
    padding: 0;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mm-injury-list li {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(0, 0, 0, .15);
}

.mm-injury-list li > span {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.mm-skill-description {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;
}

.mm-injury-add {
    display: flex;

    gap: 10px;
}

.mm-injury-add input,
.mm-injury-add select {
    flex: 1;

    min-height: 44px;

    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: #101216;

    color: var(--text);

    outline: none;
}

.mm-injury-add input:hover,
.mm-injury-add select:hover {
    border-color: var(--border-light);
}

.mm-injury-add input:focus,
.mm-injury-add select:focus {
    border-color: var(--gold);
}


/* ============================================================
   EMPTY STATES
   ============================================================ */

.mm-empty-state {
    padding:
        45px 25px;

    text-align:
        center;

    border:
        1px dashed var(--border);

    border-radius:
        var(--radius);

    background:
        rgba(0, 0, 0, .12);
}

.mm-empty-small {
    padding:
        30px 20px;
}

.mm-empty-icon {
    font-size:
        32px;

    margin-bottom:
        10px;

    color:
        var(--gold);
}

.mm-empty-state h2,
.mm-empty-state h3 {
    margin:
        5px 0;
}

.mm-empty-state p {
    color:
        var(--muted);
}


/* ============================================================
   MOBILE FIGHTER TYPE GRID
   ============================================================ */

@media(max-width: 600px) {

    .mm-header {
        padding:
            16px 18px;
    }

    .mm-main {
        padding:
            20px 15px;
    }

    .mm-fighter-type-grid {
        grid-template-columns:
            1fr;
    }

    .mm-fighter-type-option {
        min-height:
            105px;
    }

    .mm-profile {
        overflow-x:
            auto;

        min-width:
            500px;
    }

    .mm-modal-backdrop {
        padding:
            10px;
    }

    .mm-modal-body {
        padding:
            18px;
    }

    .mm-modal-footer {
        padding:
            14px 18px;
    }
}


/* ============================================================
   DEBUG / TESTING VISIBILITY
   ============================================================ */

/*
 * Makes interactive controls easy to identify while
 * developing. These do not change application logic.
 */

.mm-fighter-type-option::after {
    content:
        "SELECT";

    position:
        absolute;

    top:
        8px;

    right:
        8px;

    padding:
        2px 5px;

    border-radius:
        3px;

    background:
        rgba(196, 154, 82, .12);

    color:
        var(--gold-dark);

    font-size:
        8px;

    font-weight:
        800;

    letter-spacing:
        1px;

    opacity:
        0;

    transition:
        opacity .15s ease;
}

.mm-fighter-type-option:hover::after {
    opacity:
        1;
}


.mm-validation-success {
    color: #b8e6b8;
    background: rgba(40, 120, 40, 0.15);
    border-color: #4d914d;
}

.mm-validation-error strong {
    display: block;
    margin-bottom: 0.5rem;
}

.mm-validation-error ul {
    margin: 0;
    padding-left: 1.25rem;
}

.mm-validation-error li {
    margin: 0.25rem 0;
}

.mm-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* ============================================================
   CARD STAT ROWS
   (shared by warband cards, game cards, overview panels)
   ============================================================ */

.mm-warband-stats,
.mm-overview-stats {
    display: flex;

    gap: 20px;

    margin: 16px 0;

    padding: 14px 0;

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.mm-warband-stats > div,
.mm-overview-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mm-warband-stats strong,
.mm-overview-stats strong {
    font-size: 18px;
}

.mm-warband-stats span,
.mm-overview-stats span {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mm-card-actions {
    display: flex;
    gap: 10px;
}

.mm-card-actions .mm-button {
    flex: 1;
}

.mm-retired-toggle {
    margin: 20px 0;
}

.mm-warband-overview {
    display: flex;

    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;

    gap: 20px;

    margin-bottom: 25px;
}

.mm-warband-overview h1 {
    margin: 10px 0 0;
}


/* ============================================================
   SETTLEMENTS
   ============================================================ */

.mm-settlement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mm-settlement-card {
    display: flex;

    justify-content: space-between;
    align-items: center;
    gap: 15px;

    padding: 14px 16px;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mm-settlement-card p {
    margin: 4px 0 0;

    color: var(--muted);
    font-size: 13px;
}

.mm-settlement-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    flex-shrink: 0;
}

.mm-settlement-actions select {
    min-height: 36px;

    padding: 6px 10px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: #101216;

    color: var(--text);

    outline: none;
}

.mm-settlement-actions select:hover {
    border-color: var(--border-light);
}


/* ============================================================
   SCENARIO
   ============================================================ */

.mm-special-rules {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin-top: 10px;
}

.mm-special-rule {
    padding: 12px 14px;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mm-special-rule strong {
    display: block;

    color: var(--gold-light);
}

.mm-special-rule p {
    margin: 4px 0 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.mm-scenario-card {
    padding: 18px 20px;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mm-scenario-card h3 {
    margin: 0 0 8px;

    color: var(--gold-light);
}

.mm-scenario-card p {
    margin: 0;

    color: var(--text);

    line-height: 1.6;
}


/* ============================================================
   WARBANDS WITHIN A GAME
   ============================================================ */

.mm-game-warband-card {
    margin-bottom: 15px;
}

.mm-game-warband-detail {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 20px;

    margin-bottom: 16px;
}

.mm-game-warband-detail strong {
    display: block;

    margin-bottom: 6px;

    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
}

.mm-game-warband-detail ul {
    margin: 0;
    padding-left: 18px;
}

.mm-game-warband-detail li {
    margin: 2px 0;
}


/* ============================================================
   ADD WARBAND TO GAME
   ============================================================ */

.mm-warband-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mm-warband-select-option {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 12px 14px;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    color: var(--text);

    text-align: left;
    cursor: pointer;
}

.mm-warband-select-option:hover {
    border-color: var(--gold);

    background: var(--panel-hover);
}

.mm-warband-select-option-active {
    border-color: var(--gold);

    background:
        rgba(196, 154, 82, .12);
}

.mm-warband-select-option span {
    color: var(--muted);
    font-size: 13px;
}

.mm-warband-select-option:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}

.mm-warband-select-option:disabled:hover {
    border-color: var(--border);

    background: var(--panel);
}

/*
 * The "confirm this skill" step between picking a skill and it
 * landing on the fighter - description text plus a Back/Confirm
 * row, inside the advance picker's #advance-picker-body.
 */

.mm-skill-confirm {
    display: flex;
    flex-direction: column;

    gap: 4px;

    padding: 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--panel);
}

.mm-skill-confirm h3 {
    margin: 0;

    color: var(--gold-light);
}

.mm-picker-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 16px;
}

.mm-picker-actions .mm-button {
    flex: 1;
}

