/* =======================
    General Styles
======================= */

* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
}

body {
    background: black;
}

body::-webkit-scrollbar {
    display: none;
}

/* =======================
    Typography
======================= */
h1, h2, p, label {
    text-align: center;
    color: white;
}

h1 {
    font-size: 30px;
    font-weight: 300;
    color: black; /* Specific override */
}

h2 {
    font-size: 1.4em;
    font-weight: 700;
    color: #cfe0ff;
    text-shadow: 0 0 6px rgba(207, 224, 255, 0.8);
}

p {
    font-size: 15px;
    font-weight: 400;
}

label {
    font-size: 4.5vw;
    margin-top: 5vh;
}

#game-canvas {
    width: 100%;
    height: 100%;
    background: #000; /* Example background color */
    display: block;
    z-index: 1;
}

#joystick-zone {
    width: 250px;
    height: 100px;
    position: absolute;
    bottom: 50px;
    right: 50px;
}

/* =======================
    Layout Containers
======================= */
.home-cont, .goal-uncompleted-page, .main-content-cont {
    display: none;
    width: 100%;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    transition: 1s;
}

.home-cont {
    display: flex;
    align-items: center;
    background-position: right;
    background-size: contain;
    background-blend-mode: multiply;
    background-repeat: no-repeat;
}

.home-forum-cont {
    width: 35%;
    height: 670px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    margin: auto;
    border-radius: 40px;
    text-align: center;
}

.room-code-setup {
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 500px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transform: translate(-50%, -50%);
}

.rooms {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    width: 100%;
    height: 80%;
    overflow: scroll;
    background: gray;
    border-radius: 10px;
}

.rooms::-webkit-scrollbar {
    display: none;
}

.rooms div {
    width: 90%;
    height: 40px;
    background: #8c52ff;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    margin: 0 auto;
    align-items: center;
    transition: 0.5s;
    margin-top: 10px;
}

.rooms div:hover {
    cursor: pointer;
    opacity: 0.7;
    transform: scale(1.05);
}

.rooms div p {
    color: white;
}

.room-code-setup button {
    width: 95%;
    background: none;
    color: white;
}

.room-code-setup input {
    width: 90%;
    background: none;
    box-shadow: 0 0 15px 0 rgba(240, 240, 240, 0.2);
    color: white;
    margin-top: 30px;
}

.stars {
    font-size: 40px;
}

.star {
    cursor: pointer;
    transition: color 0.3s;
    color: #ccc;
}
.star:hover,
.star.active {
    color: gold;
}

.change-acc-button {
    display: none;
}

.join-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 120px;
    height: 35px;
}

.main-content-cont {
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden;
}

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100% !important;
}

/* =======================
    Interactive Elements
======================= */
input, button, select {
    width: 65%;
    height: 45px;
    outline: none;
    border: none;
    background: white;
    font-size: 15px;
    border-radius: 15px;
    box-shadow: 0 0 10px 0 rgb(240, 240, 240);
    transition: 0.2s;
}

input {
    padding: 0 10px !important;
    margin: 0;
}

select {
    padding-left: 2%;
}

button {
    background: #56aaed;
    color: white;
    transition: 0.25s;
    box-shadow: none;
    cursor: pointer;
}

input:hover, select:hover {
    transform: scale(1.01);
}

button:hover {
    transform: scale(1.015);
}

/* =======================
    Specific Elements
======================= */
.intro-text-group {
    max-width: 90%;
}

.intro-popup {
    display: none;
    position: absolute;
    width: 350px;
    height: 190px;
    top: 50%;
    left: 50%;
    align-items: left;
    justify-content: center;
    flex-direction: column;
    transform: translate(-50%, -50%);
    background: black;
    border-radius: 20px;
    background-image: url('./assets/images/rob-small.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right;
    transition: 1s;
    font-size: 16px;
    gap: 10px;
}

.intro-popup * {
    margin-left: 20px;
}

.intro-popup h4 {
    color: white;
    max-width: 60%;
    text-align: left;
}

.intro-popup a {
    font-size: 11px;
    color: #56aaed;
    opacity: 0.7;
    text-decoration: none;
}

@keyframes screen-shake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5px, -5px); }
    20% { transform: translate(5px, 5px); }
    30% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    50% { transform: translate(-5px, -5px); }
    60% { transform: translate(5px, 5px); }
    70% { transform: translate(-5px, 5px); }
    80% { transform: translate(5px, -5px); }
    90% { transform: translate(-5px, -5px); }
    100% { transform: translate(0, 0); }
}

