:root {
    --plum-deep: #443355;
    --plum-smooth: #5a4a6e;
    --slate-dark: #222222;
    --slate-mid: #3d3d3d;
    --stone-light: #999999;
    --parchment: #eeeedd;
    --goal-red: #884444;
    --start-green: #667755;
    --path-purple: #443366;
    --terminal-border: #bbaadd;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--slate-mid);
    color: var(--parchment);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.dashboard {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--plum-deep);
    border-right: 2px solid var(--slate-dark);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 40px;
}

.brand span {
    color: var(--stone-light);
}

.data-group {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid var(--plum-smooth);
}

.data-group label {
    display: block;
    font-size: 0.65rem;
    color: var(--stone-light);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.data-group .val {
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--parchment);
    cursor: pointer;
}

.viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maze-case {
    background-color: var(--slate-dark);
    padding: 15px;
    border: 4px solid var(--plum-smooth);
    position: relative;
}

#maze-container {
    display: grid;
    grid-template-columns: repeat(16, 34px);
    grid-template-rows: repeat(16, 34px);
    position: relative;
}

.cell {
    width: 34px;
    height: 34px;
    background-color: var(--slate-dark);
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.f-val {
    font-size: 8px;
    color: rgba(238, 238, 221, 0.2);
    z-index: 5;
    pointer-events: none;
}

.wall-top {
    border-top: 1.5px solid var(--parchment) !important;
}

.wall-right {
    border-right: 1.5px solid var(--parchment) !important;
}

.wall-bottom {
    border-bottom: 1.5px solid var(--parchment) !important;
}

.wall-left {
    border-left: 1.5px solid var(--parchment) !important;
}

.goal-zone {
    background-color: var(--goal-red) !important;
    border: none !important;
}

.start-node {
    background-color: var(--start-green) !important;
}

.cell.shortest-path {
    z-index: 8;
    cursor: crosshair;
}

.cell.shortest-path::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 2.5px solid var(--terminal-border);
    border-radius: 5px;
    pointer-events: none;
    z-index: 9;
}

.cell.shortest-path::after {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--terminal-border);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.cell.shortest-path .f-val {
    opacity: 0;
    position: absolute;
    bottom: 100%;
    background: #000;
    padding: 2px 5px;
    border-radius: 4px;
    color: #fff;
    z-index: 30;
    font-size: 9px;
    pointer-events: none;
    transform: translateY(-5px);
}

.cell.shortest-path:hover .f-val {
    opacity: 1;
}

.scanner {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: var(--parchment);
    border: 2px solid var(--plum-deep);
    border-radius: 50%;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(238, 238, 221, 0.4);
}

.scanner::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--plum-deep);
}

.cell.explored {
    background-color: rgba(90, 74, 110, 0.3) !important;
}

.controls {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    padding: 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    border: none;
    transition: 0.2s;
}

.btn-main {
    background: var(--parchment);
    color: var(--plum-deep);
}

.btn-alt {
    background: transparent;
    border: 1px solid var(--parchment);
    color: var(--parchment);
}

.enemy-node {
    background-color: rgba(255, 0, 0, 0.2) !important;
    position: relative;
    z-index: 5;
}

.enemy-node::after {
    content: '×';
    color: #ff4444;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    text-shadow: 0 0 10px red;
    animation: enemyPulse 0.4s infinite alternate;
}

@keyframes enemyPulse {
    from {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}