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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #1a1a1a;
    font-family: 'Arial', sans-serif;
}

#canvas {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #000;
    border: 2px solid #333;
    width: min(900px, 90vw);
    height: auto;
    aspect-ratio: 900 / 500;
    max-height: calc(100vh - 200px);
}

/* 説明バナー */
.instruction-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    z-index: 500;
    border-top: 2px solid #4a90e2;
    animation: slideUp 0.4s ease;
}

.instruction-banner.hidden {
    animation: slideDown 0.4s ease;
    transform: translateY(100%);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.instruction-text {
    color: #fff;
    font-size: 11px;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.icon-light,
.icon-measure {
    font-size: 18px;
    margin: 0 4px;
}

.separator {
    color: #888;
    margin: 0 12px;
}

/* 情報表示パネル */
.info-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    font-size: 11px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.info-section {
    margin-bottom: 10px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #999;
    font-size: 10px;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #4ecdc4;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* コントローラー */
.controls {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(40, 40, 40, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 400;
    flex-wrap: wrap;
    max-width: 90vw;
    justify-content: center;
}

button {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

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

.control-group label {
    color: #ccc;
    font-size: 11px;
    font-weight: normal;
}

input[type="range"] {
    width: 100px;
    cursor: pointer;
}

input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.value-display {
    color: #4ecdc4;
    font-weight: bold;
    font-size: 10px;
    min-width: 50px;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    #canvas {
        width: 85vw;
        max-height: calc(100vh - 220px);
    }
    
    .info-panel {
        right: 10px;
        top: 85px;
        min-width: 150px;
        font-size: 10px;
    }
    
    .info-value {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #canvas {
        width: 95vw;
        max-height: calc(100vh - 240px);
    }
    
    .instruction-banner {
        padding: 10px 15px;
    }
    
    .instruction-text {
        font-size: 11px;
    }
    
    .info-panel {
        right: 5px;
        top: 95px;
        min-width: 140px;
        padding: 8px 12px;
    }
    
    .controls {
        bottom: 65px;
        padding: 8px 15px;
        gap: 8px;
        max-width: 95vw;
    }
    
    button {
        padding: 6px 12px;
        font-size: 10px;
    }
    
    .control-group {
        gap: 4px;
    }
    
    label {
        font-size: 9px;
    }
    
    input[type="range"] {
        width: 60px;
    }
}

@media (max-width: 480px) {
    #canvas {
        width: 98vw;
        max-height: calc(100vh - 280px);
    }
    
    .instruction-text {
        font-size: 10px;
    }
    
    .instruction-text .separator {
        margin: 0 4px;
    }
    
    .info-panel {
        top: 105px;
        right: 3px;
        min-width: 120px;
        padding: 6px 10px;
        font-size: 9px;
    }
    
    .info-label {
        font-size: 8px;
    }
    
    .info-value {
        font-size: 11px;
    }
    
    .controls {
        bottom: 70px;
        padding: 6px 10px;
        gap: 6px;
    }
    
    button {
        padding: 5px 10px;
        font-size: 9px;
    }
    
    label {
        font-size: 8px;
        min-width: 40px;
    }
    
    .value-display {
        font-size: 8px;
    }
}