.shake {
    animation: screen-shake 0.5s ease-in-out infinite;
}

@keyframes slowPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    }
}

@keyframes slowPulse2 {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.intro-popup {
    animation: slowPulse 6s infinite ease-in-out;
}

.player-name, .player-key {
    background: none;
    width: 61%;
    box-shadow: 0 0 10px 0 rgba(240, 240, 240, 0.2);
    color: white;
}

.season-title {
    text-shadow: none;
}

.open-shop {
    font-size: 40px;
    background: none !important;
    width: auto;
    height: auto;
    position: absolute;
    top: 90%;
    right: 1%;
}

.open-shop:hover {
    filter: saturate(0);
    transform: scale(1.2) rotate(-10deg);
}

.shop {
    display: none;
    border-radius: 30px;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 50vw;
    min-height: 600px;
    height: auto;
    position: absolute;
    z-index: 3000;
    justify-content: space-around;
    flex-direction: column;
    align-items: center;
}

.shop h1 {
    color: #56aaed;
}

.shop p {
    color: #56aaed;
}

.shop-buttons {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.shop-buttons button {
    width: 40%;
    font-size: 15px;
}

.coin-count {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #56aaed;
    font-size: 20px;
}

.theme {
    display: flex;
    align-items: start;
    justify-content: space-between;
    align-items: center;
    width: 80%;
    height: auto;
    min-height: 10vh;
    text-align: left;
    margin-top: 5%;
    padding: 10px 30px;
    border-radius: 20px;
}

.theme h3, .theme h5 {
    color: white;
}

.theme button {
    width: 45%;
    background: white;
    color: black;
}

.items {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    max-height: 60vh;
    overflow: scroll;
    height: auto;
    border-radius: 60px;
}

.items::-webkit-scrollbar {
    display: none;
}

/* =======================
    Logo and Animations
======================= */
.logo-cont {
    width: 250px;
    transition: 0.5s;
}

.logo-cont:hover {
    opacity: 0.6;
    cursor: pointer;
    transition: 0.5s;
}

.shaker-shake-animation {
    animation: shakerShake 1.0s ease-in-out;
}

/* =======================
    Keyframes
======================= */
@keyframes borderGlow {
    0% { box-shadow: 0 0 10px #56aaed, 0 0 20px #56aaed; }
    100% { box-shadow: 0 0 20px #56aaed, 0 0 30px #56aaed; }
}

@keyframes shakerShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: rotate(5deg); }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInOut {
    0% { opacity: 0 }
    10% { opacity: 1 }
    50% { opacity: 1 }
    90% { opacity: 1 }
    100% { opacity: 0 }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes shake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5px, 5px); }
    20% { transform: translate(5px, -5px); }
    30% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    50% { transform: translate(-5px, 5px); }
    60% { transform: translate(5px, -5px); }
    70% { transform: translate(-5px, 5px); }
    80% { transform: translate(5px, -5px); }
    90% { transform: translate(-5px, 5px); }
    100% { transform: translate(0, 0); }
}

@keyframes particle-move {
    to {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* =======================
    Certificate Page
======================= */
.certificate-page {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #eaeaea;
    font-family: 'Cinzel', serif;
    height: 120vh;
    width: 100%;
}

.certificate-background {
    margin-top: 100px;
    background: radial-gradient(circle at center, #1a1a1a, #0a0a0a 80%);
    padding: 10px;
    border-radius: 15px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.certificate-cont {
    max-width: 600px;
    padding: 20px 100px;
    text-align: center;
    border-radius: 12px;
    position: relative;
    border: 2px solid #56aaed;
    background-size: cover;
    background-image: url('./assets/images/dots.png');
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.9);
    animation: borderGlow 2s infinite alternate;
}

.certificate-overlay {
    position: relative;
    z-index: 1;
}

.certificate-cont h1 {
    font-size: 2.4em;
    color: #4bb8ff;
    margin: 30px 0;
    text-shadow: 0 0 8px rgba(75, 184, 255, 0.8);
}

.certificate-cont h2 {
    font-size: 1.6em;
    color: #cfe0ff;
    margin: 50px 0;
    text-shadow: 0 0 6px rgba(207, 224, 255, 0.8);
}

.certificate-subtitle {
    font-size: 1.2em;
    color: #a3c8ff;
    margin: 5px 0;
    text-shadow: 0 0 6px rgba(163, 200, 255, 0.5);
}

.certificate-detail {
    font-size: 1em;
    margin: 20px 0 10px;
    color: #d1e7ff;
}

.certificate-footer {
    font-size: 0.8em;
    color: #4bb8ff;
    font-weight: bold;
    margin-top: 50px;
}

.certificate-logo {
    max-width: 150px;
    opacity: 0.9;
    align-self: center;
}

.goal-completed-image {
    width: 300px;
    height: auto;
}

/* =======================
    Button Containers
======================= */
.button-container {
    display: flex;
    height: 15vh;
    gap: 15px;
    margin: 50px;
}

.button-container button {
    color: #eaeaea;
    padding: 10px 20px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 70, 128, 0.5);
    width: 200px;
}

.download-certificate-btn:hover, .share-certificate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(45, 156, 214, 0.6);
}

/* =======================
    Game Pages
======================= */
.goal-uncompleted-page {
    display: none;
    width: 100%;
    height: 100vh;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.goal-uncompleted-page h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 25px;
    color: white;
}

.goal-uncompleted-page-cont {
    display: flex;
    width: 35%;
    height: 70vh;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    border-radius: 40px;
}

.goal-uncompleted-page button {
    width: 70%;
    height: 6vh;
}

/* =======================
    Animations and Effects
======================= */
@keyframes particle-move {
    to {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

.screen-shake {
    animation: shake 0.5s;
}

.scale-up {
    transform: scale(1.2);
    transition: transform 0.5s ease-in-out;
}

.shake {
    animation: shake 0.5s;
}

/* =======================
    Buttons and Interactions
======================= */
.mute {
    position: fixed;
    top: 20px;
    left: 20px;
    background: none !important;
    font-size: 25px;
    z-index: 2000;
    padding: 0;
    cursor: pointer;
    width: auto;
    height: auto;
    display: flex;
}

.skip-intro-button {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 16px;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.3s;
    width: 100px;
    height: 30px;
}
/* =======================
    Particle Background
======================= */
#particle-background {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
    overflow: hidden;
    background: radial-gradient(circle, #1e1e1e, #000000);
}

.progress-particle {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    opacity: 1;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    pointer-events: none;
    animation: particle-move 0.5s forwards;
}

/* =======================
    Responsive Styles
======================= */
/* Portrait Orientation */
@media only screen and (max-width: 1200px) and (orientation: portrait) {
    .intro-popup {
        width: 320px;
        height: 200px;
    }

    .intro-popup button {
        width: 50%;
    }

    .shop {
        width: 90%;
        min-height: 600px;
    }

    .theme-id {
        font-size: 20px;
    }

    .coin-count {
        font-size: 15px;
    }

    .shop-buttons {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .shop-buttons button {
        width: 85%;
    }

    .items {
        max-height: 350px;
        border-radius: 30px;
    }

    .theme {
        width: 80%;
        max-height: 100px;
        padding: 0 20px;
    }

    .theme h3, .theme h5 {
        font-size: 13px;
    }

    .theme button {
        font-size: 12px;
    }

    #intro-text, #extra-text {
        font-size: 0.9em;
    }

    .player-name, .player-key {
        font-size: 15px;
        width: 300px;
        height: 45px;
    }

    .button-container {
        flex-direction: column;
        height: auto;
        padding: 20px;
    }

    .button-container button {
        width: 80vw;
    }

    .certificate-cont {
        padding: 50px;
    }

    .certificate-cont h1 {
        font-size: 40px;
    }

    .certificate-cont h2 {
        font-size: 20px;
    }

    .certificate-logo {
        width: 100px;
    }

    #tour-button, #motivation-button {
        display: none;
    }

    .confetti-video, .confetti-mobile {
        display: none;
    }

    input:hover, select:hover {
        transform: scale(1.0);
    }

    button:hover {
        transform: rotate(0deg) scale(1.0);
    }

    .logo-cont {
        width: 210px;
        transform: scale(1.0) translateY(0);
    }

    .goal-uncompleted-page-cont {
        width: 100%;
        height: 100vh;
        box-shadow: none;
    }

        .goal-uncompleted-page-cont h1 {
        font-size: 6vw;
    }

    .main-content {
        justify-content: center;
        align-items: center;
        height: 100vh;
        transform: translateY(0);
    }

    .goal-uncompleted-page button {
        width: 70%;
    }

    * {
        color: white;
    }

    .home-cont {
        height: 100vh;
        background-position: 100% 100%;
        background-size: 150px;
    }

    .home-forum-cont {
        box-shadow: none;
        width: 100%;
        height: 700px;
        justify-content: space-around;
        background: none;
    }

    button {
        clip-path: inset(0px);
        width: 320px;
        height: 45px;
    }

    label {
        font-size: 4.5vw;
        margin-top: 5vh;
    }

    .game-control-buttons {
        flex-direction: column;
        height: 100%;
        width: 95%;
        margin: 0;
        box-shadow: none;
        border-radius: 50px;
        background: none;
    }

    .goal-uncompleted-page img {
        width: 80vw;
        height: auto;
    }

    .user-clock, .ai-clock {
        width: 15%;
        display: none;
        text-align: center;
    }

    .game-control-buttons button {
        width: 95%;
        height: 8vh;
    }

    .game-finished-btn, .game-pause-btn, .game-restart-btn, .game-boost-btn {
        width: 95%;
        height: 8vh;
        margin-top: 1%;
        border-radius: 15px;
    }

    .user-progress-cont, .user-progress, .ai-progress-cont, .ai-progress {
        height: 9vh;
        width: 90%;
        box-shadow: none;
        align-items: center;
        text-align: center;
        border-radius: 12px;
    }

    p {
        font-size: 3.0vw;
    }

    .goal-completed-video, .goal-completed-image {
        width: 350px;
        height: auto;
    }

    .goal-end-icon {
        width: 100px;
        height: 100px;
        display: none;
    }

    .ai-clock, .user-clock {
        color: white;
        width: 50px;
        position: absolute;
        left: 70%;
        right: 0;
        margin: auto;
    }
}

/* Landscape Orientation */
@media only screen and (max-width: 1200px) and (orientation: landscape) {
    
    .room-code-setup {
        height: 90vh;
    }

    .shop h1 {
        font-size: 25px;
    }

    .shop {
        min-height: 200px;
        width: 80%;
        transform: translate(-50%, -50%) scale(0.7);
    }
    .goal-completed-video, .goal-completed-image {
        width: 250px;
        height: auto;
    }

    #intro-text, #extra-text {
        font-size: 1.0em;
    }

    .goal-uncompleted-page {
        height: 100vh;
    }

    input:hover, select:hover {
        transform: scale(1.0);
    }

    button:hover {
        transform: rotate(0deg) scale(1.0);
    }

    .logo-cont {
        width: 200px;
        height: auto;
        transform: scale(1.0) translateY(0);
    }

    .main-content {
        display: flex;
        justify-content: start;
        align-items: center;
        height: 100vh;
        transform: translateY(0);
    }

    .goal-uncompleted-page h1 {
        font-size: 40px;
        font-weight: 300;
    }

    .goal-uncompleted-page button {
        width: 40%;
        height: 10vh;
    }

    .certificate-page {
        height: auto;
    }

    .home-forum-cont {
        box-shadow: none;
        width: 100%;
        height: 600px;
    }

    .theme {
        min-height: 15vh;
    }

    h1 {
        font-size: 90px;
    }

    button {
        font-size: 15px;
        width: 38%;
        border-radius: 15px;
        color: white;
        clip-path: inset(0px);
    }

    .player-name, .player-key {
        width: 36vw;
    }

    label {
        font-size: 40px;
    }

    .goal-uncompleted-page-cont {
        width: 100%;
        height: auto;
    }

    .goal-uncompleted-page-cont h1 {
        font-size: 1.3em;
    }

    p {
        font-size: 15px;
    }

}

/* Small Screens */
@media (max-width: 600px) {
    .skip-intro-button {
        font-size: 14px;
    }
}

/* =======================
    Popups and Overlays
======================= */
.encouragement-popup {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    margin: auto;
    font-size: 1.1em;
    text-align: center;
}

/* =======================
    Particle Effects
======================= */
#particle-background {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
    overflow: hidden;
    background: radial-gradient(circle, #1e1e1e, #000000);
}

/* =======================
    Additional Animations
======================= */
@keyframes borderGlow {
    0% { box-shadow: 0 0 10px #56aaed, 0 0 20px #56aaed; }
    100% { box-shadow: 0 0 20px #56aaed, 0 0 30px #56aaed; }
}

@keyframes fadeInOut {
    0% { opacity: 0 }
    10% { opacity: 1 }
    50% { opacity: 1 }
    90% { opacity: 1 }
    100% { opacity: 0 }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes shake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5px, 5px); }
    20% { transform: translate(5px, -5px); }
    30% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    50% { transform: translate(-5px, 5px); }
    60% { transform: translate(5px, -5px); }
    70% { transform: translate(-5px, 5px); }
    80% { transform: translate(5px, -5px); }
    90% { transform: translate(-5px, 5px); }
    100% { transform: translate(0, 0); }
}