/*
========================================
TABLE OF CONTENTS
========================================
1. VARIABLES & GLOBAL STYLES
   - :root, body, typography elements, footer
2. LAYOUT & NAVIGATION
   - .main-display, .content-area, .sidebar-nav, .top-bar, menu buttons
3. CORE COMPONENTS (CARDS & GRIDS)
   - .homepage-card, .mo-card, .stat-card, .planet-list-card, layouts
4. PROGRESS BARS & TASKS
   - .progress-bar-container, .bidirectional-progress-container, .mo-tasks
5. SPECIALIZED VIEWS
   - #changelog-container, #custom-alert-overlay
6. UTILITIES, ANIMATIONS & MODIFIERS
   - @keyframes, faction colors, text shadows, avatar glows
7. BIOME BACKGROUND IMAGES
   - .stat-card[data-biome]
8. MOBILE / RESPONSIVE OVERRIDES
   - @media queries
========================================
*/

/* ========================================
    1. VARIABLES & GLOBAL STYLES
    ======================================== 
*/
:root {
    --terminal-green: #4caf50;
    --helldiver-color: #ffe710;
    --helldiver-shadow-color: #997800;
    --terminid-color: #FF9f00;
    --terminid-shadow-color: #995f00;
    --automaton-color: #fe6a67;
    --automaton-shadow-color: #971410;
    --illuminate-color: #db58fb;
    --illuminate-shadow-color: #7d0099;
    --seaf-color: #6bb7ea;
    --seaf-shadow-color: #1a6090;
    --seaf-2-color: #41639c;
    --seaf-2-shadow-color: #1e304f;
    --success-color: #25c225;
    --success-shadow-color: #146b14;
    --light-grey: #777;
    --light-grey-text: #d1d5db;
    --dark-grey: #1a1a2e;
    --white-text: #eee;
}

body {
    background-image: url("/static/src/images/bg-stars.jpg");
    background-color: rgb(34, 34, 34);
    background-repeat: no-repeat;
    background-attachment: fixed; 
    background-size: cover;
    font-family: monospace;
    margin: 0;
    padding-top: 60px;
}
header {
    color: var(--helldiver-color);
    text-align: center;
    padding: 20px;
    background-color: rgba(0,0,0,0.7);
    font-family: monospace;
    text-transform: uppercase;
}
h1 {
    color: var(--helldiver-color);
    text-align: center;
    margin: 0;
}
p {
    color: var(--helldiver-color);
    line-height: 1.8;
    text-align: center;
}
footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    color: #aaa;
    background-color: rgba(0,0,0,0.5);
}

/* ========================================
    2. LAYOUT & NAVIGATION
    ======================================== 
*/
.main-display {
    display: flex;
    padding: 20px;
    margin: 0 auto;
    max-width: 1800px;
    background-color: rgba(0,0,0,0.3);
    justify-content: space-around;
    border: none;
    overflow: hidden;
}
.content-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}
.content-area h2 {
    color: var(--helldiver-color);
    font-size: 2em;
    margin-top: 6px;
    text-align: center;
}
.sidebar-nav {
    height: 100%;
    width: 240px;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    padding: 20px;
    padding-top: 60px;
    font-family: monospace;
    border-right: var(--helldiver-color) 2px solid;
    background-color: rgba(33,34,34,0.4);
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    transition: 0.3s;
    transform: translateX(-100%);
    text-align: center;
    overflow-x: hidden;
}
.sidebar-nav.active{
    transform: translateX(0);
}
.sidebar-nav h2 {
    color: var(--helldiver-color);
    margin-top: 0;
}
.sidebar-nav ul {
    list-style: none; /* Takes bullet points out */
    padding: 0;
}
.sidebar-nav li {
    color: var(--helldiver-color);
    margin-bottom: 10px;
}
.sidebar-nav a {
    color: var(--helldiver-color);
    text-transform: uppercase;
    text-decoration: none; /* No line for hyperlinks */
    font-size: 1.5em;
    display: block; /* Makes box clickable */
    padding: 10px 10px 10px 24px;
    border-radius: 4px;
    transition: background-color 0.4s ease, color 0.4s ease; /* Hover transition */
}
.sidebar-nav a:hover { /* Hover effect over text */
    background-color: var(--helldiver-color);
    color: #000;
}
.sidebar-nav a:focus {
    transition: 0.2s;
    background-color: #fef070;
    color: #000;
}
.overlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(33,34,34,0.4);
    z-index: 100;
    cursor: pointer;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--helldiver-color);
    color: black;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 105;
}
.menu-btn {
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
    color: black;
    font-weight: bold;
    margin-right: 15px;
}
.open-btn {
    font-size: 32px;
    cursor: pointer;
    border: none;
    background-color: rgba(33,34,34,0.7);
}
.close-btn {
    position: absolute;
    top: 0;
    right: 10px;
    font-size: 36px;
    margin-left: 50px;
    background: none;
    border: none;
    color: var(--helldiver-color);
    cursor: pointer;
}
.app-title {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
}
#current-page-title {
    color: #333;
    font-size: x-large;
    font-weight: 700;
}
.top-row-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr)); /* Creates responsive columns*/
    gap: 20px;
    margin-bottom: 10px;
}
.top-row-container.homepage-card {
    flex: 1;
    margin-bottom: 0; /* Handled within parent container*/
}

