html {
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* General Body & Typography */
body {
    background:
        radial-gradient(circle at 10% 12%, rgba(244, 211, 94, 0.22), transparent 38%),
        radial-gradient(circle at 90% 85%, rgba(29, 120, 116, 0.24), transparent 36%),
        linear-gradient(145deg, #f7fff7, #e7f5f2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    color: #343a40;
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* Main Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav .nav-logo {
    font-weight: 700;
    font-size: 1.8rem;
    color: #003366; /* Dark blue for a professional feel */
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.main-nav .nav-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.25rem;
}

.main-nav a {
    color: #5a6773;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 1.5rem 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 1rem;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

button,
.btn,
.diff-btn,
.game-btn,
.main-nav a,
input,
select,
textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Hero Header */
.intro-header {
    background: linear-gradient(45deg, #003366, #005f9e);
    color: #ffffff;
    text-align: center;
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    letter-spacing: 1px;
}

.intro-text p {
    font-size: 1.25rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Main Content & Sections */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #003366;
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
}

/* Game Selection */
.game-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.game-btn {
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.game-btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.game-btn img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.game-btn span {
    font-size: 1.3rem;
    font-weight: 600;
    color: #343a40;
}

/* Featured Cards */
.featured-tgb,
.featured-faq,
.from-the-blog {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
}

.featured-tgb video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.featured-tgb p {
    margin-bottom: 1rem;
}

.tgb-cta {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f5c34d, #d89a00);
    color: #1f2933;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(216, 154, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tgb-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(216, 154, 0, 0.45);
}

.faq-item {
    margin-bottom: 2rem;
}

.faq-item h3 {
    font-size: 1.4rem;
    color: #005f9e;
    margin-bottom: 0.5rem;
}

.from-the-blog p {
    font-style: italic;
    color: #6c757d;
    text-align: left;
    font-size: 1.1rem;
}

/* Footer */
.main-footer {
    background: #343a40;
    color: #f8f9fa;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.main-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .intro-text h1 {
        font-size: 2.8rem;
    }
    .intro-text p {
        font-size: 1.1rem;
    }
}

@media (max-width: 1150px) {
    .main-nav ul {
        gap: 0.8rem;
    }

    .main-nav a {
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    .main-nav {
        flex-direction: column;
        height: auto;
        padding: 1rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
        align-items: stretch;
    }
    .main-nav .nav-logo {
        justify-content: center;
    }
    .main-nav ul {
        margin-top: 0.75rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .main-nav li {
        flex: 0 0 auto;
    }
    .main-nav a {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
    .main-nav a::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-nav {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .main-nav ul {
        margin-top: 0.6rem;
    }
    .main-nav a {
        padding: 0.48rem 0.68rem;
    }

    .intro-header {
        padding: 4rem 1rem;
    }

    .intro-text h1 {
        font-size: 2.2rem;
    }

    main {
        padding: 2rem 1rem;
    }

    section h2 {
        font-size: 2rem;
    }

    .footer-links {
        gap: 0.75rem;
        margin-bottom: 0.65rem;
    }

    .footer-links a {
        font-size: 0.9rem;
    }

    .featured-tgb,
    .featured-faq,
    .from-the-blog {
        padding: 1.35rem;
    }

    .game-buttons {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 360px) {
    .main-nav {
        padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 0.75rem max(0.75rem, env(safe-area-inset-left));
    }

    .main-nav .nav-logo {
        font-size: 1.35rem;
        gap: 0.45rem;
    }

    .main-nav .nav-logo img {
        width: 34px;
        height: 34px;
    }

    .main-nav a {
        font-size: 0.82rem;
        padding: 0.45rem 0.6rem;
    }

    .intro-header {
        padding: 3rem 0.8rem;
    }

    .intro-text h1 {
        font-size: 1.8rem;
    }

    .intro-text p {
        font-size: 0.95rem;
    }

    section h2 {
        font-size: 1.55rem;
    }

    .game-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (orientation: landscape) and (max-height: 430px) {
    .main-nav {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    .intro-header {
        padding: 2.4rem 1rem;
    }

    .intro-text h1 {
        font-size: 1.9rem;
    }
}

/* Difficulty Controls */
.difficulty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.difficulty-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.diff-btn {
    padding: 0.55rem 0.9rem;
    border: 1px solid #8ecae6;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    color: #143642;
}

.diff-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(13, 59, 102, 0.24);
}

.diff-btn.active {
    border: none;
    background: linear-gradient(135deg, #1d7874, #0d3b66);
    color: #ffffff;
    font-weight: 700;
}

.game-difficulty-controls {
    justify-content: center;
}

@media (max-width: 1024px) {
    .game-difficulty-controls {
        width: min(100%, 440px);
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .game-difficulty-controls .difficulty-label,
    .game-difficulty-controls .planes-difficulty-label {
        text-align: left;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .game-difficulty-controls .diff-btn {
        min-width: 82px;
        text-align: center;
        margin: 0;
        white-space: nowrap;
    }
}

@media (max-width: 430px) {
    .game-difficulty-controls {
        width: 100%;
        gap: 6px;
        justify-content: center;
    }

    .game-difficulty-controls .diff-btn {
        font-size: 0.84rem;
        padding: 0.5rem 0.7rem;
        min-width: 78px;
    }
}
