/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lexend Deca', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.game-container {
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Typography */
.game-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.2rem;
    color: #e0e7ff;
    text-align: center;
    margin-bottom: 2rem;
}

.screen-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main Menu Styles */
.menu-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.menu-content .game-title {
    color: #4c1d95;
    margin-bottom: 0.5rem;
}

.menu-content .game-subtitle {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.menu-description {
    margin-bottom: 2rem;
}

.menu-description p {
    color: #6b7280;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Connection Status */
.connection-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.75rem;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 10px;
}

.connection-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.connection-status.connected {
    background: #10b981;
    color: white;
}

.connection-status.error {
    background: #ef4444;
    color: white;
}

.connection-status.disconnected {
    background: #6b7280;
    color: white;
}

/* Debug Panel */
.debug-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    font-size: 0.9rem;
}

.debug-info details {
    cursor: pointer;
}

.debug-info summary {
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 0.5rem;
    user-select: none;
}

.debug-info summary:hover {
    color: #b91c1c;
}

.debug-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.debug-content p {
    margin-bottom: 0.5rem;
    color: #374151;
    line-height: 1.4;
}

.debug-content strong {
    color: #dc2626;
    min-width: 120px;
    display: inline-block;
}

.debug-content span {
    font-family: 'Courier New', monospace;
    background: rgba(107, 114, 128, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.game-modes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.mode-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.mode-button ion-icon {
    font-size: 2rem;
}

.mode-button span {
    font-size: 1.1rem;
    font-weight: 600;
}

.mode-button small {
    display: block;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.menu-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Lobby Screen Styles */
.lobby-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.lobby-content .screen-title {
    color: #4c1d95;
}

.lobby-options {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.lobby-section {
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.lobby-section h3 {
    color: #4c1d95;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.lobby-section p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.player-info-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-info-input label {
    color: #374151;
    font-weight: 600;
}

.player-info-input input {
    padding: 0.75rem;
    border: 2px solid rgba(107, 114, 128, 0.2);
    border-radius: 8px;
    background: white;
    color: #374151;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.player-info-input input:focus {
    outline: none;
    border-color: #667eea;
}

.join-lobby-form {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.join-lobby-form input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid rgba(107, 114, 128, 0.2);
    border-radius: 8px;
    background: white;
    color: #374151;
    font-family: inherit;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
}

.join-lobby-form input:focus {
    outline: none;
    border-color: #667eea;
}

/* Waiting Room Styles */
.waiting-room-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.waiting-room-content .screen-title {
    color: #4c1d95;
}

.lobby-info {
    margin-bottom: 2rem;
}

.lobby-code-display {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.lobby-code-display h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.lobby-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.lobby-code span {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 10px;
}

.copy-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lobby-code-help {
    font-size: 0.9rem;
    opacity: 0.9;
}

.players-section {
    margin-bottom: 2rem;
}

.players-section h3 {
    color: #4c1d95;
    margin-bottom: 1rem;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lobby-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.lobby-player .player-name {
    font-weight: 600;
    color: #374151;
}

.lobby-player .player-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.player-status.connected {
    color: #10b981;
}

.player-status.disconnected {
    color: #ef4444;
}

.waiting-room-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.waiting-message {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Button Styles */
.primary-button, .secondary-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.secondary-button {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
    border: 2px solid rgba(107, 114, 128, 0.2);
}

.secondary-button:hover {
    background: rgba(107, 114, 128, 0.2);
    transform: translateY(-1px);
}

.score-button {
    background: rgba(255, 255, 255, 0.9);
    color: #4c1d95;
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.score-button:hover {
    background: white;
    transform: translateY(-1px);
}

/* Rules Screen */
.rules-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.rules-content .screen-title {
    color: #4c1d95;
}

.rules-section {
    margin-bottom: 2rem;
    text-align: left;
}

.rules-section h3 {
    color: #4c1d95;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.rules-section ul {
    list-style: none;
    padding-left: 0;
}

.rules-section li {
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.rules-section li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Settings Screen */
.settings-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.settings-content .screen-title {
    color: #4c1d95;
}

.setting-item {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-item label {
    color: #374151;
    font-weight: 600;
    min-width: 120px;
}

.setting-item select {
    padding: 0.5rem;
    border: 2px solid rgba(107, 114, 128, 0.2);
    border-radius: 8px;
    background: white;
    color: #374151;
    font-family: inherit;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.checkbox-label {
    color: #6b7280;
}

/* Game Screen */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.round-info {
    display: flex;
    gap: 1rem;
}

.round-info span {
    color: #374151;
    font-weight: 600;
}

.timer-container {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.timer-container.hidden {
    display: none;
}

.game-content {
    padding-top: 100px;
    padding-bottom: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card Styles */
.text-card-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.text-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 3px solid #667eea;
}

.text-card .card-content {
    text-align: center;
}

.text-card p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.6;
}

.meme-cards-container h3,
.submitted-cards-container h3 {
    color: #374151;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.meme-cards-grid,
.submitted-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.meme-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.meme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.meme-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.meme-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.meme-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: #374151;
    margin-top: auto;
}

.meme-card.selected .meme-name {
    color: white;
}

.meme-card-content {
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
}

.meme-card.selected .meme-card-content {
    color: white;
}

.submitted-cards-container {
    margin-top: 2rem;
}

.submitted-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.submitted-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.submitted-card.selected {
    border-color: #10b981;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.submitted-card.winner {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.submitted-card.winner::after {
    content: "🏆";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: #4c1d95;
    font-size: 1.5rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #374151;
}

.scoreboard-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.score-item.leader {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.player-name {
    font-weight: 600;
}

.player-score {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Game Over Screen */
.game-over-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.game-over-title {
    color: #4c1d95;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.winner-announcement {
    margin-bottom: 2rem;
}

.winner-crown {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.winner-announcement h3 {
    color: #f59e0b;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.winner-announcement p {
    color: #6b7280;
    font-size: 1.1rem;
}

.final-scoreboard {
    margin-bottom: 2rem;
}

.final-scoreboard h4 {
    color: #374151;
    margin-bottom: 1rem;
}

.game-over-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Back to Site Link */
.back-to-site {
    text-align: center;
    margin-top: 2rem;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .menu-content,
    .lobby-content,
    .waiting-room-content,
    .rules-content,
    .settings-content,
    .game-over-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .lobby-options {
        gap: 1.5rem;
    }
    
    .join-lobby-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .waiting-room-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .round-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .game-content {
        padding-top: 140px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .meme-cards-grid,
    .submitted-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .menu-options {
        flex-direction: column;
    }
    
    .game-over-buttons {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .screen-title {
        font-size: 1.8rem;
    }
    
    .meme-cards-grid,
    .submitted-cards-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .lobby-code span {
        font-size: 1.5rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.meme-card,
.submitted-card,
.score-item,
.lobby-player {
    animation: fadeIn 0.3s ease-out;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; } 
