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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-columns: 1fr 400px;
    grid-template-rows: 60px 1fr 40px 80px;
    height: 100vh;
    gap: 2px;
    background: #1a1a1a;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.container.visible {
    opacity: 1;
}

.header {
    grid-column: 1 / -1;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 2px solid #444;
}

.header h1 {
    color: #4a9eff;
    font-size: 24px;
    margin-right: auto;
}

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

.btn {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #357abd;
}

.btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.play-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.game-canvas {
    background: #000;
    position: relative;
    overflow: hidden;
    cursor: grab;
    width: 100%;
    height: 100%;
}

.game-canvas:active {
    cursor: grabbing;
}

#canvas {
    display: block;
    background: radial-gradient(circle at 30% 30%, #1a1a2e 0%, #0a0a0a 100%);
    width: 100%;
    height: 100%;
}

.info-panel {
    background: #2a2a2a;
    padding: 20px;
    overflow-y: auto;
    border-left: 2px solid #444;
}

.player-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #3a3a3a;
    border-radius: 8px;
    border-left: 4px solid;
}

.players-container {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr; /* Default: single column */
    max-height: 70vh; /* Allow scrolling when needed */
    overflow-y: auto;
}

.players-container.two-columns {
    grid-template-columns: repeat(2, 1fr);
}

.player-info h3 {
    color: #4a9eff;
    margin-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.entity-details {
    grid-column: 1 / -1;
    background: #2a2a2a;
    padding: 10px 20px;
    border-top: 2px solid #444;
}

.entity-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.entity-detail {
    background: #3a3a3a;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(74, 158, 255, 0.8);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.zoom-btn:hover {
    background: rgba(74, 158, 255, 1);
}

.coordinates {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #4a9eff;
}


.timeline-controls {
    grid-column: 1 / -1;
    background: #2a2a2a;
    padding: 15px 20px;
    border-top: 2px solid #444;
    display: flex;
    align-items: center;
    gap: 20px;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.play-btn:hover {
    background: #357abd;
}

.timeline-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.frame-slider {
    flex: 1;
    height: 6px;
    background: #444;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.frame-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
}

.frame-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.frame-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.frame-counter {
    background: #3a3a3a;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-select {
    background: #3a3a3a;
    color: white;
    border: 1px solid #555;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.interpolation-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 15px;
    color: #ccc;
    font-size: 14px;
}

.interpolation-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4a9eff;
}
.upload-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.upload-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.upload-panel {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid #444;
    max-width: 500px;
    text-align: center;
}

.upload-panel h1 {
    color: #4a9eff;
    font-size: 32px;
    margin-bottom: 20px;
}

.upload-panel p {
    color: #ccc;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.upload-area {
    border: 3px dashed #4a9eff;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 20px;
    background: rgba(74, 158, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: #357abd;
}

.upload-area.dragover {
    background: rgba(74, 158, 255, 0.3);
    border-color: #6bb6ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    color: #4a9eff;
    font-size: 18px;
    margin-bottom: 10px;
}

.upload-subtext {
    color: #888;
    font-size: 14px;
}

.file-input {
    display: none;
}

.upload-button {
    background: #4a9eff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin: 10px;
}

.upload-button:hover {
    background: #357abd;
}

.loading-text {
    color: #4a9eff;
    font-size: 18px;
    margin-top: 20px;
}

.error-text {
    color: #ff4444;
    font-size: 14px;
    margin-top: 10px;
}