/* Base styles - extracted from inline index.html */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--ui-navy-1) 0%, var(--ui-navy-2) 100%);
    color: var(--p-eeeeee);
    height: 100vh;
    overflow: hidden;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--ui-teal) 0%, var(--p-3ba89f) 100%);
    border-radius: 5px;
    border: 2px solid rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--p-5fd9d0) 0%, var(--ui-teal) 100%);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--p-3ba89f) 0%, var(--p-2d8a82) 100%);
}

::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.05);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--ui-teal) rgba(255, 255, 255, 0.05);
}

/* Dark-themed select / option elements */
select {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--p-eeeeee);
    border: 2px solid rgba(78, 205, 196, 0.4);
    border-radius: 6px;
    padding: 8px 32px 8px 12px;
    min-width: 180px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234ecdc4' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:hover {
    border-color: var(--ui-teal);
}

select:focus {
    outline: none;
    border-color: var(--ui-teal);
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.3);
}

select option {
    background: var(--ui-navy-1);
    color: var(--p-eeeeee);
    padding: 8px 12px;
}

select option:checked {
    background: rgba(78, 205, 196, 0.25);
}

/* Dark-themed checkboxes */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(78, 205, 196, 0.4);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
}

input[type="checkbox"]:hover {
    border-color: var(--ui-teal);
}

input[type="checkbox"]:checked {
    background: rgba(78, 205, 196, 0.3);
    border-color: var(--ui-teal);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid var(--ui-teal);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.container {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    overflow-y: auto;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ui-navy-1) 0%, var(--ui-navy-2) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    max-height: 100%;
    max-width: 100%;
    overflow-y: auto;
}

#loadingDiagnostics {
    width: min(640px, 85vw);
    margin: 16px auto;
    text-align: left;
    font-size: 13px;
    color: #eee;
}

#loadingDiagnosticText {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 180px;
    margin: 8px 0;
    padding: 10px;
    border: 1px solid #b99a60;
    border-radius: 6px;
    background: #111817;
    color: #eee;
    font: 12px monospace;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    user-select: text;
}

#loadingCopyStatus {
    min-height: 1.5em;
    margin: 6px 0;
}

.loading-title {
    color: var(--ui-gold);
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(78, 205, 196, 0.3);
    border-top: 4px solid var(--ui-teal);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loadingProgress {
    width: min(360px, 80vw);
    height: 14px;
    margin: 24px auto 8px;
    overflow: hidden;
    border: 1px solid #b99a60;
    border-radius: 8px;
    background: #18211f;
}

.loading-screen {
    z-index: 2147483647;
}

#loadingProgressFill {
    width: 0;
    height: 100%;
    background: #c6a66b;
}

#loadingProgressText {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

#loadingProgressDetail {
    max-width: min(480px, 85vw);
    min-height: 3em;
    overflow-wrap: anywhere;
    font-size: 12px;
    opacity: 0.8;
}

.loading-text {
    color: var(--ui-teal);
    font-size: 1.2em;
    font-family: 'Courier New', monospace;
}

h1 {
    text-align: center;
    color: var(--ui-gold);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.lifespan-container {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid var(--ui-danger);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.lifespan {
    font-size: 1.5em;
    color: var(--ui-danger);
    font-weight: bold;
}

.speed-control {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.speed-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.speed-btn {
    padding: 10px 20px;
    border: 2px solid var(--ui-teal);
    background: rgba(78, 205, 196, 0.2);
    color: var(--ui-teal);
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.speed-btn:hover {
    background: rgba(78, 205, 196, 0.4);
    transform: translateY(-2px);
}

.speed-btn.active {
    background: var(--ui-teal);
    color: var(--ui-navy-1);
}

.speed-controls-fixed.battle-locked .speed-btn:not(#pauseBtn) {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Main layout with sidebar */
.main-layout {
    display: flex;
    gap: 20px;
}

.main-content {
    flex: 1;
    overflow-y: visible;
    min-width: 0;
}
