body {
    cursor: url('../assets/cursor/yugicursor.png'), auto;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.bg-video {
    position: absolute;
    z-index: -2;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.bg-video video {
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
}

.bg-video::after {
    position: absolute;
    content: '';
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}

.container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    gap: 1rem;
    padding: 0.5rem;
    box-sizing: border-box;
}

.container_left {
    width: 25vw;
    min-width: 280px;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    display: flex;
    padding: 1rem;
}

.container_right {
    flex: 1;
    min-width: 0;
}

.score_box {
    background-color: #ffff;
    padding: 1.5rem;
    text-align: center;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
}

.frame {
    border: 0.2rem solid #000;
    border-radius: 0.2rem;
}

.card_details {
    background-color: #ffff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: auto;
    min-height: 6rem;
    width: 100%;
    text-align: center;
}

#card-name {
    font-size: clamp(0.7rem, 1.8vw, 1rem);
    margin-bottom: 0.5rem;
}

#card-type {
    font-size: clamp(0.8rem, 2vw, 1.1rem);
}

.menu_avatar img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}

.card-box__container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.3rem;
}

.card-versus__container {
    display: flex;
    flex-direction: column;
    padding-top: 0.5rem;
    height: auto;
    min-height: 300px;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#player-cards .card{
    cursor: url('../assets/cursor/yamiyugicursorGLOW.png'), auto;
}

.versus-top,
.versus-bottom { 
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 1rem;
}

.versus-bottom{
    padding: 2rem;
}

.versus-top img {
    max-height: 80px;
    width: auto;
}
#next-duel{
    display: none;
}

#player-cards .card{
    transition: transform 0.2s ease-in-out;
}

#player-cards .card:hover{
    transform: scale(1.2);
}

.selected { 
    transform: scale(1.2);
    box-shadow: 0 0 16px 4px #d1df0c;
    overflow: hidden;
}

.card-box {
    height: auto;
    min-height: 7rem;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
}

.card-box .card {
    width: auto;
    height: 100px;
    max-width: 70px;
    object-fit: contain;
}

.card-infield {
    height: clamp(140px, 15vw, 180px);
    width: clamp(95px, 10vw, 125px);
    border: 0.2rem solid #ffff;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-infield img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========== MEDIA QUERIES ========== */

@media screen and (max-width: 1024px) {
    .container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .container_left {
        width: 100%;
        min-width: auto;
        flex-direction: row;
        justify-content: space-around;
        padding: 0.5rem;
        order: -1;
    }
    
    .container_right {
        flex: 1;
    }
    
    .card_details {
        min-height: 4rem;
        padding: 0.5rem;
    }

    .card-box__container {
        justify-content: start;
    }
    
    .score_box {
        padding: 1rem;
    }
    
    .menu_avatar img {
        max-height: 120px;
    }
    
    .card-versus__container {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .container_left {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .score_box,
    .card_details {
        flex: 1;
        min-width: 200px;
    }
    
    .menu_avatar {
        order: -1;
        flex-basis: 100%;
        text-align: center;
    }
    
    .menu_avatar img {
        max-height: 100px;
    }
    
    .card-box {
        justify-content: center;
        gap: 0.3rem;
    }
    
    .card-box .card {
        height: 80px;
        max-width: 55px;
    }
    
    .versus-bottom {
        padding: 1rem;
    }
    
    .versus-top img {
        max-height: 60px;
    }
    
    .card-infield {
        height: clamp(100px, 12vw, 140px);
        width: clamp(70px, 8vw, 95px);
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0.25rem;
    }
    
    .container_left {
        padding: 0.25rem;
        gap: 0.5rem;
    }
    
    .score_box {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .card_details {
        padding: 0.5rem;
        min-height: 3rem;
    }
    
    .menu_avatar img {
        max-height: 80px;
    }
    
    .card-box {
        padding: 0.5rem;
        gap: 0.2rem;
        min-height: 5rem;
    }
    
    .card-box .card {
        height: 60px;
        max-width: 42px;
    }
    
    .card-versus__container {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        min-height: 200px;
    }
    
    .versus-bottom {
        padding: 0.5rem;
    }
    
    .versus-top {
        gap: 0.5rem;
    }
    
    .versus-top img {
        max-height: 40px;
    }
    
    .card-infield {
        height: clamp(80px, 20vw, 120px);
        width: clamp(55px, 14vw, 85px);
    }
    
    #player-cards .card:hover {
        transform: scale(1.1);
    }
    
    .selected {
        transform: scale(1.1) !important;
        box-shadow: 0 0 8px 2px #d1df0c;
    }
}

@media screen and (max-width: 320px) {
    .container_left {
        flex-direction: column;
        align-items: center;
    }
    
    .score_box,
    .card_details {
        width: 100%;
        text-align: center;
    }
    
    .menu_avatar img {
        max-height: 60px;
    }
    
    .card-box .card {
        height: 50px;
        max-width: 35px;
    }
    
    .versus-top img {
        max-height: 30px;
    }
    
    .card-infield {
        height: 100px;
        width: 70px;
    }
}

@media (hover: none) and (pointer: coarse) {
    #player-cards .card {
        transition: transform 0.15s ease-out;
    }
    
    #player-cards .card:active {
        transform: scale(1.05);
    }
    
    .rpgui-button:active {
        transform: scale(0.95);
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        gap: 0.25rem;
        padding: 0.25rem;
    }
    
    .container_left {
        width: 200px;
        flex-direction: column;
        justify-content: space-between;
        min-width: 180px;
    }
    
    .menu_avatar img {
        max-height: 60px;
    }
    
    .card-versus__container {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        min-height: auto;
    }
    
    .card-box {
        min-height: 4rem;
        padding: 0.5rem;
    }
    
    .card-box .card {
        height: 50px;
        max-width: 35px;
    }
    
    .versus-top img {
        max-height: 30px;
    }
    
    .card-infield {
        height: 80px;
        width: 55px;
    }
    
    .versus-bottom {
        padding: 0.5rem;
    }
}

.preload-images {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
}

/* ========== OVERLAY DE BOAS-VINDAS ========== */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-in;
}

.welcome-overlay.hidden {
    animation: fadeOut 0.5s ease-out forwards;
}

.welcome-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    margin: 1rem;
}

.welcome-content h1 {
    color: #ffd700;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.welcome-content p {
    color: #ffffff;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 2rem;
    line-height: 1.4;
}

#start-game {
    display: flex;
    align-items: center;

}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@media screen and (max-width: 480px) {
    .welcome-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .welcome-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

@media screen and (max-width: 320px) {
    .welcome-content {
        padding: 1rem;
    }
    
    .welcome-content h1 {
        font-size: 1.5rem;
    }
    
    .welcome-content p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}