/* ============================================================
   Anarchy League - Stylesheet
   Dark military BattleTech theme
   ============================================================ */

/* Default Theme (theme_id 1) — sampled from images/Logo.png's gold/steel/bronze-black.
   Blue Theme (theme_id 2, body.theme-2 below) preserves the site's original blue-gray look
   as a fallback for units that opt into it via units.theme_id. */
:root {
    --bg-dark:     #120f0b;
    --bg-panel:    #1a1611;
    --bg-card:     #241f19;
    --border:      #3a3226;
    --accent:      #c9a754;      /* gold */
    --accent2:     #8b1a1a;      /* dark red — semantic (danger), same across all themes */
    --text:        #e2dccf;
    --text-muted:  #948a7c;
    --text-bright: #f0ead8;
    --steel:       #b6afa7;      /* silver — secondary highlight (mission/pilot HUD labels, stat readouts) */
    --steel-rgb:   182,175,167;  /* same color as --steel, as r,g,b for use inside rgba(var(--steel-rgb), alpha) glows/borders */
    --green:       #4caf50;      /* semantic (success), same across all themes */
    --red:         #e53935;      /* semantic (danger), same across all themes */
    --blue:        #42a5f5;      /* semantic (info alerts, status pills), same across all themes */
    --radius:      4px;
}

body.theme-2 {
    --bg-dark:     #0d0e0f;
    --bg-panel:    #161a1d;
    --bg-card:     #1e2428;
    --border:      #2e3a42;
    --accent:      #c8a227;
    --text:        #d4cfc8;
    --text-muted:  #7a8a94;
    /* Blue Theme's whole identity was built around this cyan/blue HUD look on mission/pilot pages —
       --steel/--steel-rgb fall back to the original --blue value here (66,165,245 = #42a5f5) so
       switching themes restores every text color AND glow/border effect that used to be blue. */
    --steel:       #42a5f5;
    --steel-rgb:   66,165,245;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-bright); text-decoration: underline; }

/* ---- HEADER ---- */
.site-header {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1200 50%, #0a0a0a 100%);
    border-bottom: 2px solid var(--accent);
    padding: 0 1.5rem;
}
.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

/* ---- NAV ---- */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* center the menu items horizontally on their own row */
    flex-basis: 100%; /* forces the nav below the brand/tagline row inside .header-inner's flex-wrap */
    gap: 1rem; /* spacing between top menu items */
    align-items: center;
}
.main-nav a {
    padding: 0.2rem 0.35rem;
}

.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    padding: 0.25rem 0;
    z-index: 20;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: flex;
}
.nav-dropdown-menu a {
    padding: 0.45rem 0.9rem;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: var(--bg-card);
    text-decoration: none;
}

/* Main content container - center and limit width */
.site-main {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
    flex: 1;
}

/* ---- PAGE HEADINGS ---- */
.page-title {
    font-size: 1.6rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: 1px;
}

