/* Gateway Styles - Cribbage Themed */

/* Color Palette */
:root {
    --primary-color: #2c5234;    /* Deep forest green */
    --secondary-color: #8B4513;  /* Saddle brown (wood) */
    --accent-color: #ffd700;     /* Gold */
    --text-color: #2c2c2c;      /* Dark gray */
    --light-text: #666;         /* Light gray */
    --background: #f8f9fa;      /* Light background */
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Card colors */
    --club-spade: #2c2c2c;      /* Black suits */
    --heart-diamond: #dc3545;   /* Red suits */
    
    /* Board colors */
    --board-wood: #8B4513;
    --board-dark: #654321;
    --board-hole: #2c1810;
    
    /* Shadows and borders */
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.2);
    --border-radius: 8px;
    --border-radius-large: 12px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: #1a3d20;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: #5d2e09;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-full {
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>') repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-image .cribbage-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

/* Navigation */
.main-nav {
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 101;
}

.nav-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-welcome {
    white-space: nowrap;
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive Navigation */
@media (max-width: 1024px) {
    .nav-links {
        gap: 20px;
    }
    
    .nav-user {
        gap: 10px;
    }
    
    .nav-user .btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-links,
    .nav-user {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        box-shadow: var(--shadow-medium);
        flex-direction: column;
        padding: 20px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-links.active,
    .nav-user.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links {
        gap: 10px;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 20px;
        margin-bottom: 0;
    }
    
    .nav-user {
        gap: 10px;
        padding-top: 20px;
    }
    
    .nav-link {
        padding: 12px 16px;
        text-align: center;
        border: 1px solid #e9ecef;
        margin-bottom: 5px;
    }
    
    .nav-user .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .user-welcome {
        text-align: center;
        padding: 10px;
        background-color: var(--background);
        border-radius: var(--border-radius);
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 12px 15px;
    }
    
    .nav-title {
        font-size: 1.3rem;
    }
}

/* Main Content */
.main-content {
    padding: 0px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
}

/* Play Section */
.play-section {
    background-color: var(--white);
    margin-bottom: 20px;
    padding: 1px 0;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    scroll-margin-top: 40px; /* Add space above when navigating to this section */
}

.play-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.play-card {
    background-color: var(--background);
    padding: 40px;
    border-radius: var(--border-radius-large);
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.play-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.play-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.play-card p {
    color: var(--light-text);
    margin-bottom: 25px;
}

.join-input-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.join-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 16px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 2px;
}

.join-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Guide Section */
.guide-section {
    background-color: var(--background);
    padding: 0px 0;
    margin-bottom: 20px;
    scroll-margin-top: 90px; /* Add space above when navigating to this section */
}

.guide-content {
    max-width: 1000px;
    margin: 0 auto;
}

.guide-overview {
    text-align: center;
    margin-bottom: 20px;
    padding: 30px;
    background-color: var(--white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
}

.guide-overview h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.guide-overview p {
    font-size: 1.1rem;
    color: var(--light-text);
    line-height: 1.8;
}

.guide-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.guide-card {
    background-color: var(--white);
    border-radius: var(--border-radius-large);
    padding: 30px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.guide-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.guide-icon {
    font-size: 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-card h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.guide-card ul {
    list-style: none;
    padding: 0;
}

.guide-card li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-color);
}

.guide-card li:last-child {
    border-bottom: none;
}

.guide-card strong {
    color: var(--primary-color);
}

/* Cribbage Board Info */
.cribbage-board-info {
    /* background-color: var(--white); */ /* Removed to allow PNG transparency to show through */
    border-radius: var(--border-radius-large);
    padding: 20px;
    box-shadow: var(--shadow-light);
}

.cribbage-board-info h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.board-description {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.board-image {
    flex: 0 0 auto;
    background: transparent;
    /* Ensure no background bleeding through */
}

.board-image img {
    background-color: transparent !important;
    background: none !important;
    /* Ensure proper PNG transparency rendering */
    image-rendering: auto;
    /* Remove any potential border or outline */
    border: none;
    outline: none;
}

.mini-board {
    width: 300px;
    height: 100px;
    background: transparent !important;
    /* Removed border-radius and box-shadow to preserve PNG transparency */
    /* Additional transparency properties */
    image-rendering: auto;
    object-fit: contain;
    /* Ensure no borders or outlines */
    border: none !important;
    outline: none !important;
    /* Remove any potential margin/padding that could show white */
    margin: 0;
    padding: 0;
    /* Try to remove white background if it exists in the PNG */
    mix-blend-mode: multiply;
    filter: contrast(1.1) brightness(1.05);
}

.board-description p {
    flex: 1;
    font-size: 1.1rem;
    color: var(--light-text);
    line-height: 1.8;
    min-width: 220px;
}

/* Stats Section */
.stats-section {
    background-color: var(--white);
    padding: 1px 0;
    margin-bottom: 20px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    scroll-margin-top: 40px; /* Add space above when navigating to this section */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 750px;
    margin: 0 auto;
}

.stat-card {
    background-color: var(--background);
    padding: 10px;
    border-radius: var(--border-radius-large);
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--light-text);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Subsection Title */
.subsection-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 40px 0 20px 0;
    position: relative;
}

.subsection-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--accent-color);
}

/* Computer Stats Styling */
.computer-stats .stat-card {
    border-color: #e3f2fd;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
}

.computer-stats .stat-card:hover {
    border-color: var(--info);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.computer-stats .stat-number {
    color: var(--info);
}

/* Stats Note */
.stats-note {
    max-width: 900px;
    margin: 30px auto;
    text-align: center;
}

.stats-note p {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin: 0;
    color: var(--light-text);
    font-size: 0.95rem;
    line-height: 1.4;
}

.stats-note strong {
    color: var(--text-color);
}

/* Leaderboard Styles */
.leaderboard-section {
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.leaderboard-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.leaderboard-container {
    background-color: var(--white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px;
    gap: 20px;
    padding: 20px;
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.leaderboard-list {
    min-height: 400px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px;
    gap: 20px;
    padding: 5px 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
    align-items: center;
}

.leaderboard-item:hover {
    background-color: var(--background);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-align: center;
}

.leaderboard-rank.top-3 {
    color: #000000;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.leaderboard-name.placeholder {
    color: var(--light-text);
    font-style: italic;
}

.leaderboard-wins {
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.leaderboard-rate {
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1001;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--light-text);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--background);
    color: var(--text-color);
}

/* Form Styles */
.auth-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: all 0.3s ease;
}

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

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Google Auth Styles */
.auth-divider {
    text-align: center;
    position: relative;
    margin: 30px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e9ecef;
}

.auth-divider span {
    background-color: var(--white);
    padding: 0 15px;
    color: var(--light-text);
    font-size: 14px;
    font-weight: 500;
}

.google-auth-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 20px;
}

.google-signin-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Override Google button styles to match our theme */
.google-signin-button iframe {
    border-radius: var(--border-radius) !important;
}

/* Footer */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .board-description {
        flex-direction: column;
        text-align: center;
    }
    
    .join-input-group {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .guide-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .play-options {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .modal-header,
    .auth-form {
        padding: 20px;
    }
    
    .leaderboard-title {
        font-size: 1.5rem;
    }
    
    .leaderboard-header,
    .leaderboard-item {
        grid-template-columns: 20px 1fr 80px 70px;
        gap: 10px;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .leaderboard-rank {
        font-size: 1rem;
    }
    
    .leaderboard-name {
        font-size: 1rem;
    }
    
    .profile-modal {
        width: 95%;
        max-width: none;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Game List Modal Styles */
.game-list-modal {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#game-list-modal .modal-body {
    padding: 0 20px 20px;
}

.game-code-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.game-code-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.game-code-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.game-code-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
}

.game-code-form button {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.game-list-section {
    margin-top: 20px;
}

.game-list-section h4 {
    margin: 0 0 15px 20px; /* Add left margin to align with .game-code-section h4 */
    color: #333;
    font-size: 1.1em;
}

.game-list {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.game-list-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    padding: 12px;
    background-color: #f8f9fa;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.game-list-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.game-list-item:hover {
    background-color: #f9f9f9;
}

.game-list-item:last-child {
    border-bottom: none;
}

.game-code {
    font-weight: bold;
    color: #333;
}

.game-players {
    font-size: 0.9em;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-count {
    color: #666;
}

.game-join-btn {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.game-join-btn:not(.disabled) {
    background-color: #28a745;
    color: white;
}

.game-join-btn:not(.disabled):hover {
    background-color: #218838;
}

.game-join-btn.disabled {
    background-color: #6c757d;
    color: white;
    cursor: not-allowed;
    opacity: 0.7;
}

.no-games-message {
    text-align: center;
    color: #666;
    padding: 30px 20px;
    font-style: italic;
}

.loading-message {
    text-align: center;
    color: #666;
    padding: 30px 20px;
    font-size: 1.1em;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(44, 82, 52, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.loading-overlay.hidden {
    display: none;
}
.loading-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#loading-message.loading-message {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Mobile responsive adjustments for game list modal */
@media (max-width: 768px) {
    .game-list-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .game-code-form {
        flex-direction: column;
        gap: 8px;
    }
    
    .game-code-form input,
    .game-code-form button {
        width: 100%;
    }
    
    .game-list-header,
    .game-list-item {
        grid-template-columns: 1fr 1.5fr 0.8fr 0.8fr;
        gap: 8px;
        padding: 10px;
    }
    
    .game-players {
        font-size: 0.8em;
    }
    
    .game-join-btn {
        padding: 5px 8px;
        font-size: 0.8em;
    }
}

/* Profile Modal Styles */
.profile-modal {
    max-width: 500px;
    width: 90%;
}

#profile-modal .modal-body {
    padding: 0 20px 20px;
}

.form-note {
    margin-top: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--light-text);
    line-height: 1.4;
}

.form-note strong {
    color: var(--text-color);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.form-actions .btn {
    min-width: 120px;
}

/* Create Game Modal Styles */
#create-game-modal .modal-body {
    padding: 0 40px 20px;
}

.game-type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 20px;
    align-items: stretch; /* Make cards equal height */
}

.game-type-card {
    background: var(--white);
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius-large);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push button to bottom */
}

.game-type-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.game-type-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.game-type-card h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.game-type-card p {
    color: var(--light-text);
    margin-bottom: 0;
    line-height: 1.5;
    flex-grow: 1; /* Allow text to take available space */
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-type-card .btn {
    pointer-events: none; /* Prevent double-click issues */
    margin-top: 20px; /* Add space above button */
}

.local-game-options {
    text-align: center;
    padding: 20px 0;
}

.local-game-options h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.computer-player-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.computer-count-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.computer-count-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Mobile responsive adjustments for create game modal */
@media (max-width: 768px) {
    .game-type-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .game-type-card {
        padding: 20px;
    }
    
    .game-type-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .game-type-card h4 {
        font-size: 1.2rem;
    }
    
    .computer-player-options {
        max-width: 100%;
    }
}

/* Login Note Styling */
.login-note {
    text-align: center;
    margin: 20px auto 0 auto;
    margin-bottom: 20px;
    padding: 12px 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    color: var(--light-text);
    max-width: 800px;
    /* Match the width of play-options container */
}

.login-note small {
    font-size: 0.9rem;
    font-style: italic;
} 


