/* === 基本設定 === */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    overflow: hidden;
}

#app-container {
    width: 100%;
    height: 100%;
}

.screen {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* === ボタン共通スタイル === */
button {
    background-color: #e74c3c;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

    button:hover {
        background-color: #c0392b;
    }

    button:disabled {
        background-color: #95a5a6;
        cursor: not-allowed;
    }


/* === タイトル画面 === */
#title-screen {
    text-align: center;
    position: relative;
}

.title-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('images/GCSsloter_title_image.png');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.title-content {
    position: relative;
    z-index: 2;
    background-color: rgba(0,0,0,0.3);
    padding: 30px;
    border-radius: 20px;
}

.title-logo {
    max-width: 80%;
    height: auto;
    margin-bottom: 30px;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.title-btn {
    font-size: 22px;
    font-weight: bold;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid white;
    border-radius: 15px;
    padding: 10px 40px;
    min-width: 300px;
}

    .title-btn:hover {
        background-color: rgba(52, 152, 219, 0.7);
    }

.volume-control-group {
    margin-top: 20px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 10px;
}

.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .volume-control label {
        width: 80px;
        text-align: right;
    }

input[type="range"] {
    width: 180px;
}

#click-prompt {
    margin-top: 15px;
    padding: 5px 10px;
    background-color: rgba(0,0,0,0.7);
    border-radius: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}


/* === ゲーム画面 === */
#game-screen {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}

#slot-container, #shop-container {
    background-color: #34495e;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

#slot-container {
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

#slot-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: 220px;
    height: 100%;
}

#slot-main-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    flex-grow: 1;
    min-width: 300px;
}

#spin-button {
    width: 100%;
    min-height: 70px;
    font-size: 20px;
    margin: 10px 0;
}

#shop-container {
    flex-direction: column;
    max-width: 320px;
}

#status-label {
    text-align: center;
    font-size: 16px;
    padding: 10px;
    border-radius: 5px;
    background-color: #2c3e50;
    flex-shrink: 0;
    width: 100%;
}

#slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
}

.slot-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 8vw, 50px);
    font-weight: bold;
    font-family: 'Segoe UI Symbol', sans-serif;
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #34495e;
    border-radius: 10px;
}

.win {
    color: #e74c3c !important;
    animation: win-pulse 0.5s infinite alternate;
}

@keyframes win-pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.effects-container {
    text-align: center;
    flex-shrink: 0;
    width: 100%;
}

#active-effects-label {
    min-height: 80px;
    padding: 10px;
    border-radius: 5px;
    color: #95a5a6;
    border: 1px dashed #7f8c8d;
    text-align: center;
    line-height: 1.5;
    flex-grow: 1;
}

    #active-effects-label.active {
        color: #2ecc71;
        border: 1px solid #27ae60;
    }

#result-label {
    text-align: center;
    font-size: 16px;
    min-height: 3em;
    flex-shrink: 0;
    width: 100%;
}

.bottom-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: 100%;
}

    .bottom-buttons button {
        font-size: 14px;
        padding: 5px 10px;
        background-color: #34495e;
        border: 1px solid #7f8c8d;
        width: 100%;
    }

        .bottom-buttons button:hover {
            background-color: #4a627a;
        }

/* ショップ */
#shop-container h2 {
    flex-shrink: 0;
    text-align: center;
    margin: 0;
}

#shop-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
    padding: 5px;
}

.shop-item {
    background-color: #2c3e50;
    border: 1px solid #34495e;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

    .shop-item:hover {
        border-color: #3498db;
    }

    .shop-item.selected {
        border-color: #2ecc71;
        border-width: 2px;
    }

    .shop-item img {
        width: 60px;
        height: 60px;
        margin-bottom: 5px;
    }

.shop-item-placeholder {
    font-size: 30px;
    color: #7f8c8d;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

#item-desc-label {
    min-height: 70px;
    border: 1px dashed #7f8c8d;
    padding: 10px;
    border-radius: 5px;
    flex-shrink: 0;
}

#purchase-button {
    flex-shrink: 0;
}


/* === 実績画面 === */
#achievement-screen {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 100vh;
}

#achievement-list {
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #34495e;
    border-radius: 5px;
    padding: 15px;
    background-color: #34495e;
}

.achievement-item {
    display: grid;
    grid-template-columns: 64px 1fr 2fr;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #2c3e50;
}

    .achievement-item:last-child {
        border-bottom: none;
    }

.ach-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

    .ach-icon img {
        width: 100%;
        height: 100%;
    }

.ach-details {
    display: flex;
    flex-direction: column;
}

.ach-name {
    font-weight: bold;
    color: #95a5a6;
}

    .ach-name.unlocked {
        color: #f1c40f;
    }

.ach-desc {
    color: #7f8c8d;
}

    .ach-desc.unlocked {
        color: #bdc3c7;
    }

.achievement-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

#ach-reset-btn {
    background-color: #c0392b;
}

    #ach-reset-btn:hover {
        background-color: #a93226;
    }

/* === クレジット画面 === */
#credits-screen {
    position: relative;
    overflow: hidden;
}

.credits-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('images/GCSsloter_end.png');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.credits-scroll-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}
/* ▼▼▼ ここから変更 ▼▼▼ */
.credits-content {
    position: absolute;
    width: 100%;
    text-align: center;
    /* アニメーションはJSから適用 */
}

#credits-back-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 3;
}

@keyframes scroll-credits {
    from {
        transform: translateY(var(--scroll-start));
    }

    to {
        transform: translateY(var(--scroll-end));
    }
}
/* ▲▲▲ ここまで変更 ▲▲▲ */


/* === 通知 === */
#achievement-notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #f1c40f;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    padding: 15px 25px;
    z-index: 1000;
    transition: bottom 0.5s ease-out;
}

    #achievement-notification.show {
        bottom: 20px;
    }

/* === モーダル === */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

#modal-box {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #ecf0f1;
    text-align: center;
    max-width: 500px;
}

#modal-text {
    margin: 20px 0;
    line-height: 1.6;
}

#modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* === レスポンシブ対応 === */
@media (max-width: 1000px) {
    #game-screen {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #slot-container, #shop-container {
        width: 95%;
        max-width: none;
        height: auto;
    }

    #slot-container {
        flex-direction: column;
    }

    #slot-controls {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .title-btn {
        min-width: 250px;
    }
}
