html, body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
}

/* Rajdhani for all headings — angular military-tech feel */
h1, h2, h3, h4, h5, h6,
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6 {
    font-family: 'Rajdhani', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* AppBar brand title — uppercase tactical label */
.app-brand-title {
    font-family: 'Rajdhani', Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase;
}

/* Site-wide league banner (wwwroot/images/Banner.png) */
.site-banner-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem 0;
    background: #060810;
    border-bottom: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.site-banner-link {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.site-banner-img {
    display: block;
    width: 100%;
}

/* Home: full art (banners through mechs to title bar) */
.site-banner-wrap--full .site-banner-img {
    height: auto;
    object-fit: contain;
    object-position: center center;
}

/*
 * Other pages: crop to the bottom wordmark strip only
 * so content starts near the top (BATTLETECH OMAHA bar).
 */
.site-banner-wrap--compact {
    max-height: 4.25rem;
    margin-bottom: 0.75rem;
}

.site-banner-wrap--compact .site-banner-img {
    height: 4.25rem;
    object-fit: cover;
    object-position: center bottom;
}

@media (min-width: 960px) {
    .site-banner-wrap--compact {
        max-height: 4.75rem;
    }

    .site-banner-wrap--compact .site-banner-img {
        height: 4.75rem;
    }
}

/*
 * Pilot portraits: square crop is baked on save, so display is always simple cover/center.
 * Editor still uses object-position + optional zoom while framing.
 */
.pilot-portrait {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: #424242;
    flex-shrink: 0;
}

.pilot-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--portrait-x, 50%) var(--portrait-y, 50%);
    transform: scale(var(--portrait-zoom, 1));
    transform-origin: var(--portrait-x, 50%) var(--portrait-y, 50%);
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.pilot-portrait--sm {
    width: 40px;
    height: 40px;
}

.pilot-portrait--lg {
    width: 120px;
    height: 120px;
}

/* Displayed saved portraits are pre-cropped — always center, no zoom */
.pilot-portrait--final img {
    object-position: 50% 50%;
    transform: none;
}

.pilot-portrait-editor {
    width: min(280px, 80vw);
    height: min(280px, 80vw);
    border-radius: 50%;
    margin: 0 auto;
    cursor: grab;
    touch-action: none;
    border: 2px solid var(--mud-palette-primary, #c2410c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.pilot-portrait-editor:active {
    cursor: grabbing;
}

.pilot-portrait-editor img {
    pointer-events: none;
}

/* Baseline page colors before MudBlazor hydrates (see theme.js data-theme) */
html[data-theme="light"] body {
    background-color: #eef2f7;
    color: rgba(0, 0, 0, 0.87);
}

html[data-theme="dark"] body {
    background-color: #070a0d;
    color: rgba(255, 255, 255, 0.87);
}

h1:focus {
    outline: none;
}

a {
    color: inherit;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Minimal form styling for Identity account pages (static SSR; no Bootstrap) */
.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-floating > .form-control,
.form-control {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #9e9e9e;
    border-radius: 4px;
    background: transparent;
    color: inherit;
}

html[data-theme="dark"] .form-floating > .form-control,
html[data-theme="dark"] .form-control {
    border-color: #616161;
    background: rgba(255, 255, 255, 0.04);
}

.form-floating > label,
.form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #616161;
}

html[data-theme="dark"] .form-floating > label,
html[data-theme="dark"] .form-label {
    color: #bdbdbd;
}

.form-floating > .form-control:focus {
    outline: 2px solid #c2410c;
    border-color: #c2410c;
}

html[data-theme="dark"] .form-floating > .form-control:focus {
    outline-color: #f59e0b;
    border-color: #f59e0b;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
}

.btn-primary {
    background: #c2410c;
    color: #fff;
}

.btn-primary:hover {
    background: #9a3412;
}

html[data-theme="dark"] .btn-primary {
    background: #f59e0b;
    color: #0a0c10;
}

html[data-theme="dark"] .btn-primary:hover {
    background: #fbbf24;
}

.btn-link {
    background: transparent;
    color: #c2410c;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
}

html[data-theme="dark"] .btn-link {
    color: #f59e0b;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
}

.w-100 {
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.col-lg-6,
.col-md-6,
.col-md-4,
.col-lg-4 {
    flex: 1 1 280px;
    min-width: 0;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.text-danger {
    color: #c62828;
}

html[data-theme="dark"] .text-danger {
    color: #ef9a9a;
}

.alert {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-danger {
    color: #7f1d1d;
    background: #fee2e2;
    border-color: #ef4444;
}

html[data-theme="dark"] .alert-danger {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.45);
    border-color: #f87171;
}

.alert-success {
    color: #14532d;
    background: #dcfce7;
    border-color: #22c55e;
}

html[data-theme="dark"] .alert-success {
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.45);
    border-color: #4ade80;
}

.alert ul {
    margin: 0.4rem 0 0 1.1rem;
    padding: 0;
}

.validation-summary-errors ul {
    margin: 0.35rem 0 1rem 1.1rem;
    padding: 0;
}

.password-field {
    position: relative;
}

.password-field > .form-control {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.password-toggle:hover,
.password-toggle:focus {
    opacity: 1;
    outline: none;
}

.password-toggle .eye-off {
    display: none;
}

.password-toggle.is-visible .eye-on {
    display: none;
}

.password-toggle.is-visible .eye-off {
    display: inline;
}

.password-hints {
    font-size: 0.85rem;
    margin: -0.35rem 0 1rem;
    color: #616161;
}

html[data-theme="dark"] .password-hints {
    color: #bdbdbd;
}

.password-hints-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.password-hints ul {
    margin: 0;
    padding-left: 1.15rem;
}

.text-secondary {
    color: #757575;
}

.text-muted {
    color: #757575;
}

html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-muted {
    color: #bdbdbd;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1rem 0;
}

html[data-theme="dark"] hr {
    border-top-color: #424242;
}

/* Manage account nav */
.nav-pills {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.nav-pills .nav-item {
    margin-bottom: 0.25rem;
}

.nav-pills .nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:hover {
    background: rgba(194, 65, 12, 0.12);
    color: #c2410c;
}

html[data-theme="dark"] .nav-pills .nav-link.active,
html[data-theme="dark"] .nav-pills .nav-link:hover {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
}

/* —— After-action stamp (seat score) —— */
.after-action {
    position: relative;
    display: grid;
    gap: 0.35rem;
    margin: 0 0 1rem 0;
    padding: 1rem 1.15rem 0.75rem 1.35rem;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: #0c1018;
    color: #f1f5f9;
    overflow: hidden;
    animation: after-action-in 280ms ease-out;
}

.after-action::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0.4rem;
    background: currentColor;
}

.after-action-stamp {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    line-height: 0.9;
    transform: rotate(-6deg);
    transform-origin: left center;
    width: fit-content;
    padding: 0.1rem 0.55rem;
    border: 4px solid currentColor;
    margin-bottom: 0.35rem;
}

.after-action--win { border-color: #22c55e; }
.after-action--win .after-action-stamp { color: #22c55e; }
.after-action--win::before { background: #22c55e; }
.after-action--partial { border-color: #f59e0b; }
.after-action--partial .after-action-stamp { color: #f59e0b; }
.after-action--partial::before { background: #f59e0b; }
.after-action--fail { border-color: #f87171; }
.after-action--fail .after-action-stamp { color: #f87171; }
.after-action--fail::before { background: #f87171; }

.after-action-job {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 1.05rem;
}

.after-action-seat {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.after-action-pay {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.after-action-pay-num {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.04em;
}

.after-action-pay-unit {
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
}

.after-action-bits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

.after-action-roster {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.after-action-live span {
    color: #86efac;
    margin-left: 0.35rem;
    font-weight: 600;
}

.after-action-dead {
    color: #f87171;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.after-action-close {
    justify-self: start;
    color: rgba(255, 255, 255, 0.7) !important;
}

@keyframes after-action-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* —— Hangar bay cards —— */
.hangar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.hangar-card {
    display: flex;
    cursor: pointer;
    min-height: 9.5rem;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    overflow: hidden;
}

.hangar-card:hover {
    border-color: var(--mud-palette-primary);
}

.hangar-card-weight {
    width: 0.4rem;
    flex-shrink: 0;
}

.hangar-card-weight--light { background: #22d3ee; }
.hangar-card-weight--medium { background: #fbbf24; }
.hangar-card-weight--heavy { background: #fb923c; }
.hangar-card-weight--assault { background: #f87171; }
.hangar-card-weight--ready { background: #22c55e; }
.hangar-card-weight--damaged { background: #f59e0b; }
.hangar-card-weight--crippled { background: #ef4444; }
.hangar-card-weight--destroyed { background: #6b7280; }

.hangar-card-body {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.8rem 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.hangar-card-top {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.hangar-card-glyph {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
    width: 1.7rem;
    text-align: center;
    opacity: 0.55;
}

.hangar-card-id { flex: 1; min-width: 0; }

.hangar-card-name {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1.05rem;
    line-height: 1.15;
}

.hangar-card-sub {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

.hangar-card-stamps {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.hangar-card-omni {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.65rem;
    color: var(--mud-palette-info);
}

.hangar-card-stamp {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.7rem;
    border: 2px solid currentColor;
    padding: 0.1rem 0.35rem;
    transform: rotate(4deg);
    white-space: nowrap;
}

.hangar-card--ready .hangar-card-stamp { color: #16a34a; }
.hangar-card--damaged .hangar-card-stamp { color: #d97706; }
.hangar-card--crippled .hangar-card-stamp { color: #dc2626; }
.hangar-card--destroyed {
    background: #111318;
    color: #e5e7eb;
}
.hangar-card--destroyed .hangar-card-stamp { color: #9ca3af; }
.hangar-card--destroyed .hangar-card-name { opacity: 0.7; }

.hangar-card-bars { display: grid; gap: 0.25rem; }

.hangar-bar {
    display: grid;
    grid-template-columns: 2.4rem 1fr 3.2rem;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
}

.hangar-bar-track {
    height: 0.4rem;
    background: rgba(128, 128, 128, 0.25);
    overflow: hidden;
}

.hangar-bar-fill { height: 100%; }
.hangar-bar-fill--armor { background: #38bdf8; }
.hangar-bar-fill--is { background: #f59e0b; }

.hangar-card-foot {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
}

.hangar-card-pilot {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.hangar-card-empty,
.hangar-card-owner {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.hangar-card-spacer { flex: 1; }

.hangar-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hangar-pilot-face { flex-shrink: 0; }

.hangar-hit-row {
    display: flex;
    align-items: center;
    gap: 0.28rem;
}

.hangar-hit-pip {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    border: 1.5px solid rgba(148, 163, 184, 0.7);
    background: transparent;
}

.hangar-hit-pip--hit {
    background: #f59e0b;
    border-color: #d97706;
}

.hangar-hit-pip--kia.hangar-hit-pip--hit {
    background: #111318;
    border-color: #6b7280;
}

.hangar-hit-caption {
    margin-left: 0.2rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.pick-strip {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scroll-snap-type: x proximity;
}

.pick-tile {
    flex: 0 0 auto;
    width: 11.5rem;
    min-height: 5.6rem;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    cursor: pointer;
    text-align: left;
    padding: 0;
    scroll-snap-align: start;
    color: inherit;
    font: inherit;
}

.pick-tile:hover:not(:disabled) {
    border-color: var(--mud-palette-primary);
}

.pick-tile:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.pick-tile--selected {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 45%, transparent);
}

.pick-tile-rail {
    width: 0.32rem;
    flex-shrink: 0;
}

.pick-tile-rail--ready { background: #22c55e; }
.pick-tile-rail--damaged { background: #f59e0b; }
.pick-tile-rail--crippled { background: #ef4444; }
.pick-tile-rail--destroyed { background: #6b7280; }

.pick-tile-body {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pick-tile-top {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    align-items: flex-start;
}

.pick-tile-name {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.88rem;
    line-height: 1.15;
}

.pick-tile-sub {
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
}

.pick-tile-note {
    font-size: 0.65rem;
    color: #d97706;
}

.deploy-line-card {
    min-height: 6.5rem;
}

.ledger-stack {
    display: grid;
    gap: 0.5rem;
}

.ledger-line {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.ledger-line--in {
    background: color-mix(in srgb, #22c55e 7%, var(--mud-palette-surface));
}

.ledger-line--in .hangar-card-stamp { color: #16a34a; }

.ledger-line--out {
    background: color-mix(in srgb, #f59e0b 8%, var(--mud-palette-surface));
}

.ledger-line--out .hangar-card-stamp { color: #d97706; }

.ledger-line-body {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.85rem;
    align-items: center;
}

.ledger-line-activity {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.ledger-line-meta {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
}

.ledger-line-delta {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    text-align: right;
    white-space: nowrap;
}

.ledger-line--in .ledger-line-delta { color: #16a34a; }
.ledger-line--out .ledger-line-delta { color: #d97706; }

.ledger-line-balance {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
}

.treasury-hero .hangar-card-name {
    font-size: 0.85rem;
}

.treasury-hero-amount {
    font-family: Rajdhani, Roboto, sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.8rem);
    letter-spacing: 0.04em;
    line-height: 1;
}

.stat-card {
    min-height: 6.25rem;
}