/* ========================================
    3. CORE COMPONENTS (CARDS & GRIDS)
    ======================================== 
*/
.galaxy-stats-page-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Creates responsive columns*/
    max-width: 80%;
    margin: auto;
    gap: 24px;
}
.galaxy-stats-page-layout h3 {
    font-size: 2em;
}
.galaxy-stats-page-layout p {
    font-size: 1.3em;
}
.galaxy-stats-page-layout span {
    font-weight: bold;
    font-size: 1.4em;
}
.galactic-map-wrapper {
    position: relative;
    margin: -40px -20px 0 -20px;
}
.content-area .galactic-map-title {
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    z-index: 10;
    margin: 0;
    padding: 6px 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    text-align: center;
}
#map-container {
    overflow: hidden;
}
.galactic-map-tooltip {
    position: fixed;
    display: none;
    flex-direction: column;
    width: 280px;
    height: 140px;
    background: var(--dark-grey);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--seaf-color);
    color: white;
    padding: 0;
    border-radius: 6px;
    pointer-events: none;
    font-size: 13px;
    z-index: 999;
    text-align: center;
}
.galactic-map-tooltip .planet-modal-progress-bar {
    margin-top: auto;
    margin-bottom: 0;
    height: 1.1em;
    border-bottom-left-radius: 6px;
}
.galactic-map-tooltip p {
    margin: 0;
    padding: 0;
}
.galactic-map-tooltip strong {
    font-size: 1.4em;
}
.galactic-map-tooltip .icon-label {
    width: 1em;
    height: 1em;
    object-fit: contain;
}
.homepage-card {
    background-color: rgba(33,34,34,0.7);
    color: whitesmoke;
    border: var(--helldiver-color) 1px solid;
    padding: 20px;
    padding-top: 0;
    margin-bottom: 20px;
    border-radius: 4px;
}
.homepage-card h3 {
    color:var(--helldiver-color);
    font-size: 2em;
    text-transform: uppercase;
    text-align: center;
}
.homepage-card .active-planets-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    width: 100%;
    padding-bottom: 8px;
}
.icon-label {
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1.6;
}
img.icon-label {
    width: 1em;
    height: auto;
    vertical-align: middle;
}
.mo-card {
    max-width: 850px;
    width: 1fr;
    background-color: rgba(33,34,34,0.7);
    border: var(--helldiver-color) 1px solid;
    padding: 20px;
    text-align: center;
}
.mo-card h3 {
    color: var(--helldiver-color);
    font-weight: bold;
    margin-top: 0;
}
.mo-card h2 {
    color:var(--helldiver-color);
    font-weight: bold;
    margin-top: 0;
}
.mo-card p {
    color: whitesmoke;
    font-size: 1.5em;
    text-align: center;
    margin-top: 0;
}
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    text-align: center;
    background-color: rgba(33,34,34,0.7);
    border:var(--helldiver-color) 1px solid;
    border-radius: 4px;
    padding: 10px;
}
.stats-summary-grid p {
    font-size: 1.3em;
    font-weight: bold;
    margin: 10px; 
}
.stats-layout {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: repeat(2, minmax(320px, 1fr)); /* Creates responsive columns*/
    gap: 24px;
}
.stats-layout h3 {
    font-size: 2em;
}
.stats-layout p {
    font-size: 1.3em;
}
.stats-layout span {
    font-size: 1em;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    border-radius: 4px;
    z-index: 0;
}
.stat-card > * {
    position: relative;
    z-index: 1;
}
.stat-card {
    background-color: rgba(33,34,34,0.4);
    border: var(--helldiver-color) 1px solid;
    padding: 8px 15px 15px 15px;
    text-align: center;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    flex: 1 1 320px;
    max-width: 400px;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}
