/* Lightning Tracker (index.html), from the Lightning Monitor website package. Self-contained:
   the page needs no other stylesheet besides Leaflet's. */

:root {
    --lt-brand-night: #030b1c;
    --lt-brand-navy: #0e2a4f;
    --lt-brand-teal: #3cf2c8;
    --lt-brand-bolt: #ffc21a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --border-color: rgba(255, 255, 255, 0.1);
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.lt-hero {
    margin-bottom: 16px;
    padding: 18px 0 14px;
    background:
        radial-gradient(ellipse 60% 160% at 50% 0%, rgba(60, 242, 200, 0.1), transparent 70%),
        linear-gradient(180deg, var(--lt-brand-navy), var(--lt-brand-night));
}

.lt-hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.lt-hero-title {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.lt-hero h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
}

.lt-subtitle {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.4;
}

.lt-brand-mark {
    flex-shrink: 0;
    width: 44px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(60, 242, 200, 0.25));
}

.lt-gradient-text {
    background: linear-gradient(90deg, var(--lt-brand-bolt), var(--lt-brand-teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lt-noscript {
    max-width: 1440px;
    margin: 0 auto 16px;
    padding: 0 24px;
    color: var(--text-secondary);
}

.lt-meta {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.lt-powered-by a {
    color: inherit;
    text-decoration: none;
}

.lt-powered-by a:hover strong,
.lt-powered-by a:focus-visible strong {
    text-decoration: underline;
}

.lt-visitors {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.lt-visitors svg {
    flex: none;
    color: var(--lt-brand-teal);
}

.lt-powered-by {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.lt-powered-by img {
    border-radius: 5px;
}

.lt-powered-by strong {
    color: var(--lt-brand-teal);
    font-weight: 600;
}

.lt-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lt-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
}

.lt-status-dot.lt-online {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.lt-status-dot.lt-offline {
    background: #ef4444;
}

.lt-shell {
    padding: 0 24px 64px;
    background: var(--bg-primary);
}

.lt-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    max-width: 1440px;
    margin: 0 auto;
}

.lt-map-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.lt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lt-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lt-toolbar select,
.lt-button {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
}

.lt-button {
    cursor: pointer;
}

.lt-button:hover,
.lt-button:focus-visible {
    border-color: var(--lt-brand-teal);
}

.lt-map-frame {
    position: relative;
    height: min(72vh, 760px);
    min-height: 380px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

#lt-map {
    width: 100%;
    height: 100%;
    background: #111827;
}

.lt-map-message {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.lt-map-message[hidden] {
    display: none;
}

.lt-legend {
    position: absolute;
    left: 10px;
    bottom: 22px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #e5e7eb;
    font-size: 0.78rem;
}

.lt-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lt-legend-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lt-age {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.lt-age-new { background: #facc15; }
.lt-age-mid { background: #fb923c; }
.lt-age-old { background: #ef4444; opacity: 0.6; }

.lt-strike {
    background: none;
    border: none;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}

.lt-strike svg {
    display: block;
}

.lt-station {
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.lt-ring-label {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}

.lt-rings-on-dark .lt-ring-label {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 3px #000000, 0 0 2px #000000;
}

.lt-rings-on-light .lt-ring-label {
    color: #1e293b;
    text-shadow: 0 0 3px #ffffff, 0 0 2px #ffffff;
}

.lt-rings-on-dark .lt-close-label {
    color: #f87171;
}

.lt-rings-on-light .lt-close-label {
    color: #b91c1c;
}

.lt-toggle {
    cursor: pointer;
}

.lt-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--lt-brand-teal);
    cursor: pointer;
}

.lt-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.lt-banner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--lt-brand-night);
    border: 1px solid rgba(60, 242, 200, 0.25);
    color: var(--lt-brand-teal);
}

.lt-banner span {
    color: rgba(60, 242, 200, 0.7);
    font-size: 0.82rem;
}

.lt-rates,
.lt-totals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lt-rate,
.lt-totals div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.lt-totals div {
    padding: 6px 4px;
    background: transparent;
    border: none;
}

.lt-rate strong {
    color: #facc15;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.lt-rate-close strong { color: #ef4444; }
.lt-rate-noise strong { color: var(--text-secondary); }

.lt-totals strong {
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.lt-rate span,
.lt-totals span {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.lt-card {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.lt-card h2 {
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lt-types {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.lt-types td,
.lt-types th {
    padding: 3px 4px;
}

.lt-types tbody th {
    font-weight: normal;
    text-align: left;
}

.lt-types thead th {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.lt-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.lt-type-symbol {
    width: 18px;
}

.lt-type-symbol svg {
    display: block;
}

.lt-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lt-muted {
    color: var(--text-tertiary);
}

.lt-note {
    margin: 8px 0 0;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.lt-storms {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
}

.lt-storms li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lt-storms li div {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lt-storms li div span {
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.lt-storm-swatch {
    display: inline-flex;
}

.lt-storm-icon {
    background: none;
    border: none;
}

.lt-storm-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.lt-storm-label {
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.lt-trend {
    font-size: 1.1rem;
}

.lt-trend-intensifying { color: #ef4444; }
.lt-trend-weakening { color: #22c55e; }
.lt-trend-steady { color: var(--text-tertiary); }

.lt-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 0;
    font-size: 0.88rem;
}

.lt-details dt {
    color: var(--text-tertiary);
}

.lt-details dd {
    margin: 0;
    text-align: right;
}

.lt-activity svg {
    display: block;
    width: 100%;
    height: 110px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.lt-activity-key {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.lt-activity-key span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.lt-activity-key i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.lt-key-strikes { background: #facc15; }
.lt-key-noise { background: #9ca3af; }

@media (max-width: 1000px) {
    .lt-layout {
        grid-template-columns: 1fr;
    }

    .lt-map-frame {
        height: 62vh;
    }
}

/* index.html?embed=1: no page header, tighter margins, and a fixed map height, because a frame that
   grows to fit the page would otherwise make a viewport-sized map grow with it. */
.lt-embed .lt-hero {
    margin-bottom: 10px;
    padding: 10px 0 0;
    background: none;
}

.lt-embed .lt-hero-title {
    display: none;
}

.lt-embed .lt-hero-inner,
.lt-embed .lt-noscript {
    padding: 0 12px;
}

.lt-embed .lt-shell {
    padding: 0 12px 16px;
}

.lt-embed .lt-map-frame {
    height: 640px;
}

@media (max-width: 600px) {
    .lt-embed .lt-map-frame {
        height: 440px;
    }
}

@media (max-width: 600px) {
    .lt-hero {
        padding: 14px 0 12px;
    }

    .lt-hero-inner,
    .lt-noscript {
        padding: 0 16px;
    }

    .lt-shell {
        padding: 0 16px 48px;
    }

    .lt-subtitle {
        font-size: 0.85rem;
    }
}
