:root {
    --bg-primary: #ffffff;
    --bg-secondary: #000000;
    --bg-image: url('/images/Background.png');
    
    --text-primary: #ffffff;
    --text-secondary: #000000;
    --title-bg: #000000;
    --title-text: #ffffff;
    --text-accent: #72C9FF;
    --text-shadow: rgba(42, 164, 240, 0.4);
    --border-color: #000000;
    --border-color-secondary: #ffffff;
    --button-bg: #72C9FF;
    --button-bg-secondary: #000000;
    --button-text: #ffffff;
    --button-hover: #2AA4F0;
    --button-hover-secondary: #22263f;
    --header-bg: #2AA4F0;
    --intro-bg: #F6FAFC;
    --intro-text: #000000;
    
    --datasource-bg: #ffffff;
    --datasource-text: #000000;
    --datasource-icon-bg: #000000;
    --datasource-icon-color: #ffffff;
}

body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-image: url('/images/BackgroundALT.png');
    
    --text-primary: #ffffff;
    --text-secondary: #000000;
    --title-bg: #ffffff;
    --title-text: #000000;
    --text-accent: #D8263E;
    --text-shadow: rgba(147, 28, 44, 0.4);
    --border-color: #ffffff;
    --border-color-secondary: #ffffff;
    --button-bg: #D8263E;
    --button-bg-secondary: #000000;
    --button-text: #000000;
    --button-text-secondary: #ffffff;
    --button-hover: #931C2C;
    --button-hover-secondary: #ADB5DF;
    --header-bg: #D8263E;
    --intro-bg: #00142D;
    --intro-text: #ffffff;
    
    --datasource-bg: #ffffff;
    --datasource-text: #000000;
    --datasource-icon-bg: #000000;
    --datasource-icon-color: #ffffff;
}

.material-symbols-sharp {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24
}

.flicker {
    animation: flicker 1s steps(2) infinite;
}

@keyframes flicker {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'VT323', monospace;
    overflow: hidden;
    position: relative;
    transition: background-color 0.5s ease, color 0.5s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: 150%;
    background-position: center;
    filter: blur(4.5px);
    z-index: -1;
    transition: background-image 0.5s ease;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    height: 100vh;
    width: 100%;
    padding: 40px 40px 40px 40px;
    box-sizing: border-box;
}

.right-side {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.welcome-header {
    width: 65%;
    margin-bottom: 20px;
}

.header-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
}

.uhhh {
    font-family: 'Silkscreen', normal;
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    letter-spacing: 2px;
    text-shadow:
                -2px -2px 0 var(--text-secondary),
                2px -2px 0 var(--text-secondary),
                -2px 2px 0 var(--text-secondary),
                2px 2px 0 var(--text-secondary),
                -2px 0px 0 var(--text-secondary),
                2px 0px 0 var(--text-secondary),
                0px -2px 0 var(--text-secondary),
                0px 2px 0 var(--text-secondary);
}

.logo-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.title {
    font-family: 'VT323', monospace;
    font-size: 5.5rem;
    font-weight: 400;
    background: var(--title-bg);
    color: var(--title-text);
    margin: 0;
    letter-spacing: 3px;
    padding: 0 15px;
}

.header-logo {
    height: 115px;
    width: auto;
    margin-left: 5px;
}

.header-divider-image {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin: 4px 0 0 0;
}

.divider-svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.intro-section {
    width: 650px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}

.intro-box {
    width: 100%;
    border: 2px solid var(--border-color-secondary);
    box-shadow: 0 0 5px var(--text-shadow);
    padding: 20px 20px 14px 20px;
    border-radius: 0px;
    position: relative;
    background: transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.intro-box h3 {
    position: absolute;
    top: -17px;
    right: -7%;
    transform: translateX(-50%);
    background: var(--intro-bg);
    padding: 0 12px;
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 0;
    font-family: 'VT323', monospace;
    text-shadow:
        0 0 5px var(--text-shadow),
        -0.5px -0.5px 0 var(--text-accent),
        0.5px -0.5px 0 var(--text-accent),
        -0.5px 0.5px 0 var(--text-accent),
        0.5px 0.5px 0 var(--text-accent);
    transition: color 0.3s ease, background 0.3s ease;
}

.intro-content {
    margin-top: 4px;
}

.intro-content p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--intro-text);
    margin: 0 0 12px 0;
    text-align: justify;
    font-family: 'VT323', monospace;
    transition: color 0.3s ease;
}

