* {
    box-sizing: border-box;
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    user-select: none;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #008080;
    color: #000;
}

/* =========================================================
   DESKTOP
========================================================= */

.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(255,255,255,.08),
            transparent 45%
        ),
        #008080;
}

/* =========================================================
   MAIN WINDOW
========================================================= */

.window {
    position: relative;
    background: #c0c0c0;

    border: 2px solid;
    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    box-shadow:
        2px 2px 0 #000,
        5px 5px 12px rgba(0,0,0,.25);

    margin: 10px;

    display: flex;
    flex-direction: column;

    height: calc(100vh - 50px);

    min-height: 300px;

    overflow: hidden;
}

/* =========================================================
   TITLE BAR
========================================================= */

.title-bar {
    min-height: 25px;

    background:
        linear-gradient(
            90deg,
            #000080 0%,
            #0000a8 45%,
            #1084d0 100%
        );

    padding: 3px 5px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    color: #fff;

    font-size: 12px;
    font-weight: bold;

    box-shadow:
        inset 0 1px rgba(255,255,255,.25);

    flex-shrink: 0;
}

.title-bar-text {
    display: flex;
    align-items: center;
    gap: 5px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.title-bar-controls button {
    width: 18px;
    height: 16px;

    padding: 0;

    background: #c0c0c0;

    border: 1px solid;
    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    font-size: 10px;
    font-weight: bold;

    line-height: 12px;

    cursor: pointer;
}

.title-bar-controls button:hover {
    background: #d4d4d4;
}

.title-bar-controls button:active {
    border-color:
        #404040
        #ffffff
        #ffffff
        #404040;

    padding-top: 1px;
}

/* =========================================================
   HEADER
========================================================= */

.window-header {
    background: #c0c0c0;

    padding: 7px 12px;

    border-bottom: 2px solid #808080;

    box-shadow:
        inset 0 -1px #ffffff;

    flex-shrink: 0;
}

.window-header h1 {
    margin: 0;

    font-size: 18px;
    line-height: 20px;

    color: #000;

    text-shadow:
        1px 1px #fff;
}

.status-sub {
    font-size: 11px;

    margin: 3px 0 0;

    font-weight: bold;

    color: #333;
}

.status-sub .active {
    color: #008000;

    text-shadow:
        0 0 3px rgba(0,180,0,.25);
}

/* =========================================================
   WORKSPACE
========================================================= */

.app-workspace {
    display: flex;

    flex: 1;

    min-height: 0;

    padding: 6px;

    gap: 6px;

    overflow: hidden;
}

/* =========================================================
   VIEWPORT
========================================================= */

.viewport-container {
    flex: 1;

    min-width: 0;
    min-height: 0;

    position: relative;

    background:
        radial-gradient(
            circle at center,
            #06100b 0%,
            #000 70%
        );

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 2px solid;
    border-color:
        #808080
        #ffffff
        #ffffff
        #808080;

    box-shadow:
        inset 0 0 20px rgba(0,0,0,.9);
}

.viewport-titlebar {
    position: relative;

    z-index: 20;

    flex-shrink: 0;

    background:
        linear-gradient(
            90deg,
            #000080,
            #0000a0
        );

    color: #fff;

    font-size: 11px;

    padding: 4px 7px;

    min-height: 22px;

    border-bottom: 1px solid #555;

    text-shadow:
        1px 1px #000;
}

#canvas-container {
    position: relative;

    width: 100%;
    height: 100%;

    flex: 1;

    min-height: 0;

    overflow: hidden;

    background: #000;

    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

#canvas-container canvas {
    display: block;

    width: 100%;
    height: 100%;
}

/* =========================================================
   FLOATING WINDOWS
========================================================= */

.floating-panel {
    position: absolute;

    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    width: 210px;

    font-size: 11px;

    z-index: 30;

    box-shadow:
        3px 3px 8px rgba(0,0,0,.5);

    overflow: hidden;
}

.prop-panel {
    top: 25px;
    left: 15px;
}

.mesh-panel {
    bottom: 15px;
    left: 15px;
}

.panel-header {
    background:
        linear-gradient(
            90deg,
            #000080,
            #1084d0
        );

    color: white;

    padding: 3px 5px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    font-weight: bold;

    min-height: 19px;
}

.drag-handle {
    cursor: move;
}

.panel-close {
    width: 14px;
    height: 14px;

    padding: 0;

    background: #c0c0c0;

    border: 1px solid;
    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    font-size: 9px;

    line-height: 9px;

    cursor: pointer;
}

.panel-close:hover {
    background: #d8d8d8;
}

.panel-close:active {
    border-color:
        #404040
        #ffffff
        #ffffff
        #404040;
}

