/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #313244 100%);
    color: #cdd6f4;
    overflow: hidden;
    user-select: none;
}

/* 共通スタイル */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
}

.screen.hidden {
    display: none;
}

.screen.fade-out {
    opacity: 0;
}

/* ボタン共通スタイル */
.menu-btn, .control-btn {
    background: linear-gradient(135deg, #89b4fa 0%, #74c7ec 100%);
    color: #1e1e2e;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.menu-btn:hover, .control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(137, 180, 250, 0.4);
}

.control-btn.primary {
    background: linear-gradient(135deg, #a6e3a1 0%, #94e2d5 100%);
}

/* メニュー画面 */
.menu-container {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.game-title {
    font-size: 3.5em;
    margin-bottom: 50px;
    background: linear-gradient(135deg, #cba6f7 0%, #f38ba8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(203, 166, 247, 0.3);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* 楽曲選択画面 */
.song-select-container {
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.song-select-container h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #cba6f7;
}

.song-list {
    margin-bottom: 30px;
}

.song-item {
    background: rgba(69, 71, 90, 0.8);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.song-item:hover, .song-item.selected {
    border-color: #89b4fa;
    background: rgba(137, 180, 250, 0.1);
}

.song-info {
    text-align: left;
}

.song-title {
    font-size: 1.5em;
    color: #cdd6f4;
    margin-bottom: 5px;
}

.song-artist, .song-bpm {
    color: #a6adc8;
    margin-bottom: 3px;
}

.play-preview-btn {
    background: #f38ba8;
    color: #1e1e2e;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-preview-btn:hover {
    background: #f2cdcd;
    transform: scale(1.1);
}

.song-select-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* リザルト画面 */
.result-container {
    text-align: center;
    width: 90%;
    max-width: 500px;
}

.result-container h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #a6e3a1;
}

.final-score {
    margin-bottom: 30px;
}

.final-score h3 {
    font-size: 3em;
    color: #f9e2af;
    margin-bottom: 10px;
}

.final-score p {
    font-size: 2em;
    font-weight: bold;
}

.result-details {
    background: rgba(69, 71, 90, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(166, 173, 200, 0.2);
}

.result-row:last-child {
    border-bottom: none;
}

.result-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* 設定画面 */
.settings-container {
    width: 90%;
    max-width: 600px;
}

.settings-container h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 30px;
    color: #89b4fa;
}

.setting-group {
    background: rgba(69, 71, 90, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.setting-group h3 {
    color: #cba6f7;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-item label {
    min-width: 150px;
    text-align: left;
}

.setting-item input[type="range"] {
    flex: 1;
    height: 6px;
    background: #45475a;
    border-radius: 3px;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #89b4fa;
    border-radius: 50%;
    cursor: pointer;
}

.settings-buttons {
    text-align: center;
}

/* ヘルプ画面 */
.help-container {
    width: 90%;
    max-width: 700px;
}

.help-container h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 30px;
    color: #a6e3a1;
}

.help-content {
    background: rgba(69, 71, 90, 0.8);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #f9e2af;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.help-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.help-section ul {
    margin-left: 20px;
    line-height: 1.6;
}

.help-section li {
    margin-bottom: 5px;
}

.help-buttons {
    text-align: center;
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5em;
    }
    
    .song-item {
        padding: 15px;
    }
    
    .song-title {
        font-size: 1.2em;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-item label {
        min-width: auto;
    }
    
    .setting-item input[type="range"] {
        width: 100%;
    }
}