body {
    font-family: 'Arial', sans-serif;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(to bottom right, #87CEEB, #ADD8E6);
    padding: 10px;
    box-sizing: border-box;
    color: #333;
}

#start-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    margin: auto;
    max-width: 500px;
    width: 90%;
}

#start-screen h2 {
    font-size: 38px;
    color: #2c3e50;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#start-button {
    font-size: 26px;
    padding: 15px 30px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#start-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

#start-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-options {
    margin-top: 20px;
    font-size: 18px;
    color: #555;
}

.game-options label,
.game-options select {
    margin: 0 5px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #bbb;
    background-color: #f9f9f9;
    font-size: 16px;
    color: #333;
}

.game-options select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

.main-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px; /* パディングを調整 */
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 60vh; /* 最小高さを調整 */
    margin: auto;
}

h1 {
    color: #2c3e50;
    font-size: 36px;
    margin-bottom: 5px; /* マージンを調整 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

p {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 5px; /* マージンを調整 */
}

#scores span {
    font-size: 48px !important; /* さらに大きく、強制適用 */
    color: #007bff; /* 青色にして強調 */
}

#scores {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 26px; /* 親要素のフォントサイズは小さくてもOK */
    font-weight: bold;
    margin-bottom: 10px;
    color: #34495e;
}

#reach-message {
    font-size: 30px;
    font-weight: bold;
    color: #e74c3c;
    animation: blink 0.8s infinite alternate;
    margin-bottom: 5px; /* マージンを調整 */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

#streak-message {
    font-size: 18px;
    font-weight: bold;
    color: #3498db;
    margin-top: 5px;
    height: 22px;
    margin-bottom: 10px; /* マージンを調整 */
}

#character-display {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 10px; /* マージンを調整 */
}

.character-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

#result {
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
}

#vs-text p {
    font-size: 60px !important; /* 60pxに設定 */
    line-height: 1; /* 行の高さを調整して詰める */
}

#vs-text {
    font-weight: bold;
    color: #e67e22;
    margin: 0 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.result-display {
    text-align: center;
}

.result-img {
    width: 110px;
    height: 110px;
    border: 3px solid #ccc;
    border-radius: 10px;
    animation-duration: 0.5s;
    animation-timing-function: ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#outcome {
    font-size: 26px;
    font-weight: bold;
    margin-top: 15px; /* マージンを調整 */
    color: #27ae60;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

#choose-hand-text {
    margin-top: 20px; /* マージンを調整 */
    font-size: 20px;
    font-weight: bold;
    color: #555;
}

#player-choices {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

#player-choices .choice {
    width: 100px;
    height: 100px;
    cursor: pointer;
    margin: 8px;
    border: 3px solid transparent;
    border-radius: 10px;
    transition: transform 0.1s ease, border-color 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#player-choices .choice:hover {
    transform: scale(1.05);
    border-color: #3498db;
}

.hidden {
    display: none !important;
}

#game-over {
    margin-top: 20px; /* マージンを調整 */
    font-size: 26px;
    font-weight: bold;
    color: #e74c3c;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

#reset-button {
    font-size: 18px;
    padding: 10px 20px;
    margin-top: 10px; /* マージンを調整 */
    background-color: #f39c12;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#reset-button:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

#reset-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- Animation Classes --- */
.popup {
    animation-name: popup;
}

.shake {
    animation-name: shake;
}

.win-glow {
    animation-name: win-glow;
    box-shadow: 0 0 25px 12px gold;
}

.score-up {
    animation-name: score-up;
    animation-duration: 0.3s;
}

@keyframes popup {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes win-glow {
    0% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 25px 12px gold; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes score-up {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Confetti --- */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 20px;
    background: #f00;
    top: -20px;
    opacity: 0;
    animation: fall 5s linear infinite;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
