@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

:root {
    --color-background: #0a0a0a;
    --color-surface: #1a1a1a;
    --color-helldivers: #ffe710;
    --color-helldivers-dark: #d4bd00;
    --color-text: #f0f0f0;
    --color-text-secondary: #b0b0b0;
    --color-border: #2a2a2a;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    --glow-sm:       0 0 10px rgba(255, 231, 16, 0.2);
    --glow-md:       0 0 20px rgba(255, 231, 16, 0.3);
    --glow-lg:       0 0 30px rgba(255, 231, 16, 0.5);
    --glow-inset-sm: inset 0 0 20px rgba(255, 231, 16, 0.05);
    --glow-inset-lg: inset 0 0 30px rgba(255, 231, 16, 0.1);
    --glow-text:     0 0 12px rgba(255, 231, 16, 0.6);
    --glow-header:   0 0 10px rgba(255, 231, 16, 0.3);
    --glow-focus:    0 0 0 3px rgba(255, 231, 16, 0.1);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SUPER EARTH
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root[data-theme="super-earth"] {
    --color-background: #162840;
    --color-surface: #3a587f;
    --color-helldivers: #f0c020;
    --color-helldivers-dark: #d4a818;
    --color-text: #ffffff;
    --color-text-secondary: #b8cce0;
    --color-border: #4a6a94;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.0);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);

    --glow-sm:       0 0 10px rgba(240, 192, 32, 0.2);
    --glow-md:       0 0 20px rgba(240, 192, 32, 0.3);
    --glow-lg:       0 0 30px rgba(240, 192, 32, 0.4);
    --glow-inset-sm: inset 0 0 20px rgba(240, 192, 32, 0.05);
    --glow-inset-lg: inset 0 0 30px rgba(240, 192, 32, 0.08);
    --glow-text:     0 0 12px rgba(240, 192, 32, 0.5);
    --glow-header:   0 0 10px rgba(240, 192, 32, 0.3);
    --glow-focus:    0 0 0 3px rgba(240, 192, 32, 0.15);
}

[data-theme="super-earth"] body {
    background: url('../assets/themes/State_Flag_of_Super_Earth.webp') center center / cover fixed;
}

[data-theme="super-earth"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(22, 40, 64, 0.55);
    pointer-events: none;
    z-index: 0;
}

[data-theme="super-earth"] body > * {
    position: relative;
    z-index: 1;
}

[data-theme="super-earth"] #controls,
[data-theme="super-earth"] #settings-panel {
    backdrop-filter: blur(16px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CYBERSTAN — Industrial red. Automaton warning lights.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root[data-theme="cyberstan"] {
    --color-background: #080404;
    --color-surface: #1a0a0a;
    --color-helldivers: #e82020;
    --color-helldivers-dark: #b01515;
    --color-text: #f0d8d8;
    --color-text-secondary: #996666;
    --color-border: rgba(200, 40, 40, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.8);

    --glow-sm:       0 0 10px rgba(220, 30, 30, 0.35);
    --glow-md:       0 0 20px rgba(220, 30, 30, 0.5);
    --glow-lg:       0 0 40px rgba(220, 30, 30, 0.7);
    --glow-inset-sm: inset 0 0 20px rgba(220, 30, 30, 0.06);
    --glow-inset-lg: inset 0 0 30px rgba(220, 30, 30, 0.12);
    --glow-text:     0 0 12px rgba(255, 60, 60, 0.9);
    --glow-header:   0 0 14px rgba(220, 30, 30, 0.6);
    --glow-focus:    0 0 0 3px rgba(220, 30, 30, 0.2);
}

[data-theme="cyberstan"] body {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(220, 30, 30, 0.015) 2px,
            rgba(220, 30, 30, 0.015) 4px
        ),
        var(--color-background);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BILE — Toxic acid green. Bug bile. Bioluminescent horror.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root[data-theme="bile"] {
    --color-background: #030801;
    --color-surface: #0a1405;
    --color-helldivers: #7dff00;
    --color-helldivers-dark: #5acc00;
    --color-text: #d8f0c8;
    --color-text-secondary: #5a8840;
    --color-border: rgba(100, 200, 20, 0.25);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.8);

    --glow-sm:       0 0 10px rgba(100, 220, 0, 0.3);
    --glow-md:       0 0 20px rgba(100, 220, 0, 0.45);
    --glow-lg:       0 0 40px rgba(100, 220, 0, 0.65);
    --glow-inset-sm: inset 0 0 20px rgba(100, 220, 0, 0.05);
    --glow-inset-lg: inset 0 0 30px rgba(100, 220, 0, 0.1);
    --glow-text:     0 0 14px rgba(130, 255, 0, 0.95);
    --glow-header:   0 0 14px rgba(100, 220, 0, 0.55);
    --glow-focus:    0 0 0 3px rgba(100, 220, 0, 0.2);
}

[data-theme="bile"] body {
    background:
        radial-gradient(ellipse at 20% 80%, rgba(40, 80, 0, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(20, 60, 0, 0.14) 0%, transparent 55%),
        var(--color-background);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MERIDIA
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root[data-theme="meridia"] {
    --color-background: #000000;
    --color-surface: rgba(15, 5, 30, 0.80);
    --color-helldivers: #9966ff;
    --color-helldivers-dark: #7744dd;
    --color-text: #ddd0ff;
    --color-text-secondary: #8866bb;
    --color-border: rgba(120, 60, 220, 0.35);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.9);

    --glow-sm:       0 0 10px rgba(120, 60, 220, 0.4);
    --glow-md:       0 0 20px rgba(120, 60, 220, 0.5);
    --glow-lg:       0 0 40px rgba(120, 60, 220, 0.7);
    --glow-inset-sm: inset 0 0 20px rgba(120, 60, 220, 0.08);
    --glow-inset-lg: inset 0 0 30px rgba(120, 60, 220, 0.15);
    --glow-text:     0 0 12px rgba(150, 80, 255, 0.9);
    --glow-header:   0 0 15px rgba(150, 80, 255, 0.6);
    --glow-focus:    0 0 0 3px rgba(120, 60, 220, 0.25);
}

[data-theme="meridia"] body {
    background: url('../assets/themes/Meridian_Black_Hole.webp') center center / cover fixed;
}

[data-theme="meridia"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 15, 0.65);
    pointer-events: none;
    z-index: 0;
}

[data-theme="meridia"] body > * {
    position: relative;
    z-index: 1;
}

[data-theme="meridia"] .card,
[data-theme="cyberstan"] .card {
    backdrop-filter: blur(4px);
}

[data-theme="meridia"] #controls,
[data-theme="meridia"] #settings-panel {
    backdrop-filter: blur(16px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   REDACTED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root[data-theme="redacted"] {
    --color-background: #080808;
    --color-surface: #141414;
    --color-helldivers: #dddddd;
    --color-helldivers-dark: #999999;
    --color-text: #c8c8c8;
    --color-text-secondary: #484848;
    --color-border: rgba(160, 160, 160, 0.15);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.9);

    --glow-sm:       0 0 8px  rgba(200, 200, 200, 0.15);
    --glow-md:       0 0 18px rgba(200, 200, 200, 0.22);
    --glow-lg:       0 0 35px rgba(200, 200, 200, 0.32);
    --glow-inset-sm: inset 0 0 20px rgba(200, 200, 200, 0.03);
    --glow-inset-lg: inset 0 0 30px rgba(200, 200, 200, 0.07);
    --glow-text:     0 0 10px rgba(220, 220, 220, 0.5);
    --glow-header:   0 0 10px rgba(200, 200, 200, 0.25);
    --glow-focus:    0 0 0 3px rgba(180, 180, 180, 0.1);
}

[data-theme="redacted"] img, [data-theme="redacted"] .card.liberating img {
    filter: grayscale(100%);
}

[data-theme="redacted"] .card.liberated img {
    filter: grayscale(100%) brightness(0.08);
}

[data-theme="redacted"] .card.liberated:hover img {
    filter: grayscale(100%) brightness(0.12);
}

[data-theme="redacted"] .card:not(.liberated):hover img {
    filter: grayscale(100%) brightness(1.1);
}

/* black bar */
[data-theme="redacted"] .card.liberated .stamp {
    background: #000000;
    color: transparent;
    border-color: #000000;
    box-shadow: 0 0 0 6px #000000;
    text-shadow: none;
    padding: 1.1rem 0;
    letter-spacing: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ERATA PRIME — Dry desert. Spice dust. Dune horizon.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root[data-theme="erata-prime"] {
    --color-background: #0e0a04;
    --color-surface: #1e1508;
    --color-helldivers: #c8922a;
    --color-helldivers-dark: #a06e18;
    --color-text: #e8d9b8;
    --color-text-secondary: #8a7050;
    --color-border: rgba(160, 110, 40, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.8);

    --glow-sm:       0 0 10px rgba(180, 130, 40, 0.3);
    --glow-md:       0 0 20px rgba(180, 130, 40, 0.45);
    --glow-lg:       0 0 40px rgba(180, 130, 40, 0.65);
    --glow-inset-sm: inset 0 0 20px rgba(180, 130, 40, 0.05);
    --glow-inset-lg: inset 0 0 30px rgba(180, 130, 40, 0.12);
    --glow-text:     0 0 14px rgba(210, 160, 60, 0.85);
    --glow-header:   0 0 14px rgba(180, 130, 40, 0.5);
    --glow-focus:    0 0 0 3px rgba(180, 130, 40, 0.2);
}

/* Layered sand dunes via radial gradients + a fine grain texture overlay */
[data-theme="erata-prime"] body {
    background:
        /* grain/noise texture — tiny repeating dots give it that dry gritty feel */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E"),
        /* distant haze at the top */
        radial-gradient(ellipse at 50% 0%,   rgba(90, 58, 12, 0.5)  0%, transparent 60%),
        /* warm spice-orange horizon glow */
        radial-gradient(ellipse at 50% 100%, rgba(120, 70, 10, 0.6)  0%, transparent 55%),
        /* subtle dune ridge left */
        radial-gradient(ellipse at 15% 70%,  rgba(60, 38, 6, 0.4)  0%, transparent 45%),
        /* subtle dune ridge right */
        radial-gradient(ellipse at 85% 60%,  rgba(50, 30, 4, 0.35) 0%, transparent 45%),
        var(--color-background);
}

/* Heat-shimmer scanlines — very subtle, horizontal, spaced far apart */
[data-theme="erata-prime"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 6px,
        rgba(200, 140, 20, 0.012) 6px,
        rgba(200, 140, 20, 0.012) 7px
    );
    pointer-events: none;
    z-index: 0;
}

[data-theme="erata-prime"] body > * {
    position: relative;
    z-index: 1;
}

[data-theme="erata-prime"] #controls,
[data-theme="erata-prime"] #settings-panel {
    backdrop-filter: blur(14px);
}

