/* 基本設定 */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Helvetica', 'Arial', sans-serif;
    background-color: #333;
    color: white;

}



/* ゲーム全体のコンテナ */
#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* スマホ横画面を想定 */
    max-width: 800px; 
    max-height: 450px;
    margin: auto;
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
}

/* 画面の基本スタイル（スタート画面・ゲームオーバー画面） */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.message-box {
    text-align: center;
    padding: 20px;
    background: #444;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.message-box h1 {
    margin-top: 0;
}

.message-box button {
    padding: 10px 20px;
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #5a5a5a;
    color: white;
    transition: background-color 0.3s;
}
.message-box button:hover {
    background-color: #777;
}

/* ゲームボード */
#game-board {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    box-sizing: border-box;
}

/* 手札エリア */
.hand-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    height: 33%;
}

/* 中央エリア */
.center-field {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    height: 33%;
    min-height: 120px; /* カードの高さに合わせる */
}

/* スコア表示エリア */
.score-area {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

/* カードのスタイル */
.card {
    width: 80px;
    height: 120px;
    border-radius: 8px;
    background-color: #a9a9a9; /* 裏側の色 */
    cursor: pointer;
    position: relative;
    transition: transform 0.6s, box-shadow 0.3s;
    transform-style: preserve-3d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.card .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    font-weight: bold;
    border-radius: 8px;
}

.card .card-front {
    background-color: #fff;
    color: #333;
    transform: rotateY(180deg);
}

.card .card-back {
    /* 裏側は.cardの背景色で表示 */
}

/* めくられたカード */
.card.flipped {
    transform: rotateY(180deg);
}

/* 使用不可のカード */
.card.used {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

/* 0のカードの画像 */
.card-front img {
    max-width: 100%;
    max-height: 100%;
}

/* PC用キーボードカーソル */
.card.selected {
    box-shadow: 0 0 15px 5px gold;
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

#game-over-message {
    font-size: 24px;
    font-weight: bold;
}