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

body {
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#gameCanvas {
    display: block;
    background: #16213e;
}

#ui {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    z-index: 10;
}

#timer {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#score {
    font-size: 24px;
    color: #fff;
    display: flex;
    align-items: center;
}

/* Name Entry Screen */
#nameScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Title image on name screen */
.title-image {
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}

#nameScreen h1 {
    font-size: 64px;
    color: #e94560;
    margin-bottom: 10px;
}

#nameScreen p {
    font-size: 24px;
    color: #fff;
    margin-bottom: 40px;
}

#nameScreen .hint {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.name-entry {
    display: flex;
    gap: 15px;
    align-items: center;
}

#nameInput {
    padding: 15px 25px;
    font-size: 24px;
    border: 3px solid #e94560;
    border-radius: 10px;
    background: #16213e;
    color: #fff;
    outline: none;
    width: 300px;
    text-align: center;
}

#nameInput:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

#nameInput::placeholder {
    color: #666;
}

#joinBtn {
    padding: 15px 40px;
    font-size: 24px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#joinBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

#joinBtn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Lobby Screen */
#lobbyScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    z-index: 100;
    overflow-y: auto;
}

.lobby-header {
    text-align: center;
    margin-bottom: 20px;
}

.lobby-header h1 {
    font-size: 42px;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.player-count {
    font-size: 18px;
    color: #888;
    background: rgba(255,255,255,0.1);
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
}

.lobby-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    flex: 1;
    min-height: 400px;
}

.team-column {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.guards-column {
    border-color: rgba(233, 69, 96, 0.3);
}

.prisoners-column {
    border-color: rgba(78, 205, 196, 0.3);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.team-header h2 {
    font-size: 24px;
    margin: 0;
}

.team-count {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 16px;
    color: #fff;
}

.guard-title {
    color: #e94560;
}

.prisoner-title {
    color: #4ecdc4;
}

.player-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Player Card Styles */
.player-card {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.player-card.guard {
    border-left: 4px solid #e94560;
}

.player-card.prisoner {
    border-left: 4px solid #4ecdc4;
}

.player-card.is-you {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.player-card.is-bot {
    opacity: 0.7;
    border-style: dashed;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-right: 12px;
    flex-shrink: 0;
}

.player-card.guard .player-avatar {
    background: linear-gradient(135deg, #e94560, #c73e54);
}

.player-card.prisoner .player-avatar {
    background: linear-gradient(135deg, #4ecdc4, #3db8b0);
}

.player-card.is-bot .player-avatar {
    background: linear-gradient(135deg, #666, #444);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 16px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.player-badge.host {
    background: #ffd700;
    color: #000;
}

.player-badge.bot {
    background: #666;
    color: #ccc;
}

.player-badge.you {
    background: #4caf50;
    color: #fff;
}

.player-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.ready-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s;
}

.ready-indicator.not-ready {
    background: rgba(255,255,255,0.1);
    border: 2px solid #666;
}

.ready-indicator.is-ready {
    background: #4caf50;
    border: 2px solid #4caf50;
    color: #fff;
}

.remove-bot-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.remove-bot-btn:hover {
    opacity: 1;
}

/* Add Bot Button */
.add-bot-btn {
    margin-top: 10px;
    padding: 12px;
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-bot-btn:hover {
    border-color: rgba(255,255,255,0.5);
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
}

.guard-bot-btn:hover {
    border-color: #e94560;
    color: #e94560;
}

.prisoner-bot-btn:hover {
    border-color: #4ecdc4;
    color: #4ecdc4;
}

/* Center Controls */
.lobby-center {
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-shrink: 0;
}

.your-controls {
    text-align: center;
}

.your-team-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-select-lobby {
    display: flex;
    gap: 10px;
}

.team-btn {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    font-weight: 500;
}

.guard-btn {
    color: #e94560;
    border-color: #e94560;
}

.guard-btn:hover, .guard-btn.selected {
    background: #e94560;
    color: #fff;
}

.prisoner-btn {
    color: #4ecdc4;
    border-color: #4ecdc4;
}

.prisoner-btn:hover, .prisoner-btn.selected {
    background: #4ecdc4;
    color: #1a1a2e;
}

.ready-section {
    width: 100%;
}

.ready-btn {
    width: 100%;
    padding: 18px 30px;
    font-size: 20px;
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ready-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.ready-btn.is-ready {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.ready-btn.is-ready:hover {
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.4);
}

.start-section {
    text-align: center;
    width: 100%;
}

.start-btn {
    width: 100%;
    padding: 18px 30px;
    font-size: 20px;
    background: linear-gradient(135deg, #e94560, #d63d56);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.start-btn:disabled {
    background: linear-gradient(135deg, #555, #444);
    cursor: not-allowed;
    transform: none;
}

#lobbyStatus {
    margin-top: 15px;
    font-size: 14px;
    color: #888;
    min-height: 20px;
}

#lobbyStatus.warning {
    color: #ff9800;
}

#lobbyStatus.ready {
    color: #4caf50;
}

/* Old Start Screen */
#startScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#startScreen h1 {
    font-size: 64px;
    color: #e94560;
    margin-bottom: 10px;
}

#startScreen p {
    font-size: 24px;
    color: #fff;
    margin-bottom: 40px;
}

.team-select {
    display: flex;
    gap: 20px;
}

.team-select button {
    padding: 20px 40px;
    font-size: 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#playGuard {
    background: #e94560;
    color: #fff;
}

#playPrisoner {
    background: #0f3460;
    color: #fff;
}

.team-select button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

#gameOver {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.game-over-content {
    text-align: center;
    max-width: 800px;
    width: 90%;
}

#gameOver h1 {
    font-size: 48px;
    color: #fff;
    margin-bottom: 30px;
}

.game-summary {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 30px;
}

.summary-section {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    min-width: 250px;
}

.summary-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.summary-section h3:first-child {
    color: #4ecdc4;
}

.summary-section:last-child h3 {
    color: #e94560;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
}

.stat-row.caught {
    opacity: 0.6;
}

.stat-row .player-name {
    font-weight: 500;
}

.stat-row .stat-value {
    color: #888;
    font-size: 13px;
}

.stat-row .stat-value.survived {
    color: #4caf50;
}

.stat-row .stat-value.catches {
    color: #e94560;
}

.mvp-section {
    margin-bottom: 30px;
}

.mvp-award {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.1));
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 20px 40px;
}

