@font-face {
    font-family: 'UltrasLiberi';
    src: url('ultrasliberi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* Improves font loading performance */
}

/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'UltrasLiberi', sans-serif;
/*    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    background: url('../img/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    padding-bottom: 60px;
    color: #f1f1f1;
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
}

html {
  overscroll-behavior: none;
  touch-action: manipulation;
}

h1, h3 {
    color: #fff;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2rem;
}

a {
    color: #4ea8de;
    text-decoration: none;
    font-size: 1.1rem;
}

a:hover {
    text-decoration: underline;
}

.page {
    display: none;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
    flex: 1 0 auto;
}

.page.active {
  display: block;
  overflow-y: auto;
  height: auto;
  max-height: 100%;
}

button {
    background-color: #222;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s ease;
    touch-action: manipulation;
}

button:hover, button:active {
    background-color: #444;
}

input {
    width: 20%;
    padding: 12px;
    margin: 10px 0;
    background-color: #1c1c1c;
    border: 1px solid #333;
    color: #fff;
    border-radius: 6px;
}

.navbar {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    pointer-events: auto;
}

.home-nav-btn {
    background-color: #222;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    pointer-events: auto;
}

.home-nav-btn:hover, .home-nav-btn:active {
    background-color: #444;
    transform: scale(1.05);
}


.footer-logo {
    text-align: center;
    margin-top: 20px;
}

.footer-logo img {
    max-width: 100%;
    height: auto;
    width: 280px;
    transition: opacity 0.3s ease;
}

.footer-logo img:hover {
    opacity: 1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pulse-text {
    animation: pulse 1.8s infinite;
    display: inline-block;
}

/* Centrare verticalmente e orizzontalmente tutte le sezioni con login-box */
#login, #signup, #recover {
    position: fixed;
    top: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
    flex-direction: column;
}

#login.active,
#signup.active,
#recover.active {
    display: flex !important;
}

/* Login box compatta */
.login-box {
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%;
    max-width: 350px;
    animation: fadeIn 0.3s ease;
    z-index: 99999;
}

/* Input e bottoni dentro la box */
.login-box input,
.login-box button {
    width: 40%; /* più flessibile */
    max-width: 300px;
    box-sizing: border-box;
}

.login-box button:hover {
    background-color: #444;
}


/* Fade-in animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Auth Buttons & Info */
.auth-buttons {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1100;
}


#howItWorks {
    background-color: rgba(27, 27, 27, 0.9);
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 800px;
    box-sizing: border-box;
    overflow: hidden;
}

#howItWorks h3 {
    text-align: center;
    font-size: 2rem;
    margin-top: 10px;
    margin-bottom: 20px;
}

#earn img {
    display: block;
    margin: 20px auto;
    max-width: 200px;
    border-radius: 12px;
}

.how-it-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

.step {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
    word-wrap: break-word;
    font-size: 1.2rem;
}

.step strong {
    font-size: 1.3rem;
}

/* Footer */
footer {
    margin-top: 40px;
    font-size: 12px;
    color: #777;
    text-align: center;
    padding: 20px;
}

/* Responsive */
@media(max-width: 768px) {
    .auth-buttons, .auth-info {
        flex-direction: column;
        top: 10px;
        right: 10px;
    }
}
input[type="text"], input[type="password"] {
    width: 40%;  /* Adjust width */
    font-size: 15px;  /* Adjust font size */
    padding: 10px;  /* Adjust padding for better spacing */
}

.main-footer {
    margin-top: auto;
    padding: 15px 0;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    width: 100%;
    font-size: 1.1rem;
}

@media (min-width: 769px) {
  body:not(#login):not(#signup):not(#recover) .main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
  }
}

.footer-line {
    height: 1px;
    background-color: #333;
    margin-bottom: 15px;
}

.home-content {
    text-align: center;
    padding: 20px;
    margin-top: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

#home h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

#home p {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

/* Mobile Styles (Up to 480px) */
@media (max-width: 480px) {
    body {
        background-attachment: scroll;
        font-size: 16px;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h3 {
        font-size: 1.7rem !important;
    }
    
    .home-content {
        margin-top: 50px;
        padding: 10px;
    }
    
    .auth-buttons {
        position: fixed;
        top: 10px;
        right: 10px;
        flex-direction: row;
        justify-content: flex-end;
        gap: 6px;
        z-index: 1100;
        bottom: auto;
        left: auto;
    }
    
    .auth-buttons button {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .home-nav-btn {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    #home h1 {
        font-size: 2rem;
    }
    
    #home p {
        font-size: 1.2rem;
    }
    
    .step {
        padding: 10px 8px;
        font-size: 1.1rem;
        margin: 0;
    }
    
    .step strong {
        font-size: 1.2rem;
    }
    
    .main-footer {
        font-size: 1rem;
        padding: 10px 0;
    }
}

/* Small Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .auth-buttons {
        position: fixed;
        top: 10px;
        right: 10px;
        flex-direction: row;
        justify-content: flex-end;
        gap: 8px;
        bottom: auto;
        left: auto;
    }
    
    .how-it-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-logo img {
        width: 250px;
    }
    
    #home h1 {
        font-size: 1.8rem;
    }
}

/* Tablets and Small Laptops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .how-it-steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Larger Screens (1025px and up) */
@media (min-width: 1025px) {
    .how-it-steps {
        grid-width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile small screen optimization */
@media (max-width: 375px) {
    body {
        font-size: 16px;
    }
    
    .home-content {
        margin-top: 40px;
        padding: 10px 5px;
    }
    
    .navbar {
        top: 8px;
        left: 8px;
    }
    
    .home-nav-btn {
        padding: 6px 10px;
        font-size: 15px;
    }

    #howItWorks {
        padding: 15px 8px;
        font-size: 16px;
        max-height: none;
        overflow: visible;
        width: 94%;
        margin: 10px auto;
    }
    
    #howItWorks h3 {
        font-size: 1.6rem;
    }

    .how-it-steps {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0;
    }

    .step {
        font-size: 1rem;
        padding: 8px 6px;
        margin: 0;
    }
    
    .step strong {
        font-size: 1.1rem;
    }

    .footer-logo img {
        width: 180px;
    }
    
    .auth-buttons {
        top: 8px;
        right: 8px;
        gap: 5px;
    }
    
    .auth-buttons button {
        padding: 6px 10px;
        font-size: 15px;
    }
    
    #home h1 {
        font-size: 1.8rem;
    }
    
    #home p {
        font-size: 1.1rem;
    }
}