/* ---- PANELS / CARDS ---- */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.panel-title {
    font-size: 1.05rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Tab styles moved to per-page inline CSS in pages/unit.php to avoid global layout changes */

/* ---- GRID LAYOUTS ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }

/* ---- TABLES ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th {
    background: var(--bg-card);
    color: var(--accent);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:hover td { background: rgba(200, 162, 39, 0.05); }

/* ---- STAT BADGES ---- */
.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    text-align: center;
}
.stat-box .stat-val {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent);
    display: block;
}
.stat-box .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- STATUS PILLS ---- */
.pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pill-active  { background: rgba(76,175,80,0.2);  color: var(--green); border: 1px solid var(--green); }
.pill-injured { background: rgba(66,165,245,0.2);  color: var(--blue);  border: 1px solid var(--blue); }
.pill-dead    { background: rgba(229,57,53,0.2);   color: var(--red);   border: 1px solid var(--red); }
.pill-disabled{ background: rgba(255,152,0,0.2);   color: #ff9800;     border: 1px solid #ff9800; }
.pill-retired  { background: rgba(122,138,148,0.2); color: var(--text-muted); border: 1px solid var(--text-muted); }
.pill-crippled { background: rgba(156,39,176,0.2);  color: #ce93d8;         border: 1px solid #ce93d8; }
.pill-yellow  { background: rgba(253,216,53,0.2);  color: #fdd835;     border: 1px solid #fdd835; }
.pill-grey    { background: rgba(189,189,189,0.2); color: #bdbdbd;     border: 1px solid #bdbdbd; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* ---- ACTION ICONS ---- */
.action-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 5px;
    object-fit: contain;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s;
    text-decoration: none;
}
/* Compound .btn.btn-* (not just .btn-*) so a button's own color always wins over a more specific
   scoped link-color rule like .mission-body a — otherwise an <a class="btn btn-primary"> inside a
   .mission-body panel loses its black button text to that panel's blue link color. */
.btn.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.btn-primary:hover { background: #e0b82d; color: #000; text-decoration: none; }
.btn.btn-danger  { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.btn.btn-danger:hover { background: #a52020; text-decoration: none; color: #fff; }
.btn.btn-ghost   { background: transparent; color: var(--accent); border-color: var(--border); }
.btn.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }
.btn-sm { padding: 0.25rem 0.65rem; font-size: 0.8rem; }

/* ---- ALERTS ---- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error   { background: rgba(229,57,53,0.15);   border: 1px solid var(--red);   color: var(--red); }
.alert-success { background: rgba(76,175,80,0.15);   border: 1px solid var(--green); color: var(--green); }
.alert-info    { background: rgba(66,165,245,0.15);  border: 1px solid var(--blue);  color: var(--blue); }

/* ---- PILOT CARD ---- */
.pilot-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.pilot-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}
.pilot-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.pilot-name { font-size: 1.05rem; font-weight: bold; color: var(--text-bright); }
.pilot-rank { font-size: 0.8rem; color: var(--accent); }
.pilot-stats { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.pilot-stat  { font-size: 0.8rem; color: var(--text-muted); }
.pilot-stat span { color: var(--text); font-weight: bold; }

/* ---- MECH STATS ---- */
.armour-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    font-size: 0.8rem;
    text-align: center;
}
.armour-loc {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.25rem;
}
.armour-loc .loc-name { color: var(--text-muted); font-size: 0.7rem; }
.armour-loc .loc-val  { color: var(--text-bright); font-weight: bold; }

/* ---- MECH RECORD SHEET DIAGRAM ---- */
.mech-diagrams {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.mech-diagram-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 200px;
    max-width: 320px;
}
.mech-diagram-label {
    color: #45505a;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mech-diagram {
    position: relative;
    width: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
.mech-diagram.diagram-armour   { aspect-ratio: 462 / 800; }
.mech-diagram.diagram-internal { aspect-ratio: 316 / 427; }
.mech-diagram.diagram-aerospace { aspect-ratio: 573 / 800; }
.mech-diagram.diagram-vehicle { aspect-ratio: 511 / 800; }
.mech-diagram.diagram-vtol { aspect-ratio: 573 / 800; }
.mech-diagram.diagram-navy { aspect-ratio: 258 / 804; }
.mech-diagram.diagram-aircraft { aspect-ratio: 544 / 700; }
.dg-loc {
    position: absolute;
    transform: translate(-50%, -50%);
}
.dg-loc .dg-val {
    display: inline-block;
    background: rgba(240, 234, 216, 0.92);
    color: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 3px;
    font-size: 0.7rem;
    font-weight: bold;
    line-height: 1.3;
}

/* ---- FORUM ---- */
.forum-thread {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.forum-type-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}
.forum-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.forum-post-header {
    background: var(--bg-panel);
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.forum-post-body {
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ---- MISSION REPORT ---- */
.mission-header {
    background: linear-gradient(135deg, var(--bg-panel), var(--bg-card));
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent2);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}
.mission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.mission-meta span { color: var(--text); }

/* Tactical map room background — mission.php's header only (other pages reuse .mission-header
   for an unrelated equipment-record header and must not pick this up). The image itself is set
   inline via site_url() so it resolves correctly regardless of install path; this rule only adds
   sizing/position plus a dark scrim so text stays readable over the photo. */
.mission-header--map {
    position: relative;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.mission-header--map::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10,10,10,0.78), rgba(10,10,10,0.5));
    -webkit-backdrop-filter: brightness(1.7);
    backdrop-filter: brightness(1.7);
    pointer-events: none;
}
.mission-header--map > * {
    position: relative;
    z-index: 1;
}
.mission-header--map .mission-meta,
.mission-header--map .mission-meta span {
    color: #eee;
}

/* Equipment-record header background (unit_equipment.php, mech.php, etc.) — same photo-background/scrim
   treatment as .mission-header--map, but sized for the compact name+stats header rather than a full
   photo card, since these panels can also hold a chassis thumbnail alongside the text. */
.mission-header--hangar {
    position: relative;
    min-height: 180px;
    background-size: cover;
    background-position: center top;
    overflow: hidden;
}
.mission-header--hangar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10,10,10,0.78), rgba(10,10,10,0.5));
    -webkit-backdrop-filter: brightness(1.7);
    backdrop-filter: brightness(1.7);
    pointer-events: none;
}
.mission-header--hangar > * {
    position: relative;
    z-index: 1;
}
.mission-header--hangar .mission-meta,
.mission-header--hangar .mission-meta span {
    color: #eee;
}

/* HUD-style "tablet" readouts (Date/Time, Terrain/Temp, Planet) floated over the mission header photo —
   a glass panel with a tech glow (warm bronze on Default Theme, cyan on Blue Theme — see --steel-rgb)
   to read as an in-universe cockpit/command-room display. */
.mission-tablet {
    background: linear-gradient(160deg, rgba(var(--steel-rgb),0.18), rgba(14,11,8,0.8));
    border: 1px solid rgba(var(--steel-rgb),0.45);
    border-radius: 6px;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    box-shadow: 0 0 14px rgba(var(--steel-rgb),0.3), inset 0 0 10px rgba(var(--steel-rgb),0.08);
    padding: 0.5rem 0.9rem;
}
.mission-tablet .tablet-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--steel);
    text-shadow: 0 0 6px rgba(var(--steel-rgb),0.8);
}
.mission-tablet .tablet-value {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.9rem;
    color: var(--text-bright);
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    white-space: nowrap;
}
.mission-tablet .tablet-stat + .tablet-stat {
    margin-top: 0.4rem;
}

