body {
    margin: 0;
    padding: 0;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: url('images/background.png') center/cover, linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* 共通画面スタイル */
#start-screen,
#game-screen,
#result-screen {
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    display: none; /* デフォルトは非表示 */
}


/* GameBaseの画面管理システムに対応 */
#start-screen.active, #game-screen.active, #result-screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* スタート画面 */
.game-icon {
    width: 200px;
    height: 200px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

#start-screen h1 {
    font-size: 48px;
    margin: 0 0 20px 0;
}

#start-screen p {
    font-size: 20px;
    margin-bottom: 30px;
}

/* ボタン */
.primary-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.primary-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

/* UI統計 */
#ui {
    margin-bottom: 30px;
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    font-size: 18px;
    font-weight: bold;
}

.highlight {
    color: #ffd700;
    font-size: 24px;
}

/* 問題エリア */
#question-area {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

#question-text {
    font-size: 64px;
    margin: 0 0 30px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#input-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

#answer-input {
    width: 200px;
    padding: 15px;
    font-size: 32px;
    text-align: center;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    font-weight: bold;
}

#answer-input:focus {
    outline: 3px solid #ffd700;
}

#submit-btn {
    padding: 15px 30px;
    font-size: 20px;
}

/* フィードバック */
#feedback {
    margin-top: 20px;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    animation: fadeIn 0.3s;
}

#feedback.success {
    background: rgba(72, 187, 120, 0.8);
}

#feedback.fail {
    background: rgba(229, 62, 62, 0.8);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 結果画面 */
#result-screen h2 {
    font-size: 36px;
    margin-bottom: 30px;
}

.result-stats {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.result-stats p {
    font-size: 24px;
    margin: 15px 0;
}

/* レスポンシブ対応 */

/* タブレット横向き・中サイズデスクトップ */
@media (max-width: 1024px) {
    #start-screen h1 {
        font-size: 42px;
    }

    #start-screen p {
        font-size: 18px;
    }

    .game-icon {
        width: 180px;
        height: 180px;
    }

    #question-text {
        font-size: 56px;
    }

    #answer-input {
        width: 180px;
        font-size: 28px;
    }
}

/* タブレット縦向き */
@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 36px;
    }

    #start-screen p {
        font-size: 16px;
    }

    .game-icon {
        width: 160px;
        height: 160px;
    }

    #question-text {
        font-size: 52px;
    }

    #answer-input {
        width: 160px;
        font-size: 26px;
        padding: 12px;
    }

    .primary-btn {
        padding: 12px 32px;
        font-size: 18px;
    }

    #submit-btn {
        padding: 12px 24px;
        font-size: 18px;
    }

    #question-area {
        padding: 30px;
    }

    .result-stats p {
        font-size: 22px;
    }

    #result-screen h2 {
        font-size: 32px;
    }
}

/* スマートフォン */
@media (max-width: 600px) {
    #start-screen h1 {
        font-size: 32px;
        margin: 0 0 15px 0;
    }

    #start-screen p {
        font-size: 15px;
        margin-bottom: 25px;
    }

    .game-icon {
        width: 140px;
        height: 140px;
        margin-bottom: 15px;
    }

    #question-text {
        font-size: 48px;
        margin: 0 0 25px 0;
    }

    #answer-input {
        width: 150px;
        font-size: 24px;
        padding: 12px;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
        font-size: 16px;
    }

    .highlight {
        font-size: 20px;
    }

    #question-area {
        padding: 25px 20px;
    }

    .primary-btn {
        padding: 12px 30px;
        font-size: 18px;
    }

    #submit-btn {
        padding: 12px 20px;
        font-size: 18px;
    }

    #feedback {
        font-size: 20px;
        padding: 12px 25px;
    }

    .result-stats {
        padding: 25px;
    }

    .result-stats p {
        font-size: 20px;
        margin: 12px 0;
    }

    #result-screen h2 {
        font-size: 28px;
        margin-bottom: 25px;
    }
}

/* 小さいスマートフォン */
@media (max-width: 480px) {
    #start-screen h1 {
        font-size: 28px;
    }

    #start-screen p {
        font-size: 14px;
    }

    .game-icon {
        width: 120px;
        height: 120px;
    }

    #question-text {
        font-size: 40px;
    }

    #answer-input {
        width: 130px;
        font-size: 22px;
        padding: 10px;
    }

    #input-container {
        flex-direction: column;
        gap: 15px;
    }

    #submit-btn {
        width: 100%;
        max-width: 200px;
    }

    #question-area {
        padding: 20px 15px;
    }

    .stats {
        font-size: 15px;
    }

    .primary-btn {
        padding: 12px 25px;
        font-size: 16px;
    }

    #feedback {
        font-size: 18px;
        padding: 10px 20px;
    }

    .result-stats p {
        font-size: 18px;
    }

    #result-screen h2 {
        font-size: 24px;
    }
}

/* 極小スマートフォン（横向きも考慮） */
@media (max-width: 380px) {
    #start-screen h1 {
        font-size: 24px;
    }

    .game-icon {
        width: 100px;
        height: 100px;
    }

    #question-text {
        font-size: 36px;
    }

    #answer-input {
        width: 120px;
        font-size: 20px;
    }

    .stats {
        font-size: 14px;
    }

    .highlight {
        font-size: 18px;
    }
}

/* 横向き対応（高さが制限される場合） */
@media (max-height: 600px) and (orientation: landscape) {
    .game-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
    }

    #start-screen h1 {
        font-size: 28px;
        margin: 0 0 10px 0;
    }

    #start-screen p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    #question-area {
        padding: 15px;
    }

    #question-text {
        font-size: 36px;
        margin: 0 0 15px 0;
    }

    #ui {
        margin-bottom: 15px;
    }

    .stats {
        font-size: 14px;
    }

    .result-stats {
        padding: 15px;
        margin-bottom: 15px;
    }

    .result-stats p {
        font-size: 16px;
        margin: 8px 0;
    }

    #result-screen h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
}
