﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
    overflow-y: hidden;
    background: #0a0a0f;
    color: #ffffff;
}

#top-stripe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 55px;
    background: linear-gradient(to bottom, #a08ab2, #877699);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#casino-logo {
    width: 73px;
    height: auto;
    position: absolute;
    left: calc(50% - 290px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    cursor: pointer;
}

.wallet-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.wallet-address {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.wallet-info-btn {
    background: linear-gradient(to bottom, #836EF9, #5B4FC0);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .wallet-info-btn:hover {
        background: linear-gradient(to bottom, #5B4FC0, #836EF9);
        transform: translateY(-2px);
    }

.user-icon-btn {
    background: none;
    border: none;
    font-size: 19px;
    color: #ffffff !important;
    fill: #ffffff;
    margin-left: 8px;
    cursor: pointer;
    padding: 4px;
    width: 27px;
    height: 27px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transform: translateY(3px);
}

    .user-icon-btn:hover {
        color: #d8b4fe !important;
    }

.user-menu {
    position: absolute;
    top: 40px;
    left: calc(50% + 50px);
    background: #ffffff;
    border: 1px solid #836EF9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1350;
    padding: 0;
    min-width: 100px;
}

    .user-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .user-menu .menu-option {
        padding: 4px 10px;
        color: #333333;
        font-size: 14px;
        font-weight: bold;
        cursor: pointer;
        transition: background 0.3s ease;
    }

        .user-menu .menu-option:hover {
            background: rgba(0, 0, 0, 0.1);
        }

.wallet-info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(590px, 80vw);
    height: 330px;
    background: linear-gradient(to bottom, rgba(50, 46, 70, 0.95), rgba(30, 26, 42, 0.95));
    border: 2px solid #836EF9;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1200;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    overflow-y: auto;
}

    .wallet-info-panel p {
        margin: 0;
        color: #C99CFF;
        font-size: 18px;
        font-weight: 600;
        text-align: center;
        line-height: 1.4;
    }

.custom-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(calc(-50% + 500px), -50%);
    width: min(337.8px, calc(33.6vw + 90px));
    height: 154px;
    background: linear-gradient(to bottom, rgba(50, 46, 70, 0.95), rgba(30, 26, 42, 0.95));
    border: 2px solid #836EF9;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1200;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    overflow-y: auto;
}

.custom-panel-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

.custom-panel p {
    margin: 0;
    color: #C99CFF;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

#segment-counts-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(354px, 48vw);
    height: 330px;
    background: linear-gradient(to bottom, rgba(50, 46, 70, 0.95), rgba(30, 26, 42, 0.95));
    border: 2px solid #836EF9;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    z-index: 1200;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    overflow-y: auto;
}

.segment-counts-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

#segment-counts-list {
    margin: 0;
    padding: 0 15px;
    list-style: none;
    color: #C99CFF;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    overflow-y: auto;
    flex: 1;
}

    #segment-counts-list li {
        margin-bottom: 7px;
    }

.close-wallet-info-btn, .close-segment-counts-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #5B4FC0;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

    .close-wallet-info-btn:hover, .close-segment-counts-btn:hover {
        background: #836EF9;
    }

#embedded-wallet-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    display: none;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(255, 103, 155, 0.3) 0%, transparent 50%), radial-gradient(circle at 40% 80%, rgba(75, 0, 130, 0.4) 0%, transparent 50%), linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
}

    .animated-bg::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(600px circle at 50% 200px, rgba(120, 119, 198, 0.1), transparent), radial-gradient(800px circle at 80% 100px, rgba(255, 103, 155, 0.1), transparent), radial-gradient(400px circle at 20% 300px, rgba(75, 0, 130, 0.1), transparent);
        animation: float 8s ease-in-out infinite;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: particleFloat 6s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.home-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 40px;
    flex-wrap: wrap;
}

.home-content {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 50px 40px;
    max-width: 600px;
    width: 100%;
    height: 100%;
    max-height: 800px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

    .home-content::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
        animation: shimmer 3s infinite;
    }

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

#play-btn {
    background: #4CAF50;
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 28px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    margin: 10px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 20;
}

    #play-btn:active {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }

#higher-btn, #lower-btn, #skip-btn {
    background: #836EF9;
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 28px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    margin: 10px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 20;
}

