:root {
    --mc-dirt: #4d321f;
    --hedge-green: #2d5a27;
    --hedge-light: #4a8c3d;
    --path-white: #f0f0f0;
    --mc-diamond: #63d7e8;
    --mc-wood: #a17b58;
    --mc-wood-dark: #6e5038;
    --mc-ui-bg: #c6c6c6;
    --mc-ui-border-light: #ffffff;
    --mc-ui-border-dark: #555555;
    --mc-text: #373737;
    --mc-path: #ffd700;
    --font-pixel: 'Press Start 2P', cursive;
}

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: var(--font-pixel);
    background: #1a2a1a url('https://www.transparenttextures.com/patterns/dark-matter.png');
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--mc-wood-dark) url('https://www.transparenttextures.com/patterns/wood-pattern.png');
    padding: 1.2rem 2rem;
    border-bottom: 6px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terminal-text {
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 3px 3px 0px #222;
}

.version {
    font-size: 0.45rem;
    color: #00ff00;
}

.controls {
    display: flex;
    gap: 1.5rem;
}

.control-group label {
    font-size: 0.4rem;
    color: #ccc;
    margin-bottom: 6px;
    display: block;
}

select {
    background: var(--mc-ui-bg);
    border: 4px solid #000;
    border-top-color: var(--mc-ui-border-dark);
    border-left-color: var(--mc-ui-border-dark);
    border-right-color: var(--mc-ui-border-light);
    border-bottom-color: var(--mc-ui-border-light);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.5rem;
    color: var(--mc-text);
}

.btn {
    padding: 8px 14px;
    background: var(--mc-ui-bg);
    border: 4px solid #000;
    border-top-color: var(--mc-ui-border-light);
    border-left-color: var(--mc-ui-border-light);
    border-right-color: var(--mc-ui-border-dark);
    border-bottom-color: var(--mc-ui-border-dark);
    color: var(--mc-text);
    font-family: inherit;
    font-size: 0.5rem;
    cursor: pointer;
    text-shadow: 1px 1px 0px #fff;
}

.btn-primary {
    background: #3c8527;
    color: #fff;
    text-shadow: 2px 2px 0px #000;
    border-top-color: #56942f;
    border-left-color: #56942f;
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    padding: 1rem;
    background: #121a12;
}

.grid-container {
    background: var(--path-white);
    border: 8px solid #222;
    display: grid;
    height: 100%;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.node {
    border: 1px solid rgba(0, 0, 0, 0.03);
    background: var(--path-white);
}

.node-wall {
    background: var(--hedge-green);
    background-image: radial-gradient(var(--hedge-light) 20%, transparent 20%),
                      radial-gradient(var(--hedge-light) 20%, transparent 20%);
    background-position: 0 0, 4px 4px;
    background-size: 8px 8px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
    border: none;
}

.node-start {
    background: #8e44ad !important; /* Portal-like purple for start */
    display: flex;
    align-items: center;
    justify-content: center;
}

.character {
    width: 70%;
    height: 70%;
    background: #2b1d14;
    border: 2px solid #000;
    position: relative;
    z-index: 100;
}

.character::before {
    content: "";
    position: absolute;
    top: 20%; left: 10%; width: 80%; height: 60%;
    background: #dbac82;
}

.character::after {
    content: "";
    position: absolute;
    top: 40%; left: 20%; width: 20%; height: 15%;
    background: #fff; box-shadow: 8px 0 0 #fff;
}

.node-end {
    background: #e74c3c !important; /* Red target */
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-end::after {
    content: "🚩";
    font-size: 0.7rem;
}

.node-visited {
    background: rgba(46, 204, 113, 0.15);
}

.node-path {
    background: #f1c40f !important; /* Golden path */
    box-shadow: inset 0 0 10px #f39c12;
    z-index: 10;
    animation: pathGlow 0.5s ease-in-out infinite alternate;
}

@keyframes pathGlow {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.dashboard {
    background: var(--mc-ui-bg);
    border: 6px solid #000;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.dashboard-card h2 {
    font-size: 0.5rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.status-badge {
    background: #000;
    color: #0f0;
    padding: 4px;
    font-size: 0.4rem;
    border: 2px solid #fff;
}

.stat-card {
    background: #999;
    border: 3px solid #000;
    padding: 8px;
}

.stat-value {
    font-size: 0.5rem;
    color: #fff;
    text-shadow: 1px 1px #000;
}

.bar-bg {
    height: 10px;
    background: #000;
    border: 2px solid #fff;
}

.bar {
    height: 100%;
    background: #2ecc71;
}

footer {
    background: var(--mc-wood);
    padding: 0.8rem;
    border-top: 6px solid #000;
}

.legend-item {
    font-size: 0.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-sample {
    width: 18px;
    height: 18px;
    border: 2px solid #000;
}
.node-sample.node-wall { background: var(--hedge-green); }
.node-sample.node-start { background: #8e44ad; }
.node-sample.node-end { background: #e74c3c; }
