:root {
    --bg-color: #5f9ea0;
    --box-border: #000000;
    --box-side: #808080;
    --box-face: #dddddd;
    --box-highlight: #ffffff;
    --text-color: #000000;
    --font-main: 'Courier New', Courier, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: var(--font-main);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.layout-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    max-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.box-button {
  cursor: pointer;
  border: 4px solid var(--box-border);
  background-color: var(--box-side);
  padding-bottom: 10px;
  transition: 0.1s ease-in-out;
  user-select: none;
  display: inline-block; 
}

.button {
  background-color: var(--box-face);
  border: 4px solid var(--box-highlight);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.button span {
  font-size: 1.2em;
  letter-spacing: 1px;
  font-weight: bold;
  text-transform: uppercase;
}

.box-button:active {
  padding-bottom: 0;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 10px;
  transform: translateY(10px);
}

.box-static {
    border: 4px solid var(--box-border);
    background-color: var(--box-side);
    padding-bottom: 10px;
    width: 100%;
}

.box-static.hidden {
    display: none;
}

.content-frame {
    background-color: var(--box-face);
    border: 4px solid var(--box-highlight);
    padding: 20px;
    height: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
}

.logo-box {
    width: auto;
    display: inline-block;
}

.logo-box .content-frame {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
}

.logo-box h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.icon-floppy {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.status-indicators {
    display: flex;
    gap: 10px;
    padding-bottom: 10px;
}

.led {
    width: 15px;
    height: 15px;
    background-color: #333;
    border: 2px solid #000;
    border-radius: 50%;
}

.led.on {
    background-color: #ff3333;
    box-shadow: 0 0 5px #ff0000;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.main-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.nav-item .button {
    height: 100%;
}

.main-body-container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    gap: 15px;
    position: relative;
    padding-right: 5px;
}

main {
    flex-grow: 1;
    overflow-y: scroll;
    padding-right: 10px;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

main::-webkit-scrollbar { 
    display: none;
}

.custom-scrollbar-container {
    width: 32px;
    height: 100%;
    background-color: var(--box-side);
    border: 4px solid var(--box-border);
    padding: 0;
    flex-shrink: 0;
    position: relative;
}

.custom-scrollbar-track {
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(0,0,0,0.2) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.2)), 
        linear-gradient(45deg, rgba(0,0,0,0.2) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.2));
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;
    position: relative;
}

.custom-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 50px;
    cursor: grab;
    z-index: 10;
    margin: 0 !important;
    display: block !important;
    transition: height 0.1s, transform 0.1s, padding 0.1s !important; 
}

.custom-scrollbar-thumb:active {
    cursor: grabbing;
    transform: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.custom-scrollbar-thumb .button {
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grip-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 60%;
}

.grip-lines span {
    display: block;
    height: 2px;
    background-color: #999;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #555;
    width: 100%;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10000;
    background: 
        linear-gradient(
            rgba(18, 16, 16, 0) 50%, 
            rgba(0, 0, 0, 0.02) 50%
        ),
        repeating-radial-gradient(
            rgba(0,0,0,0) 0 0.0001%,
            rgba(0,0,0,0.02) 0 0.0002%
        );
    background-size: 100% 2px, 100% 100%;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.05);
    mix-blend-mode: multiply;
    opacity: 1;
    animation: flicker-crt 5s infinite;
}

@keyframes flicker-crt {
    0% { opacity: 1; }
    50% { opacity: 0.97; }
    100% { opacity: 1; }
}

.screen-section {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: flicker 0.2s ease-in-out;
}

.screen-section.active {
    display: flex;
}

@keyframes flicker {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

h2, h3 {
    margin-top: 0;
    text-transform: uppercase;
    border-bottom: 2px solid black;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.divider {
    height: 4px;
    background-color: black;
    border-bottom: 2px solid white;
    margin-bottom: 15px;
    display: none;
}

.widgets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#clock {
    font-size: 2rem;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    border: 2px solid black;
    padding: 2px;
    margin: 10px 0;
}

.progress-bar {
    width: 70%;
    height: 100%;
    background-color: black;
    background-image: repeating-linear-gradient(
        45deg,
        black,
        black 5px,
        #333 5px,
        #333 10px
    );
}

.stats-list {
    list-style: none;
    padding: 0;
    width: 100%;
}
.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed black;
}
.stats-list li:last-child {
    border-bottom: none;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card .project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid black;
    margin-bottom: 10px;
    padding-bottom: 5px;
}
.project-card h3 {
    margin: 0;
    border: none;
    padding: 0;
}
.badge {
    background: black;
    color: white;
    padding: 2px 5px;
    font-size: 0.8em;
}

.grid-buttons {
    display: flex;
    gap: 10px;
}

.small {
    flex: 0 0 auto;
}

.small .button {
    padding: 5px 10px;
}

.small .button span {
    font-size: 0.9em;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px dotted black;
    padding-bottom: 5px;
}

.toggle-switch {
    background: black;
    color: white;
    padding: 2px 5px;
    font-size: 0.8em;
    cursor: pointer;
}

.toggle-switch.active {
    background: #ff3333;
}

.tag {
    background-color: black;
    color: #00ff00;
    padding: 5px 10px;
    font-weight: bold;
    display: inline-block;
}

.project-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-dropdown {
    position: relative;
    width: 200px;
    display: flex;
    flex-direction: column;
    min-height: 54px;
}

.dropdown-selected {
    width: 100%;
    margin-bottom: 0;
}

.dropdown-selected .button {
    justify-content: space-between;
}

.dropdown-selected .button::after {
    content: '▼';
    font-size: 0.8em;
    margin-left: 10px;
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 100;
    margin-top: 5px;
    padding-bottom: 0;
}

.dropdown-options.hidden {
    display: none;
}

.dropdown-option {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid black;
    background: var(--box-face);
    color: black;
    font-weight: bold;
}

.dropdown-option:hover {
    background: var(--box-highlight);
}

.dropdown-option:last-child {
    border-bottom: none;
}

footer p, footer .scrolling-text {
    margin: 0;
    font-family: var(--font-main);
    font-weight: bold;
    text-align: center;
}

.retro-separator {
    height: 2px;
    background-color: white;
    border: none;
    margin: 30px 0;
    width: 100%;
}

@media (max-width: 600px) {
    .widgets-grid {
        grid-template-columns: 1fr;
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .status-indicators {
        margin-top: 10px;
        align-self: flex-end;
    }
    
    .main-nav {
        gap: 10px;
    }
    
    .nav-item {
        min-width: 45%;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    max-width: 350px;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.5);
    animation: popup 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-box.large {
    max-width: 90vw;
    width: 900px;
    height: 80vh;
}

.modal-box.large .content-frame {
    display: flex;
    flex-direction: column;
}

.iframe-wrapper {
    flex-grow: 1;
    width: 100%;
    border: 2px solid black;
    background: #000;
}

@keyframes popup {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}