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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 800px;
}

.hidden {
    display: none !important;
}

/* Join Screen */
#join-screen h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #e94560;
}

#join-screen p {
    margin-bottom: 30px;
    color: #888;
}

.join-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

.join-form input {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: #0f3460;
    color: #fff;
}

.join-form input::placeholder {
    color: #666;
}

.join-form button {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    background: #e94560;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.join-form button:hover {
    background: #ff6b6b;
    transform: scale(1.02);
}

/* Lobby Screen */
.lobby-players {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 30px auto;
}

.lobby-slot {
    padding: 20px;
    border-radius: 8px;
    background: #0f3460;
}

.lobby-slot.filled {
    background: #1a5f4a;
}

.lobby-slot.you {
    border: 2px solid #e94560;
}

.lobby-hint {
    color: #666;
    margin-top: 20px;
}

.launch-btn {
    margin-top: 20px;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    background: #22c55e;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.launch-btn:hover {
    background: #16a34a;
    transform: scale(1.02);
}

/* Game Screen */
#game-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    max-width: 100%;
}

#game-canvas {
    border-radius: 12px;
    background: #0f3460;
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

/* Turn Info */
.turn-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 52, 96, 0.9);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10;
}

#turn-number {
    font-weight: bold;
    margin-right: 10px;
}

#waiting-status {
    color: #ffd700;
}

/* Bottom Panel */
.bottom-panel {
    width: 100%;
    max-width: 500px;
    margin-top: 15px;
    background: rgba(15, 52, 96, 0.95);
    border-radius: 12px;
    padding: 15px;
}

.action-status {
    text-align: center;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 16px;
    color: #ffd700;
}

.action-status.action-defend {
    color: #4ecdc4;
}

.action-status.action-shoot {
    color: #e94560;
}

.action-status.action-loot {
    color: #ffd700;
}

.panel-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.panel-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #16213e;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-tab.active {
    background: #e94560;
    color: #fff;
}

.panel-tab:hover:not(.active) {
    background: #1a3a5c;
}

.panel-tab-content {
    min-height: 80px;
    max-height: 150px;
    overflow-y: auto;
}

/* Card Buttons */
.card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.card-btn {
    padding: 10px 14px;
    border: 2px solid #666;
    border-radius: 6px;
    background: #2d3a4f;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.card-btn:hover:not(:disabled) {
    border-color: #ffd700;
}

.card-btn.selected {
    border-color: #ffd700;
    background: #5c4a1f;
}

.card-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Event List */
.event-list {
    list-style: none;
    text-align: left;
    font-size: 14px;
    padding: 5px;
}

.event-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.event-shoot { color: #ff6b6b; }
.event-loot { color: #ffd700; }
.event-defend { color: #4ecdc4; }
.event-reflect { color: #a855f7; }
.event-death { color: #888; }

/* Submit Button */
.submit-btn {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: #1a5f4a;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #238b6a;
}

/* Game Over Screen */
#gameover-screen h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #e94560;
}

#gameover-message {
    font-size: 1.2em;
    margin-bottom: 30px;
}

#play-again-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    background: #e94560;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

#play-again-btn:hover {
    background: #ff6b6b;
    transform: scale(1.02);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .screen {
        padding: 10px;
    }

    #join-screen h1 {
        font-size: 2em;
    }

    .lobby-players {
        grid-template-columns: repeat(2, 1fr);
    }

    .lobby-slot {
        padding: 15px 10px;
        font-size: 14px;
    }

    .turn-info {
        font-size: 12px;
        padding: 8px 10px;
    }

    .bottom-panel {
        border-radius: 12px 12px 0 0;
        margin-top: 10px;
    }

    .card-btn {
        padding: 8px 10px;
        font-size: 13px;
    }
}
