/* Basic Reset & Body Styles */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f0f0f0; /* Light gray background */
    overflow: hidden; /* Hide scrollbars for screen transitions */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content to the top */
    min-height: 100vh; /* Ensure it takes full viewport height */
}

/* Screen Management (Single Page App approach) */
.screen {
    width: 100%;
    max-width: 450px; /* Typical mobile app width constraint */
    height: 100vh;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: absolute; /* Allows screens to overlap for transitions */
    top: 0;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for perfect centering */
    overflow-y: auto; /* Enable scrolling for content that exceeds screen height */
    -webkit-overflow-scrolling: touch; /* Smoother scrolling on iOS */
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; /* Smooth transitions */
}

.screen.hidden {
    display: none; /* Hide non-active screens */
    /* For transitions, you might set opacity: 0; transform: translateX(100%); */
    /* Then revert in .active */
}

.screen.active {
    display: flex;
    z-index: 10; /* Bring active screen to front */
    /* opacity: 1; transform: translateX(-50%); */
}

/* Main Entry Screen Styles (srgsg.jpg inspired) */
#mainEntryScreen {
    justify-content: space-between; /* Push logo up, buttons central, links down */
    align-items: center;
    padding-top: 10vh; /* Space above logo */
    padding-bottom: 20px;
    background-color: #f8f8f8; /* Very light gray for this screen */
}

.roblox-logo-container {
    position: relative;
    width: 80%; /* Adjust size */
    max-width: 250px;
    margin-bottom: 50px; /* Space between logo and buttons */
}

.roblox-logo {
    width: 100%;
    height: auto;
    display: block;
}

.roblox-logo-circle {
    position: absolute;
    top: 15%; /* Position over the 'o' */
    right: 18%; /* Position over the 'o' */
    width: 20px; /* Size of the white circle */
    height: 20px;
    background-color: white;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1); /* Subtle border */
}

.button-group {
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 300px;
    margin-bottom: 50px; /* Space between buttons and terms */
}

.action-button {
    background-color: #1a71b1; /* Roblox blue */
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 15px; /* Space between buttons */
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.action-button:hover {
    background-color: #155e92;
}

.action-button:active {
    transform: translateY(1px);
}

.action-button.guest-button {
    background-color: #f2f2f2; /* Lighter background for "Play Now" */
    color: #333;
    border: 1px solid #ddd;
}

.action-button.guest-button:hover {
    background-color: #e0e0e0;
}

.terms-links {
    text-align: center;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.terms-links a {
    color: #1a71b1;
    text-decoration: none;
}

.info-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 24px;
    color: #1a71b1;
    border: 1px solid #1a71b1;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Welcome Screen Styles */
#welcomeScreen {
    background-color: #e30613; /* Roblox Red */
    justify-content: center;
    align-items: center;
    text-align: center;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-content h1 {
    color: black; /* Black text */
    font-size: 48px;
    margin-bottom: 20px;
}

.welcome-logo {
    width: 80%; /* Adjust size */
    max-width: 300px;
    height: auto;
    filter: invert(100%) brightness(0); /* Make logo black if it's white or light */
}

/* Gender Selection Content (now only for Game Play Gender Selection) */
.gender-selection-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.gender-selection-content h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    text-align: center;
}

.gender-options {
    display: flex;
    gap: 30px; /* Space between cards */
}

.gender-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gender-card:hover {
    transform: translateY(-5px);
    border-color: #1a71b1;
}

.gender-card img {
    width: 120px; /* Size for avatar images */
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #eee;
}

.gender-card span {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Specific styles for game play gender selection cards */
.play-gender-card[data-gender="boy"] {
    background-color: #ADD8E6; /* Light Blue */
}
.play-gender-card[data-gender="girl"] {
    background-color: #FFC0CB; /* Pink */
}


/* Header for Games and Forms (faff.jpg inspired) */
.header {
    background-color: #1a71b1;
    color: white;
    padding: 10px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-menu-icon, .header-back-icon {
    font-size: 24px;
    cursor: pointer;
    padding: 5px; /* Make clickable area larger */
}

.header-back-icon span {
    font-weight: bold;
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    flex-grow: 1;
    text-align: center;
}

.header-icons span {
    font-size: 20px;
    margin-left: 15px;
    padding: 2px 5px;
    border: 1px solid white; /* For R$ symbol */
    border-radius: 3px;
    font-weight: bold;
}

/* Content Wrapper (for scrollable sections like Games list, Game Detail) */
.content-wrapper {
    flex-grow: 1;
    padding: 15px;
    background-color: #f0f0f0; /* Background for the scrollable content */
    overflow-y: auto; /* Allow content to scroll */
}

.section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.view-all-button {
    background-color: #007bff; /* Standard blue for secondary buttons */
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.view-all-button:hover {
    background-color: #0056b3;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Responsive grid */
    gap: 15px;
}

.game-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    text-decoration: none; /* Remove underline for links/divs behaving as links */
    color: inherit;
    cursor: pointer; /* Indicate it's clickable */
}

.game-card img {
    width: 100%;
    height: 100px; /* Fixed height for thumbnails */
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.game-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.2;
}

.game-title .alpha {
    font-size: 10px;
    background-color: #ddd;
    color: #555;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
}

.game-title.update-text {
    font-size: 10px;
    color: #f00; /* Red for update */
    font-weight: normal;
    margin-bottom: 2px;
}

.game-stats {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
    margin-top: auto; /* Push stats to the bottom if content grows */
}

.game-stats .percentage, .game-stats .players {
    display: flex;
    align-items: center;
}

.view-feed-button {
    background-color: #f2f2f2;
    color: #333;
    border: 1px solid #ddd;
    width: calc(100% - 30px); /* Adjust for padding */
    margin: 10px auto 20px auto;
    display: block;
}
.view-feed-button:hover {
    background-color: #e0e0e0;
}


/* Footer Navigation (faff.jpg inspired) */
.footer-nav {
    background-color: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.nav-item {
    text-align: center;
    font-size: 12px;
    color: #777;
    padding: 5px;
    cursor: pointer;
    flex: 1; /* Distribute space evenly */
}

.nav-item.active {
    color: #1a71b1;
    font-weight: bold;
}

.nav-item span {
    display: block;
    margin-top: 3px;
}

.chat-notification {
    background-color: red;
    color: white;
    font-size: 10px;
    border-radius: 50%;
    padding: 2px 5px;
    position: relative;
    top: -8px;
    left: -5px;
    min-width: 10px; /* Ensure it's visible even with single digit */
    display: inline-block; /* Aligns well with text */
    text-align: center;
}

/* Form Container (Login/Sign Up Screens) */
.form-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center vertically */
    align-items: center;
    padding: 20px;
    background-color: #f8f8f8;
}

.form-container h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    text-align: center;
}

.form-container form {
    width: 100%;
    max-width: 300px; /* Limit form width */
}

.form-container input[type="text"],
.form-container input[type="password"] {
    width: calc(100% - 24px); /* Account for padding */
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box; /* Include padding in width */
}

.form-container input[type="text"]:focus,
.form-container input[type="password"]:focus {
    border-color: #1a71b1;
    box-shadow: 0 0 5px rgba(26, 113, 177, 0.3);
}

/* Gender Radio Group for Sign Up */
.gender-radio-group {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
}

.gender-radio-group label {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #555;
    cursor: pointer;
}

.gender-radio-group input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2); /* Make radio buttons slightly larger */
    accent-color: #1a71b1; /* Style the radio button itself */
}