.stats-layout .stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stats-layout .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(255, 231, 16, 0.25);
}
.stat-card .health-bar .progress-bar-container {
    margin-top: 0;
    margin-left: -15px;
    margin-right: -15px;
    border-radius: 0;
    border-left: none;
    border-right: none;
}
.stat-card .defense-timer {
    margin-top: 8px;
    margin-bottom: auto;
}
.stat-card .war-effort {
    text-align: center;
    width: auto;
    font-variant: small-caps;
}
.stat-card.is-defending {
    animation-name: pulse-danger;
    animation-duration: 1.3s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}
.planet-card-header {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px 4px 0 0;
    padding: 8px 15px;
    margin: -8px -15px 0 -15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.planet-regen-stat {
    position: absolute;
    right: 10px;
    font-size: 1em;
    font-weight: bold;
    color: whitesmoke;
    text-align: right;
    line-height: 1.4;
    text-shadow: 1px 1px 2px #000;
}
.planet-player-stat {
    position: absolute;
    left: 10px;
    font-size: 0.72em;
    font-weight: bold;
    color: whitesmoke;
    text-align: left;
    line-height: 1.4;
    text-shadow: 1px 1px 2px #000;
}
.regen-trend {
    display: block;
    font-size: 0.9em;
}
.player-pct-bar-container {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin-top: 3px;
    position: relative;
}
.player-pct-bar-container::after {
    content: attr(data-pct);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--helldiver-color);
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.player-pct-bar-container:hover::after {
    opacity: 1;
}
.player-pct-bar {
    height: 100%;
    background: var(--helldiver-color);
    border-radius: 2px;
    transition: width 0.6s ease;
}
.stat-card h3 {
    color: var(--helldiver-color);
    font-size: 1.5em;
    font-weight: bold;
    margin: 0;
    word-wrap: break-word;
    text-shadow: 2px 2px 2px #000;
}
.stat-card p {
    color: whitesmoke;
    font-size: 1em;
    font-weight: bold;
    margin: 0;
    margin-bottom: 10px;
    text-shadow: 2px 2px 2px #000;
}
.stat-card img.icon-label {
    width: 1.4em;
}
.stat-card .progress-bar-container {
    width: 108.25%;
}
#planet-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}
.planet-list-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    background-color: rgba(33, 34, 34, 0.6);
    border: 1px solid #777;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.planet-list-card:hover {
    transform: translateX(5px);
    border-color: var(--helldiver-color);
}
.planet-avatar-container {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: rgba(33, 34, 34, 0.6);
    border: 2px solid var(--helldiver-color);
    box-shadow: 0 0 10px rgba(255, 231, 16, 0.4);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.planet-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.planet-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.2;
}
.planet-list-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.planet-list-info strong {
    font-variant: small-caps;
    font-weight: bold;
    font-size: 1rem;
}
.planet-list-info p {
    margin: 2px 0;
    color: whitesmoke;
    font-size: 0.9rem;
    text-align: left;
    padding: 0;
}
.planet-card-stat {
    font-size: 1rem;
}
.planet-list-title {
    margin: 0 0 5px 0;
    color: var(--helldiver-color);
    font-size: 1.5rem;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px #000;
}
.mo-page-container {
    font-size: 1.1em;
}
.mo-page-container h3 {
    text-align: center;
    color: var(--helldiver-color);
    font-size: 2.4em;
    font-weight: bold;
}
.mo-page-container p {
    color: var(--white-text);
}
.mo-page-container strong {
    color: var(--helldiver-color);
    font-variant: small-caps;
}
.mo-page-description {
    font-size: 1.1em;
    margin-top: 20px;
    margin-bottom: 20px;
}
.mo-page-expiry {
    font-size: 1.4em;
}



