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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Full Screen Background */
.game-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a2e;
    z-index: 1;
}

.game-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.3) 0%, rgba(22, 22, 40, 0.4) 100%);
    z-index: 2;
}

/* Welcome Container */
.welcome-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: -120px;
    z-index: 10;
    animation: slideDown 0.6s ease-out;
    max-width: 400px;
    width: 90%;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

.welcome-text {
    background: #FEB103;
    color: #383838;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(254, 177, 3, 0.4);
    border: 2px solid rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: center;
}

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

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.welcome-text.login-required {
    background: #E74C3C;
    color: #fff;
    box-shadow: 0 10px 40px rgba(231, 76, 60, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

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

.username-highlight {
    color: #2C3E50;
    font-weight: 800;
    text-transform: capitalize;
    position: relative;
    display: inline;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: usernameBounce 2s ease-in-out infinite;
}

@keyframes usernameBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Notification Container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
}

.notification {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFBF0 100%);
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(254, 177, 3, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInRight 0.4s ease-out, fadeOut 0.4s ease-in 4.6s forwards;
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification:hover {
    transform: translateX(-5px);
    box-shadow: 0 15px 50px rgba(254, 177, 3, 0.5);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.notification::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: currentColor;
    animation: progressBar 5s linear;
    animation-play-state: running;
}

.notification:hover::before {
    animation-play-state: paused;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.notification.success {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
}

.notification.success::before {
    background: #4CAF50;
}

.notification.error {
    border-left-color: #F44336;
    background: linear-gradient(135deg, #FFEBEE 0%, #FFF3E0 100%);
}

.notification.error::before {
    background: #F44336;
}

.notification.warning {
    border-left-color: #FF9800;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFFDE7 100%);
}

.notification.warning::before {
    background: #FF9800;
}

.notification.info {
    border-left-color: #FEB103;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFBF0 100%);
}

.notification.info::before {
    background: #FEB103;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    font-weight: bold;
}

.notification-icon i {
    font-size: 18px;
}

.notification.success .notification-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: #fff;
}

.notification.error .notification-icon {
    background: linear-gradient(135deg, #F44336 0%, #E91E63 100%);
    color: #fff;
}

.notification.warning .notification-icon {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    color: #fff;
}

.notification.info .notification-icon {
    background: linear-gradient(135deg, #FEB103 0%, #F7931E 100%);
    color: #fff;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 16px;
    font-weight: 700;
    color: #383838;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 14px;
    color: #5A5A5A;
    line-height: 1.4;
}

.notification-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(254, 177, 3, 0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #383838;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(254, 177, 3, 0.3);
    transform: scale(1.1);
}

.notification-close i {
    font-size: 12px;
}

/* Game Container */
.game-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

/* Dice Container */
.dice-container {
    position: absolute;
    display: flex;
    gap: 60px;
    opacity: 0;
    transform: scale(0.3) translateY(-100px);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 200;
}

.dice-container.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Simple 2D Dice */
.dice {
    width: 100px;
    height: 100px;
    position: relative;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.dice-face {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 3px solid #2c3e50;
    border-radius: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 10px;
    gap: 5px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 3px 8px rgba(0, 0, 0, 0.1);
}

.dot {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    align-self: center;
    justify-self: center;
}

/* Dot positioning */
.dot.top-left { grid-column: 1; grid-row: 1; }
.dot.top-right { grid-column: 3; grid-row: 1; }
.dot.middle-left { grid-column: 1; grid-row: 2; }
.dot.center { grid-column: 2; grid-row: 2; }
.dot.middle-right { grid-column: 3; grid-row: 2; }
.dot.bottom-left { grid-column: 1; grid-row: 3; }
.dot.bottom-right { grid-column: 3; grid-row: 3; }

/* Dice Animation - Simple pulse */
@keyframes dicePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Roll Button */
.roll-button {
    position: relative;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 100;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.4));
    transform: scale(1);
    opacity: 1;
}

.roll-button:hover:not(:disabled) {
    transform: translateY(-8px) scale(1.05);
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.5));
}

.roll-button:active:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
}

.roll-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(1) drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.roll-button-image {
    width: 300px;
    height: auto;
    display: block;
    transition: all 0.3s ease;
}

.roll-button:hover:not(:disabled) .roll-button-image {
    filter: brightness(1.1);
}

.roll-count {
    font-size: 20px;
    font-weight: 700;
    color: #FFA000;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 160, 0, 0.3);
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 24px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

/* Reward Modal */
.reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(10px);
}

.reward-modal.visible {
    opacity: 1;
    pointer-events: all;
}

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

.reward-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FEB103;
    border-radius: 50%;
    box-shadow: 0 0 10px #FEB103, 0 0 20px #FFD700, 0 0 30px #FF8C00;
    animation: sparkleFloat 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    50% {
        transform: translateY(-100px) scale(1.5);
        opacity: 1;
    }
}

