body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    background-color: #15062B;
    font-family: 'Montserrat', sans-serif;
    color: white;
    display: flex;
    flex-direction: column;
    font-weight: 400;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: -1;
}

#root {
    position: fixed; /* поверх усього */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999; /* найвищий шар */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#root .overlay-content {
    pointer-events: auto; /* ловить події */
}

/* Header Styles */
.top-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    padding-bottom: 10px;
    position: relative;
}

.logo {
    margin-bottom: 0;
}

.logo img {
    height: 18px;
    width: auto;
    vertical-align: middle;
}

.language-selector {
    display: flex;
    gap: 10px;
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    padding-top: 15px;
}

.lang-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lang-btn.active {
    opacity: 1;
}

.lang-btn img {
    height: 1rem;
    width: auto;
}

/* Main Content Styles */
.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding: 20px;
    min-height: 100%;
    padding-top: 0px;
    overflow-x: hidden;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding: 20px;
    min-height: 100%;
    padding-top: 0px;
    overflow-x: hidden;
}

/* Create a wrapper for the top content */
.hero-content {
    margin-top: 40px;
}

h1 {
    font-size: 3.5rem;
    margin: 0;
    margin-bottom: 4px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.05em;
    padding: 0 20px;
}

h2 {
    font-size: 2.5rem;
    margin: 0;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
}

.subtitle {
    color: #EEEBF4;
    opacity: 0.6;
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.08em;
}

.login-container {
    background: rgba(21, 6, 43, 0.8);
    padding: 24px 56px;
    margin: auto 0px;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    border: 1px solid rgba(106, 76, 167, 0.8);
}

.login-container h3 {
    margin: 0 0 24px 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    font-family: 'Montserrat', sans-serif;
}

.login-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
}

.login-btn {
    display: grid;
    grid-template-columns: 75px 1fr;
    align-items: center;
    padding: 8px 10px;
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: 'Montserrat', sans-serif;
    flex: 1;
    max-width: 270px;
    position: relative;
}

.login-btn::after {
    content: '';
    position: absolute;
    left: 75px;
    top: 0;
    width: 2px;
    height: 100%;
}

.login-btn:hover {
    opacity: 0.9;
}

.line-btn {
    background-color: #06C755;
}

.line-btn::after {
    background-color: #06B74E;
}

.telegram-btn {
    background-color: #36A6DE;
}

.telegram-btn::after {
    background-color: #2F9ACF;
}

.login-btn img {
    width: 56px;
    height: 56px;
    justify-self: start;
}

.login-btn span {
    text-align: center;
    width: 100%;
    display: inline-block;
}

/* Footer Styles */
footer {
    padding: 16px 0 4px;
    text-align: center;
}

.social-links {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.social-icon {
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.social-icon img {
    width: 32px;
    height: 32px;
}

.social-icon:hover {
    opacity: 1;
}

/* Desktop footer styles */
.footer-text {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.footer-text a,
.footer-text span {
    margin: 0;  /* Remove default margins */
    color: #F8F6FF;
    opacity: 0.5;
}

.footer-text a {
    text-decoration: none;
}

/* Hide links-row div on desktop but show on mobile */
.footer-text .links-row {
    display: none;
}

/* Base responsive adjustments */
@media screen and (max-width: 768px) {
    .top-nav {
        padding: 16px 20px;
        justify-content: space-between;
    }

    .logo img {
        height: 16px;
    }

    .language-selector {
        position: static;
        padding-top: 0;
        transform: none;
    }

    .hero-section {
        justify-content: space-between;
        padding: 0;
    }

    .main-content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px 0;
        width: 100%;
        align-items: center;
    }

    .hero-content {
        margin-top: 0;
        margin-bottom: 32px;
        width: 100%;
    }

    h1 {
        font-size: 2.2rem;
        padding: 0 24px;
        white-space: nowrap;
    }

    .subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 16px;
        padding: 0 32px;
        white-space: normal;
    }

    .login-container {
        padding: 20px;
        border-radius: 20px;
        width: calc(100% - 64px);
        max-width: 500px;
        margin: 0 auto;
    }

    .login-buttons {
        flex-direction: column;
        gap: 20px;
    }

    .login-btn {
        max-width: none;
    }

    footer {
        padding: 16px 0;
    }

    .footer-text {
        gap: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-text > a {
        display: none;
    }

    .footer-text .links-row {
        display: flex;
        gap: 32px;
        margin-bottom: 8px;
    }
}

/* Specific mobile adjustments */
@media screen and (max-width: 480px) {
    .hero-section {
        padding: 16px 4px;
    }

    .login-container {
        padding: 20px;
        border-radius: 20px;
        width: calc(100% - 48px);
        margin: 0 24px;
    }

    .login-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .login-btn {
        max-width: none;
    }

    .social-links {
        margin-bottom: 16px;
    }

    .footer-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        font-size: 1.0rem;
    }

    .footer-text .links-row {
        display: flex;
        gap: 32px;
        margin-bottom: 4px;
    }

    footer {
        padding: 8px 0;
    }

    .footer-text span,
    .footer-text a {
        margin: 0;
    }

    h1 {
        font-size: 2.0rem;
    }
}

/* Handle very small screens */
@media screen and (max-width: 360px) {
    h1 {
        font-size: 1.6rem;
        padding: 0 16px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .login-container {
        padding: 16px;
    }
}

/* Game section styles */
.game-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #15062B;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.game-section::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: -1;
}

.game-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    position: relative;
    /*width: 95%;*/
    height: 95%;
}
.game-background {
    height: calc(100vh - 200px); /* Full height minus padding and nav/footer space */
    width: calc((100vh - 200px) * (590/599)); /* Match the content width */
    object-fit: contain;
}

.unity-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: calc(100vh - 200px); /* Match the background image height */
    width: calc((100vh - 200px) * (310/599)); /* Calculate width based on aspect ratio */
    max-height: 88%;
}

.game-section .game-footer {
    padding: 16px 0 24px;
}

/* Hide nav and footer on mobile for game section */
@media screen and (max-width: 768px) {
    .game-section .game-nav,
    .game-section .game-footer {
        display: none;
    }
    .game-container {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
        max-height: 100%;
    }
    .game-background {
        width: 100%;
        height: 100%;
    }
    .unity-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
    }
}


.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.popup-overlay-thirdweb {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.popup-content {
    background: linear-gradient(180deg, #1B0B3B 0%, #2D1657 100%);
    padding: 24px;
    border-radius: 16px;
    position: relative;
    width: 90%;
    max-width: 500px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.popup-content-thirdweb {
    background: transparent;
    padding: 24px;
    border-radius: 16px;
    position: relative;
    max-width: 500px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

.popup-link-container-thirdweb {
    margin: 20px 0;
    padding: 16px;
    background-color: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 480px) {
    .popup-content {
        padding: 20px 16px;
        width: 100%;
    }
}

.popup-close {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    font-size: 28px;
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    opacity: 1;
}

.popup-content h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
}

.popup-link-container {
    margin: 20px 0;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
    .popup-link-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
}

.popup-link {
    flex-grow: 1;
    word-break: break-all;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    padding: 4px 0;
}

.copy-button {
    padding: 12px 24px;
    background: linear-gradient(90deg, #6E3FF3 0%, #8F5BFF 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    min-width: 100px;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(110, 63, 243, 0.3);
    background: linear-gradient(90deg, #7B4EF4 0%, #9B6BFF 100%);
}

@media (max-width: 480px) {
    .copy-button {
        width: 100%;
        padding: 14px 24px;
    }
}
