/* === 全体の設定 === */
body {
    font-family: "Zen Maru Gothic", sans-serif;
    background-color: #FFF8E1;
    background-image: 
        linear-gradient(#E0F7FA 1px, transparent 1px),
        linear-gradient(90deg, #E0F7FA 1px, transparent 1px);
    background-size: 20px 20px;
    margin: 0;
    padding: 20px 10px;
    text-align: center;
    color: #444;
    user-select: none;
    -webkit-user-select: none;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    padding: 30px 20px;
    height: auto;
    min-height: auto; 
    border: 4px solid #FFECB3;
}

.screen {
    width: 100%;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === スタート・終了画面 === */

/* タイトルエリア修正：黄緑色、傾きなし、立体的 */
.title-area {
    background-color: #8BC34A; /* ゲーム画面の緑と統一 */
    color: white;
    padding: 20px;
    border-radius: 20px; /* 角丸長方形 */
    margin-bottom: 20px;
    transform: none; /* 傾き削除 */
    box-shadow: 0 6px 0 #558B2F; /* 立体的な影 */
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.main-title {
    font-size: 36px;
    margin: 0;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.description {
    font-size: 18px;
    line-height: 1.8;
    color: #555;
    background: #E1F5FE;
    padding: 20px;
    border-radius: 15px;
    border: 2px dashed #81D4FA;
    margin-bottom: 20px;
}

/* 赤太字の設定 */
.highlight-red {
    color: #FF1744;
    font-size: 1.1em;
    font-weight: bold;
}

/* 音設定：普通のチェックボックスに戻す */
.sound-setting {
    margin: 25px 0;
    font-size: 20px;
    font-weight: bold;
    color: #666;
}

.checkbox-label {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* チェックボックスを大きくする */
.checkbox-label input[type="checkbox"] {
    transform: scale(1.8); /* サイズ1.8倍 */
    margin-right: 15px;
    cursor: pointer;
}

/* === ゲーム画面ヘッダー === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #ddd;
}

.badge {
    background-color: #8BC34A;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #666;
}

/* === ゲームエリア（画像リスト） === */
.game-area-wrapper {
    margin: 10px 0;
}

.game-area {
    position: relative;
}

.image-list {
    list-style: none;
    padding: 5px; /* 余白を減らしました */
    margin: 0;
    background-color: #FAFAFA;
    border: 3px solid #B0BEC5;
    border-radius: 15px;
    min-height: 200px; 
}

/* 画像アイテム修正：画像を大きく表示 */
.image-item {
    background-color: white;
    border: 2px solid #EEE;
    margin: 6px 0;
    height: 90px;
    border-radius: 12px;
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    position: relative;
    box-shadow: 0 3px 0 #ddd;
    transition: transform 0.1s;
    /* 左右の余白を削除 */
    padding: 0; 
}

.image-item:active {
    cursor: grabbing;
}

.image-item img {
    /* 画像を枠いっぱいに広げる */
    width: 100%; 
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
    /* 必要なら少しだけパディングを入れる（お好みで調整してください） */
    padding: 0 5px; 
}

.image-item.dragging {
    opacity: 0.6;
    background-color: #FFF9C4;
    border: 2px dashed #FBC02D;
    transform: scale(0.98);
}

/* ○×判定オーバーレイ */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 150px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    text-shadow: 4px 4px 0 #fff; 
}

/* メッセージエリア */
.game-message {
    height: 35px;
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === ボタン類 === */
.btn {
    font-family: "Zen Maru Gothic", sans-serif;
    font-size: 20px;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin: 5px;
    font-weight: bold;
    transition: all 0.1s;
    border-bottom: 5px solid rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(4px);
    border-bottom: 1px solid rgba(0,0,0,0.2);
    margin-bottom: 9px;
}

.start-btn {
    background-color: #00BCD4;;
    color: white;
    font-size: 24px;
    padding: 15px 60px;
    width: 80%;
    margin-top: 10px;
}

.primary-btn {
    background-color: #00BCD4;
    color: white;
    min-width: 140px;
}

.secondary-btn {
    background-color: #CFD8DC;
    color: #546E7A;
}

.text-btn {
    background: none;
    border: 2px solid #ccc;
    color: #888;
    font-size: 14px;
    padding: 5px 15px;
    border-bottom: 2px solid #bbb;
}

/* === 結果画面 === */
.end-title {
    color: #E91E63;
    font-size: 28px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border: 3px solid #E91E63;
    border-radius: 20px;
    padding: 20px;
    width: 80%;
    margin: 0 auto 30px auto;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    margin: 10px 0;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
}

.score-num {
    font-size: 32px;
}
.red { color: #E91E63; }
.gray { color: #78909C; }

.final-comment {
    font-size: 24px;
    color: #FF9800;
    font-weight: bold;
    margin-bottom: 30px;
}