.reward-content {
    position: relative;
    background: linear-gradient(135deg, #FEB103 0%, #FF8C00 50%, #FFD700 100%);
    padding: 60px 70px;
    border-radius: 40px;
    text-align: center;
    transform: scale(0.5) translateY(100px) rotate(-5deg);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 30px 90px rgba(254, 177, 3, 0.6),
        0 0 100px rgba(255, 215, 0, 0.4),
        inset 0 0 100px rgba(255, 255, 255, 0.1);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 5px solid rgba(255, 255, 255, 0.3);
    z-index: 3;
    animation: contentGlow 2s ease-in-out infinite alternate;
}

@keyframes contentGlow {
    0% {
        box-shadow: 
            0 30px 90px rgba(254, 177, 3, 0.6),
            0 0 100px rgba(255, 215, 0, 0.4),
            inset 0 0 100px rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 
            0 30px 90px rgba(254, 177, 3, 0.8),
            0 0 120px rgba(255, 215, 0, 0.6),
            inset 0 0 120px rgba(255, 255, 255, 0.2);
    }
}

.reward-modal.visible .reward-content {
    transform: scale(1) translateY(0) rotate(0deg);
}

.reward-glow-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(254, 177, 3, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
}

.reward-title {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: 
        0 0 10px rgba(56, 56, 56, 0.8),
        0 0 20px rgba(56, 56, 56, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.5),
        0 4px 20px rgba(0, 0, 0, 0.3);
    animation: titleShine 0.8s ease-out 0.3s backwards, titleFloat 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.reward-trophy {
    font-size: 42px;
    color: #FFD700;
    filter: drop-shadow(0 0 10px #FEB103) drop-shadow(0 0 20px #FF8C00);
    animation: trophySpin 1s ease-out 0.5s backwards, trophyBounce 2s ease-in-out 1.5s infinite;
}

@keyframes trophySpin {
    0% {
        transform: rotate(-360deg) scale(0);
        opacity: 0;
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes trophyBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes titleShine {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.reward-display {
    margin: 40px 0;
    color: #fff;
    position: relative;
}

.reward-image {
    margin: 30px 0;
    animation: imageExplode 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.5s backwards;
    position: relative;
}

.reward-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(254, 177, 3, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    animation: imageGlow 1.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes imageExplode {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
        filter: blur(20px);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes imageGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.reward-image img {
    max-width: 400px;
    max-height: 400px;
    border-radius: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(254, 177, 3, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    border: 6px solid rgba(254, 177, 3, 0.5);
    animation: imageFloat 3s ease-in-out 1s infinite;
}

@keyframes imageFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

.reward-name {
    font-size: 38px;
    font-weight: 800;
    color: #383838;
    margin: 30px 0;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 1),
        0 0 20px rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 20px 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 20px;
    border: 3px solid rgba(254, 177, 3, 0.6);
    animation: nameShimmer 0.8s ease-out 0.7s backwards, nameWave 2s ease-in-out 1.5s infinite;
    position: relative;
    overflow: hidden;
}

.reward-name::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: nameShine 3s ease-in-out 1s infinite;
}

@keyframes nameShimmer {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes nameWave {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes nameShine {
    0% {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    100% {
        transform: translate(50%, 50%) rotate(45deg);
    }
    animation: rewardPulse 0.5s ease-out 0.4s backwards;
}

@keyframes rewardPulse {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reward-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    animation: buttonsExplode 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.9s backwards;
    margin-top: 20px;
}

@keyframes buttonsExplode {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.accept-button,
.reroll-button {
    padding: 22px 55px;
    font-size: 24px;
    font-weight: 800;
    border: 4px solid rgba(255, 255, 255, 0.5);
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.accept-button::before,
.reroll-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.accept-button:hover::before,
.reroll-button:hover::before {
    width: 300px;
    height: 300px;
}

.button-icon {
    font-size: 26px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.button-icon i {
    font-size: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.accept-button {
    background: linear-gradient(135deg, #383838 0%, #505050 50%, #606060 100%);
    color: #FEB103;
    box-shadow: 
        0 10px 30px rgba(56, 56, 56, 0.6),
        0 0 20px rgba(254, 177, 3, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: acceptPulse 2s ease-in-out 1.5s infinite;
    border-color: rgba(254, 177, 3, 0.5);
}

@keyframes acceptPulse {
    0%, 100% {
        box-shadow: 
            0 10px 30px rgba(56, 56, 56, 0.6),
            0 0 20px rgba(254, 177, 3, 0.4),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 10px 30px rgba(56, 56, 56, 0.8),
            0 0 40px rgba(254, 177, 3, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

.accept-button:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 
        0 15px 50px rgba(56, 56, 56, 0.8),
        0 0 50px rgba(254, 177, 3, 0.8),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    border-color: rgba(254, 177, 3, 0.8);
    color: #FFD700;
}

.accept-button:hover .button-icon {
    transform: scale(1.3) rotate(360deg);
}

.reroll-button {
    background: linear-gradient(135deg, #FEB103 0%, #FF8C00 50%, #FFA500 100%);
    color: #fff;
    box-shadow: 
        0 10px 30px rgba(254, 177, 3, 0.6),
        0 0 20px rgba(254, 177, 3, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: rerollPulse 2s ease-in-out 1.5s infinite;
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes rerollPulse {
    0%, 100% {
        box-shadow: 
            0 10px 30px rgba(254, 177, 3, 0.6),
            0 0 20px rgba(254, 177, 3, 0.4),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 10px 30px rgba(254, 177, 3, 0.8),
            0 0 40px rgba(254, 177, 3, 0.6),
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

.reroll-button:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 
        0 15px 50px rgba(254, 177, 3, 0.8),
        0 0 50px rgba(255, 215, 0, 0.6),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.reroll-button:hover .button-icon {
    transform: scale(1.3) rotate(720deg);
}

.accept-button:active,
.reroll-button:active {
    transform: translateY(-3px) scale(1.05);
}

.accept-button span,
.reroll-button span {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Success Message */
.success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: successBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.success-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #383838 0%, #505050 50%, #606060 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    color: #FEB103;
    box-shadow: 
        0 10px 40px rgba(56, 56, 56, 0.6),
        0 0 60px rgba(254, 177, 3, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    animation: iconSpin 1s ease-out, iconPulse 2s ease-in-out 1s infinite;
    border: 4px solid rgba(254, 177, 3, 0.5);
}

@keyframes iconSpin {
    0% {
        transform: scale(0) rotate(-360deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 10px 40px rgba(56, 56, 56, 0.6),
            0 0 60px rgba(254, 177, 3, 0.4),
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 10px 40px rgba(56, 56, 56, 0.8),
            0 0 80px rgba(254, 177, 3, 0.6),
            inset 0 0 40px rgba(255, 255, 255, 0.3);
    }
}

.success-icon i {
    font-size: 70px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    animation: iconRotate 2s ease-in-out 1s infinite;
}

@keyframes iconRotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.success-text {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(254, 177, 3, 0.8),
        0 0 20px rgba(254, 177, 3, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.4);
    animation: textShine 1s ease-out 0.5s backwards, textWave 2s ease-in-out 1.5s infinite;
}

@keyframes textShine {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes textWave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-container {
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        margin-top: -100px;
        width: calc(100% - 40px);
        max-width: 350px;
    }
    
    .welcome-text {
        font-size: 16px;
        padding: 10px 24px;
        text-align: center;
    }
    
    .username-highlight {
        max-width: 150px;
    }
    
    .notification-container {
        top: 20px;
        right: 15px;
        left: 15px;
        max-width: none;
    }
    
    .notification {
        padding: 16px 20px;
        box-shadow: 0 8px 30px rgba(254, 177, 3, 0.3);
    }
    
    .notification-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .notification-title {
        font-size: 14px;
    }
    
    .notification-message {
        font-size: 13px;
    }
    
    .dice-container {
        gap: 30px;
    }
    
    .dice,
    .dice-face {
        width: 80px;
        height: 80px;
    }
    
    .dice-face {
        padding: 9px;
        gap: 4px;
    }
    
    .dot {
        width: 14px;
        height: 14px;
    }
    
    .roll-button-image {
        width: 220px;
    }
    
    .roll-count {
        font-size: 16px;
        padding: 6px 20px;
    }
    
    .reward-content {
        padding: 40px 30px;
    }
    
    .reward-title {
        font-size: 28px;
    }
    
    .reward-name {
        font-size: 22px;
    }
    
    .accept-button,
    .reroll-button {
        padding: 16px 35px;
        font-size: 18px;
    }
    
    .button-icon {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .welcome-container {
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        margin-top: -90px;
        width: calc(100% - 30px);
        max-width: 300px;
    }
    
    .welcome-text {
        font-size: 14px;
        padding: 8px 18px;
    }
    
    .username-highlight {
        max-width: 120px;
    }
    
    .notification-container {
        top: 15px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        padding: 14px 16px;
        gap: 10px;
        box-shadow: 0 6px 25px rgba(254, 177, 3, 0.3);
    }
    
    .notification-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
    
    .notification-close {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .notification-close i {
        font-size: 11px;
    }
    
    .dice-container {
        gap: 20px;
    }
    
    .dice,
    .dice-face {
        width: 60px;
        height: 60px;
    }
    
    .dice-face {
        padding: 8px;
        gap: 3px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
    
    .roll-button-image {
        width: 180px;
    }
    
    .roll-count {
        font-size: 14px;
        padding: 5px 16px;
    }
    
    .reward-content {
        padding: 30px 20px;
    }
    
    .reward-title {
        font-size: 24px;
    }
    
    .reward-image img {
        max-width: 200px;
        max-height: 200px;
    }
    
    .accept-button,
    .reroll-button {
        padding: 14px 25px;
        font-size: 16px;
        flex-direction: column;
        gap: 5px;
    }
    
    .button-icon {
        font-size: 18px;
    }
}


/* ==================== TELEGRAM MODAL ==================== */
.telegram-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.telegram-modal.visible {
    opacity: 1;
    display: flex !important;
}

.telegram-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.telegram-modal.visible .telegram-content {
    transform: scale(1);
}

.telegram-title {
    color: #383838;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.telegram-title i {
    font-size: 32px;
    color: #0088cc;
}

.telegram-description {
    color: #383838;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

.telegram-join-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0088cc 0%, #00a0e9 100%);
    color: #fff;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 136, 204, 0.4);
}

.telegram-join-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 136, 204, 0.6);
}

.telegram-join-button i {
    font-size: 24px;
}

.telegram-form {
    margin-bottom: 25px;
}

.telegram-label {
    display: block;
    color: #383838;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.telegram-label i {
    margin-right: 8px;
    color: #0088cc;
}

.telegram-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #383838;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    background: #fff;
}

.telegram-input:focus {
    outline: none;
    border-color: #0088cc;
}

.telegram-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.telegram-hint {
    display: block;
    color: #5A5A5A;
    font-size: 13px;
    margin-bottom: 15px;
    font-style: italic;
}

.telegram-save-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.telegram-save-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.telegram-save-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.telegram-verify-section {
    padding-top: 25px;
    border-top: 2px solid rgba(56, 56, 56, 0.2);
}

.telegram-verify-text {
    color: #383838;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 15px;
    text-align: center;
}

.telegram-verify-text i {
    color: #0088cc;
    margin-right: 6px;
}

.telegram-verify-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0088cc 0%, #00a0e9 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.telegram-verify-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.telegram-verify-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.telegram-edit-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.telegram-edit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
}

.telegram-edit-button i {
    font-size: 16px;
}

.telegram-countdown {
    text-align: center;
    color: #5A5A5A;
    font-size: 13px;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .telegram-content {
        padding: 30px 25px;
    }
    
    .telegram-title {
        font-size: 24px;
    }
    
    .telegram-description {
        font-size: 14px;
    }
    
    .telegram-join-button,
    .telegram-save-button,
    .telegram-verify-button {
        padding: 12px 25px;
        font-size: 16px;
    }
}
