* {
    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;
}
#connect-wallet-message {
    position: fixed;
    top: 50%;
    left: calc(50% + 0px);
    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;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
    #connect-wallet-message p {
        margin: 0;
        color: #ffffff;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        line-height: 1.4;
    }
.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 {
    height: 100vh;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 40px;
    flex-wrap: wrap;
    overflow: hidden;
}
.home-content {
    position: relative;
    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: 450px;
    min-height: auto;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
    .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;
        z-index: -1;
    }
@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);
    }
.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(255, 0, 0, 0.2);
    margin-bottom: 10px;
    font-weight: 500;
    display: none;
}
.loading {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}
.card-hand {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 0;
    flex-wrap: nowrap;
}
#dealer-hand {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    min-height: 160px;
    border-radius: 16px;
    padding: 5px;
    overflow: visible;
}
#player-hand {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    min-height: 160px;
    border-radius: 16px;
    padding: 5px;
    overflow: visible;
}
#dealer-score {
    position: absolute;
    top: 162px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
    text-align: center;
}
#player-score {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
    text-align: center;
}
#blackjack-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
}
#hit-btn, #stand-btn {
    background: #836EF9;
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 28px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 20;
}
    #hit-btn:active, #stand-btn:active {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }
#hit-btn {
    margin-right: 30px;
}
.card {
    width: 68px;
    height: 102px;
    background: none;
    color: #d00;
    font-size: 34px;
    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: visible;
    flex-shrink: 0;
}
    .card img {
        object-fit: contain;
        width: 100%;
        height: 100%;
    }
@media (min-width: 601px) {
    #dealer-hand, #player-hand {
        min-height: 160px;
        border-radius: 16px;
        padding: 5px;
        overflow: visible;
    }
    .card {
        width: 82px;
        height: 123px;
        font-size: 52px;
        flex-shrink: 0;
    }
}
@media (min-width: 601px) and (max-width: 1024px) {
    .home-container {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
        padding-top: 55px;
        height: 100vh;
    }
    .home-content {
        max-width: 100%;
        padding: 30px 25px;
        height: 400px;
        margin-top: -150px;
    }
    #dealer-hand {
        top: 15px;
    }
    #player-hand {
        bottom: 60px;
    }
    #blackjack-controls {
        bottom: 10px;
    }
    #dealer-score {
        top: 147px;
    }
    #player-score {
        bottom: 70px;
    }
    .card {
        width: 77.76px;
        height: 118.08px;
        font-size: 34px;
        flex-shrink: 0;
    }
    .user-menu {
        left: calc(100% - 80px);
    }
    .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% + 5px);
        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;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
        #connect-wallet-message p {
            margin: 0;
            color: #ffffff;
            font-size: 16px;
            font-weight: 400;
            text-align: center;
            line-height: 1.4;
        }
}
@media (min-width: 1025px) {
    .user-menu {
        left: calc(100% - 65px);
    }
    .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;
    }
    #connect-wallet-message {
        position: fixed;
        top: 50%;
        left: calc(50% + 0px);
        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;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
        #connect-wallet-message p {
            margin: 0;
            color: #ffffff;
            font-size: 16px;
            font-weight: 400;
            text-align: center;
            line-height: 1.4;
        }
}
@media (max-width: 600px) {
    .home-container {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
        padding-top: 55px;
        height: 100vh;
    }
    .home-content {
        max-width: 100%;
        padding: 30px 25px;
        height: 400px;
        margin-top: -210px;
    }
    .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;
        }
    .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;
    }
    #dealer-hand {
        top: 30px;
        left: 50%;
        transform: translateX(-50%);
        min-height: 160px;
        border-radius: 16px;
        padding: 5px;
        overflow: visible;
    }
    #player-hand {
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        min-height: 160px;
        border-radius: 16px;
        padding: 5px;
        overflow: visible;
    }
    #blackjack-controls {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    #dealer-score {
        top: 132px;
        left: 50%;
        transform: translateX(-50%);
    }
    #player-score {
        bottom: 90px;
        left: 50%;
        transform: translateX(-50%);
    }
    #play-btn, #hit-btn, #stand-btn {
        padding: 9px 18px;
        border-radius: 21px;
        font-size: 0.54rem;
        margin-top: 0;
        transform: translateX(0);
    }
    .card {
        width: 58px;
        height: 87px;
        font-size: 24px;
        flex-shrink: 0;
    }
    #casino-logo {
        width: 65px;
        left: calc(50% - 189px);
        cursor: pointer;
    }
    #connect-wallet-message {
        position: fixed;
        top: 50%;
        left: calc(50% + 0px);
        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;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
        #connect-wallet-message p {
            margin: 0;
            color: #ffffff;
            font-size: 16px;
            font-weight: 400;
            text-align: center;
            line-height: 1.4;
        }
}