/* Homepage Dispatch Stylings */
.dispatch-summary-grid {
    display: grid;
    grid-column: 1;
    max-height: 300px;
    overflow: scroll;
    gap: 10px;
}
.homepage-dispatch-data {
    border: 1px solid var(--light-grey);
    border-radius: 4px;
    padding: 6px;
}
.homepage-dispatch-pub-date {
    color: var(--seaf-color);
}
.homepage-dispatch-msg-text {
    text-align: left;
}
.dispatch-header {
    font-weight: bold;
    color: var(--light-grey-text);
    font-size: 1.3em;
    margin-bottom: 0;
}
.dispatch-highlight {
    font-weight: bold;
    color: var(--helldiver-color);
}



/* ========================================
    4. PROGRESS BARS & TASKS
    ======================================== 
*/
.war-effort {
    width: auto; /* Let the grid handle the width */
}
.planet-info-wrapper {
    display: flex;
    flex-direction: column; /* This stacks the header and the bar */
    width: 100%;
    gap: 4px;
}
.progress-bar-container {
    display: flex;
    position: relative;
    width: 100%;
    height: 20px;
    background-color: rgba(34,34,34,0.6);
    border: 1px solid #777;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 0;
}
.progress-bar-container .progress-bar-text,
.progress-bar-container .task-progress-bar-text {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem !important;
    line-height: 1;
    text-shadow: 1px 1px 2px black;
    z-index: 10;
}
.progress-bar {
    color: #fff !important;
    font-size: 0.75rem;
    text-align: center;
    line-height: 22px;
    white-space: nowrap;
    height: 100%;
    transition: width 0.5s ease-in-out;
}
.progress-bar-container:has(+ .progress-bar-container) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}
.progress-bar-container + .progress-bar-container {
    margin-top: 0; 
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none; 
}
.defender-bar {
    background-color: #41639C;
    text-shadow: 1px 1px 2px #000;
}
.attacker-bar {
    text-shadow: 1px 1px 2px #000;
}
.liberation-bar {
    background-color: var(--helldiver-color);
    text-shadow: 1px 1px 2px #000;
}
.mo-tasks {
    text-align: left;
    margin: 20px auto;
    max-width: 80%;
}
.mo-arrow {
    position: absolute;
    top: -1.1em;
    left: 50%; /* Default center */
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.4rem;
    color: var(--helldiver-color);
    text-shadow: 1px 1px 2px #000;
    transition: left 0.4s ease-out;
    z-index: 10;
    line-height: 1;
}
.planet-modal-hazards {
    font-size: 0.85em; 
    margin: 2px 0 8px 0;
}
.mo-arrow-text {
    font-weight: bold;
    color: var(--helldiver-color);
}
.bidirectional-progress-container {
    position: relative;
    width: 80%;
    height: 1.5em;
    background: linear-gradient(90deg, var(--automaton-color) 50%, var(--success-color) 50%);
    border: 1px solid #000;
    border-radius: 4px;
    margin-top: 15px;
    margin-bottom: 5px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5); /* Adds depth */
}
.progress-bar-container-binary {
    margin-bottom: 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
}
.progress-bar-container-binary .task-container {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%;
}
.progress-bar-container-binary .type-name {
    font-size: 1.4rem;
    text-transform: uppercase;
    text-align: left;
    flex: 1;
    color: var(--helldiver-color);
}
.progress-bar-container-binary .target-name {
    text-align: center;
    font-size: 1.65rem;
    font-weight: bold;
    flex: 2;
    word-wrap: break-word;
    text-shadow: 2px 2px 2px #000;
}
.progress-bar-container-binary .status {
    text-align: right; 
    font-weight: bold;
    flex: 1;
}

/* ========================================
    5. SPECIALIZED VIEWS
    ======================================== 
*/
#changelog-container {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid #444;
    padding: 30px;
    border-radius: 8px;
    color: #d1d5db;
    line-height: 1.6;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}
