.treasure-chest-container {
    text-align: center;
    margin: 20px 0;
}

.treasure-chest-btn, .treasure-chest-code-btn {
    background-size: cover;
    background-position: center;
    width: 250px; /* ?????????????? */
    height: 250px; /* ?????????????? */
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.treasure-chest-btn:hover, .treasure-chest-code-btn:hover {
    transform: scale(1.05);
}

.treasure-chest-result p {
    font-size: 1.2em;
    margin-top: 10px;
}

/* ???????????? */
.treasure-effect-bounce:hover {
    animation: bounce 1s infinite;
}

.treasure-effect-shake:hover {
    animation: shake 0.5s infinite;
}

.treasure-effect-rotate:hover {
    animation: rotate 2s infinite linear;
}

.treasure-effect-flip:hover {
    animation: flip 2s infinite;
}

.treasure-effect-pulse:hover {
    animation: pulse 1.5s infinite;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes flip {
    0%, 100% { transform: perspective(400px) rotateY(0); }
    50% { transform: perspective(400px) rotateY(180deg); }
}

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

/* ????????????? - ??????? */
.treasure-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 9999;
}

.treasure-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* ?????????????????????????????? */
.treasure-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.treasure-popup-close {
    font-size: 24px;
    cursor: pointer;
    margin-left: 10px;
    color: #999;
    transition: color 0.3s ease;
}

.treasure-popup-close:hover {
    color: #333;
}

.treasure-sound-control {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    transition: transform 0.3s ease;
}

.treasure-sound-control:hover {
    transform: scale(1.2);
}

.treasure-popup-title {
    margin: 0;
    font-size: 1.6em;
    color: #e6a23c;
    flex-grow: 1;
    text-align: center;
}

.treasure-popup-code-container {
    margin-bottom: 15px;
}

.treasure-popup-code {
    font-size: 1.5em;
    margin: 10px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.treasure-popup-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.treasure-popup-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.treasure-copy-button {
    background-color: #4CAF50;
    color: white;
}

.treasure-copy-button:hover {
    background-color: #3e8e41;
}

.treasure-tweet-button {
    background-color: #1DA1F2;
    color: white;
}

.treasure-tweet-button:hover {
    background-color: #1991da;
}

/* ????????? - ?????? */
.treasure-stats {
    margin: 20px 0;
    font-size: 16px;
}

.treasure-stats-boxed {
    border: 1px solid #ffd700;
    border-radius: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #fffdf0, #fff8e0);
    box-shadow: 0 4px 12px rgba(230, 162, 60, 0.15);
    position: relative;
    overflow: hidden;
}

.treasure-stats-boxed:before {
    content: '?';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    opacity: 0.2;
}

.treasure-stats-boxed:after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, rgba(255,215,0,0) 70%);
    border-radius: 50%;
    animation: shine 4s infinite ease-in-out;
}

@keyframes shine {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

.treasure-stats-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #e6a23c;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

.treasure-stats-title:before {
    content: '?';
    margin-right: 8px;
    font-size: 24px;
}

.treasure-stats-grid {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 10px;
}

.treasure-stats-item {
    text-align: center;
    padding: 10px;
    position: relative;
    transition: transform 0.3s ease;
}

.treasure-stats-item:hover {
    transform: translateY(-5px);
}

.treasure-stats-value {
    font-size: 28px;
    font-weight: bold;
    color: #e6a23c;
    display: block;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.treasure-stats-label {
    font-size: 14px;
    color: #666;
    display: block;
    margin-top: 5px;
}

.treasure-stats-progress {
    height: 16px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.treasure-stats-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 8px;
    transition: width 1s ease-in-out;
    position: relative;
}

.treasure-stats-progress-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0.1) 100%
    );
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.treasure-stats-percentage {
    text-align: right;
    font-size: 14px;
    color: #4caf50;
    font-weight: bold;
}

/* ??????????? */
.treasure-stats-minimal {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f9f9f9, #f0f0f0);
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.treasure-stats-minimal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.treasure-stats-minimal .treasure-stats-available {
    font-weight: bold;
    color: #4CAF50;
    font-size: 16px;
}

.treasure-stats-minimal .treasure-stats-separator {
    color: #999;
    margin: 0 2px;
}

.treasure-stats-minimal .treasure-stats-total {
    color: #666;
}

.treasure-stats-minimal .treasure-stats-label {
    margin-left: 5px;
    color: #888;
    background-color: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

/* ???????????? */
@keyframes treasureGet {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.treasure-get-animation {
    animation: treasureGet 1s ease;
}

/* ???????? */
@media screen and (max-width: 767px) {
    .treasure-chest-btn, .treasure-chest-code-btn {
        width: 180px;
        height: 180px;
    }

    .treasure-popup-content {
        width: 90%;
        max-width: 350px;
        padding: 15px;
    }

    .treasure-popup-title {
        font-size: 1.3em;
    }

    .treasure-popup-code {
        font-size: 1.2em;
        padding: 8px;
        word-break: break-all;
    }

    .treasure-popup-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .treasure-popup-button {
        width: 100%;
    }

    .treasure-stats-boxed .treasure-stats-grid {
        flex-direction: column;
    }

    .treasure-stats-item {
        padding: 5px 0;
    }
    
    /* ??????????? */
    .treasure-chest-btn:hover, .treasure-chest-code-btn:hover {
        transform: none;
    }
    
    .treasure-chest-btn:active, .treasure-chest-code-btn:active {
        transform: scale(0.95);
    }
}

/* ???????????? */
@media screen and (max-width: 480px) {
    .treasure-popup-content {
        max-width: 300px;
    }
    
    .treasure-stats-minimal {
        width: 100%;
        text-align: center;
    }
}