.mvp-label {
    font-size: 14px;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.mvp-name {
    font-size: 24px;
    color: #fff;
    font-weight: bold;
}

.mvp-time {
    font-size: 16px;
    color: #ffd700;
    margin-top: 5px;
}

/* Countdown Overlay */
#countdownOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.countdown-content {
    text-align: center;
}

#countdownNumber {
    font-size: 180px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 50px rgba(233, 69, 96, 0.8);
    animation: countdownPulse 1s ease-in-out infinite;
}

#countdownNumber.go {
    font-size: 120px;
    color: #4caf50;
    text-shadow: 0 0 50px rgba(76, 175, 80, 0.8);
}

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

#countdownText {
    font-size: 32px;
    color: #888;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 5px;
}

/* Caught Overlay */
#caughtOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(233, 69, 96, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    animation: caughtFlash 0.5s ease-out;
}

@keyframes caughtFlash {
    0% { background: rgba(255, 255, 255, 0.9); }
    100% { background: rgba(233, 69, 96, 0.9); }
}

.caught-content {
    text-align: center;
    animation: caughtBounce 0.5s ease-out;
}

@keyframes caughtBounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.caught-icon {
    font-size: 80px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 5px 30px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

#caughtByText {
    font-size: 28px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

.spectate-hint {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    animation: fadeInUp 0.5s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Spectating Label */
#spectatingLabel {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #ff9800;
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    z-index: 50;
    border: 2px solid #ff9800;
}

#restartBtn {
    padding: 20px 40px;
    font-size: 24px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

#restartBtn:hover {
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

/* Scrollbar for player list */
.player-list::-webkit-scrollbar {
    width: 8px;
}

.player-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.player-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.player-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* ========================================
   Lobby Browser Styles
   ======================================== */

#lobbyBrowser {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    z-index: 100;
    overflow-y: auto;
}

.browser-header {
    text-align: center;
    margin-bottom: 25px;
}

.browser-header h1 {
    font-size: 42px;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.welcome-text {
    font-size: 18px;
    color: #888;
}

.welcome-text span {
    color: #e94560;
    font-weight: bold;
}

.browser-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.create-lobby-btn {
    padding: 15px 35px;
    font-size: 18px;
    background: linear-gradient(135deg, #e94560, #d63d56);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.create-lobby-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(233, 69, 96, 0.4);
}

.join-code-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

#joinCodeInput {
    padding: 15px 20px;
    font-size: 18px;
    width: 150px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    outline: none;
    letter-spacing: 5px;
    font-weight: bold;
}

#joinCodeInput:focus {
    border-color: #4ecdc4;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
}