/* Mission detail page body panels (Briefing, Objectives, Units & Pilots, Turn-by-Turn) — same
   tactical/glass identity as the header tablets, scoped under .mission-body so other pages' plain
   .panel styling is untouched. */
.mission-body .panel {
    position: relative;
    background: linear-gradient(165deg, var(--bg-panel), var(--bg-card));
    border: 1px solid rgba(var(--steel-rgb),0.25);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), inset 0 1px 0 rgba(var(--steel-rgb),0.12);
    overflow: hidden;
    color: var(--text-bright);
}
.mission-body .panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(var(--steel-rgb),0.85));
}
.mission-body .panel-title {
    color: var(--steel);
    text-shadow: 0 0 6px rgba(var(--steel-rgb),0.7);
    letter-spacing: 1px;
    border-bottom-color: rgba(var(--steel-rgb),0.25);
}
.mission-body a {
    color: var(--steel);
}
.mission-body a:hover {
    color: var(--text-bright);
}
.mission-body .data-table th {
    background: rgba(var(--steel-rgb),0.08);
    border-bottom: 2px solid rgba(var(--steel-rgb),0.35);
}
.mission-body .data-table tr:hover td {
    background: rgba(var(--steel-rgb),0.07);
}
.mission-body .stat-val {
    color: var(--steel);
}