[data-theme="erata-prime"] .card {
    backdrop-filter: blur(3px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SCROLLBAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-background);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-helldivers);
    cursor: pointer;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BASE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
* {
    box-sizing: border-box;
}

body {
    background: var(--color-background);
    color: var(--color-text);
    font-family: "Chakra Petch", sans-serif;
    padding: 2rem 1rem;
    margin: 0;
    min-height: 100vh;
}

header {
    color: var(--color-helldivers);
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: var(--glow-header), 0 2px 4px rgba(0, 0, 0, 0.8);
}

button {
    background: linear-gradient(135deg, var(--color-helldivers) 0%, var(--color-helldivers-dark) 100%);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-background);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--glow-md);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

#percentage {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 1px;
}

.link {
    color: var(--color-helldivers);
    text-decoration: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CONTROLS BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#controls-wrapper {
    max-width: 1200px;
    margin: 0 auto 2rem;
}

#controls {
    align-items: center;
    display: flex;
    font-weight: 600;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: border-radius 0.35s ease;
}

#controls.panel-open {
    border-radius: 12px 12px 0 0;
    border-bottom-color: transparent;
}

#controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-secondary);
}

#settingsCog {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: all 0.2s ease;
    box-shadow: none;
}

#settingsCog:hover {
    border-color: var(--color-helldivers);
    color: var(--color-helldivers);
    transform: none;
    box-shadow: none;
    filter: none;
}

