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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a1a;
    color: #e0e0e0;
    overflow: hidden;
    min-height: 100vh;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.pixel-text {
    font-size: 48px;
    font-weight: bold;
    color: #4a9eff;
    text-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.loading-text {
    font-size: 16px;
    color: #888;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.world-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ui-panel {
    position: absolute;
    background: rgba(10, 10, 26, 0.85);
    border: 2px solid #2a2a3e;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: auto;
}

.top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    height: 32px;
}

.ui-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label {
    color: #888;
    font-size: 11px;
}

.value {
    color: #e0e0e0;
    font-weight: bold;
}

.inspector-panel {
    top: 48px;
    left: 8px;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.inspector-header {
    border-bottom: 1px solid #2a2a3e;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.inspector-content {
    font-size: 10px;
    line-height: 1.6;
}

.inspector-placeholder,
.timeline-placeholder,
.conversation-placeholder {
    color: #666;
    font-style: italic;
    font-size: 10px;
}

.timeline-panel {
    top: 48px;
    right: 8px;
    width: 240px;
    max-height: 300px;
    overflow-y: auto;
}

.timeline-header {
    border-bottom: 1px solid #2a2a3e;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.timeline-content {
    font-size: 10px;
    line-height: 1.6;
    max-height: 260px;
    overflow-y: auto;
}

.conversation-panel {
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 120px;
    max-height: 120px;
}

.conversation-header {
    border-bottom: 1px solid #2a2a3e;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.conversation-content {
    font-size: 10px;
    line-height: 1.6;
    max-height: 90px;
    overflow-y: auto;
}

.speech-bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.speech-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: #0a0a1a;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: fadeOut 4s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(-10px); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.hidden {
    display: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 4px;
        height: auto;
        padding: 4px;
    }

    .ui-section {
        font-size: 9px;
    }

    .inspector-panel {
        top: 80px;
        width: 100%;
        max-height: 150px;
    }

    .timeline-panel {
        top: 240px;
        width: 100%;
        max-height: 150px;
    }

    .conversation-panel {
        bottom: 40px;
        height: 80px;
        max-height: 80px;
    }
}

@media (max-width: 480px) {
    .pixel-text {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .loading-text {
        font-size: 12px;
    }
}
