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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.sound-controls {
    display: flex;
    justify-content: flex-end;
    margin: -10px 0 20px;
}

.sound-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.95em;
    cursor: pointer;
    background: #f5f5f5;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sound-btn.on {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

/* 로비 */
.lobby {
    text-align: center;
}

.player-selection {
    margin-bottom: 30px;
}

.player-selection h2 {
    margin-bottom: 20px;
    color: #666;
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.player-btn, .spectator-btn, .ready-btn, .leave-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.spectator-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.ready-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1.3em;
    padding: 20px 40px;
}

.leave-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-status {
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
}

.game-status h2 {
    margin-bottom: 15px;
    color: #666;
}

#status {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

#players {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
}

.ready-section {
    margin-top: 30px;
}

#readyStatus {
    margin-top: 15px;
    font-size: 1.2em;
    color: #4facfe;
    font-weight: bold;
}

/* 게임 화면 */
.game-area {
    position: relative;
}

.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 60px rgba(79, 172, 254, 0.5);
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.1s ease-out, font-size 0.1s ease-out;
    user-select: none;
}

.game-boards {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.player-board {
    text-align: center;
}

.player-board h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 2em;
}

.player-label {
    font-size: 0.6em;
    color: #4facfe;
    font-weight: normal;
}

.game-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.game-info div {
    background: #f5f5f5;
    padding: 10px 20px;
    border-radius: 10px;
}

canvas {
    border: 3px solid #333;
    border-radius: 10px;
    background: #000;
    display: block;
}

.next-piece {
    margin-top: 15px;
}

.next-piece h3 {
    margin-bottom: 10px;
    color: #666;
}

.next-piece canvas {
    border: 2px solid #ddd;
}

/* 관전 모드 */
.spectator-view {
    text-align: center;
}

.spectator-boards {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.spectator-board {
    text-align: center;
}

.spectator-board h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 2em;
}

.controls {
    margin-top: 30px;
    text-align: center;
}

.control-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 20px;
    text-align: left;
}

.control-info p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .game-boards, .spectator-boards {
        flex-direction: column;
        align-items: center;
    }

    h1 {
        font-size: 1.8em;
    }

    .countdown {
        font-size: 5em;
    }
}
