/* Import the existing playing cards CSS */
@import url('/assets/css_graphics/full_deck/playing_cards.css');

/* Font Awesome for icons */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

/* Game header should be visible but ensure no extra padding on body */
body {
    padding-top: 0 !important;
}

body.with-game-header {
    padding-top: 80px !important;
}

/* ============================================================================
   GAME MENU CUSTOMIZATION (Go Fish)
   ============================================================================ */
:root {
    --game-primary: #3498db;
    --game-primary-dark: #2980b9;
    --game-secondary: #1abc9c;
    --bg-color: #f8f9fa;
}

body.game-menu-active {
    --menu-bg-image: url('/interactive/shared/backgrounds/gofish.png');
}

/* All screens hidden by default */
.game-menu-screen,
.login-screen,
.league-screen,
.friends-screen,
.opponent-select-screen,
.tournament-screen,
.multiplayer-setup-screen,
.join-game-screen,
.waiting-room-screen,
#gameContainer {
    display: none;
}

/* Ensure proper centering when mode-select is visible */
#mode-select.game-menu-screen {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* Defer backdrop/overlay to shared game-menu.css */
}

/* ============================================================================
   GAME-SPECIFIC STYLES
   ============================================================================ */

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary), #3498db);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-screen p {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login/Signup Screen with Full-Screen Poster */
.login-screen {
    min-height: 100vh;
    height: 100vh;
    display: none; /* Hidden by default, shown by JavaScript */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-poster-bg {
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('poster.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none; /* Don't block clicks */
}

/* Hide poster when login screen is hidden */
.login-screen[style*="display: none"] .login-poster-bg,
.login-screen[style*="display: none"] .login-overlay {
    display: none !important;
}

/* Fallback for browsers that don't support WebP */
.no-webp .login-poster-bg {
    background-image: url('poster.png');
}

.login-overlay {
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(201, 12, 15, 0.85), rgba(52, 152, 219, 0.75));
    z-index: 2;
    pointer-events: none; /* Don't block clicks */
}

.login-container {
    position: relative;
    z-index: 3;
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease-out;
}

.login-logo h1 {
    color: white;
    font-size: 4rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.login-tagline {
    color: white;
    font-size: 1.3rem;
    font-weight: normal;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.login-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out;
}

.login-box h2 {
    text-align: center;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

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

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

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201, 12, 15, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.error-message {
    color: #C90C0F;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.btn-block {
    width: 100%;
}

.auth-toggle {
    text-align: center;
    margin-bottom: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    transition: all 0.2s;
}

.btn-link:hover {
    color: #a00a0c;
    text-decoration: underline;
}

.guest-option {
    margin-top: 1.5rem;
}

.guest-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.guest-divider::before,
.guest-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #dee2e6;
}

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

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

.guest-divider span {
    background: white;
    padding: 0 1rem;
    color: #999;
    font-size: 0.9rem;
    font-weight: bold;
}

.guest-note {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.75rem;
    font-style: italic;
}

/* League Table Screen */
.league-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.league-container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--secondary);
}

.league-container h1 {
    text-align: center;
    color: var(--secondary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.league-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.league-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--secondary);
    background: #fffbf0;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.filter-btn i {
    font-size: 1.1rem;
}

.league-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.league-table thead {
    background: var(--secondary);
    color: white;
}

.league-table th {
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
}

.league-table th:first-child {
    border-top-left-radius: 8px;
}

.league-table th:last-child {
    border-top-right-radius: 8px;
}