#higher-btn, #lower-btn, #stop-btn {
    display: none;
}

    #higher-btn:active, #lower-btn:active, #skip-btn:active {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }

#stop-btn {
    background: #F44336;
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 28px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    margin: 10px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 20;
}

    #stop-btn:active {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }

.error-message {
    color: #FF0000;
    background: rgba(255, 0, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    margin-bottom: 10px;
    font-weight: 500;
    display: none;
}

.success-message {
    color: #008000;
    background: rgba(0, 128, 0, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 128, 0, 0.2);
    margin-bottom: 10px;
    font-weight: 500;
    display: none;
}

.loading {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}

.streak-green::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 12px;
    background: #4CAF50;
    margin-right: 4px;
    vertical-align: middle;
}

.streak-red::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 12px;
    background: #F44336;
    margin-right: 4px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .home-container {
        flex-direction: column;
        gap: 30px;
        padding: 15px;
    }

    .home-content {
        max-width: 100%;
        padding: 30px 25px;
    }
}

.home-content > * {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

    .home-content > *:nth-child(1) {
        animation-delay: 0.1s;
    }

    .home-content > *:nth-child(2) {
        animation-delay: 0.2s;
    }

    .home-content > *:nth-child(3) {
        animation-delay: 0.3s;
    }

    .home-content > *:nth-child(4) {
        animation-delay: 0.4s;
    }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hilo-container {
    position: relative;
    margin: 2em auto;
    width: min(500px, 80vw);
    height: min(500px, 80vw);
    aspect-ratio: 1 / 1;
    z-index: 10;
}

#card-board {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: rgba(106, 90, 205, 0.2);
    background-size: cover;
    background-position: center;
    padding-bottom: 120px;
    overflow: hidden;
    border-radius: 16px;
}

.card {
    position: absolute;
    width: 280px;
    height: 400px;
    background: none;
    color: #d00;
    font-size: 70px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0px solid #000;
    border-radius: 15px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: hidden;
}

    .card img {
        object-fit: contain;
    }

#current-card {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transform-origin: left center;
    z-index: 1;
}

#next-card {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transform-origin: right center;
    z-index: 1;
    display: none;
}

#discard-pile {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 15px;
    z-index: 5;
    margin-top: -10px;
    margin-bottom: 1rem;
}

.discard-card {
    width: 70px;
    height: 100px;
    display: inline-block;
}

    .discard-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

#probabilities {
    width: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    font-size: 16px;
    color: white;
    line-height: 1.2;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

#connect-wallet-message {
    position: fixed;
    top: 50%;
    left: calc(50% - 200px);
    transform: translate(-50%, -50%);
    width: min(500px, 80vw);
    height: 180px;
    background: rgba(30, 26, 42, 0.9);
    border: 1px solid #836EF9;
    border-radius: 16px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
    padding: 15px;
}

@media (min-width: 601px) {
    #hilo-container {
        width: min(370px, 65vw);
        height: min(370px, 65vw);
        aspect-ratio: 1 / 1;
    }

    .card {
        width: 207px;
        height: 296px;
        font-size: 52px;
    }

    .discard-card {
        width: 52px;
        height: 74px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .home-container {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
        padding-top: 55px;
        margin-top: -100px; /* Move o home-container 100px para cima */
    }

    #hilo-container {
        width: min(240.5px, 70vw);
        height: min(240.5px, 70vw);
        margin-top: 3vh;
        aspect-ratio: 1 / 1;
    }

    .card {
        width: 135px;
        height: 192px;
        font-size: 34px;
    }

    .discard-card {
        width: 34px;
        height: 48px;
    }

    .user-menu {
        left: calc(100% - 80px);
    }

    #discard-pile {
        margin-top: 10px;
    }

    #probabilities {
        position: absolute;
        bottom: 110px;
    }

    .custom-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, calc(-50% + 280px));
        width: min(480.39px, calc(56.784vw + 90px));
        height: 180.18px;
        background: linear-gradient(to bottom, rgba(50, 46, 70, 0.95), rgba(30, 26, 42, 0.95));
        border: 2px solid #836EF9;
        border-radius: 20px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
        z-index: 1200;
        padding: 20px;
        display: none;
        flex-direction: column;
        gap: 15px;
        align-items: center;
        overflow-y: auto;
    }

    #connect-wallet-message {
        position: fixed;
        top: 50%;
        left: calc(50% - 145px);
        transform: translate(-50%, -50%);
        width: min(287.5px, 46vw);
        height: 70.2px;
    }
}