/* DASHBOARD STYLING */
#dashboard {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 40px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

#dashboard.active {
    display: flex;
}

/* Box contenitore */
.dashboard-box {
    background-color: rgba(20, 20, 20, 0.9);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    color: #fff;
    text-align: center;
}

/* Spaziatura e font */
.dashboard-box p {
    margin: 10px 0;
    font-size: 1rem;
    color: #ddd;
}

.dashboard-box h1 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #fff;
}

/* Bottoni */
.dashboard-box button {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px auto;
    font-size: 1rem;
    background-color: #222;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dashboard-box button:hover {
    background-color: #444;
}

/* Responsive */
@media (max-width: 600px) {
    .dashboard-box {
        padding: 20px;
    }

    .dashboard-box h1 {
        font-size: 1.5rem;
    }

    .dashboard-box p {
        font-size: 0.95rem;
    }

    .dashboard-box button {
        font-size: 0.95rem;
    }
}

#earn {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 40px 20px;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

#earn.active {
    display: flex;
}

.earn-box {
    background-color: rgba(20, 20, 20, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    max-width: 600px;
    width: 100%;
    text-align: center;
    color: #fff;
}

.earn-box h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.earn-box p {
    margin: 10px 0;
    font-size: 1rem;
}

.earn-box button {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px auto;
    font-size: 1rem;
    background-color: #222;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.earn-box button:hover {
    background-color: #444;
}

.ad-container {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
}

/* ✅ iPhone 11, 12, 13, 14, SE 2ª/3ª Gen (375px) */
@media (max-width: 375px) {
    .home-content {
        padding: 10px 5px;
        margin-top: 40px;
    }
    
    .navbar {
        top: 8px;
        left: 8px;
    }
    
    .home-nav-btn {
        padding: 6px 10px;
        font-size: 15px;
    }

    #howItWorks {
        padding: 15px 8px;
        font-size: 16px;
        max-height: none;
        overflow: visible;
        width: 94%;
        margin: 10px auto;
    }
    
    #howItWorks h3 {
        font-size: 1.6rem;
    }

    .how-it-steps {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0;
    }

    .step {
        font-size: 1rem;
        padding: 8px 6px;
        margin: 0;
    }
    
    .step strong {
        font-size: 1.1rem;
    }

    .footer-logo img {
        width: 180px;
    }
    
    .auth-buttons {
        top: 8px;
        right: 8px;
        gap: 5px;
    }
    
    .auth-buttons button {
        padding: 6px 10px;
        font-size: 15px;
    }
    
    #home h1 {
        font-size: 1.8rem;
    }
    
    #home p {
        font-size: 1.1rem;
    }
}

/* ✅ iPhone 14 Pro Max, iPhone XR, 11 Pro Max (414px) */
@media (max-width: 414px) {
    .home-content {
        padding: 10px;
        margin-top: 45px;
    }
    
    .navbar {
        top: 10px;
        left: 10px;
    }
    
    .home-nav-btn {
        padding: 8px 12px;
        font-size: 16px;
    }

    #howItWorks {
        font-size: 16px;
        max-height: none;
        padding: 15px 10px;
        width: 93%;
        margin: 15px auto;
    }
    
    #howItWorks h3 {
        font-size: 1.7rem;
    }

    .how-it-steps {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 2px;
    }

    .step {
        font-size: 1.1rem;
        padding: 10px 8px;
        margin: 0;
    }
    
    .step strong {
        font-size: 1.2rem;
    }
    
    .auth-buttons {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .auth-buttons button {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    #home h1 {
        font-size: 1.9rem;
    }
    
    #home p {
        font-size: 1.2rem;
    }
}

/* ✅ iPhone 12/13/14 Pro (390px) */
@media (max-width: 390px) {
  .home-content {
    padding: 10px 5px;
    margin-top: 40px;
  }

  .step {
    font-size: 0.87rem;
    padding: 9px 7px;
    margin: 0;
  }

  .login-box input,
  .login-box button {
    width: 75%;
  }

  #howItWorks {
    padding: 15px 8px;
    width: 94%;
    margin: 12px auto;
  }

  .how-it-steps {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 0 1px;
  }

  .auth-buttons {
    top: 8px;
    right: 8px;
    gap: 5px;
  }
}

/* ✅ iPhone 14 Plus (430px) */
@media (max-width: 430px) {
  .home-content {
    padding: 10px;
    margin-top: 45px;
  }

  .step {
    font-size: 0.9rem;
    padding: 10px 8px;
    margin: 0;
  }

  .login-box {
    width: 90%;
  }

  .login-box input,
  .login-box button {
    width: 70%;
  }

  #howItWorks {
    padding: 15px 10px;
    width: 92%;
    margin: 15px auto;
  }

  .how-it-steps {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 2px;
  }

  .auth-buttons {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
}