.league-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.league-table tbody tr:hover {
    background: var(--bg-color, #f8f9fa);
}

.league-table .pos-cell {
    font-weight: bold;
    color: #666;
}

.league-table .name-cell {
    text-align: left;
    font-weight: bold;
    color: var(--primary);
}

.league-table .points-cell {
    background: var(--bg-color, #f8f9fa);
    font-size: 1.1rem;
}

.league-table .positive {
    color: #28a745;
}

.league-table .negative {
    color: #C90C0F;
}

.league-table .current-user {
    background: #d4edda;
    font-weight: bold;
}

.league-table .current-user:hover {
    background: #c3e6cb;
}

.league-table .ai-player .name-cell {
    color: #3498db;
}

.league-legend {
    background: var(--bg-color, #f8f9fa);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-bottom: 1.5rem;
}

.league-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Friends Screen */
.friends-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg-color, #f8f9fa);
}

.friends-container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

.friends-container h1 {
    text-align: center;
    color: #3498db;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.add-friend-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color, #f8f9fa);
    border-radius: 12px;
}

.add-friend-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.add-friend-form {
    display: flex;
    gap: 0.5rem;
}

.add-friend-form input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.add-friend-form input:focus {
    outline: none;
    border-color: #3498db;
}

.friend-message {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.friend-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.friend-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.friends-list-section {
    margin: 2rem 0;
}

.friends-list-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.friends-list {
    max-height: 400px;
    overflow-y: auto;
}

.no-friends-message {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
    font-style: italic;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.3s;
}

.friend-item:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.friend-details {
    display: flex;
    flex-direction: column;
}

.friend-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

.friend-status {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.friend-status.online {
    color: #28a745;
    font-weight: bold;
}

.friend-status.online::before {
    content: '●';
    color: #28a745;
    font-size: 1.2rem;
}

.friend-status.offline::before {
    content: '●';
    color: #6c757d;
    font-size: 1.2rem;
}

.friend-actions {
    display: flex;
    gap: 0.5rem;
}

.friend-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.friend-action-btn.challenge {
    background: #28a745;
    color: white;
}

.friend-action-btn.challenge:hover {
    background: #218838;
    transform: scale(1.05);
}

.friend-action-btn.remove {
    background: #dc3545;
    color: white;
}

.friend-action-btn.remove:hover {
    background: #c82333;
    transform: scale(1.05);
}

.friend-action-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.friends-controls {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* User Header in Mode Selection - OLD STYLES (commented out, no longer used)
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-weight: bold;
    color: var(--primary);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
*/

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

/* Opponent Selection Screen */
.opponent-select-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.opponent-select-container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
    text-align: center;
}

.opponent-select-container h1 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.opponent-select-container h2 {
    color: #666;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Tournament Bracket Screen */
.tournament-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.tournament-container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
}

/* Multiplayer Setup Screen */
.multiplayer-setup-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.multiplayer-setup-container {
    max-width: 700px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
    text-align: center;
}

/* Join Game Screen */
.join-game-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.join-game-container {
    max-width: 500px;
    width: 100%;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
    text-align: center;
}

/* Waiting Room Screen */
.waiting-room-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.waiting-room-container {
    max-width: 800px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
    text-align: center;
}

/* Mode Selection Screen - Now using shared game-menu.css styles */
/* Old mode-select styles commented out - kept for reference
.mode-select-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
    opacity: 1 !important;
    visibility: visible !important;
}

.mode-select-container {
    max-width: 800px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
    text-align: center;
}

.mode-select-container h1 {
    color: var(--primary);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.mode-subtitle {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mode-btn {
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.mode-btn:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.mode-btn i {
    font-size: 3rem;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
}

.mode-btn span {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.mode-btn small {
    display: block;
    font-size: 1rem;
    color: #666;
    font-weight: normal;
}

.mode-multiplayer:hover {
    background: linear-gradient(135deg, #fff, #e0f2fe);
}

.mode-quick:hover {
    background: linear-gradient(135deg, #fff, #f0f9ff);
}

.mode-tournament:hover {
    background: linear-gradient(135deg, #fff, #fef3c7);
}

.mode-practice:hover {
    background: linear-gradient(135deg, #fff, #f0fdf4);
}
*/

/* Multiplayer Setup Screen */
.multiplayer-setup-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.multiplayer-setup-container {
    max-width: 700px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #3498db;
    text-align: center;
}

.multiplayer-setup-container h1 {
    color: #3498db;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.multiplayer-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.multiplayer-option-btn {
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

.multiplayer-option-btn:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #fff, #e0f2fe);
}

.multiplayer-option-btn i {
    font-size: 3rem;
    color: #3498db;
    min-width: 60px;
    text-align: center;
}

.multiplayer-option-btn span {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.multiplayer-option-btn small {
    display: block;
    font-size: 1rem;
    color: #666;
    font-weight: normal;
}

.multiplayer-controls {
    display: flex;
    justify-content: center;
}

/* Join Game Screen */
.join-game-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.join-game-container {
    max-width: 500px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #3498db;
}

.join-game-container h1 {
    text-align: center;
    color: #3498db;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.join-options {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

.join-option-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.join-option-btn:hover {
    border-color: #3498db;
    background: #e0f2fe;
    transform: translateY(-2px);
}

.join-option-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.join-game-form {
    margin: 2rem 0;
}

.join-game-form input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.qr-scanner-container {
    margin: 2rem 0;
    text-align: center;
}

#qr-reader {
    border: 3px solid #3498db;
    border-radius: 12px;
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.scanner-status {
    padding: 1rem;
    background: #e0f2fe;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: bold;
    color: #3498db;
}

.scanner-status.success {
    background: #d4edda;
    color: #28a745;
}

.scanner-status.error {
    background: #f8d7da;
    color: #C90C0F;
}

.join-game-controls {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Waiting Room Screen */
.waiting-room-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.waiting-room-container {
    max-width: 800px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #3498db;
}

.waiting-room-container h1 {
    text-align: center;
    color: #3498db;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: bold;
}

.game-code-display {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.game-code-content {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.game-code-text {
    flex: 1;
    min-width: 250px;
}

.game-code-qr {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.qr-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: bold;
}

#qrCodeCanvas {
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: white;
}

.game-code-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.game-code {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
}

.game-code-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-code-display .btn {
    margin: 0.25rem;
}

.players-waiting {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
    gap: 2rem;
}

.player-slot {
    flex: 1;
    text-align: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
}

.player-slot.ready {
    background: #d4edda;
    border-color: #28a745;
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dee2e6;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #666;
}

.player-slot.ready .player-avatar {
    background: #28a745;
    color: white;
}

.player-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.player-status {
    font-size: 1rem;
    color: #666;
}

.player-slot.ready .player-status {
    color: #28a745;
    font-weight: bold;
}

.vs-divider {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary);
}

.waiting-room-message {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
}

.waiting-room-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Tournament Screen */
.tournament-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.tournament-container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--secondary);
}

.tournament-container h2 {
    text-align: center;
    color: var(--secondary);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.bracket-stage {
    text-align: center;
    color: #666;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    font-weight: bold;
}

.bracket-display {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 250px;
}

.bracket-round-title {
    text-align: center;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.bracket-match {
    background: var(--bg-color, #f8f9fa);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
}

.bracket-match.active {
    border-color: var(--secondary);
    box-shadow: 0 0 20px rgba(250, 183, 25, 0.3);
}

.bracket-match.completed {
    opacity: 0.7;
}

.bracket-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 8px;
    border: 2px solid transparent;
}

.bracket-player.winner {
    background: #d4edda;
    border-color: #28a745;
    font-weight: bold;
}

.bracket-player.loser {
    opacity: 0.5;
}

.bracket-player-name {
    color: var(--primary);
    font-weight: bold;
}

.bracket-player-score {
    color: #666;
    font-size: 1.2rem;
    font-weight: bold;
}

.tournament-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Opponent Selection Screen */
.opponent-select-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color, #f8f9fa);
}

.opponent-select-container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
}

.opponent-select-container h1 {
    text-align: center;
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.opponent-select-container h2 {
    text-align: center;
    color: #666;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: normal;
}

.opponent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.opponent-card {
    background: var(--bg-color, #f8f9fa);
    border: 3px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.opponent-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.opponent-card.selected {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 4px 12px rgba(201, 12, 15, 0.2);
}

.opponent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dee2e6;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #666;
    font-weight: bold;
    overflow: hidden;
}

.opponent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opponent-card.selected .opponent-avatar {
    background: var(--primary);
    color: white;
    border: 3px solid var(--primary);
}

.opponent-name {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.opponent-title {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.opponent-difficulty {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.difficulty-easy {
    background: #d4edda;
    color: #155724;
}

.difficulty-medium {
    background: #fff3cd;
    color: #856404;
}

.difficulty-hard {
    background: #f8d7da;
    color: #721c24;
}

.opponent-details {
    background: var(--bg-color, #f8f9fa);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.opponent-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #dee2e6;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--primary);
    overflow: hidden;
    position: relative;
}

.opponent-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 4rem;
    color: #666;
    font-weight: bold;
}

.opponent-details h3 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.opponent-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.opponent-bio {
    color: #333;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.opponent-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.opponent-actions .btn {
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

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

:root {
    --primary: #C90C0F;
    --secondary: #FAB719;
    --card-border-radius: 8px;
    --bg-color: #f8f9fa;
}

body {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    background: var(--surface, #f8f9fa);
    color: #1D1D1B;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure background stays light when game is active */
body:not(.game-menu-active) {
    background: var(--bg-color, #f8f9fa);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid var(--primary);
}

header {
    text-align: center;
}

header h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    font-weight: bold;
}

.opponent-name-display {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.turn-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    margin: 0 auto 1rem;
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s;
}

.turn-indicator.player-turn {
    background: #d4edda;
    color: #28a745;
    border: 2px solid #28a745;
}

.turn-indicator.opponent-turn {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #856404;
}

.game-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.info-item .label {
    font-weight: bold;
    color: var(--primary);
}

.info-item span:last-child {
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 20px;
    margin-bottom: 20px;
}

.opponent-area,
.player-area {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid #dee2e6;
    grid-column: 1 / -1;
}

/* Stock takes 30%, books takes 70% */
.stock-area {
    grid-column: 1 / 2;
}

.books-area {
    grid-column: 2 / 3;
}

.opponent-area h2,
.player-area h2 {
    color: var(--primary);
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.hand {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    min-height: 120px;
    position: relative;
    overflow-x: hidden;
    align-items: center;
}

/* Cards in hand have individual positioning */
.hand .card {
    margin: 0;
    flex-shrink: 0;
}

/* Stock and Books */
.stock-area {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-pile {
    position: relative;
    width: 100px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.books-area {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid #dee2e6;
}

.books-area h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.books-key {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-color, #f8f9fa);
    border-radius: 8px;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.key-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #333;
}

.player-color {
    background: #28a745;
}

.opponent-color {
    background: #3498db;
}

.books-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.book-checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-color, #f8f9fa);
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
}

.book-checklist-item.completed-player {
    background: #d4edda;
    border-color: #28a745;
}

.book-checklist-item.completed-opponent {
    background: #d1ecf1;
    border-color: #3498db;
}

.book-rank {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary);
}

.book-checklist-item.completed-player .book-rank,
.book-checklist-item.completed-opponent .book-rank {
    text-decoration: line-through;
}

.book-checklist-item.completed-player .book-rank {
    color: #28a745;
}

.book-checklist-item.completed-opponent .book-rank {
    color: #3498db;
}

.book-status {
    font-size: 1.5rem;
}

.book-status.incomplete {
    color: #dee2e6;
}

.book-status.complete-player {
    color: #28a745;
}

.book-status.complete-opponent {
    color: #3498db;
}

.books-score {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-color, #f8f9fa);
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-item span:first-child {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
}

.player-score-item .score-value {
    color: #28a745;
}

.opponent-score-item .score-value {
    color: #3498db;
}

/* Cards - using existing playing cards system */
.card {
    width: 80px;
    height: 112px;
    background: white;
    border: 1px solid #666;
    border-radius: var(--card-border-radius);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    font-family: 'Rockwell', 'Times New Roman', serif;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    user-select: none;
    box-shadow: 
        1px 1px 3px rgba(0,0,0,0.2),
        2px 2px 6px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.card.disabled {
    cursor: not-allowed;
    filter: grayscale(100%);
}

.card.disabled:hover {
    transform: none;
    box-shadow: 
        1px 1px 3px rgba(0,0,0,0.2),
        2px 2px 6px rgba(0,0,0,0.1);
}

.card.newly-drawn {
    animation: cardGlow 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(250, 183, 25, 0.8), 0 0 40px rgba(250, 183, 25, 0.4);
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(250, 183, 25, 0.8), 0 0 40px rgba(250, 183, 25, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(250, 183, 25, 1), 0 0 60px rgba(250, 183, 25, 0.6);
    }
}

:root {
    --cache-buster: 'v=20251104b';
}

.card-back {
    background-image: var(--card-back-url, url('/assets/css_graphics/full_deck/cards/images/fish/card_back.png?v=20251203a'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: default;
    border: none;
}

.card-back:hover {
    transform: none;
    box-shadow: none;
}

/* Corner elements */
.corner-top {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 12px;
    line-height: 1;
    font-family: 'Rockwell', 'Times New Roman', serif;
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 2px white;
    -webkit-text-stroke: 0.5px white;
}

.corner-bottom {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 12px;
    line-height: 1;
    transform: rotate(180deg);
    font-family: 'Rockwell', 'Times New Roman', serif;
    font-weight: bold;
    text-shadow: 
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 2px white;
    -webkit-text-stroke: 0.5px white;
}

.center-symbols {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 18px;
    position: relative;
}

/* Face image styling */
/* Default face image styling (overridden by deck-specific rules like .card.santa .face-image and .card.fish .face-image below) */
.face-image {
    width: 85% !important;
    height: 85% !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    display: block !important;
    z-index: 1 !important;
    position: relative !important;
    margin: auto !important;
}

/* Fish deck - ensure cards with face images have proper layout */
.card.fish:has(.face-image) {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
    position: relative !important;
    display: block !important;
    flex-direction: initial !important;
    justify-content: initial !important;
    align-items: initial !important;
    z-index: 0; /* Create stacking context */
}

/* Fish deck - center-symbols container should fill entire card for face images */
.card.fish:has(.face-image) .center-symbols {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    flex: none !important;
    flex-direction: initial !important;
    align-items: initial !important;
    justify-content: initial !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Fish deck - images fill entire card with cropping - highest specificity */
.card.fish:has(.face-image) img.face-image,
.card.fish:has(.face-image) .face-image,
.card.fish:has(.face-image) .center-symbols img.face-image,
.card.fish:has(.face-image) .center-symbols .face-image,
.card.fish .face-image,
.card.fish img.face-image,
.card.fish .center-symbols .face-image {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: var(--card-border-radius) !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
    display: block !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

/* Fish deck - remove card border and padding for face cards and Ace of Spades */
.card.fish.hearts-J,
.card.fish.hearts-Q,
.card.fish.hearts-K,
.card.fish.diamonds-J,
.card.fish.diamonds-Q,
.card.fish.diamonds-K,
.card.fish.clubs-J,
.card.fish.clubs-Q,
.card.fish.clubs-K,
.card.fish.spades-J,
.card.fish.spades-Q,
.card.fish.spades-K,
.card.fish.spades-A {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Santa deck - ensure cards with face images have proper layout */
.card.santa:has(.face-image) {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
    position: relative !important;
    display: block !important;
    flex-direction: initial !important;
    justify-content: initial !important;
    align-items: initial !important;
    z-index: 0; /* Create stacking context */
}

/* Santa deck - center-symbols container should fill entire card for face images */
.card.santa:has(.face-image) .center-symbols {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    flex: none !important;
    flex-direction: initial !important;
    align-items: initial !important;
    justify-content: initial !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Santa deck - images fill entire card with cropping - highest specificity */
.card.santa:has(.face-image) img.face-image,
.card.santa:has(.face-image) .face-image,
.card.santa:has(.face-image) .center-symbols img.face-image,
.card.santa:has(.face-image) .center-symbols .face-image,
.card.santa .face-image,
.card.santa img.face-image,
.card.santa .center-symbols .face-image {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: var(--card-border-radius) !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
    display: block !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

/* Santa deck - remove card border and padding for face cards and Ace of Spades */
.card.santa.hearts-J,
.card.santa.hearts-Q,
.card.santa.hearts-K,
.card.santa.diamonds-J,
.card.santa.diamonds-Q,
.card.santa.diamonds-K,
.card.santa.clubs-J,
.card.santa.clubs-Q,
.card.santa.clubs-K,
.card.santa.spades-J,
.card.santa.spades-Q,
.card.santa.spades-K,
.card.santa.spades-A {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Santa deck - white stroke around corner elements */
.card.santa .corner-top,
.card.santa .corner-bottom {
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 3px white;
    -webkit-text-stroke: 0px;
    z-index: 10;
    background: none;
}

/* Fish deck - white stroke around corner elements */
.card.fish .corner-top,
.card.fish .corner-bottom {
    position: absolute !important;
    z-index: 100 !important;
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 3px white;
    -webkit-text-stroke: 0px;
    background: none !important;
    pointer-events: none !important;
}

/* Ensure corner-top positioning for fish deck */
.card.fish .corner-top {
    top: 4px !important;
    left: 4px !important;
}

/* Ensure corner-bottom positioning for fish deck */
.card.fish .corner-bottom {
    bottom: 4px !important;
    right: 4px !important;
}

/* Pip styling */
.pip {
    font-size: 1.2em;
    text-shadow: 
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 2px white;
    -webkit-text-stroke: 0.5px white;
}

/* Santa deck - stronger white stroke for pips */
.card.santa .pip {
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 3px white;
    -webkit-text-stroke: 0px;
}

/* Suit colours */
.suit.hearts, .suit.diamonds {
    color: #e74c3c;
}

.suit.clubs, .suit.spades {
    color: #2c3e50;
}

/* Ace symbols using data attributes */
.center-symbols[data-suit="hearts"]::before {
    content: "♥";
    color: #e74c3c;
    font-size: 2.5em;
    display: block;
}

.center-symbols[data-suit="diamonds"]::before {
    content: "♦";
    color: #e74c3c;
    font-size: 2.5em;
    display: block;
}

.center-symbols[data-suit="clubs"]::before {
    content: "♣";
    color: #000;
    font-size: 2.5em;
    display: block;
}

/* Santa deck - stronger white stroke for ace symbols */
.card.santa .center-symbols[data-suit="hearts"]::before,
.card.santa .center-symbols[data-suit="diamonds"]::before,
.card.santa .center-symbols[data-suit="clubs"]::before {
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 3px white;
    -webkit-text-stroke: 0px;
}

/* Santa deck - white stroke for suit symbols */
.card.santa .suit {
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 3px white;
    -webkit-text-stroke: 0px;
}

/* Hide regular pips for ace cards */
.card.hearts-A .pip,
.card.diamonds-A .pip,
.card.clubs-A .pip {
    display: none !important;
}

/* Game Log */
.game-log {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid #dee2e6;
}

.game-log h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: bold;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.log-entry {
    padding: 5px;
    margin-bottom: 5px;
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

.log-entry.player {
    border-left-color: #28a745;
}

.log-entry.opponent {
    border-left-color: var(--primary);
}

.log-entry.system {
    border-left-color: var(--secondary);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #a00a0c;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(201, 12, 15, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.login-box .btn-primary {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    padding: 0.9rem 2rem;
}

.login-box .btn-secondary {
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary);
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: bold;
    padding-right: 40px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.instructions h3 {
    color: var(--primary);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.instructions ul, .instructions ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.rank-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.rank-btn {
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    background: var(--bg-color, #f8f9fa);
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.rank-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

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

.rank-btn:disabled:hover {
    background: var(--bg-color, #f8f9fa);
    color: inherit;
    transform: none;
}

/* Animations */
@keyframes cardDraw {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card.new {
    animation: cardDraw 0.5s ease-out;
}

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

.book.new {
    animation: bookComplete 0.6s ease-in-out;
}

/* Opponent Notification Popup */
.opponent-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--primary);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.opponent-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

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

.notification-content strong {
    display: block;
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

#notification-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
}

/* Go Fish Notification Popup */
.gofish-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--secondary);
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gofish-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

#gofish-text {
    font-size: 3rem;
    font-weight: bold;
    color: var(--secondary);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    text-align: center;
}

/* Book Completion Notification Popup */
.book-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid #28a745;
    z-index: 2200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.book-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

#book-text {
    font-size: 1.5rem;
    font-weight: normal;
    color: #333;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    text-align: center;
    line-height: 1.4;
}

#book-text i {
    color: var(--secondary);
    margin-right: 0.5rem;
    font-size: 1.8rem;
    vertical-align: middle;
}

.book-notification .player-book {
    color: #28a745;
    font-weight: bold;
}

.book-notification .opponent-book {
    color: #3498db;
    font-weight: bold;
}

/* Mobile Burger Menu */
.mobile-burger-btn {
    display: none; /* Hidden by default, shown only on mobile */
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 2500;
    background: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    transition: all 0.3s;
}

.mobile-burger-btn:active {
    transform: scale(0.95);
}

.mobile-burger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Drawer Overlay */
.mobile-drawer-overlay {
    display: none; /* Hidden by default, shown only on mobile */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Drawer */
.mobile-drawer {
    display: none; /* Hidden by default, shown only on mobile */
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 2400;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transition: right 0.3s ease-in-out;
}

.mobile-drawer.open {
    right: 0;
}

.mobile-drawer-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-drawer-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-drawer-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-drawer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-drawer-content {
    padding: 1rem;
}

.drawer-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-color, #f8f9fa);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.drawer-section h2,
.drawer-section h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.drawer-section.controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.drawer-section.controls .btn {
    width: 100%;
}

/* Mobile Player Area (hidden on desktop) */
.mobile-player-area {
    display: none; /* Hidden by default, shown only on mobile */
}

/* Mobile Scoreboard (hidden on desktop) */
.mobile-scoreboard {
    display: none; /* Hidden by default, shown only on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}

.mobile-score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mobile-score-item .score-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
}

.mobile-score-item .score-number {
    font-size: 2rem;
    font-weight: bold;
}

.mobile-score-item .score-number.player-score {
    color: #28a745;
}

.mobile-score-item .score-number.opponent-score {
    color: #3498db;
}

.mobile-score-divider {
    width: 2px;
    height: 50px;
    background: #dee2e6;
}

/* Mobile Hand Grouping */
.mobile-hand {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 1.5rem 1rem;
    padding: 2rem 1rem 1rem;
    min-height: auto;
}

.card-fan {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
}

.card-fan-header {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    white-space: nowrap;
}

.card-fan.near-book .card-fan-header {
    background: var(--secondary);
    border-color: var(--secondary);
}

.card-fan-rank {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary);
}

.card-fan.near-book .card-fan-rank {
    color: white;
}

.card-fan-count {
    font-size: 0.75rem;
    font-weight: bold;
    color: #666;
}

.card-fan.near-book .card-fan-count {
    color: white;
}

.card-fan-cards {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 110px;
    width: 100px;
    padding-top: 10px;
}

.card-fan-cards .card {
    position: absolute;
    flex-shrink: 0;
    transition: transform 0.2s;
    cursor: pointer;
}

/* Fanning effect - cards overlap and rotate slightly */
.card-fan-cards .card:nth-child(1) {
    transform: translateX(-25px) rotate(-10deg);
    z-index: 1;
}

.card-fan-cards .card:nth-child(2) {
    transform: translateX(-8px) rotate(-5deg);
    z-index: 2;
}

.card-fan-cards .card:nth-child(3) {
    transform: translateX(8px) rotate(5deg);
    z-index: 3;
}

.card-fan-cards .card:nth-child(4) {
    transform: translateX(25px) rotate(10deg);
    z-index: 4;
}

/* For single card fans */
.card-fan-cards .card:only-child {
    transform: translateX(0) rotate(0deg);
    z-index: 1;
}

/* For two card fans */
.card-fan-cards .card:first-child:nth-last-child(2) {
    transform: translateX(-17px) rotate(-7deg);
    z-index: 1;
}

.card-fan-cards .card:first-child:nth-last-child(2) ~ .card {
    transform: translateX(17px) rotate(7deg);
    z-index: 2;
}

/* Active state on tap */
.card-fan-cards .card:active {
    transform: scale(1.05) !important;
    z-index: 100 !important;
}

/* Responsive Design - Mobile Optimization */
@media (max-width: 768px) {
    body {
        padding: 0;
        padding-bottom: 100px; /* Space for fixed scoreboard */
    }
    
    .container {
        padding: 0.5rem;
        max-width: 100%;
    }
    
    /* Show mobile-only elements (but hide when game header is visible) */
    body.with-game-header .mobile-burger-btn {
        display: none !important;
    }
    
    body:not(.with-game-header) .mobile-burger-btn {
        display: flex !important;
    }
    
    .mobile-drawer-overlay {
        display: block !important;
    }
    
    .mobile-drawer {
        display: block !important;
    }
    
    .mobile-player-area {
        display: block !important;
        background: white;
        padding: 2.5rem 0.5rem 0.5rem;
        border-radius: 12px;
        margin-bottom: 0.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border: 2px solid #dee2e6;
        overflow: visible;
    }
    
    .mobile-player-area h2 {
        color: var(--primary);
        margin-bottom: 0.5rem;
        text-align: center;
        font-size: 1rem;
        font-weight: bold;
    }
    
    .mobile-scoreboard {
        display: flex !important;
    }
    
    /* Hide desktop game board elements on mobile */
    .game-board {
        display: none !important;
    }
    
    .game-log {
        display: none !important;
    }
    
    .controls {
        display: none !important;
    }
    
    /* Compact header */
    header {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        border-width: 2px;
    }
    
    header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }
    
    .opponent-name-display {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .turn-indicator {
        font-size: 0.9rem;
        padding: 0.3rem 0.6rem;
        margin-bottom: 0.25rem;
    }
    
    .game-info {
        flex-direction: row;
        gap: 5px;
        font-size: 12px;
        justify-content: center;
    }
    
    .info-item {
        flex-direction: row;
        gap: 3px;
        align-items: center;
    }
    
    .info-item .label {
        font-size: 10px;
    }
    
    .info-item span:last-child {
        padding: 2px 6px;
        font-size: 12px;
        min-width: 20px;
    }
    
    /* Compact game board */
    .game-board {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* Override grid column assignments for mobile - all full width */
    .opponent-area,
    .player-area,
    .stock-area,
    .books-area {
        grid-column: 1 / -1 !important;
    }
    
    .opponent-area,
    .player-area {
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .opponent-area h2,
    .player-area h2 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Dynamically sized cards for mobile - much bigger! */
    .mobile-hand .card {
        width: 70px;
        height: 98px;
        font-size: 12px;
        padding: 3px;
    }
    
    /* Desktop cards stay small */
    .hand .card {
        width: 50px;
        height: 70px;
        font-size: 10px;
        padding: 2px;
    }
    
    .mobile-hand .corner-top,
    .mobile-hand .corner-bottom {
        font-size: 12px;
        top: 4px;
        left: 4px;
    }
    
    .mobile-hand .corner-bottom {
        bottom: 4px;
        right: 4px;
    }
    
    .mobile-hand .center-symbols {
        font-size: 16px;
    }
    
    .mobile-hand .center-symbols[data-suit="hearts"]::before,
    .mobile-hand .center-symbols[data-suit="diamonds"]::before,
    .mobile-hand .center-symbols[data-suit="clubs"]::before {
        font-size: 2.2em;
    }
    
    .mobile-hand .pip {
        font-size: 1em;
    }
    
    /* Desktop hand cards */
    .hand .corner-top,
    .hand .corner-bottom {
        font-size: 10px;
        top: 3px;
        left: 3px;
    }
    
    .hand .corner-bottom {
        bottom: 3px;
        right: 3px;
    }
    
    .hand .center-symbols {
        font-size: 14px;
    }
    
    .hand .center-symbols[data-suit="hearts"]::before,
    .hand .center-symbols[data-suit="diamonds"]::before,
    .hand .center-symbols[data-suit="clubs"]::before {
        font-size: 1.8em;
    }
    
    .hand .pip {
        font-size: 0.9em;
    }
    
    /* Compact hands */
    .hand {
        min-height: 75px;
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Compact stock and books side by side */
    .stock-area,
    .books-area {
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .books-area h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .books-key {
        gap: 1rem;
        padding: 8px;
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
    
    .key-color {
        width: 16px;
        height: 16px;
    }
    
    .books-display {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        max-height: 200px;
    }
    
    .book-checklist-item {
        padding: 6px 8px;
    }
    
    .book-rank {
        font-size: 0.85rem;
    }
    
    .book-status {
        font-size: 1rem;
    }
    
    .books-score {
        padding: 10px;
        margin-top: 10px;
        flex-direction: row;
        gap: 1rem;
    }
    
    .score-item span:first-child {
        font-size: 0.8rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    /* Hide or minimize game log on mobile */
    .game-log {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }
    
    .game-log h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .log-content {
        max-height: 80px;
        font-size: 11px;
    }
    
    /* Compact controls */
    .controls {
        gap: 10px;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    /* Compact notification */
    .opponent-notification,
    .gofish-notification,
    .book-notification {
        padding: 1rem 1.5rem;
        max-width: 90%;
    }
    
    .notification-content strong {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    #notification-text {
        font-size: 1.5rem;
    }
    
    #gofish-text {
        font-size: 2rem;
    }
    
    #book-text {
        font-size: 1.1rem;
    }
    
    #book-text i {
        font-size: 1.4rem;
    }
    
    /* Compact modals */
    .modal-content {
        padding: 1.5rem;
        max-width: 90%;
        max-height: 90vh;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .instructions h3 {
        font-size: 1.2rem;
        margin-top: 1rem;
    }
    
    .instructions ul, 
    .instructions ol {
        margin-left: 15px;
        font-size: 14px;
    }
    
    .instructions li {
        margin-bottom: 5px;
    }
    
    /* Adjust santa deck styles for mobile */
    .card.santa .corner-top,
    .card.santa .corner-bottom {
        font-size: 10px;
    }
    
    /* Adjust fish deck styles for mobile */
    .card.fish .corner-top,
    .card.fish .corner-bottom {
        font-size: 10px;
    }
    
    /* Opponent selection mobile */
    .opponent-select-screen {
        padding: 1rem;
    }
    
    .opponent-select-container {
        padding: 1.5rem;
    }
    
    .opponent-select-container h1 {
        font-size: 1.8rem;
    }
    
    .opponent-select-container h2 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .opponent-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .opponent-card {
        padding: 0.75rem;
    }
    
    .opponent-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .opponent-name {
        font-size: 0.8rem;
    }
    
    .opponent-title {
        font-size: 0.7rem;
    }
    
    .opponent-difficulty {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .opponent-details {
        padding: 1rem;
    }
    
    .opponent-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .avatar-placeholder {
        font-size: 3rem;
    }
    
    .opponent-details h3 {
        font-size: 1.3rem;
    }
    
    .opponent-subtitle {
        font-size: 0.9rem;
    }
    
    .difficulty-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .opponent-bio {
        font-size: 0.9rem;
    }
    
    .opponent-actions .btn {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    
    /* Login screen mobile */
    .login-screen {
        padding: 1rem;
    }
    
    .login-logo h1 {
        font-size: 2.5rem;
    }
    
    .login-tagline {
        font-size: 1rem;
    }
    
    .login-box {
        padding: 1.5rem;
    }
    
    .login-box h2 {
        font-size: 1.4rem;
    }
    
    .form-group input {
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }
    
    .login-box .btn-primary {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Mode selection mobile - Old styles commented out
    .mode-select-container {
        padding: 1.5rem;
    }
    
    .mode-select-container h1 {
        font-size: 2rem;
    }
    
    .mode-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .mode-btn {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .mode-btn i {
        font-size: 2.5rem;
    }
    
    .mode-btn span {
        font-size: 1.3rem;
    }
    
    .mode-btn small {
        font-size: 0.85rem;
    }
    */
    
    /* Tournament mobile */
    .tournament-container {
        padding: 1.5rem;
    }
    
    .tournament-container h2 {
        font-size: 1.8rem;
    }
    
    .bracket-stage {
        font-size: 1.1rem;
    }
    
    .bracket-display {
        flex-direction: column;
        gap: 1rem;
    }
    
    .bracket-round {
        min-width: 100%;
    }
    
    .bracket-round-title {
        font-size: 1rem;
    }
    
    .bracket-player-name {
        font-size: 0.9rem;
    }
    
    .bracket-player-score {
        font-size: 1rem;
    }
    
    .tournament-controls {
        flex-direction: column;
    }
    
    /* Join Game Screen Responsive */
    .join-game-screen {
        padding: 1rem;
        min-height: 100vh;
    }
    
    .join-game-container {
        padding: 1.5rem;
        border-width: 2px;
        max-width: 100%;
    }
    
    .join-game-screen h1 {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem;
    }
    
    .mode-subtitle {
        font-size: 0.9rem !important;
    }
    
    .join-options {
        gap: 0.5rem;
        margin: 1.5rem 0;
        flex-wrap: wrap;
    }
    
    .join-option-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
    
    .join-option-btn i {
        font-size: 1rem;
    }
    
    .join-game-form {
        margin: 1.5rem 0;
    }
    
    .join-game-form input {
        font-size: 1.2rem !important;
        letter-spacing: 1px;
        padding: 0.8rem;
    }
    
    .qr-scanner-container {
        margin: 1rem 0;
    }
    
    #qr-reader {
        max-width: 100%;
        border-width: 2px;
    }
    
    .scanner-status {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .join-game-controls {
        margin-top: 1rem;
    }
    
    .join-game-controls .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Waiting Room Responsive */
    .waiting-room-screen {
        padding: 1rem;
    }
    
    .waiting-room-container {
        padding: 1.5rem;
    }
    
    .waiting-room-container h1 {
        font-size: 1.8rem !important;
        margin-bottom: 1.5rem;
    }
    
    .game-code-display {
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .game-code-label {
        font-size: 0.9rem;
    }
    
    .game-code {
        font-size: 1.5rem !important;
    }
    
    .game-code-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .game-code-actions button {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .game-code-qr {
        margin-top: 1rem;
    }
    
    #qrCodeCanvas {
        max-width: 120px;
        height: auto;
    }
    
    .qr-label {
        font-size: 0.8rem;
    }
    
    /* Multiplayer Setup Responsive */
    .multiplayer-setup-container {
        padding: 1.5rem;
    }
    
    .multiplayer-setup-container h1 {
        font-size: 1.8rem !important;
    }
    
    .multiplayer-option-btn {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .multiplayer-option-btn i {
        font-size: 2.5rem;
        min-width: auto;
    }
    
    .multiplayer-option-btn span {
        font-size: 1.4rem;
    }
    
    .multiplayer-option-btn small {
        font-size: 0.85rem;
    }
    
    /* User Header Responsive */
    /* Old user-header mobile styles (commented out)
    .user-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .user-actions {
        width: 100%;
        justify-content: center;
    }
    
    .user-actions .btn-sm {
        flex: 1;
    }
    */
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 400px) {
    .join-game-screen h1 {
        font-size: 1.5rem !important;
    }
    
    .join-game-container {
        padding: 1rem;
    }
    
    .join-option-btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        min-width: 120px;
    }
    
    .join-game-form input {
        font-size: 1rem !important;
        padding: 0.7rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .game-code {
        font-size: 1.2rem !important;
        letter-spacing: 1px;
    }
    
    #qrCodeCanvas {
        max-width: 100px;
    }
}