#changelog-container h1 {
    font-variant: small-caps;
    color: var(--light-grey-text);
    border-bottom: 2px solid var(--light-grey-text);
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-shadow: 0 0 8px rgba(255, 231, 16, 0.4);
}
#changelog-container h2 {
    border-bottom: 2px solid var(--helldiver-color);
    border-bottom-style: double;
    color: var(--helldiver-color);
    padding-bottom: 5px;
    margin-top: 30px;
    text-align: left;
}
#changelog-container h3 {
    font-variant: small-caps;
    color: var(--automaton-color);
    padding-bottom: 0;
    padding-top: 10px;
}
#changelog-container h4 {
    font-size: 1rem;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 3px var(--illuminate-shadow-color);
    color: var(--illuminate-color);
    padding-left: 32px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.6;
    text-align: left;
}
#changelog-container p {
    font-size: 1rem;
    color: var(--light-grey-text);
    line-height: 1.6;
}
#changelog-container strong {
    font-size: 1.1rem;
    color: var(--seaf-color);
}
#changelog-container em {
    color: #999;
    font-style: italic;
}
#changelog-container code {
    font-family: monospace;
    color: var(--terminal-green);
    text-shadow: 0 0 3px rgba(76, 175, 80, 0.5);
}
#changelog-container ul {
    list-style-type: none;
    padding-left: 32px;
}
#changelog-container ul > li::marker {
    content: "> ";
    color: var(--seaf-color);
}
#changelog-container ul ul {
    list-style-type: disc;
    padding-left: 24px;
    margin-top: 2px;
    margin-bottom: 2px;
}
#changelog-container ul ul > li::marker {
    content: unset;
}
#changelog-container ul ul ul {
    list-style-type: circle;
    padding-left: 20px;
}
#changelog-container li {
    margin-bottom: 4px;
    font-size: 1rem;
}
#changelog-container ul ul li {
    font-size: 0.95rem;
    color: var(--light-grey-text);
    margin-bottom: 2px;
}
#changelog-container li strong {
    color: var(--helldiver-color);
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 0 0 3px rgba(255, 231, 16, 0.5);
}
#changelog-container li code {
    text-shadow: 0 0 3px rgba(76, 175, 80, 0.5);
    color: var(--terminal-green);
    font-family: monospace;
    font-size: 1rem;
}
#custom-alert-overlay {
    position: fixed; /* Cover the whole screen */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex; /* Use flex to center the box */
    align-items: center;
    justify-content: center;
}
#custom-alert-box {
    background-color: rgb(34, 34, 34);
    border: 2px solid var(--helldiver-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    min-width: 300px;
    max-width: 80%;
}
#custom-alert-message {
    font-family: monospace;
    color: whitesmoke;
    font-size: 1.1em;
    white-space: pre-wrap; /* Respect newlines \n */
    margin: 0 0 20px 0;
    text-align: left;
}
#custom-alert-ok {
    background-color: var(--helldiver-color);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
#custom-alert-ok:hover {
    background-color: #fff;
}

/* ========================================
    6. PLANET MODAL
    ========================================
*/
.planet-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.8);
    z-index: 500;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.planet-modal-overlay.active {
    display: flex;
}
.planet-modal-content {
    background-color: rgb(34,34,34);
    border: 2px solid var(--helldiver-color);
    border-radius: 8px;
    padding: 24px 0 0 0;
    max-width: 1200px;
    width: 90%;
    height: 70%;
    position: relative;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.planet-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--helldiver-color);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}
