* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 15px;
}

header {
    text-align: center;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.6rem;
    background: linear-gradient(90deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #aaa;
    font-size: 0.85rem;
    margin-top: 3px;
}

/* ゲームエリア */
.game-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
}

/* キャラクターセクション */
.character-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    min-height: 120px;
    margin-bottom: 15px;
}

/* ヒーローキャラ（CSSアート） */
.hero {
    position: relative;
    width: 60px;
    height: 80px;
    animation: heroIdle 1s ease-in-out infinite;
}

.hero-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 45px;
    background: linear-gradient(180deg, #4a90d9, #2d5a87);
    border-radius: 8px 8px 5px 5px;
}

.hero-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    background: linear-gradient(180deg, #ffd4a3, #e5b080);
    border-radius: 50%;
}

.hero-head::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -3px;
    width: 41px;
    height: 20px;
    background: linear-gradient(180deg, #8b4513, #654321);
    border-radius: 10px 10px 0 0;
}

.hero-head::after {
    content: '◕ ◕';
    position: absolute;
    top: 12px;
    left: 5px;
    font-size: 8px;
    letter-spacing: 8px;
}

.hero-sword {
    position: absolute;
    right: -15px;
    top: 25px;
    width: 8px;
    height: 40px;
    background: linear-gradient(180deg, #c0c0c0, #808080);
    border-radius: 2px;
    transform: rotate(-30deg);
}

.hero-sword::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -3px;
    width: 14px;
    height: 8px;
    background: #ffd700;
    border-radius: 2px;
}

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

.hero.attacking {
    animation: heroAttack 0.3s ease-out;
}

@keyframes heroAttack {
    0% { transform: translateX(0); }
    50% { transform: translateX(30px) rotate(10deg); }
    100% { transform: translateX(0); }
}

/* VS テキスト */
.vs-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    animation: vsPulse 1s ease-in-out infinite;
}

@keyframes vsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 敵キャラ */
.enemy {
    text-align: center;
}

.enemy-body {
    width: 50px;
    height: 50px;
    margin: 0 auto 8px;
    border-radius: 50% 50% 45% 45%;
    animation: enemyBounce 0.8s ease-in-out infinite;
}

.enemy-body.slime {
    background: linear-gradient(180deg, #7fdbff, #39cccc);
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.2);
}

.enemy-body.goblin {
    background: linear-gradient(180deg, #3d9970, #2ecc40);
    border-radius: 40%;
}

.enemy-body.orc {
    background: linear-gradient(180deg, #85144b, #b10dc9);
    width: 60px;
    height: 55px;
    border-radius: 30%;
}

.enemy-body.dragon {
    background: linear-gradient(180deg, #ff4136, #ff851b);
    width: 70px;
    height: 60px;
    border-radius: 20%;
    position: relative;
}

.enemy-body.dragon::before {
    content: '🔥';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
}

@keyframes enemyBounce {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-8px) scaleY(0.95); }
}

.enemy.hit .enemy-body {
    animation: enemyHit 0.2s ease-out;
}

@keyframes enemyHit {
    0%, 100% { transform: translateX(0); filter: brightness(1); }
    50% { transform: translateX(10px); filter: brightness(2); }
}

.enemy-hp-bar {
    width: 60px;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin: 0 auto 5px;
    overflow: hidden;
}

.enemy-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4136, #ff851b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.enemy-name {
    font-size: 0.75rem;
    color: #aaa;
}

/* ステータスヘッダー */
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

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

.level-label {
    font-size: 0.8rem;
    color: #888;
}

#level {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700;
    display: block;
}

.points-display {
    font-size: 1.2rem;
    color: #4ecdc4;
    font-weight: bold;
}

.kill-count {
    font-size: 0.9rem;
    color: #ff6b6b;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.action-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: transform 0.1s, box-shadow 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
}

.train-btn {
    background: linear-gradient(145deg, #ffd700, #ffb700);
    color: #333;
}

.battle-btn {
    background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.5rem;
}

/* バトルログ */
.battle-log {
    min-height: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
    padding: 5px;
}

.battle-log.win {
    color: #2ecc40;
    font-weight: bold;
}

.battle-log.lose {
    color: #ff4136;
}

/* ステータスパネル */
.stats-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
}

.stats-panel h2 {
    font-size: 1rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-align: center;
}

.stat-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-of-type {
    border-bottom: none;
}

.stat-icon {
    width: 25px;
    font-size: 1rem;
}

.stat-name {
    flex: 1;
    font-weight: bold;
    color: #aaa;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4ecdc4;
    width: 50px;
    text-align: right;
    margin-right: 10px;
}

.upgrade-btn {
    background: linear-gradient(145deg, #4ecdc4, #44a39b);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.upgrade-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.upgrade-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.upgrade-cost {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 10px;
}

/* 総合力 */
.total-power {
    text-align: center;
    font-size: 1.2rem;
    color: #ff6b6b;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
}

#totalPower {
    font-size: 1.6rem;
    font-weight: bold;
}

/* 称号パネル */
.achievements-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
}

.achievements-panel h2 {
    font-size: 1rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-align: center;
}

.title-display {
    text-align: center;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
}

#currentTitle {
    color: #ffd700;
    font-weight: bold;
}

.achievement-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.achievement {
    padding: 5px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    font-size: 0.75rem;
    color: #888;
}

.achievement.unlocked {
    background: linear-gradient(145deg, #ffd700, #ffb700);
    color: #333;
}

/* シェアボタン */
.share-btn {
    display: block;
    width: 100%;
    background: linear-gradient(145deg, #1da1f2, #0d8ecf);
    border: none;
    border-radius: 10px;
    padding: 15px;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 15px;
    transition: transform 0.1s;
}

.share-btn:hover {
    transform: scale(1.02);
}

/* 自動クリッカー */
.auto-clicker {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
}

.auto-clicker h3 {
    font-size: 0.9rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-align: center;
}

.auto-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auto-btn {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.auto-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* フローティングテキスト */
.floating-text-container, .damage-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-text {
    position: absolute;
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: floatUp 1s ease-out forwards;
}

.damage-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff4136;
    text-shadow: 2px 2px 0 #000;
    animation: damageFloat 0.8s ease-out forwards;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(1.3); }
}

@keyframes damageFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.5); }
}

.level-up-animation {
    animation: levelUp 0.5s ease-out;
}

@keyframes levelUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); color: #ff6b6b; }
    100% { transform: scale(1); }
}

/* レスポンシブ */
@media (max-width: 400px) {
    h1 { font-size: 1.4rem; }
    .action-btn { padding: 12px; font-size: 0.9rem; }
    .hero { width: 50px; height: 70px; }
    .enemy-body { width: 40px; height: 40px; }
}
