/* style.css - Update for Enemy Images */
:root {
    --primary-color: #FF9F1C;
    --secondary-color: #2EC4B6;
    --accent-color: #FFBF69;
    --success-color: #4CB944;
    --danger-color: #E71D36;
    --bg-color: #CBF3F0;
    --card-bg: #FFFFFF;
    --text-color: #2B2D42;
    --shadow: 0 8px 0 rgba(0,0,0,0.15);
    --shadow-pressed: 0 4px 0 rgba(0,0,0,0.15);
}

body {
    font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic Pro", "Meiryo", sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--secondary-color) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    touch-action: manipulation;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 50px;
}

h1, h2, h3 {
    text-align: center;
    color: var(--text-color);
    text-shadow: 2px 2px 0 #fff;
}

h1 {
    font-size: 2.5rem;
    color: #FF5400;
    margin-bottom: 10px;
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    text-align: center;
    border: 4px solid #fff;
    position: relative;
}

/* キャラクター画像 (案内役など) */
.character-img {
    max-width: 150px;
    height: auto;
    margin-bottom: -10px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.2));
    transition: transform 0.3s;
}
.character-img:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 敵画像 */
.enemy-container {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.enemy-img {
    max-height: 100%;
    max-width: 100%;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
    animation: float 3s ease-in-out infinite;
}

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

/* 経験値バー */
.xp-bar-container {
    background: #eee;
    border-radius: 15px;
    height: 25px;
    width: 100%;
    margin: 10px 0;
    border: 2px solid #fff;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.xp-bar-fill {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    height: 100%;
    width: 0%;
    border-radius: 15px;
    transition: width 0.5s ease-out;
}

.xp-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    line-height: 25px;
}

/* ボタン */
.btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border-radius: 15px;
    text-decoration: none;
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    transition: all 0.1s;
    box-sizing: border-box;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:active {
    box-shadow: var(--shadow-pressed);
    transform: translateY(4px);
}

.btn-primary { 
    background-color: var(--primary-color); 
    color: #fff;
}
.btn-success { 
    background-color: var(--success-color);
}
.btn-danger { 
    background-color: var(--danger-color);
}
.btn-outline { 
    background-color: #fff; 
    border: 3px solid var(--secondary-color); 
    color: var(--secondary-color);
    box-shadow: 0 4px 0 #ddd;
}
.btn-outline:active {
    box-shadow: 0 2px 0 #ddd;
}

/* フラッシュカード */
.flashcard {
    min-height: 400px; /* 少し縦長に */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: #fff;
    border: 5px solid var(--secondary-color);
    transition: transform 0.2s;
}

.flashcard:active {
    transform: scale(0.98);
}

.word-en {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 10px;
}

.word-jp {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
    display: none;
}
.word-jp.visible {
    display: block;
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.actions {
    display: none;
    margin-top: 30px;
    gap: 15px;
    width: 100%;
}
.actions.visible {
    display: flex;
    justify-content: space-between;
}

/* アニメーション */
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

.bounce {
    animation: bounce 1s;
}

/* コンボ表示 */
.combo-counter {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

/* レベルバッジ */
.level-badge {
    background: #FFD700;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* サウンドコントロール */
.sound-control {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* レスポンシブ (タブレット・スマホ) */
@media (max-width: 600px) {
    .word-en { font-size: 2.5rem; }
    .word-jp { font-size: 1.5rem; }
    .btn { padding: 12px; font-size: 1rem; }
}

/* ランキング表 */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.ranking-table th, .ranking-table td {
    padding: 10px;
    border-bottom: 2px solid #eee;
    text-align: center;
    font-weight: bold;
}
.ranking-table th {
    color: #888;
    font-size: 0.8rem;
}
.rank-1 { color: #FFD700; font-size: 1.2rem; text-shadow: 1px 1px 0 #000; } /* 金 */
.rank-2 { color: #C0C0C0; font-size: 1.1rem; text-shadow: 1px 1px 0 #000; } /* 銀 */
.rank-3 { color: #CD7F32; font-size: 1.1rem; text-shadow: 1px 1px 0 #000; } /* 銅 */

.current-user-row {
    background-color: #fff9c4; /* 自分をハイライト */
    border: 2px solid #FFD700;
    border-radius: 10px;
}
/* テーブルの行に丸みをつけるためのハック */
.ranking-table tr.current-user-row td:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; border-left: 2px solid #FFD700; }
.ranking-table tr.current-user-row td:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-right: 2px solid #FFD700; }