/* =========================================================
   PANEL CONTENT
========================================================= */

.panel-body {
    padding: 6px;
}

.panel-body label {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-top: 4px;

    color: #000;
}

.panel-body label span {
    font-family: "Courier New", monospace;

    color: #000080;

    font-weight: bold;
}

.panel-body input[type="range"] {
    width: 100%;

    margin:
        2px
        0
        5px;

    accent-color: #000080;

    cursor: pointer;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 220px;

    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    gap: 6px;

    overflow-y: auto;

    overflow-x: hidden;

    padding-right: 1px;
}

/* =========================================================
   GENERIC PANELS
========================================================= */

.panel {
    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    flex-shrink: 0;

    box-shadow:
        1px 1px 0 rgba(0,0,0,.3);
}

.panel:hover {
    box-shadow:
        1px 1px 0 rgba(0,0,0,.3),
        inset 0 0 0 1px rgba(255,255,255,.25);
}

.flex-col {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

/* =========================================================
   BUTTONS
========================================================= */

.win-btn,
.start-btn {
    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    padding: 4px 6px;

    font-size: 11px;

    cursor: pointer;

    text-align: center;

    min-height: 25px;

    transition:
        background .08s ease;
}

.win-btn:hover,
.start-btn:hover {
    background: #d8d8d8;
}

.win-btn:focus,
.start-btn:focus {
    outline: 1px dotted #000;

    outline-offset: -4px;
}

.win-btn:active,
.start-btn:active {
    border-color:
        #404040
        #ffffff
        #ffffff
        #404040;

    padding-top: 5px;
    padding-left: 7px;

    background: #bdbdbd;
}

/* =========================================================
   IP INPUT
========================================================= */

.ip-input {
    width: 100%;

    background: #fff;

    border: 2px solid;

    border-color:
        #808080
        #ffffff
        #ffffff
        #808080;

    padding: 3px 5px;

    font-size: 11px;

    font-family:
        "Courier New",
        Courier,
        monospace;

    margin-bottom: 4px;

    color: #000;

    outline: none;

    user-select: text;
}

.ip-input:focus {
    border-color:
        #000080
        #ffffff
        #ffffff
        #000080;

    box-shadow:
        inset 0 0 0 1px #000080;
}

.ip-input::placeholder {
    color: #808080;
}

/* =========================================================
   INSET WINDOWS
========================================================= */

.win-inset {
    border: 2px solid;

    border-color:
        #808080
        #ffffff
        #ffffff
        #808080;
}

.win-inset-dark {
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(0,255,100,.04),
            transparent 60%
        ),
        #000;

    color: #00ff66;

    font-family:
        "Courier New",
        monospace;

    border: 2px solid;

    border-color:
        #808080
        #ffffff
        #ffffff
        #808080;

    padding: 4px;

    box-shadow:
        inset 0 0 12px rgba(0,255,100,.05);
}

/* =========================================================
   LOG
========================================================= */

.log-box {
    height: 105px;

    overflow-y: auto;

    overflow-x: hidden;

    font-size: 10px;

    line-height: 13px;

    scrollbar-color:
        #008000
        #101010;
}

.log-box p {
    margin: 2px 0;

    white-space: normal;

    word-break: break-word;
}

.log-box p::before {
    color: #008000;
}

/* =========================================================
   PERFORMANCE
========================================================= */

.perf-box {
    font-size: 11px;

    min-height: 80px;
}

.fps-text,
.temp-text {
    margin: 3px 0;
}

.fps-text span {
    color: #00ff66;

    font-weight: bold;

    font-family:
        "Courier New",
        monospace;
}

.temp-text span {
    color: #ff3300;

    font-weight: bold;

    font-family:
        "Courier New",
        monospace;
}

/* =========================================================
   WAVEFORM
========================================================= */

.waveform {
    position: relative;

    height: 25px;

    margin-top: 5px;

    overflow: hidden;

    background:
        repeating-linear-gradient(
            90deg,
            #000 0px,
            #000 5px,
            #003b22 6px
        );

    border: 1px solid #003b22;

    opacity: .9;
}

.waveform::before {
    content: "";

    position: absolute;

    left: -100%;

    top: 50%;

    width: 200%;

    height: 2px;

    background: #00ff66;

    box-shadow:
        0 0 4px #00ff66;

    animation:
        waveformMove
        1.2s
        linear
        infinite;
}

.waveform::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            transparent 48%,
            rgba(0,255,100,.12) 50%,
            transparent 52%
        );
}

