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

body {
    font-family: 'Arial', 'Hiragino Sans', 'Meiryo', sans-serif;
    overflow: hidden;
    background-color: #1a1a1a;
    color: #fff;
    touch-action: none;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-overlay * {
    pointer-events: auto;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    text-align: center;
}

.info {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 1rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

#game-screen {
    background-color: transparent;
    pointer-events: none;
}

#hud {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
}

.player-info {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    min-width: 150px;
}

.player-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.status {
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
}

.status.ready {
    background-color: rgba(0, 255, 0, 0.3);
}

.status.out {
    background-color: rgba(255, 0, 0, 0.3);
}

.status.down {
    background-color: rgba(255, 165, 0, 0.3);
}

#reset-button {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

#winner-text {
    font-size: 3rem;
    margin-bottom: 2rem;
    animation: bounce 0.5s ease;
}

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

/* タップエリア */
.tap-area {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, rgba(102, 126, 234, 0.1) 70%);
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tap-area:active,
.tap-area.active {
    background: radial-gradient(circle, rgba(102, 126, 234, 0.7) 0%, rgba(102, 126, 234, 0.3) 70%);
    border-color: rgba(102, 126, 234, 1);
    transform: scale(0.95);
}

.tap-top-left {
    top: 10px;
    left: 10px;
}

.tap-top-right {
    top: 10px;
    right: 10px;
}

.tap-bottom-left {
    bottom: 70px;
    left: 10px;
}

.tap-bottom-right {
    bottom: 70px;
    right: 10px;
}

/* 操作説明 */
.controls-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(102, 126, 234, 0.8);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    pointer-events: none;
}

.controls-info p {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

/* モバイル対応 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }

    .player-info {
        min-width: 120px;
        padding: 0.7rem;
    }

    .player-info h3 {
        font-size: 1rem;
    }

    #winner-text {
        font-size: 2rem;
    }

    .tap-area {
        width: 120px;
        height: 120px;
    }

    .controls-info p {
        font-size: 0.9rem;
    }
}