#settingsCog.open {
    border-color: var(--color-helldivers);
    color: var(--color-helldivers);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SETTINGS PANEL — vertical stacked sections
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#settings-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 0 1.5rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                padding 0.4s ease;
}

#settings-panel.open {
    max-height: 500px;
    opacity: 1;
    padding: 0.5rem 1.5rem 1.25rem;
}

.settings-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-secondary);
    min-width: 7rem;
    flex-shrink: 0;
}

.settings-section-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* SETTINGS BUTTONS */
.settings-section-buttons button {
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    box-shadow: none;
}

.settings-section-buttons button:hover {
    border-color: var(--color-helldivers);
    color: var(--color-helldivers);
    background: transparent;
    box-shadow: none;
    filter: none;
    transform: translateY(-2px);
}

.settings-section-buttons button.active {
    border-color: var(--color-helldivers);
    color: var(--color-helldivers);
    background: transparent;
    box-shadow: var(--glow-sm);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FORM ELEMENTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--color-helldivers);
}

select {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--color-background);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

select:focus {
    outline: none;
    border-color: var(--color-helldivers);
    box-shadow: var(--glow-focus);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   GRID & CARDS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* REPLACE the existing .title and .title.hidden rules */

.title {
    color: var(--color-helldivers);
    font-weight: 700;
    margin: 0;
    text-align: center;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                padding 0.35s ease;
}

.title.hidden {
    height: 0;
    opacity: 0;
    padding: 0;
}

#grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--color-border);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    cursor: pointer;
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-helldivers);
}

.card.liberated img {
    filter: brightness(0.4) grayscale(100%);
    opacity: 0.7;
}

.card.liberated:hover img {
    filter: brightness(0.5) grayscale(100%);
}