.planet-modal-close:hover {
    color: #fff;
}
.planet-modal-content p {
    color: whitesmoke;
    text-align: left;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0 0 6px 0;
    text-shadow: 1px 1px 3px #000;
}
.planet-modal-content strong {
    font-size: 1rem;
    color: var(--helldiver-color);
}
.planet-modal-content .icon-label {
    width: 1.1em;
    margin-bottom: 0.5vh;
    margin-left: 24px;
    filter: drop-shadow(0 0 6px var(--helldiver-shadow-color));
}
#planet-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.planet-modal-main-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex: 1;
    min-height: 0;
    padding: 0 24px;
}
.planet-modal-left {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    line-height: 1;
    max-width: 320px;
}
.planet-modal-info-box {
    background-color: rgba(33, 34, 34, 0.4);
    border: 1px solid var(--helldiver-color);
    border-radius: 4px;
    padding: 10px 12px 8px 12px;
    flex: 1;
    min-width: 0;
    min-height: 140px;
    box-sizing: border-box;
    margin-top: 20px;
    margin-right: 6px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    overflow-y: auto;
}
.info-box-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    overflow-y: auto;
}
.info-box-stats p {
    margin: 0;
    line-height: 1em;
}
.info-box-stats hr {
    color: var(--helldiver-color);
}
.player-graph-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 4px;
    border-left: 1px solid rgba(255, 231, 16, 0.15);
    padding-left: 10px;
}
.player-graph-title {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--helldiver-color);
    opacity: 0.7;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
}
.player-graph-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: block;
}
.planet-modal-progress-bar {
    margin-top: auto;
    margin-bottom: 0;
    height: 2em;
    border-radius: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}
