@charset "utf-8";
/* CSS Document */
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Courier New', monospace;
            background: #000;
            min-height: 100svh;
            
            padding-bottom: 100px; /* コントロールのスペースを確保 */
            color: #fff;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto; padding-top: 20px;
        }

        h1 {
            text-align: center;
            margin-bottom: 1em;
            font-size: 1.5em;
            letter-spacing: 0.3em;
            font-weight: 300;
        }

        .subtitle {
            text-align: center;
            margin-bottom: 30px;
            font-size: 0.9em;
            color: #888;
            letter-spacing: 0.2em;
        }


        #fileInput {
            display: none;
        }

        .upload-btn {
            background: #1a1a1a;
            border: 1px solid #666;
            color: white;
            padding: 12px 24px;
            font-size: 0.9em;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em;
        }

        .upload-btn:hover {
            background: #2a2a2a;
            border-color: #fff;
            transform: translateY(-2px);
        }

        .images-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;padding: 20px;
        }

        .image-card {
            background: #111;
            border: 1px solid #333;
            padding: 15px;
            position: relative;
            transition: all 0.3s;
        }

        .image-card:hover {
            border-color: #666;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
        }
        
        .image-card.playing {
            border-color: #fff;
            box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
        }

        .image-card img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            margin-bottom: 10px;
            filter: grayscale(100%) contrast(1.2);
        }

        .instrument-label {
            font-size: 1.2em;
            margin-bottom: 10px;
            letter-spacing: 0.1em;
            color: #fff;
        }

        .image-info {
            font-size: 0.85em;
            line-height: 1.8;
            color: #888;
        }

        .remove-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            background: #666;
            border: 0px solid #ff0000;
            color: white;
            width: 35px;
            height: 35px;
            cursor: pointer;
            font-size: 1.6em;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            line-height: 1;
            z-index: 10;
            border-radius: 3px;
            /* タッチ領域を広げる */
            padding: 8px;
            min-width: 44px;
            min-height: 44px; border-radius: 50%;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 20px;
            flex-wrap: wrap;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #000;
            padding: 20px;
            border-top: 1px solid #333;
            z-index: 100;
        }

        button {
            background: #000;
            border: 0px solid #666;
            color: white;
            padding: 15px 40px;
            font-size: 1em;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em;
        }

        button:hover:not(:disabled) {
            background: #1a1a1a;
            border-color: #fff;
        }

        button:disabled {
            display: none;
        }

        button.playing {
            background: #fff;
            color: #000;
        }

        .visualizer {
            display: none;
            background: #000;
            border: 0px solid #333;
            padding: 20px;
            margin-bottom: 20px;
        }

        .visualizer.show {
            display: block;
        }

        #canvas {
            width: 100%;
            height: 300px;
            background: #000;
        }

        .info-text {
            text-align: center;
            margin: 20px 0;
            font-size: 0.9em;
            color: #666;
            letter-spacing: 0.1em;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.4);
            animation: fadeIn 0.3s;
        }

        .modal.show {
            display: flex;
            align-items: stretch;
            justify-content: stretch;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-content {
            background: #111;
            border: 0px solid #666;
            padding: 20px 20px 0 20px;
            width: 100%;
            height: 100%;
            overflow-y: auto;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        @media (max-width: 768px) {
            .modal-content {
                width: 100%;
                height: 100%;
                padding: 15px 15px 0 15px;
            }
            
            #drawingCanvas {
                max-width: 100%;
                height: auto;
            }
        }

        .modal-header {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 20px;
            border-bottom: 1px solid #333;
            padding-bottom: 15px;
            gap: 15px;
        }

        .modal-header h2 {
            margin: 0;
            font-size: 1.5em;
            letter-spacing: 0.2em;
            font-weight: 300; width: calc( 100% - 80px); text-align: center;
        }

        .modal-close {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            padding: 0;
            line-height: 1;
        }

        .modal-close:hover {
            opacity: 0.7;
        }

        .modal-close .material-symbols-outlined {
            font-size: 24px;
        }

        .drawing-controls {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-bottom: 20px;
            padding: 15px;
            background: #0a0a0a;
            border: 1px solid #333;
        }

        .control-group {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .control-group label {
            font-size: 0.9em;
            letter-spacing: 0.1em;
            min-width: 100px;
        }

        .control-group input[type="color"] {
            width: 50px;
            height: 30px;
            border: 1px solid #666;
            background: #000;
            cursor: pointer;
        }

        .control-group input[type="range"] {
            flex: 1;
            min-width: 150px;
        }

        .control-btn {
            background: #1a1a1a;
            border: 1px solid #666;
            color: white;
            padding: 8px 16px;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'Courier New', monospace;
            font-size: 0.9em;
        }

        .control-btn:hover {
            background: #2a2a2a;
            border-color: #fff;
        }

        .control-btn.active {
            background: #fff;
            color: #000;
        }

        .canvas-container {
            display: flex;
            justify-content: center;
            background: #000;
            border: 1px solid #666;
            padding: 20px;
            margin-bottom: 20px;
        }

        #drawingCanvas {
            background: #fff;
            cursor: crosshair;
            max-width: 100%;
            touch-action: none;
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            padding: 15px 0;
            border-top: 1px solid #333;
            position: sticky;
            bottom: 0;
            background: #111;
            z-index: 10;
            margin-top: auto;
        }

        .modal-btn {
            background: #000;
            border: 1px solid #666;
            color: white;
            padding: 12px 30px;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em;
            font-size: 1em;
        }

        .modal-btn:hover {
            background: #1a1a1a;
            border-color: #fff;
        }

        .modal-btn-primary {
            background: #fff;
            color: #000;
        }

        .modal-btn-primary:hover {
            background: #e0e0e0;
        }

        .meter {
            height: 4px;
            background: #111;
            margin-top: 10px;
            position: relative;
            overflow: hidden;
        }

        .meter-fill {
            height: 100%;
            background: #fff;
            width: 0%;
            transition: width 0.1s;
        }
        #addArea { position: sticky; top:0; left: 0; width: 100%; text-align: center; z-index: 101;}
        #addBtn { width: 100%; background-color: #ff0000; border: none; position: relative;}
        #addBtn .material-symbols-outlined { color: #FFFFFF; font-size: 30px; }
        #playBtn .material-symbols-outlined { color: #ff0000; font-size: 60px; }
        #stopBtn .material-symbols-outlined { color: #ff0000; font-size: 60px; }
        #clearBtn {
            grid-column: 1 / -1; /* グリッドの全列にまたがる */
            width: 100%;
            background: #1a1a1a;
            border: 1px solid #666;
            color: white;
            padding: 15px 40px;
            font-size: 1em;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em;
            margin-top: 20px;
        }

        #clearBtn:hover:not(:disabled) {
            background: #2a2a2a;
            border-color: #fff;
        }

        #clearBtn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .dropdown-overlay {
            display: none;
            position: fixed;
            z-index: 100;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            animation: fadeIn 0.3s;
        }
        
        .dropdown-overlay.show {
            display: block;
        }
        
        .dropdown-menu {
            display: block;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #111;
            border: 1px solid #333;
            border-top: 2px solid #ff0000;
            z-index: 101;
            padding: 15px;
            max-height: 80vh;
            overflow-y: auto;
            transform: translateY(100%);
            transition: transform 0.3s ease-out;
        }
        
        .dropdown-menu.show {
            transform: translateY(0);
        }
        
        .dropdown-item {
            display: block;
            width: 100%;
            background: #1a1a1a;
            border: 1px solid #666;
            color: white;
            padding: 12px 20px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.3s;
            font-family: 'Courier New', monospace;
            letter-spacing: 0.1em;
            text-align: center;
        }
        
        .dropdown-item:last-child {
            margin-bottom: 0;
        }
        
        .dropdown-item:hover {
            background: #2a2a2a;
            border-color: #fff;
        }
        
        .upload-area {
            background: #111;
            border: 1px solid #333;
            padding: 40px;
            text-align: center;
            cursor: default;
            transition: all 0.3s;
            margin-bottom: 15px;
        }
        
        .upload-area.dragover {
            background: #222;
            border-color: #fff;
        }