.species-count {
    margin-top: 12px;
    color: var(--text-primary);
    text-shadow: 0 0 8px var(--text-shadow), 0 0 2px var(--text-shadow);
}

.count-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-accent);
    letter-spacing: 0.5px;
}

.intro-content p:last-of-type {
    margin-bottom: 16px;
}

.intro-content strong {
    color: var(--text-accent);
    font-weight: 400;
}

.enter-wrapper {
    width: 65%;
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    padding-left: 0;
}

.enter-btn {
    display: inline-block;
    padding: 8px 24px;
    border: 2px solid var(--border-color-secondary);
    background: var(--button-bg);
    color: var(--button-text);
    font-family: 'VT323', monospace;
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    position: relative;
}

.enter-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px solid var(--border-color-secondary);
    pointer-events: none;
    transition: border-color 0.2s;
}

.enter-btn:hover {
    background: var(--button-hover);
}

.enter-btn:hover::before {
    border-color: #ffffff;
}

.left-side {
    position: fixed;
    bottom: 80px;
    left: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    z-index: 100;
}

.readme-header {
    margin-bottom: 2px;
}

.readme-title {
    font-family: 'Silkscreen', normal;
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 2px;
    text-shadow:
                -2px -2px 0 var(--text-secondary),
                2px -2px 0 var(--text-secondary),
                -2px 2px 0 var(--text-secondary),
                2px 2px 0 var(--text-secondary),
                -2px 0px 0 var(--text-secondary),
                2px 0px 0 var(--text-secondary),
                0px -2px 0 var(--text-secondary),
                0px 2px 0 var(--text-secondary);
}

.readme-divider-image {
    width: 340px;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 4px;
}

.readme-divider-svg {
    max-width: 100%;
    height: auto;
    display: block;
}

#about-panel {
    width: 340px;
    max-width: 340px;
    max-height: 368px;
    background: var(--button-bg-secondary);
    backdrop-filter: blur(12px);
    border: 2px solid var(--border-color);
    border-radius: 0px;
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out, 
                min-height 0.35s ease-in-out,
                border-color 0.3s ease, 
                background 0.3s ease;
}

#about-panel .window-content {
    padding: 10px 14px 14px 14px;
    overflow-y: auto;
    flex: 1;
    max-height: 320px;
    background: var(--bg-secondary);
    transition: max-height 0.35s ease-in-out, 
                padding 0.35s ease-in-out,
                opacity 0.25s ease-in-out;
    opacity: 1;
}

#about-panel .about-content p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    margin: 0 0 10px 0;
    text-align: justify;
}

#about-panel .about-content p:last-child {
    margin-bottom: 0;
}

#about-panel .about-content strong {
    color: var(--text-accent);
    font-weight: 700;
    font-size: 17px;
}

#patch-panel {
    width: 340px;
    max-width: 340px;
    max-height: 368px;
    background: var(--button-bg-secondary);
    backdrop-filter: blur(12px);
    border: 2px solid var(--border-color);
    border-radius: 0px;
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out, 
                min-height 0.35s ease-in-out,
                border-color 0.3s ease, 
                background 0.3s ease;
}

#patch-panel .window-content {
    padding: 10px 14px 14px 14px;
    overflow-y: auto;
    flex: 1;
    max-height: 320px;
    background: var(--bg-secondary);
    transition: max-height 0.35s ease-in-out, 
                padding 0.35s ease-in-out,
                opacity 0.25s ease-in-out;
    opacity: 1;
}

#about-panel .window-title-bar,
#patch-panel .window-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--header-bg);
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
    min-height: 28px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

#about-panel .window-title-left,
#patch-panel .window-title-left {
    display: flex;
    align-items: center;
    gap: 3px;
}