@keyframes waveformMove {

    0% {
        transform:
            translateX(0)
            translateY(-7px)
            rotate(3deg);
    }

    25% {
        transform:
            translateX(20%)
            translateY(5px)
            rotate(-2deg);
    }

    50% {
        transform:
            translateX(50%)
            translateY(-4px)
            rotate(4deg);
    }

    75% {
        transform:
            translateX(75%)
            translateY(6px)
            rotate(-3deg);
    }

    100% {
        transform:
            translateX(100%)
            translateY(-7px)
            rotate(3deg);
    }
}

/* =========================================================
   STATUS BAR
========================================================= */

.status-bar {
    background: #c0c0c0;

    border-top: 2px solid #808080;

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 3px 6px;

    font-size: 10px;

    min-height: 24px;

    overflow-x: auto;

    overflow-y: hidden;

    white-space: nowrap;

    flex-shrink: 0;
}

.status-bar span {
    padding: 2px 5px;

    border: 1px solid;

    border-color:
        #808080
        #ffffff
        #ffffff
        #808080;

    background: #c0c0c0;
}

.tag-undetectable {
    background: #00aa00 !important;

    color: #000;

    font-weight: bold;

    border-color:
        #006600
        #ffffff
        #ffffff
        #006600 !important;
}

/* =========================================================
   TASKBAR
========================================================= */

.taskbar {
    position: relative;

    z-index: 100;

    height: 30px;

    flex-shrink: 0;

    background: #c0c0c0;

    border-top: 2px solid #ffffff;

    display: flex;

    align-items: center;

    padding: 2px 4px;

    gap: 4px;

    box-shadow:
        0 -1px 0 #808080;
}

.taskbar-item {
    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #404040
        #ffffff
        #ffffff
        #404040;

    padding: 3px 9px;

    height: 24px;

    min-width: 180px;

    font-size: 11px;

    font-weight: bold;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.taskbar-item.active {
    background: #bdbdbd;

    box-shadow:
        inset 1px 1px #808080;
}

.system-tray {
    margin-left: auto;

    min-width: 75px;

    text-align: center;

    border: 2px solid;

    border-color:
        #808080
        #ffffff
        #ffffff
        #808080;

    padding: 3px 6px;

    height: 24px;

    font-size: 11px;

    font-family:
        "MS Sans Serif",
        Tahoma,
        sans-serif;
}

/* =========================================================
   SCROLLBARS
========================================================= */

::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: #c0c0c0;

    border-left: 1px solid #808080;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;
}

::-webkit-scrollbar-thumb:hover {
    background: #d0d0d0;
}

::-webkit-scrollbar-button {
    background: #c0c0c0;

    border: 2px solid;

    border-color:
        #ffffff
        #404040
        #404040
        #ffffff;

    height: 14px;
}

/* =========================================================
   SCAN EFFECT
========================================================= */

.scan-overlay {
    position: absolute;

    inset: 22px 0 0;

    z-index: 50;

    pointer-events: none;

    display: none;

    background:
        repeating-linear-gradient(
            0deg,
            rgba(0,255,100,.025) 0px,
            rgba(0,255,100,.025) 2px,
            transparent 3px,
            transparent 5px
        );
}

.scan-overlay.active {
    display: block;

    animation:
        scanFlicker
        .15s
        infinite alternate;
}

.scan-line {
    position: absolute;

    left: 0;

    top: 0;

    width: 100%;

    height: 2px;

    background: #00ff66;

    box-shadow:
        0 0 8px #00ff66,
        0 0 18px rgba(0,255,100,.7);

    animation:
        scanLine
        1.5s
        linear
        infinite;
}

@keyframes scanLine {

    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

@keyframes scanFlicker {

    from {
        opacity: .35;
    }

    to {
        opacity: .75;
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .window {
        margin: 5px;

        height:
            calc(100vh - 40px);
    }

    .sidebar {
        width: 190px;
    }

    .floating-panel {
        width: 190px;
    }

    .window-header h1 {
        font-size: 16px;
    }
}

@media (max-width: 700px) {

    .window {
        margin: 2px;

        height:
            calc(100vh - 34px);
    }

    .app-workspace {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;

        max-height: 180px;

        flex-direction: row;

        overflow-x: auto;

        overflow-y: hidden;
    }

    .sidebar .panel {
        min-width: 190px;
    }

    .floating-panel {
        transform: scale(.85);

        transform-origin:
            top left;
    }

    .status-bar {
        gap: 3px;
    }

    .taskbar-item {
        min-width: 120px;
    }
}

@media (max-height: 600px) {

    .window-header {
        padding: 4px 8px;
    }

    .window-header h1 {
        font-size: 14px;
    }

    .status-sub {
        font-size: 9px;
    }

    .log-box {
        height: 75px;
    }

    .sidebar {
        gap: 3px;
    }

    .app-workspace {
        padding: 4px;
        gap: 4px;
    }
}