/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    touch-action: none;
    background: #000;
}

#ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#score {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

#combo {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 32px;
    background: rgba(255,200,0,0.8);
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
}

#lives {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 20px;
    letter-spacing: 5px;
}

#mode-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    background: rgba(255,150,0,0.8);
    color: #fff;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#mode-indicator.hidden {
    display: none;
}

#mode-indicator.connected {
    background: rgba(0,200,100,0.8);
}

/* スタートボタン */
#btn-start {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: none;
    padding: 20px 50px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255,100,100,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 50;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    display: none; /* 初期状態は非表示 */
}

#btn-start:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(255,100,100,0.7);
}

#btn-start:active {
    transform: translate(-50%, -50%) scale(0.95);
}

#btn-start.hidden {
    display: none;
}

#btn-start.playing {
    background: linear-gradient(135deg, #666, #444);
    box-shadow: 0 4px 15px rgba(100,100,100,0.5);
}

/* ボタンコントロール */
#controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 30;
}

#controls button {
    width: 70px;
    height: 70px;
    font-size: 32px;
    background: rgba(255,255,255,0.9);
    border: 3px solid rgba(0,0,0,0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s, background 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#controls button:active {
    transform: scale(0.9);
    background: rgba(200,200,200,0.9);
}

#controls button:hover {
    background: rgba(255,255,255,1);
}

#btn-jump {
    background: rgba(255,200,0,0.9);
}

#btn-jump:active {
    background: rgba(255,180,0,0.9);
}

/* レスポンシブ */
@media (max-width: 600px) {
    #controls button {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

#message {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 15px 30px;
    border-radius: 40px;
    text-align: center;
    white-space: nowrap;
    border: 2px solid rgba(255,255,255,0.3);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#debug {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: #0f0;
    font-family: monospace;
    font-size: 12px;
    padding: 5px;
    border-radius: 4px;
    z-index: 20;
    max-width: 300px;
    pointer-events: none;
}

/* カメラ映像表示（デバッグ用） */
#camera-feed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 160px;
    height: 120px;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    z-index: 20;
    transform: scaleX(-1); /* 鏡像 */
    object-fit: cover;
}

#camera-feed.hidden {
    display: none;
}

/* スタート前のオーバーレイ */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
    transition: opacity 0.5s;
}

#start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#start-overlay h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(100,200,255,0.5);
}

#start-overlay p {
    font-size: 24px;
    margin-bottom: 40px;
}

#start-overlay .wave-icon {
    font-size: 80px;
    animation: wave 1.5s infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(30deg); }
    75% { transform: rotate(-30deg); }
}

/* レスポンシブ */
@media (max-width: 600px) {
    #score { font-size: 36px; }
    #combo { font-size: 24px; }
    #message { font-size: 18px; bottom: 50px; }
    #start-overlay h1 { font-size: 36px; }
    #start-overlay p { font-size: 18px; }
}
