/*==================
BASE
===================*/

* {
    box-sizing: border-box;
}

:root {
    --crt-scanline-alpha: 0.2;
    --crt-noise-opacity: 0.05;
    --icon-shadow-opacity: 0.3;
    --crt-vignette-opacity: 0.6;
    --crt-flicker-animation: none;
    --text-glow-alpha: 0.5;
}

html, body{
    margin:0;
    padding:0;
    height: 100%;
}
body {
    font-family: ui-monospace, monospace;
    background-color: #000000;
    color: #E87F24;

    display: flex;
    flex-direction: column;

    background-image: image-set(
        url("../media/wallpaper.webp") type("image/webp"),
        url("../media/wallpaper.jpg") type("image/jpeg")
    );
    background-size: cover;
    background-position: center;
    min-height: 0;
}

/*==================
TIPO GRAFIA
===================*/

h1, h2, h3, h4, h5, h6 {
    color: #FAF3E1;
}

/*==================
LAYOUT PRINCIPAL
===================*/

.main{
    min-height: 0;
    flex:1;
    display: flex;
    flex-direction: column;

    min-height: 0;
}

#loader{
    position: fixed;
    inset: 0;

    background: #000000;

    display: flex;
    flex-direction: column;

    z-index: 9999;
}

#terminal{
    white-space: pre;
    font-size:18px;
}

.ok{
    color: #00ff88;
}

/*==================
ICONS
===================*/

.icons{
    margin-top:30px;
    margin-left: 10px;

    display: flex;
    flex-direction: column;
    
    flex-wrap: wrap;
    width: fit-content;
    
    flex:1;
    min-height: 0;
}

.icon{
    width: 80px;

    display: flex;
    flex-direction: column;
    align-items: center;

    cursor: pointer;
}
.icon a{
    display: flex;
    flex-direction: column;
    align-items: center;

    text-decoration: none;
}
.icon img{
    width: 64px;
    height: 64px;
    object-fit: contain;

    filter: drop-shadow(0 0px 4px rgba(0,0,0,var(--icon-shadow-opacity)));
}

.icon p{
    width: 80px;
    text-align: center;

    overflow-wrap: break-word;

    color: #ffffff;
    
    text-shadow: 2px 2px 4px black;
}

/*==================
EFEITOS
===================*/

.crt-overlay {
    position: fixed;
    inset: 0;

    pointer-events: none;
    z-index: 99999;

    will-change: opacity;
    animation: var(--crt-flicker-animation, none);

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(0,0,0,var(--crt-scanline-alpha)),
            rgba(0,0,0,var(--crt-scanline-alpha)) 1px,
            transparent 1px,
            transparent 3px
        );

    opacity: 0.85;
}

.crt-overlay::before {
    content: "";
    position: absolute;
    inset: 0;

    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0,0,0,var(--crt-vignette-opacity, 0.6)) 100%
    );
}

.crt-overlay::after {
    content: "";
    position: absolute;
    inset: 0;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");

    opacity: var(--crt-noise-opacity);
    animation: noise 2s infinite;
    background-size: 100px 100px;
}

/*==================
ANIMAÇÕES
===================*/

@keyframes noise {
    0% { transform: translate(0,0); }
    10% { transform: translate(-1px,1px); }
    20% { transform: translate(1px,-1px); }
    30% { transform: translate(-1px,-1px); }
    40% { transform: translate(1px,1px); }
    50% { transform: translate(0,0); }
}

@keyframes flicker-low {
    0% { opacity: 0.65; }
    50% { opacity: 0.7; }
    100% { opacity: 0.65; }
}

@keyframes flicker-high {
    0% { opacity: 0.9; }
    50% { opacity: 1; }
    100% { opacity: 0.9; }
}


/*==================
FOOTER
===================*/

footer{
    background-color: #0000ff;
    
    box-shadow:
        inset 0 10px 8px 0px rgba(69, 80, 196, 0.6),
        inset 15px 10px 20px 10px #221e96;

    display: flex;
    justify-content: space-between;
    align-items: stretch;
}

footer .start{
    cursor: pointer;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 10px;

    color:#ffffff;
    background-color: #7dc343;

    text-decoration: none;

    width: fit-content;

    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;

    box-shadow: 
        inset 0 10px 8px 0px rgba(83, 174, 92, 0.6),
        inset -15px 10px 20px 10px rgb(36, 124, 45);
}
footer p{
    text-shadow: 2px 2px 4px black;
}
footer img{
    height: 24px;
    filter: drop-shadow(0 0px 4px rgba(0,0,0,0.6));
}

/*==================
GEAR / SETTINGS
===================*/

.gear{
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 10px;
}
.gear img{
    height: 32px;
    filter: drop-shadow(0 0px 4px rgba(0,0,0,0.6));
    transition: transform 0.2s;
}
.gear:hover img{
    transform: rotate(30deg);
}

.settings-group{
    margin-bottom: 16px;
}
.settings-group:last-child{
    margin-bottom: 0;
}
.settings-options{
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.settings-options button{
    flex: 1;
    padding: 8px;
    background: #555;
    color: #FAF3E1;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}
.settings-options button:hover{
    background: #666;
}
.settings-options button.active{
    background: #E87F24;
    color: #000;
}
.settings-status{
    color: #aaa;
    font-size: 12px;
    margin-top: 8px;
}

/*==================
FAKE WINDOW
===================*/

.window{
    width: min(500px, 90vw);
    height: min(400px, 80vh);

    position: absolute;

    border: 1px solid #555;
    border-left: 4px solid #E87F24;
    background: #222;

    box-shadow:
        10px 10px 0 rgba(0, 0, 255, 0.45),
        0 0 32px rgba(0, 255, 255, 0.12);

    display: flex;
    flex-direction: column;
    will-change: transform;
}

.window a{
    color: #00ffff;
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s;
}

.window a:hover,
.window a:focus-visible {
    color: #FAF3E1;
    background: rgba(0, 255, 255, 0.12);
}

.titlebar{
    height: 36px;

    background-color: #0000ff;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 8px 0 12px;

    cursor: move;

    touch-action: none;
    user-select: none;
}
.buttons{
    display: flex;
    gap: 4px;
}
.buttons button{
    width: 24px;
    height: 24px;
    border: 1px solid #a9a9a9;
    background-color: #dcdcdc;
    color: #111;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s;
}
.buttons button:hover{
    background-color: #FAF3E1;
}
.buttons button:last-child:hover{
    background-color: #E87F24;
    color: #000;
}

.content{
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.07), transparent 46%), #222;
    color: #e0e0e0;
}

.content h2,
.content h3 {
    color: #FAF3E1;
    margin-top: 0;
}

.content h2::before {
    content: "> ";
    color: #E87F24;
}

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

.content::-webkit-scrollbar {
    width: 10px;
}

.content::-webkit-scrollbar-thumb {
    background: #555;
    border: 2px solid #222;
}

.start-section {
    margin-bottom: 16px;
}
.start-section:last-child {
    margin-bottom: 0;
}
.start-heading {
    color: #E87F24;
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.start-link {
    display: block;
    color: #00ffff;
    text-decoration: none;
    padding: 4px 8px;
    margin: 2px 0;
    font-size: 13px;
    border-left: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.start-link:hover {
    background: rgba(0,255,255,0.12);
    border-left-color: #E87F24;
}

.hidden{
    display: none;
}

/*==================
SCROLLBAR
===================*/

* {
    scrollbar-width: thin;
    scrollbar-color: #00ffff rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
    background-color: #ff6d1f;
}