.card:not(.liberated):hover img {
    filter: brightness(1.1);
}

/* LIBERATING STATE */
.card.liberating {
    animation: liberatingPulse 2s ease-in-out infinite;
    border-color: var(--color-helldivers);
    box-shadow: var(--shadow-sm), var(--glow-md), var(--glow-inset-sm);
}

@keyframes liberatingPulse {
    0%, 100% {
        box-shadow: var(--shadow-sm), var(--glow-md), var(--glow-inset-sm);
        border-color: var(--color-helldivers);
    }
    50% {
        box-shadow: var(--shadow-md), var(--glow-lg), var(--glow-inset-lg);
        border-color: var(--color-helldivers-dark);
    }
}

.card.liberating img {
    filter: brightness(0.9) saturate(1.2);
}

.card.liberating .image-wrapper::before,
.card.liberating .image-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        -45deg,
        var(--color-helldivers) 0px,
        var(--color-helldivers) 10px,
        rgba(0, 0, 0, 0.8)     10px,
        rgba(0, 0, 0, 0.8)     20px
    );
    background-size: 28px 28px;
    animation: hazardScroll 2s linear infinite;
    pointer-events: none;
    z-index: 2;
}

.card.liberating .image-wrapper::before { top: 0; }
.card.liberating .image-wrapper::after  { bottom: 0; }

@keyframes hazardScroll {
    from { background-position: 0 0; }
    to   { background-position: 28px 0; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STAMP — full-width banner
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.image-wrapper {
    position: relative;
    overflow: hidden;
}

.image-wrapper img {
    display: block;
    width: 100%;
    transition: all 0.3s ease;
    aspect-ratio: 2048 / 1024;
}

.stamp {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-helldivers);
    border-top: 2px solid var(--color-helldivers);
    border-bottom: 2px solid var(--color-helldivers);
    padding: 0.5rem 1.25rem;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    letter-spacing: 4px;
    text-shadow: var(--glow-text);
    box-shadow: var(--glow-sm), var(--glow-inset-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.card.liberated .stamp {
    opacity: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STATUS MENU
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.status-menu {
    background: var(--color-surface);
    border: 3px solid var(--color-helldivers);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg), var(--glow-md);
    animation: menuFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.status-option {
    background: transparent;
    color: var(--color-text-secondary);
    border: 2px solid var(--color-border);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 150px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-option:hover {
    border-color: var(--color-helldivers);
    color: var(--color-helldivers);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm), var(--glow-sm);
}

.status-option:active {
    transform: translateY(0);
}

.status-option.active {
    background: linear-gradient(135deg, var(--color-helldivers) 0%, var(--color-helldivers-dark) 100%);
    color: var(--color-surface);
    border-color: var(--color-helldivers);
    font-weight: 700;
    box-shadow: var(--shadow-sm), var(--glow-md);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SEARCH — search bar
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#search-wrapper .search-icon {
    position: absolute;
    left: 0.65rem;
    color: var(--color-text-secondary);
    pointer-events: none;
    transition: color 0.2s ease;
}

#search-wrapper:focus-within .search-icon {
    color: var(--color-helldivers);
}

#search {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: var(--color-background);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    padding: 0.5rem 2rem 0.5rem 2.2rem;
    border-radius: 6px;
    width: 220px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, width 0.2s ease;
}

#search::placeholder {
    color: var(--color-text-secondary);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

#search:hover { border-color: var(--color-helldivers); }

#search:focus {
    outline: none;
    border-color: var(--color-helldivers);
    box-shadow: var(--glow-focus);
    /* width: 280px;    removed cause messing with cog and clear button */
}

#search-clear {
    position: absolute;
    right: 0.4rem;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 0;
    box-shadow: none;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

#search-clear:hover {
    color: var(--color-helldivers);
    transform: none;
    box-shadow: none;
    filter: none;
}

#search-clear.visible { display: flex; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
footer {
    display: flex;
    font-size: 0.8rem;
    justify-content: center;
    margin-top: 3rem;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 1rem;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    header h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    #percentage {
        font-size: 0.95rem;
    }

    #controls {
        gap: 1rem;
        padding: 1rem;
        font-size: 0.85rem;
    }

    button {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    #grid {
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .card {
        border-radius: 8px;
    }

    .stamp {
        font-size: 1rem;
        letter-spacing: 3px;
    }

    .status-menu {
        max-width: 90vw;
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .status-option {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .title {
        font-size: 1rem;
    }

    .settings-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .settings-label {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    #controls {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        padding: 0.75rem;
    }

    #controls label {
        display: flex;
        justify-content: space-between;
        width: 100%;
        font-size: 0.8rem;
    }

    select {
        font-size: 0.8rem;
    }
}