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

body {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 100%);
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

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

h1 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ゲーム情報 */
.game-info {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.7rem;
    color: #888;
}

.info-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #00ffff;
}

#highScore {
    color: #ffd700;
}

/* ゲームエリア */
.game-area {
    flex: 1;
    position: relative;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 100%);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    min-height: 400px;
}

.lane-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 33.33%;
    width: 2px;
    background: linear-gradient(180deg,
        rgba(0, 255, 255, 0) 0%,
        rgba(0, 255, 255, 0.3) 50%,
        rgba(0, 255, 255, 0) 100%
    );
}

.lane-divider.right {
    left: 66.66%;
}

/* プレイヤー */
.player {
    position: absolute;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #00ffff, #0088ff);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6),
                inset 0 -5px 10px rgba(0, 0, 0, 0.3);
    transition: left 0.15s ease-out;
    z-index: 10;
}

.player::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.player.hit {
    animation: playerHit 0.3s ease-out;
}

@keyframes playerHit {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(0.8); filter: brightness(2) hue-rotate(180deg); }
}

.player.invincible {
    animation: invincibleGlow 0.3s ease-in-out infinite;
}

@keyframes invincibleGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 1); }
}

/* 障害物 */
.obstacle {
    position: absolute;
    border-radius: 5px;
    z-index: 5;
}

.obstacle.rock {
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #8b4513, #654321);
    border-radius: 50% 50% 45% 45%;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.4);
}

.obstacle.spike {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 50px solid #ff4444;
    background: transparent;
}

.obstacle.laser {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, transparent, #ff00ff, transparent);
    box-shadow: 0 0 15px #ff00ff;
    animation: laserPulse 0.2s ease-in-out infinite;
}

@keyframes laserPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* アイテム */
.item {
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    z-index: 5;
    animation: itemFloat 0.5s ease-in-out infinite;
}

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

.item.shield {
    background: linear-gradient(145deg, #ffd700, #ffaa00);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.item.shield::after {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #fff;
}

/* コントロール */
.controls {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
}

.move-btn {
    width: 80px;
    height: 60px;
    border: none;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
    user-select: none;
}

.move-btn:active {
    transform: scale(0.9);
}

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

.right-btn {
    background: linear-gradient(145deg, #4ecdc4, #26a69a);
    color: #fff;
}

/* オーバーレイ */
.start-overlay, .gameover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.start-content, .gameover-content {
    text-align: center;
    padding: 30px;
}

.start-content h2, .gameover-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.start-content p {
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.6;
}

.start-btn, .retry-btn, .share-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
}

.start-btn, .retry-btn {
    background: linear-gradient(145deg, #00ffff, #0088ff);
    color: #000;
}

.share-btn {
    background: linear-gradient(145deg, #1da1f2, #0d8ecf);
    color: #fff;
}

.final-score {
    font-size: 3rem;
    font-weight: bold;
    color: #00ffff;
    margin: 20px 0;
}

.result-buttons {
    margin-top: 20px;
}

/* レスポンシブ */
@media (max-width: 400px) {
    h1 { font-size: 1.3rem; }
    .game-area { min-height: 350px; }
    .player { width: 40px; height: 40px; }
    .move-btn { width: 70px; height: 50px; font-size: 1.2rem; }
}