#joinCodeInput::placeholder {
    color: #666;
    letter-spacing: 0;
    font-weight: normal;
}

.join-code-btn {
    padding: 15px 25px;
    font-size: 18px;
    background: #4ecdc4;
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.join-code-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

.browser-divider {
    width: 100%;
    max-width: 700px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.browser-divider::before,
.browser-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

.browser-divider::before {
    left: 0;
}

.browser-divider::after {
    right: 0;
}

.browser-divider span {
    background: #1a1a2e;
    padding: 0 20px;
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.lobby-list {
    width: 100%;
    max-width: 700px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.lobby-list::-webkit-scrollbar {
    width: 8px;
}

.lobby-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.lobby-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.no-lobbies {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-lobbies p:first-child {
    font-size: 18px;
    margin-bottom: 10px;
}

.lobby-card {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.lobby-card:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(233, 69, 96, 0.5);
    transform: translateX(5px);
}

.lobby-card.locked {
    border-color: rgba(255, 152, 0, 0.3);
}

.lobby-card.locked:hover {
    border-color: rgba(255, 152, 0, 0.6);
}

.lobby-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.lobby-info {
    flex: 1;
}

.lobby-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.lobby-host {
    font-size: 13px;
    color: #888;
}

.lobby-players {
    font-size: 16px;
    color: #4ecdc4;
    font-weight: 600;
    margin-right: 15px;
}

.lobby-join-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
    border: 2px solid #e94560;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-card:hover .lobby-join-btn {
    background: #e94560;
    color: #fff;
}

.browser-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 15px;
}

#refreshStatus {
    font-size: 13px;
    color: #666;
}

.refresh-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: transparent;
    color: #888;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    border-color: #fff;
    color: #fff;
}

.solo-play-section {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.solo-play-btn {
    padding: 12px 30px;
    font-size: 14px;
    background: transparent;
    color: #666;
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.solo-play-btn:hover {
    border-color: #888;
    color: #888;
}

/* ========================================
   Modal Styles
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 35px;
    max-width: 400px;
    width: 90%;
    border: 2px solid rgba(255,255,255,0.1);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    font-size: 28px;
    color: #fff;
    margin-bottom: 25px;
    text-align: center;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.player-count-select {
    display: flex;
    gap: 10px;
}

.count-btn {
    flex: 1;
    padding: 15px;
    font-size: 18px;
    background: rgba(255,255,255,0.05);
    color: #888;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.count-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.count-btn.active {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    color: #e94560;
}

.privacy-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.privacy-btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    background: rgba(255,255,255,0.05);
    color: #888;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.privacy-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.privacy-btn.active {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
    color: #4ecdc4;
}

.code-display {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.code-display span:first-child {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.lobby-code {
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
    letter-spacing: 8px;
    display: block;
    margin-bottom: 10px;
}

.copy-btn {
    padding: 8px 20px;
    font-size: 12px;
    background: rgba(255,215,0,0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #ffd700;
    color: #1a1a2e;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.cancel-btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    background: transparent;
    color: #888;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    border-color: #fff;
    color: #fff;
}

.confirm-btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    background: linear-gradient(135deg, #e94560, #d63d56);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.confirm-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

#modalCodeInput {
    width: 100%;
    padding: 20px;
    font-size: 32px;
    text-align: center;
    letter-spacing: 10px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    outline: none;
    margin-bottom: 10px;
}

#modalCodeInput:focus {
    border-color: #4ecdc4;
}

.error-text {
    color: #e94560;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
}

/* ========================================
   Lobby Screen Updates
   ======================================== */

.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
}

.back-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: transparent;
    color: #888;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: #fff;
    color: #fff;
}

.lobby-title-section {
    text-align: center;
    flex: 1;
}

.lobby-title-section h1 {
    font-size: 32px;
    margin-bottom: 5px;
}

.lobby-code-inline {
    font-size: 14px;
    color: #ffd700;
    background: rgba(255,215,0,0.1);
    padding: 5px 15px;
    border-radius: 5px;
    display: inline-block;
}

.lobby-code-inline span {
    font-weight: bold;
    letter-spacing: 3px;
}
