body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050510;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

#webgl-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to WebGL */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    font-size: 2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 150, 255, 0.8);
}

h1 span {
    font-size: 0.8rem;
    color: #00f0ff;
}

.status-bar {
    display: flex;
    gap: 20px;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    pointer-events: auto; /* ボタンをクリック可能にするため追加 */
}

.status-item {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.6rem;
    color: #88aadd;
    margin-bottom: 2px;
}

.value {
    font-family: 'Orbitron', monospace;
    font-variant-numeric: tabular-nums; /* 数字の横幅を完全に固定する */
    font-size: 1rem;
    color: #00f0ff;
    min-width: 190px; 
    display: inline-block;
    text-align: right; /* 右寄せにして左側がガタガタするのを防ぐ */
}

.dashboard {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.panel {
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    width: 300px;
    pointer-events: auto; /* Re-enable pointer events for panels */
}

.panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #00f0ff;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 5px;
}

.heatmap-panel {
    width: 250px;
}

.scale-bar {
    height: 10px;
    background: linear-gradient(90deg, #0055ff, #00f0ff, #ffaa00, #ff0055);
    border-radius: 5px;
    margin-bottom: 5px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #88aadd;
}

.log-panel {
    height: 200px;
    display: flex;
    flex-direction: column;
}

#event-log {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#event-log li {
    padding: 5px;
    background: rgba(255, 0, 85, 0.1);
    border-left: 3px solid #ff0055;
    animation: fadeIn 0.3s ease-out;
}

#event-log li.minor {
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid #ffaa00;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.4);
    border-radius: 3px;
}