@media (min-width: 1025px) {
    .user-menu {
        left: calc(100% - 65px);
    }

    #probabilities {
        position: absolute;
        bottom: 110px;
        left: calc(50% - 300px);
    }

    #connect-wallet-message {
        position: fixed;
        top: 50%;
        left: calc(50% - 150px);
        transform: translate(-50%, -50%);
        width: min(287.5px, 46vw);
        height: 70.2px;
    }
}

@media (max-width: 600px) {
    .home-container {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
        padding-top: 55px;
    }

    .home-content {
        max-width: 100%;
        padding: 30px 25px;
        max-height: 100%;
        margin-top: -250px;
    }

    .wallet-container {
        display: flex;
        align-items: center;
        gap: 10px;
        position: relative;
    }

    .wallet-address {
        font-size: 12px;
        transform: translateX(50px);
    }

    .wallet-info-btn {
        padding: 6px 12px;
        font-size: 10px;
        transform: translateX(50px);
    }

    .user-icon-btn {
        font-size: 17px;
        margin-left: 24px;
        padding: 3px;
        width: 23px;
        height: 23px;
        display: flex;
        justify-content: center;
        align-items: center;
        line-height: 1;
        transform: translateY(3px) translateX(35px);
    }

        .user-icon-btn svg {
            width: 16px;
            height: 16px;
        }

        .user-icon-btn:hover {
            color: #d8b4fe !important;
        }

    .user-menu {
        top: 40px;
        left: calc(50% + 100px);
        min-width: 100px;
        z-index: 1350;
    }

        .user-menu .menu-option {
            font-size: 12px;
            padding: 3px 8px;
        }

    #hilo-container {
        width: min(240.5px, 70vw);
        height: min(240.5px, 70vw);
        margin-top: 3vh;
    }

    .card {
        width: 49%;
        height: 70%;
        font-size: 11.2vw;
    }

    .custom-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, calc(-50% + 280px));
        width: min(480.39px, calc(56.784vw + 90px));
        height: 180.18px;
        background: linear-gradient(to bottom, rgba(50, 46, 70, 0.95), rgba(30, 26, 42, 0.95));
        border: 2px solid #836EF9;
        border-radius: 20px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
        z-index: 1200;
        padding: 20px;
        display: none;
        flex-direction: column;
        gap: 15px;
        align-items: center;
        overflow-y: auto;
    }

    #play-btn {
        padding: 9px 18px;
        border-radius: 21px;
        font-size: 0.54rem;
        margin-top: 20px;
        transform: translateX(0);
    }

    #higher-btn, #lower-btn {
        padding: 9px 18px;
        border-radius: 21px;
        font-size: 0.54rem;
        margin-top: 20px;
        transform: translateX(-5px);
    }

    #skip-btn {
        padding: 9px 18px;
        border-radius: 21px;
        font-size: 0.54rem;
        margin-top: 20px;
        transform: translateX(0);
    }

    #stop-btn {
        padding: 9px 18px;
        border-radius: 21px;
        font-size: 0.54rem;
        margin-top: 20px;
        transform: translateX(-5px);
    }

    #probabilities {
        position: relative;
        font-size: 14px;
        padding: 8px;
        margin-top: 8px;
        white-space: nowrap;
        overflow: hidden;
    }

    #connect-wallet-message {
        position: fixed;
        top: 50%;
        left: calc(50% - 150px);
        transform: translate(-50%, -50%);
        width: min(460px, 73.6vw);
        height: 65.52px;
        background: rgba(30, 26, 42, 0.9);
        border: 1px solid #836EF9;
        border-radius: 16px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
        display: none;
        z-index: 100;
        padding: 15px;
    }

    .discard-card {
        width: 52.5px;
        height: 75px;
    }

        .discard-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 10px;
        }

    #casino-logo {
        width: 65px;
        left: calc(50% - 189px);
        cursor: pointer;
    }
}