#about-panel .window-title,
#patch-panel .window-title {
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    font-family: 'VT323', monospace;
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s ease, background 0.3s ease;
}

#about-panel .window-controls,
#patch-panel .window-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

#about-panel .window-btn,
#patch-panel .window-btn {
    background: none;
    border: none;
    background: var(--bg-secondary);
    cursor: pointer;
    padding: 2px 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#about-panel .window-btn .material-symbols-sharp,
#patch-panel .window-btn .material-symbols-sharp {
    font-size: 17px;
    color: var(--text-primary);
}

#about-panel.minimized,
#patch-panel.minimized {
    max-height: 36px;
    min-height: 36px;
    width: 340px;
    min-width: 340px;
    cursor: pointer;
}

#about-panel.minimized .window-content,
#patch-panel.minimized .window-content {
    max-height: 0;
    padding: 0 14px;
    overflow: hidden;
    opacity: 0;
}

#about-panel.minimized .window-title,
#patch-panel.minimized .window-title {
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#about-panel .window-content::-webkit-scrollbar,
#patch-panel .window-content::-webkit-scrollbar {
    width: 5px;
}

#about-panel .window-content::-webkit-scrollbar-track,
#patch-panel .window-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 2px;
}

#about-panel .window-content::-webkit-scrollbar-thumb,
#patch-panel .window-content::-webkit-scrollbar-thumb {
    background: var(--text-primary);
    border-radius: 2px;
}

#patch-panel .patch-section {
    margin-bottom: 12px;
}

#patch-panel .patch-section:last-child {
    margin-bottom: 0;
}

#patch-panel .patch-section h3 {
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    padding-bottom: 4px;
    text-transform: uppercase;
    font-family: 'VT323', monospace;
    transition: color 0.3s ease, border-color 0.3s ease;
}

#patch-panel .patch-section ul {
    margin: 0;
    padding: 0;
    padding-left: 0;
    list-style: none;
}

#patch-panel .patch-section ul li {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    padding: 2px 0;
    padding-left: 0;
    transition: color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 40px;
    background: var(--button-bg-secondary);
    color: var(--button-text-secondary);
    border: 2px solid var(--border-color-secondary);
    padding: 8px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    width: 44px;
    height: 44px;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px solid var(--border-color-secondary);
    pointer-events: none;
}

.theme-toggle:hover {
    background: var(--button-hover-secondary);
}

.theme-toggle .material-symbols-sharp {
    font-size: 24px;
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .intro-box {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .welcome-container {
        padding: 20px;
        justify-content: flex-start;
        padding-top: 40px;
        align-items: center;
    }

    .welcome-header {
        width: 100%;
    }

    .uhhh {
        font-size: 2rem;
    }

    .title {
        font-size: 3rem;
    }

    .header-logo {
        height: 60px;
    }

    .intro-box {
        width: 100%;
    }

    .intro-content p {
        font-size: 14px;
    }

    .intro-box h3 {
        font-size: 18px;
        top: -12px;
    }

    .left-side {
        bottom: 80px;
        left: 20px;
    }

    #about-panel,
    #patch-panel {
        width: 280px;
        max-width: 280px;
    }

    .readme-divider-image {
        width: 280px;
    }

    .theme-toggle {
        left: 20px;
        bottom: 80px;
    }

    .divider-svg {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .uhhh {
        font-size: 1.5rem;
    }

    .title {
        font-size: 2rem;
    }

    .header-logo {
        height: 40px;
    }

    .intro-box h3 {
        font-size: 16px;
        top: -10px;
    }

    .intro-content p {
        font-size: 13px;
    }

    .left-side {
        bottom: 80px;
        left: 10px;
    }

    #about-panel,
    #patch-panel {
        width: 240px;
        max-width: 240px;
    }

    .readme-divider-image {
        width: 240px;
    }

    #about-panel .window-content,
    #patch-panel .window-content {
        padding: 8px 10px 10px 10px;
    }

    #about-panel .about-content p,
    #patch-panel .patch-section ul li {
        font-size: 12px;
    }

    .enter-btn {
        font-size: 16px;
        padding: 6px 18px;
    }

    .divider-svg {
        max-width: 60%;
    }
}