body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #000000;
    font-size: 14px;
    color: #929292;
    font-family: 'Courier New', monospace;
    overflow: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 28px;
    letter-spacing: 2px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.control-section {
    padding: 20px;
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 4px;
}

.control-section h2 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #929292;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: normal;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.control-group label {
    font-size: 12px;
    color: #929292;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group select,
.control-group input[type="range"] {
    padding: 8px;
    background-color: #000000;
    border: 1px solid #333333;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
}

.control-group select {
    border-radius: 2px;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #666666;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #333333;
    outline: none;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #929292;
    cursor: pointer;
    border-radius: 0;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #929292;
    cursor: pointer;
    border-radius: 0;
    border: none;
}

.button-group {
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 20px;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}

button:hover {
    background-color: #2a2a2a;
    border-color: #666666;
}

button:active {
    background-color: #0a0a0a;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.main-content {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 400px;
}

#maze-canvas {
    border: 1px solid #333333;
    background-color: #000000;
}

.console-window {
    width: 350px;
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 15px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.console-window h3 {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #929292;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: normal;
}

#console-output {
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    background-color: #000000;
    padding: 10px;
    border: 1px solid #333333;
    color: #00ff00;
}

.console-line {
    margin-bottom: 5px;
    word-wrap: break-word;
}

.console-line.info {
    color: #00ff00;
}

.console-line.decision {
    color: #ffff00;
}

.console-line.complete {
    color: #00ffff;
    font-weight: bold;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border: 1px solid #333333;
}

.legend-color.entrance {
    background-color: #00ff00;
}

.legend-color.exit {
    background-color: #ff0000;
}

#size-value,
#solver-speed-value,
#race-speed-value {
    color: #ffffff;
    font-weight: bold;
}

.stats {
    display: flex;
    gap: 20px;
    padding: 10px 15px;
    background-color: #000000;
    border: 1px solid #333333;
    border-radius: 2px;
}

.stat-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-label {
    color: #929292;
    font-size: 12px;
    text-transform: uppercase;
}

.stat-item span:last-child {
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
}

.stats-dashboard {
    margin-top: 30px;
    padding: 20px;
    background-color: #0a0a0a;
    border: 1px solid #333333;
    border-radius: 4px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333333;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.dashboard-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-line {
    font-size: 12px;
    color: #929292;
}

.stat-line span {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
}

#reset-stats {
    padding: 8px 16px;
    font-size: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 15px;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.dashboard-card h3 {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #929292;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: normal;
}

.chart-container {
    min-height: 150px;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.chart-label {
    width: 120px;
    font-size: 11px;
    color: #ffffff;
    font-weight: bold;
}

.chart-bar-bg {
    flex: 1;
    height: 24px;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5px;
    font-size: 10px;
    font-weight: bold;
    color: #000000;
}

.chart-bar-fill.cyan {
    background-color: #00ffff;
}

.chart-bar-fill.magenta {
    background-color: #ff00ff;
}

.chart-bar-fill.yellow {
    background-color: #ffff00;
}

.stats-table {
    overflow-x: auto;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.stats-table th {
    background-color: #1a1a1a;
    color: #929292;
    text-align: left;
    padding: 10px;
    border: 1px solid #333333;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
}

.stats-table td {
    padding: 8px 10px;
    border: 1px solid #333333;
    color: #ffffff;
}

.stats-table tr:hover {
    background-color: #1a1a1a;
}

.runner-name {
    font-weight: bold;
}

.runner-name.cyan {
    color: #00ffff;
}

.runner-name.magenta {
    color: #ff00ff;
}

.runner-name.yellow {
    color: #ffff00;
}

.leaderboard {
    font-size: 12px;
}

.leaderboard-item {
    padding: 10px;
    margin: 8px 0;
    background-color: #1a1a1a;
    border-left: 3px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-item.cyan {
    border-left-color: #00ffff;
}

.leaderboard-item.magenta {
    border-left-color: #ff00ff;
}

.leaderboard-item.yellow {
    border-left-color: #ffff00;
}

.leaderboard-rank {
    font-size: 18px;
    margin-right: 10px;
}

.leaderboard-name {
    flex: 1;
    font-weight: bold;
    color: #ffffff;
}

.leaderboard-value {
    color: #00ff00;
    font-weight: bold;
}
