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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header h1 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.audio-controls {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 0.9em;
}

.audio-controls label {
    font-weight: bold;
    color: #4a5568;
}

#volume-slider {
    width: 120px;
    height: 6px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#volume-display {
    font-weight: bold;
    color: #4a5568;
    min-width: 40px;
}

.stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #2d3748;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.workshop,
.orders {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #4a5568;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.trumpet-display {
    text-align: center;
    margin: 20px 0;
    border: 2px dashed #cbd5e0;
    padding: 20px;
    border-radius: 15px;
    background: #f7fafc;
}

.trumpet {
    font-size: 4em;
    margin: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.trumpet:hover {
    transform: scale(1.1);
}

.music-game {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #667eea;
}

.notes-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.note {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #667eea;
}

.note.correct {
    background: #48bb78;
    color: white;
    transform: scale(1.1);
}

.note.wrong {
    background: #f56565;
    color: white;
    animation: shake 0.5s ease-in-out;
}

.note:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.order-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.order-item.selected {
    background: #e6fffa;
    border-left-color: #38b2ac;
}

.materials {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    grid-column: 1 / -1;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.material-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.material-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
}

.material-item.selected {
    border-color: #38b2ac;
    background: #e6fffa;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn.success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn.warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

/* 注意を引くアニメーション */
@keyframes attention {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }

    75% {
        transform: scale(1.02);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
}

/* ゲーム状態表示 */
.game-status {
    background: #edf2f7;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #cbd5e0;
    text-align: center;
}

.game-status p {
    margin: 0;
    font-weight: 600;
    color: #4a5568;
}

/* デバッグパネル */
.debug-btn {
    margin-top: 10px;
    margin-left: 10px;
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    font-size: 0.8em;
    padding: 6px 12px;
}

.debug-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.debug-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.debug-content h3 {
    margin-bottom: 15px;
    color: #4a5568;
    border-bottom: 2px solid #ed8936;
    padding-bottom: 5px;
}

#debug-info {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
}

/* ボタン状態の改善 */
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn.warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.game-status {
    background: #edf2f7;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #cbd5e0;
    text-align: center;
}

.game-status p {
    margin: 0;
    font-weight: 600;
    color: #4a5568;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 0.3s ease;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.success {
    background: #48bb78;
}

.notification.error {
    background: #f56565;
}

.notification.show {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .notes-container {
        flex-wrap: wrap;
    }
}

/* チュートリアル・ヘルプ機能 */
.help-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    font-size: 0.9em;
    padding: 8px 16px;
}

.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tutorial-modal.show {
    opacity: 1;
    visibility: visible;
}

.tutorial-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tutorial-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-body {
    padding: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.tutorial-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-step h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.tutorial-step p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #2d3748;
}

.tutorial-step ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.tutorial-step li {
    margin-bottom: 8px;
    color: #4a5568;
}

.tutorial-nav {
    background: #f7fafc;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
}

.tutorial-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    margin: 0 5px;
}

.step-indicator {
    font-weight: bold;
    color: #4a5568;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #667eea;
}

.start-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.guide-highlight {
    position: absolute;
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: rgba(255, 215, 0, 0.1);
    pointer-events: none;
    z-index: 1500;
    opacity: 0;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.guide-highlight.show {
    opacity: 1;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
}

/* ガイドモード時のオーバーレイ */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
}

.guide-tooltip {
    position: absolute;
    background: #2d3748;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    max-width: 300px;
    font-size: 0.9em;
    line-height: 1.4;
    z-index: 1600;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.guide-tooltip.show {
    opacity: 1;
}

.guide-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border: 8px solid transparent;
    border-top-color: #2d3748;
}

/* ヘルプテキストのスタイル */
.help-text {
    background: #e6fffa;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #38b2ac;
    margin-bottom: 15px;
}

.help-text p {
    margin: 0;
    color: #2c7a7b;
    font-size: 0.9em;
    font-weight: 500;
}

/* 状態表示の改善 */
.trumpet-display {
    border: 2px dashed #cbd5e0;
    padding: 20px;
    border-radius: 15px;
    background: #f7fafc;
}

.workshop[data-state="idle"] .trumpet-display {
    border-color: #cbd5e0;
}

.workshop[data-state="crafting"] .trumpet-display {
    border-color: #4299e1;
    background: #ebf8ff;
    animation: workingPulse 2s infinite;
}

@keyframes workingPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.workshop[data-state="ready"] .trumpet-display {
    border-color: #48bb78;
    background: #f0fff4;
}
