/* minigame.css */

#page-minigame {
    background: radial-gradient(circle at center, #fff, #fff0f5);
    display: flex; flex-direction: column;
}

.game-ui {
    height: 100%; display: flex; flex-direction: column; justify-content: space-between;
}

.game-stats-container {
    background: rgba(255,255,255,0.9); padding: 15px; border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-bottom: 20px;
}
.stat-box { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-box i { color: var(--deep-rose); width: 20px; text-align: center; }
.stat-bar-bg { flex: 1; height: 12px; background: #eee; border-radius: 6px; overflow: hidden; }
.stat-bar-val { height: 100%; background: linear-gradient(90deg, #ff9a9e, #ffb7d5); transition: width 0.5s, background 0.3s; }

.game-char-area {
    flex: 1; display: flex; justify-content: center; align-items: center; position: relative;
    overflow: hidden; /* エフェクトが枠外に出ないように */
}

.floating-char {
    width: 180px; height: auto;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.1));
    transition: transform 0.3s, filter 0.3s;
    will-change: transform;
}

/* --- 生きているようなランダムな動き --- */
.char-pose-1 { transform: translate(-5px, 2px) rotate(-2deg) scale(1.01); }
.char-pose-2 { transform: translate(5px, -3px) rotate(2deg) scale(0.99); }
.char-pose-3 { transform: translate(0px, 5px) scale(1.02); }

/* --- 状態変化 --- */
/* 空腹時：青ざめて震える */
.char-starving {
    filter: hue-rotate(180deg) brightness(1.2) grayscale(0.5) !important;
    animation: shivering 0.2s infinite alternate !important;
}
@keyframes shivering {
    0% { transform: translate(0, 0) rotate(0); }
    100% { transform: translate(2px, 0) rotate(1deg); }
}

/* アクション反応（バウンド） */
.anim-bounce { animation: bounce-happy 0.6s !important; }
@keyframes bounce-happy {
    0% { transform: scale(1); }
    30% { transform: scale(1.15) translateY(-10px); }
    50% { transform: scale(1.1) translateY(0); }
    70% { transform: scale(1.05) translateY(-5px); }
    100% { transform: scale(1); }
}

/* --- エフェクト（パーティクル） --- */
.effect-particle {
    position: absolute;
    pointer-events: none;
    font-size: 24px;
    z-index: 20;
    animation: float-up-fade 1.5s ease-out forwards;
}
.particle-heart { color: #ff6b81; }
.particle-star { color: #ffd700; }
.particle-sparkle { color: #a18cd1; font-size: 30px; }

@keyframes float-up-fade {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    20% { opacity: 1; transform: translate(var(--rnd-x, 0), -20px) scale(1.2); }
    100% { transform: translate(var(--rnd-x2, 0), -100px) scale(0); opacity: 0; }
}

/* --- レベルアップ演出 --- */
.level-up-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 999;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.level-up-overlay.show { display: flex; animation: fadeIn 0.3s; }

.level-up-box {
    background: white; padding: 30px; border-radius: 20px;
    text-align: center; color: var(--deep-rose);
    box-shadow: 0 10px 30px rgba(255,183,213,0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.level-up-box i { font-size: 40px; margin-bottom: 10px; color: gold; }
.level-up-box h3 { margin: 0; font-size: 24px; font-weight: 800; }
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; }
}

.game-controls { display: flex; gap: 10px; padding-top: 20px; }
.game-btn {
    flex: 1; padding: 15px 5px; border: none; background: white;
    border-radius: 15px; color: var(--text-dark); font-weight: bold;
    box-shadow: 0 4px 0 #eee; cursor: pointer; font-size: 12px;
}
.game-btn:active { transform: translateY(4px); box-shadow: none; }
.game-btn i { font-size: 20px; color: var(--deep-rose); margin-bottom: 5px; display: block; }