body {
    background: radial-gradient(ellipse at bottom, #0d1117 0%, #050508 100%);
    color: #fff;
    font-family: 'Helvetica Neue', Arial, sans-serif;    
    height: 100vh;
    margin: 0;
    overflow: hidden;
    display: flex; /* bodyをflexにして、子要素（スタート画面やゲーム画面）を中央に配置 */
    justify-content: center;
    align-items: center;
}

/* スタート画面 */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: radial-gradient(ellipse at bottom, #0d1117 0%, #050508 100%); /* 背景を統一 */
}

#start-screen h1 {
    font-size: 4rem;
    color: #00f2ff;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
}

#start-button {
    padding: 15px 40px;
    font-size: 2rem;
    cursor: pointer;
    background-color: #00f2ff;
    color: #0f0f1b;
    border: none;
    border-radius: 10px;
    margin-top: 40px;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.7);
    transition: all 0.3s ease;
}

#start-button:hover {
    background-color: #00c0d0;
    box-shadow: 0 0 25px rgba(0, 242, 255, 1);
    transform: scale(1.05);
}

/* 星空の背景スタイル */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 3層の異なる速度の星（眩しくないよう透明度を低く設定） */
#stars1, #stars2, #stars3 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-repeat: repeat;
}

#stars1 {
    background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.2), transparent),
                      radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.1), transparent);
    background-size: 200px 200px;
    animation: moveStars 100s linear infinite;
}

#stars2 {
    background-image: radial-gradient(2px 2px at 50px 100px, rgba(255,255,255,0.15), transparent);
    background-size: 300px 300px;
    animation: moveStars 150s linear infinite;
}

@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

#game-container {
    display: none; /* JSでflexに切り替え */
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    min-width: 500px;
}

#katakana-display {
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #cca300;
    text-shadow: 0 0 8px rgba(204, 163, 0, 0.3);
}

#pokemon-image {
    width: 150px; /* 画像のサイズを調整 */
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.5)); /* ネオン風の影 */
}

#typed-display {
    margin-top: 2rem;
    font-size: 3rem;
    height: 1.5em;
    letter-spacing: 0.3rem;
    font-weight: bold;
    /* キラキラした豪華なグラデーション */
    background: linear-gradient(
        90deg, 
        #0099aa 0%, 
        #a0f9ff 25%, 
        #0099aa 50%, 
        #a0f9ff 75%, 
        #0099aa 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* ネオンの輝き */
    filter: drop-shadow(0 0 5px rgba(0, 242, 255, 0.4));
    animation: shimmer 2s linear infinite, sparkle-glow 1.5s ease-in-out infinite alternate;
}

/* 横に光が流れるアニメーション */
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* 輝きが強弱するアニメーション */
@keyframes sparkle-glow {
    from { filter: drop-shadow(0 0 5px rgba(0, 242, 255, 0.4)); }
    to { filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.6)) brightness(1.1); }
}

/* ゲーム情報表示（タイマー、スコア） */
.game-info {
    position: fixed;
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    z-index: 10;
}

#timer-display {
    top: 20px;
    left: 30px;
}

/* 残り10秒以下の強調スタイル */
.timer-urgent {
    color: #ff4d4d !important;
    font-size: 4rem !important;
    text-shadow: 0 0 20px rgba(255, 77, 77, 0.6);
    animation: timer-pulse 0.5s infinite;
    transform-origin: left top;
}

@keyframes timer-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#total-score-display {
    top: 20px;
    right: 30px;
}

/* 1文字打つたびのポップエフェクト */
.type-pop {
    animation: type-pop-anim 0.1s ease-out;
}

@keyframes type-pop-anim {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); filter: brightness(1.2); }
    100% { transform: scale(1); }
}

/* ミス時のフラッシュアニメーション */
@keyframes flash-red {
    0% { box-shadow: inset 0 0 100px rgba(255, 0, 0, 0.25); }
    100% { box-shadow: inset 0 0 100px rgba(255, 0, 0, 0); }
}

.miss-flash {
    animation: flash-red 0.3s ease-out;
}

/* ミス時のメッセージ表示 (画面左上) */
#miss-overlay {
    position: fixed;
    top: 20px;
    left: 30px;
    font-size: 3rem;
    font-weight: 900;
    font-style: italic;
    color: rgba(255, 77, 77, 0.8); /* 眩しすぎない落ち着いた赤 */
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    text-transform: uppercase;
}

#miss-overlay.show {
    opacity: 1;
    /* 左上で震えるようなアニメーション */
    animation: miss-shake 0.3s ease-in-out;
}

@keyframes miss-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* コンボ表示のスタイル */
#combo-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    font-size: 2.5rem;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    font-weight: bold;
}

/* 途中終了ボタンのスタイル */
#quit-button {
    position: fixed;
    bottom: 40px;
    left: 40px;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

#quit-button:hover {
    background-color: rgba(255, 77, 77, 0.2);
    border-color: rgba(255, 77, 77, 0.5);
    color: #ff4d4d;
    transform: scale(1.05);
}

/* ゲームオーバーモーダル */
#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* 初期状態では非表示 */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#modal .modal-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.2);
}

#modal h2 {
    font-size: 4rem;
    color: #ffcc00;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.7);
    margin-bottom: 30px;
}

#rank-display {
    font-size: 6rem;
    font-weight: 900;
    margin-bottom: 10px;
    font-style: italic;
    text-shadow: 0 0 20px currentColor;
    animation: rank-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#final-score-display {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 40px;
}

#return-to-start-button {
    padding: 15px 30px;
    font-size: 1.5rem;
    cursor: pointer;
    background-color: #ff00ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.7);
    transition: all 0.3s ease;
}

#return-to-start-button:hover {
    background-color: #cc00cc;
    box-shadow: 0 0 25px rgba(255, 0, 255, 1);
    transform: scale(1.05);
}

@keyframes rank-in {
    0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 正解時のメッセージ表示 (前面に大げさに表示) */
#message-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 8rem;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    /* 金色と水色の二重の輝き */
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.4), 0 0 20px rgba(255, 204, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
    text-align: center;
    text-transform: uppercase;
    line-height: 0.8;
}

#message-overlay.show {
    transform: translate(-50%, -50%) scale(1.2) rotate(-10deg);
    opacity: 1;
}

.combo-message {
    font-size: 4rem;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
    margin-top: 1rem;
    animation: combo-appear 0.4s ease-out forwards;
}

@keyframes combo-appear {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 成功時のフラッシュ */
@keyframes success-flash-anim {
    0% { box-shadow: inset 0 0 100px rgba(0, 242, 255, 0.15); }
    100% { box-shadow: inset 0 0 100px rgba(0, 242, 255, 0); }
}
.success-flash {
    animation: success-flash-anim 0.4s ease-out;
}

/* ポケモンの正解アニメーション */
.pokemon-correct-animation {
    animation: type-pop-anim 0.5s ease-out;
    filter: brightness(1.05) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)) !important;
}