/* Eternal-flame flicker around The Fallen's portraits — a warm glow that also lights the portrait
   itself (via --lit feeding into each portrait's own `filter: brightness()`), rather than just a ring
   floating around its edge. The actual randomization happens in JS (see the #tab-fallen script below)
   re-rolling these custom properties every ~70-180ms per portrait, independently — true flicker, not a
   single looping animation everyone pulses in sync with. The transition is what turns each JS step into
   a smooth flicker instead of a hard jump; --lit/--glow* default here so portraits look right even
   before the first JS tick lands. */
.fallen-portrait {
    --glow1: 8px; --glow1o: 0.55; --glow2: 18px; --glow2o: 0.28; --lit: 1;
    box-shadow: 0 0 var(--glow1) 2px rgba(255,140,0,var(--glow1o)), 0 0 var(--glow2) 6px rgba(255,70,0,var(--glow2o));
    transition: box-shadow 0.1s linear, filter 0.1s linear;
}

/* Unit Points ledger panel — full "ledger.jpg" background, a single image that always covers at
   least the full width and scales up further (cropping left/right) to also cover the full height
   as the panel grows taller with more transaction rows — never tiled. Selector is doubled up to
   `.mission-body .panel--ledger` so it outweighs .mission-body .panel's `background:` shorthand,
   which would otherwise reset background-size/repeat back to their defaults (causing the image to
   render at native size and tile). */
.mission-body .panel--ledger {
    position: relative;
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
    overflow: hidden;
}
.panel--ledger::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.72);
    pointer-events: none;
    z-index: 0;
}
.panel--ledger > * {
    position: relative;
    z-index: 1;
}

/* ---- HOME HERO ---- */
.home-hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, rgba(139,26,26,0.15), rgba(200,162,39,0.08));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.home-hero h2 { font-size: 2rem; color: var(--accent); letter-spacing: 2px; }
.home-hero p  { color: var(--text-muted); max-width: 600px; margin: 0.75rem auto 0; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination a, .pagination span {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.pagination a { color: var(--text); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); color: #000; border-color: var(--accent); }

/* Mission units logos in missions list */
.mission-units a {
    display: inline-block;
    line-height: 0;
    font-size: 0;
    text-decoration: none;
    vertical-align: middle;
}
.mission-units a:hover {
    text-decoration: none;
}
.mission-units img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: inline-block;
    vertical-align: middle;
}

/* Era tabs (mission archive, home recent missions) */
.era-tab-list { display: flex; gap: .5rem; margin-bottom: .6rem; align-items: flex-end; flex-wrap: wrap; }
.era-tab-button { position: relative; display: flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1px solid #2e3a42; background: #1e2428; color: var(--text); border-top-left-radius: 4px; border-top-right-radius: 4px; text-decoration: none; }
.era-tab-button img { width: 26px; height: 26px; object-fit: contain; display: block; }
.era-tab-button.active { background: var(--bg-panel); color: var(--accent); position: relative; top: 1px; z-index: 3; }
.era-tab-content { display: none; }
.era-tab-content.active { display: block; }

/* Era tab tooltip: icon-only buttons show the era name on hover/focus */
.era-tab-button[data-era-name]::after {
    content: attr(data-era-name);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #101416;
    color: var(--text);
    border: 1px solid #2e3a42;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease;
    pointer-events: none;
    z-index: 10;
}
.era-tab-button[data-era-name]:hover::after,
.era-tab-button[data-era-name]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}
.logo-missing {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    margin-right: 0.45rem;
    font-weight: bold;
    vertical-align: middle;
}

/* Units card grid */
.units-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .units-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .units-grid { grid-template-columns: 1fr; } }
.unit-card { text-align: center; padding: 1rem; }
.unit-card .unit-logo { width: 96px; height: 96px; object-fit: contain; display:block; margin: 0 auto 0.5rem; }
.unit-card .unit-name { display:block; font-weight:700; color:var(--text-bright); margin-bottom:0.5rem; }
.unit-card .stats { display:grid; grid-template-columns: repeat(2,1fr); gap:0.5rem; margin-top:0.6rem; }
.unit-card .stat-box { padding:0.6rem; font-size:0.9rem; }
