* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #111;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, 'Helvetica Neue', sans-serif;
}

/* === Monitor Bezel === */
#monitor {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    width: 100%;
    padding: 8px;
}

#bezel {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 50%, #1f1f1f 100%);
    border-radius: 28px;
    padding: 28px 32px 20px 32px;
    box-shadow:
        0 0 0 2px #555,
        0 0 0 4px #1a1a1a,
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 20px 60px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    max-width: 100%;
}

#power-led {
    position: absolute;
    top: 16px;
    left: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #33ff33;
    box-shadow: 0 0 6px #33ff33, 0 0 12px #33ff33;
}

#screen-container {
    background: #000;
    border-radius: 16px;
    padding: 12px;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.95),
        inset 0 0 4px rgba(0,50,0,0.3);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

#screen-reflection {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.03) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255,255,255,0.01) 100%
    );
    pointer-events: none;
}

#crt {
    display: block;
    border-radius: 8px;
    width: 100%;
    height: auto;
    max-width: 560px;
}

#bottom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

#rainbow-logo {
    height: 20px;
    width: auto;
    opacity: 0.9;
}

#model-text {
    color: #777;
    font-size: 13px;
    letter-spacing: 3px;
    font-weight: 300;
}

/* === Toolbar === */
#toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

#toolbar button {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #aaa;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-family: -apple-system, 'Helvetica Neue', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s;
}

#toolbar button:hover {
    background: #3a3a3a;
    color: #ddd;
    border-color: #666;
}

#toolbar button:active {
    background: #222;
    transform: scale(0.97);
}

#btn-reset {
    border-color: #663333;
    color: #cc8888;
}

#btn-reset:hover {
    background: #3a2020;
    border-color: #884444;
    color: #ffaaaa;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    min-width: 200px;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.6);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 4px;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #333;
    color: #ccc;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}

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

.dropdown-content button:hover {
    background: #3a3a3a;
    color: #33ff33;
}

/* === Hidden input for mobile keyboard === */
#mobile-input {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* === About Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    margin: auto;
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    background: #1a1a1a;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    padding: 4px 8px;
    margin: -16px -16px 0 0;
    border-radius: 8px;
}

.modal-close:hover {
    color: #fff;
}

#about-logo {
    width: 120px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.modal-content h1 {
    color: #eee;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.modal-content .version {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
}

.modal-content .tagline {
    color: #999;
    font-size: 13px;
    margin-bottom: 16px;
    font-style: italic;
}

.modal-content hr {
    border: none;
    border-top: 1px solid #333;
    margin: 16px 0;
}

.modal-content .specs {
    text-align: left;
    padding: 0 16px;
}

.modal-content .specs p {
    color: #aaa;
    font-size: 12px;
    margin: 4px 0;
    font-family: 'Courier New', monospace;
}

.modal-content .specs strong {
    color: #33ff33;
}

.modal-content .credits {
    color: #777;
    font-size: 11px;
    line-height: 1.6;
}

#about-rainbow {
    width: 32px;
    margin-top: 16px;
    opacity: 0.8;
}

/* === Responsive === */
@media (max-width: 620px) {
    #bezel {
        border-radius: 16px;
        padding: 16px 12px 12px 12px;
    }

    #screen-container {
        border-radius: 10px;
        padding: 6px;
    }

    #power-led {
        top: 10px;
        left: 14px;
        width: 6px;
        height: 6px;
    }

    #bottom-bar {
        gap: 6px;
    }

    #rainbow-logo {
        height: 14px;
    }

    #model-text {
        font-size: 10px;
        letter-spacing: 2px;
    }

    #toolbar button {
        padding: 5px 10px;
        font-size: 10px;
    }

    .modal {
        padding: 12px;
        align-items: flex-start;
    }

    .modal-content {
        padding: 20px;
        max-height: 85vh;
        margin-top: 20px;
        border-radius: 12px;
    }

    .modal-close {
        font-size: 28px;
        padding: 8px 12px;
        margin: -12px -12px 0 0;
    }

    #about-logo {
        width: 80px;
    }
}
