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

body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    padding: 20px;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 48px;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    letter-spacing: 8px;
}

.subtitle {
    color: #888;
    font-size: 18px;
    margin-top: 10px;
}

#main-container {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

#game-panel {
    flex: 1;
}

#gameCanvas {
    background: #111;
    border: 2px solid #00ff88;
    display: block;
    width: 100%;
    max-width: 800px;
}

#match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    margin-top: 10px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-info.right {
    flex-direction: row-reverse;
}

.player-name {
    font-size: 14px;
    color: #00ff88;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-score {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
}

.match-status {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
}

#control-panel {
    width: 320px;
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.panel-section h3 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 16px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #888;
}

.control-group input[type="number"],
.control-group select {
    width: 100%;
    padding: 8px;
    background: #0a0a0a;
    border: 1px solid #444;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

.control-group input[type="range"] {
    width: calc(100% - 50px);
    vertical-align: middle;
}

.control-group span {
    display: inline-block;
    width: 45px;
    text-align: right;
    font-size: 12px;
    color: #00ff88;
}

.btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover:not(:disabled) {
    background: #444;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: #00ff88;
    color: #000;
    border-color: #00ff88;
}

.btn.primary:hover:not(:disabled) {
    background: #00cc6a;
}

.btn.danger {
    background: #ff4444;
    border-color: #ff4444;
}

.btn.danger:hover:not(:disabled) {
    background: #cc3333;
}

#generation-stats p {
    margin: 8px 0;
    font-size: 14px;
}

#generation-stats span {
    color: #00ff88;
    float: right;
}

#tournament-bracket {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 30px;
}

#tournament-bracket h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

#bracket-container {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 20px 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 200px;
}

.bracket-round h4 {
    text-align: center;
    color: #888;
    margin-bottom: 15px;
    font-size: 12px;
}

.bracket-match {
    background: #0a0a0a;
    border: 1px solid #444;
    margin-bottom: 20px;
    padding: 10px;
}

.bracket-match.active {
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.bracket-match.completed {
    opacity: 0.7;
}

.bracket-player {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    font-size: 12px;
}

.bracket-player.winner {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.bracket-player.loser {
    color: #666;
}

#leaderboard-section {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 30px;
}

#leaderboard-section h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

#leaderboard {
    width: 100%;
    border-collapse: collapse;
}

#leaderboard th,
#leaderboard td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

#leaderboard th {
    background: #0a0a0a;
    color: #00ff88;
    font-size: 12px;
    text-transform: uppercase;
}

#leaderboard tr:hover {
    background: rgba(0, 255, 136, 0.1);
}

#leaderboard .rank-1 { color: #ffd700; }
#leaderboard .rank-2 { color: #c0c0c0; }
#leaderboard .rank-3 { color: #cd7f32; }

#genome-viewer {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 30px;
}

#genome-viewer h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

#genome-select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid #444;
    color: #fff;
    font-family: inherit;
    margin-bottom: 20px;
}

#genome-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.genome-gene {
    background: #0a0a0a;
    padding: 15px;
    border: 1px solid #333;
}

.genome-gene .gene-name {
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
}

.genome-gene .gene-value {
    font-size: 18px;
    color: #00ff88;
}

.genome-gene .gene-bar {
    height: 4px;
    background: #333;
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
}

.genome-gene .gene-bar-fill {
    height: 100%;
    background: #00ff88;
    transition: width 0.3s;
}

#log-section {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 20px;
}

#log-section h2 {
    color: #00ff88;
    margin-bottom: 20px;
}

#event-log {
    height: 200px;
    overflow-y: auto;
    background: #0a0a0a;
    padding: 15px;
    font-size: 12px;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 5px;
}

.log-entry .timestamp {
    color: #666;
}

.log-entry.evolution {
    color: #ff88ff;
}

.log-entry.match {
    color: #88ffff;
}

.log-entry.tournament {
    color: #ffff88;
}

.log-entry.info {
    color: #888;
}

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