.planet-modal-progress-bar .progress-bar {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.planet-modal-progress-bar:has(+ .planet-modal-progress-bar) .progress-bar {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* ========================================
    7. UTILITIES, ANIMATIONS & MODIFIERS
    ========================================
*/
@keyframes pulse-danger {
    0% { box-shadow: 0 0 5px var(--automaton-color), 0 0 10px var(--automaton-color); }
    50% { box-shadow: 0 0 16px var(--automaton-color), 0 0 30px var(--automaton-color); }
    100% { box-shadow: 0 0 5px var(--automaton-color), 0 0 10px var(--automaton-color); }
}
@keyframes warPulse {
    0% { background-color: rgba(255, 0, 0, 0.2); box-shadow: 0 0 5px rgba(255, 0, 0, 0.2); }
    50% { background-color: rgba(255, 0, 0, 0.6); box-shadow: 0 0 15px rgba(255, 0, 0, 0.8); }
    100% { background-color: rgba(255, 0, 0, 0.2); box-shadow: 0 0 5px rgba(255, 0, 0, 0.2); }
}
.planetHealth.terminid-color { background-color: var(--terminid-color) !important; }
.planetHealth.automaton-color { background-color: var(--automaton-color) !important; }
.planetHealth.illuminate-color { background-color: var(--illuminate-color) !important; }
.planetHealth.seaf-color { background-color: var(--seaf-color) !important; color: #fff !important; }
.planetHealth.seaf-color-2 { background-color: var(--seaf-2-color) !important; color: #fff !important; }
.avatar-glow-seaf { box-shadow: 0 0 24px color-mix(in srgb, #3498db, transparent 60%); border: 2px solid #3498db; }
.avatar-glow-terminids { box-shadow: 0 0 24px color-mix(in srgb, #f39c12, transparent 60%); border: 2px solid #f39c12; }
.avatar-glow-automaton { box-shadow: 0 0 24px color-mix(in srgb, #e74c3c, transparent 60%); border: 2px solid #e74c3c; }
.avatar-glow-illuminate { box-shadow: 0 0 24px color-mix(in srgb, #9b59b6, transparent 60%); border: 2px solid #9b59b6; }
.helldiver-color { color: var(--helldiver-color) !important; }
.terminid-color { color: var(--terminid-color) !important; }
.automaton-color { color: var(--automaton-color) !important; }
.illuminate-color { color: var(--illuminate-color) !important; }
.seaf-color { color: var(--seaf-color) !important; }
.seaf-color-2 { color: var(--seaf-2-color) !important; }
.success-color { color: var(--success-color) !important; }
.text-super-earth { font-size: 1.1rem; font-weight: bold; text-shadow: 0 0 2px rgba(44, 130, 201, 0.4); color: #2c82c9; }
.text-terminids { font-size: 1.1rem; font-weight: bold; text-shadow: 0 0 2px rgba(230, 126, 34, 0.4); color: #e67e22; }
.text-automatons { font-size: 1.1rem; font-weight: bold; text-shadow: 0 0 2px rgba(207, 0, 15, 0.4); color: #cf000f; }
.text-illuminate { font-size: 1.1rem; font-weight: bold; text-shadow: 0 0 2px rgba(155, 89, 182, 0.4); color: #9b59b6; }
.contested-text-pulse { font-size: 1.1rem; font-weight: bold; border-radius: 8px; animation: warPulse 2s infinite ease-in-out; }
.filter-option-button { padding: 10px; flex-grow: 1; background: #222; color: #fff; border: 1px solid #ffe710; border-radius: 4px; }

/* ========================================
    7. BIOME BACKGROUND IMAGES
    ======================================== 
*/
.stat-card[data-biome="Acidic Badlands"] { background-image: url('/static/src/images/landscapes/Acidic_Badlands.png'); }
.stat-card[data-biome="Basic Swamp"] { background-image: url('/static/src/images/landscapes/Basic_Swamp.png'); }
.stat-card[data-biome="Black Hole"] { background-image: url('/static/src/images/landscapes/Black_Hole.png'); }
.stat-card[data-biome="Boneyard"] { background-image: url('/static/src/images/landscapes/Boneyard.png'); }
.stat-card[data-biome="Deadlands"] { background-image: url('/static/src/images/landscapes/Deadlands.png'); }
.stat-card[data-biome="Desert Cliffs"] { background-image: url('/static/src/images/landscapes/Desert_Cliffs.png'); }
.stat-card[data-biome="Desert Dunes"] { background-image: url('/static/src/images/landscapes/Desert_Dunes.png'); }
.stat-card[data-biome="Ethereal Jungle"] { background-image: url('/static/src/images/landscapes/Ethereal_Jungle.png'); }
.stat-card[data-biome="Haunted Swamp"] { background-image: url('/static/src/images/landscapes/Haunted_Swamp.png'); }
.stat-card[data-biome="Hive World"] { background-image: url('/static/src/images/landscapes/Hive_World.png'); }
.stat-card[data-biome="Icy Glaciers"] { background-image: url('/static/src/images/landscapes/Icy_Glaciers.png'); }
.stat-card[data-biome="Ionic Crimson"] { background-image: url('/static/src/images/landscapes/Ionic_Crimson.png'); }
.stat-card[data-biome="Ionic Jungle"] { background-image: url('/static/src/images/landscapes/Ionic_Jungle.png'); }
.stat-card[data-biome="Magma"] { background-image: url('/static/src/images/landscapes/Magma.jpg'); }
.stat-card[data-biome="Moon"] { background-image: url('/static/src/images/landscapes/Moon.png'); }
.stat-card[data-biome="Plains"] { background-image: url('/static/src/images/landscapes/Plains.png'); }
.stat-card[data-biome="Rocky Canyons"] { background-image: url('/static/src/images/landscapes/Rocky_Canyons.png'); }
.stat-card[data-biome="Scorched Moor"] { background-image: url('/static/src/images/landscapes/Scorched_Moor.png'); }
.stat-card[data-biome="Super Earth"] { background-image: url('/static/src/images/landscapes/Super_Earth.png'); }
.stat-card[data-biome="Supercolony"] { background-image: url('/static/src/images/landscapes/Supercolony.png'); }
.stat-card[data-biome="Tien Kwan"] { background-image: url('/static/src/images/landscapes/Tien_Kwan.png'); }
.stat-card[data-biome="Tundra"] { background-image: url('/static/src/images/landscapes/Tundra.png'); }
.stat-card[data-biome="Volcanic Jungle"] { background-image: url('/static/src/images/landscapes/Volcanic_Jungle.png'); }

/* ========================================
    8. MOBILE / RESPONSIVE OVERRIDES
    ======================================== 
*/




/* --- TABLETS & LARGE PHONES --- */
@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }
    .main-display {
        padding: 10px;
    }
    .content-area {
        padding: 10px;
    }
    .mo-card p {
        font-size: 1.2em;
    }
    .stats-layout h3 {
        font-size: 1.2em;
    }
    .stat-card {
        min-width: 100%;
        max-width: 100%;
    }

    #planet-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

}


@media (max-width: 480px) {
    .app-text {
        display: none;
    }
    .separator {
        display: none;
    }
    .top-row-container{
        grid-template-columns: 1fr;
    }
    .stats-layout {
        grid-template-columns: 1fr;
    }
    .planet-list-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .planet-list-info p {
        text-align: center;
    }
}