.form-submit-button {
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.form-link {
    color: #1a71b1;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
}

.form-link:hover {
    text-decoration: underline;
}

/* Game Detail Page Specific Styles */
.game-detail-content {
    background-color: white;
    padding-bottom: 20px;
}

.game-detail-main-img {
    width: 100%;
    height: 200px; /* Larger image for detail page */
    object-fit: cover;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#gameDetailName {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    padding: 0 15px; /* Match content padding */
}

.game-detail-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 0 15px; /* Match content padding */
}

.game-detail-stats {
    display: flex;
    justify-content: space-around;
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
    padding: 0 15px; /* Match content padding */
}

.game-detail-stats span {
    display: flex;
    align-items: center;
}

.game-play-button {
    width: calc(100% - 30px); /* Adjust for padding */
    margin: 0 15px 30px 15px;
}

.game-detail-section {
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    padding: 15px;
    margin-top: 15px;
}

.game-detail-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.game-detail-section p {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* Placeholder Content Styling */
.placeholder-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%; /* Take full height of content wrapper */
    padding: 20px;
}

.placeholder-content h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 20px;
}

.placeholder-content p {
    color: #777;
    font-size: 16px;
    max-width: 80%; /* Constrain text width */
}


/* Responsive adjustments for smaller screens */
@media (max-width: 400px) {
    .screen {
        max-width: 100%; /* Full width on very small screens */
    }

    .header-title {
        font-size: 18px;
    }

    .header-icons span {
        font-size: 18px;
        margin-left: 10px;
    }

    .gender-options {
        flex-direction: column; /* Stack gender cards vertically on small screens */
        gap: 20px;
    }

    .gender-card img {
        width: 100px;
        height: 120px;
    }

    .game-info {
        padding: 5px;
    }

    .game-title {
        font-size: 12px;
    }

    .game-stats {
        font-size: 10px;
    }

    .form-container input {
        padding: 10px;
        font-size: 14px;
    }

    .action-button {
        padding: 12px;
        font-size: 16px;
    }

    .game-detail-main-img {
        height: 150px;
    }

    #gameDetailName {
        font-size: 20px;
    }

    .game-detail-description,
    .game-detail-section p {
        font-size: 13px;
    }
}