/* ========================================
   Select Package Popup Styles
   ======================================== */

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Popup Container */
.popup-container {
    position: relative;
    width: 280px;
    /* background: rgba(40, 15, 15, 0.75); */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    border: 3px solid #c9a861;
    box-shadow: 0 0 30px rgba(201, 168, 97, 0.3), inset 0 0 0 2px rgba(139, 0, 0, 0.6);
    padding: 24px 16px;
    font-family: 'Kanit', sans-serif;
}

/* Popup Header */
.popup-header {
    text-align: center;
    margin-bottom: 10px;
}

.popup-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(180deg, #FFFFFF 0%, #ffe3aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Close Button */
.popup-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.popup-close-btn:hover {
    transform: scale(1.1);
}

/* Package List */
.package-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    background: transparent;
}

/* Package Option */
.package-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: transparent;
    border-radius: 6px;
    /* border: 1px solid rgba(90, 32, 32, 0.4); */
    cursor: pointer;
    transition: all 0.2s ease;
}

.package-option:hover {
    border-color: rgba(201, 168, 97, 0.8);
    background: rgba(77, 32, 32, 0.3);
}

.package-option input[type="radio"] {
    display: none;
}

/* Active state - when radio is checked, show yellow border */
.package-option:has(input[type="radio"]:checked) {
    border: 2px solid #c9a861;
    background: rgba(201, 168, 97, 0.15);
    box-shadow: 0 0 8px rgba(201, 168, 97, 0.3);
    border-radius: 10px;
}

/* Package Coins */
.package-coins {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #ffe3aa;
}

.coins-text {
    font-weight: 400;
    color: #c9a861;
}

/* Package HTG */
.package-htg {
    font-size: 13px;
    font-weight: 700;
    color: #ffe3aa;
}

.htg-text {
    font-weight: 400;
    color: #c9a861;
}

/* Action Buttons */
.popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.popup-btn {
    flex: 1;
    padding: 10px 16px;
    font-family: 'Kanit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cancel-btn {
    background: linear-gradient(180deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
    border: 2px solid #000;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

.cancel-btn:hover {
    background: linear-gradient(180deg, #ff5555 0%, #dd1111 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
}

.next-btn {
    background: linear-gradient(180deg, #FFFFFF 0%, #E1C59C 100%);
    color: #000;
    border: 2px solid #000;
    box-shadow: 0 4px 15px rgba(225, 197, 156, 0.4);
}

.next-btn:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #d4b68a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 197, 156, 0.5);
}

/* ========================================
   Confirm Buy More Popup Styles
   ======================================== */

.confirm-popup {
    width: 500px;
    text-align: center;
}

.confirm-content {
    margin-bottom: 16px;
}

.confirm-message {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 8px 0;
}

.confirm-coins {
    font-size: 28px;
    font-weight: 700;
    color: #ffe3aa;
    margin: 0 0 6px 0;
}

.confirm-coins .coins-label {
    font-size: 16px;
    font-weight: 400;
    color: #c9a861;
}

.confirm-price {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.confirm-price #confirmPriceAmount {
    font-weight: 700;
    color: #ffe3aa;
}

.confirm-price .htg-label {
    color: #c9a861;
}

/* ========================================
   Register Popup Styles
   ======================================== */

/* ========================================
   Register Popup Styles
   ======================================== */

.register-popup {
    width: 300px;
    min-height: 160px;
    padding: 10px 12px;
    overflow: visible;
    position: relative;
}

.register-content {
    position: relative;
    min-height: 80px;
}

/* Character Image - behind text and button */
.register-character {
    position: absolute;
    left: 40px;
    width: 110px;
    height: 130px;
    z-index: 1;
}

.register-character img {
    width: 130%;
    height: 110%;
    object-fit: contain;
}

/* Right Side Content - container for text and button */
.register-right {
    position: relative;
    z-index: 10;
    min-height: 80px;
}

/* Question Mark Icon - behind everything */
.register-question-icon {
    position: absolute;
    top: 10px;
    right: 5px;
    width: 60px;
    height: 60px;
    z-index: 0;
}

.register-question-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Text Content - bottom left, on top of character */
.register-text {
    position: absolute;
    /*    top: 80px*/
    top: 30px;
    left: 10px;
    text-align: left;
    width: 60%;
    z-index: 5;
}

.register-message {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.register-message .highlight-text {
    color: #ffe3aa;
    font-weight: 700;
}

/* Register Confirm Button - bottom right, on top of character */
.register-confirm-btn {
    position: absolute;
    top: 80px;
    right: 0px;
    flex: unset;
    width: auto;
    padding: 6px 16px;
    z-index: 5;
}

/* ========================================
   Withdraw Popup Styles
   ======================================== */

.withdraw-popup {
    width: 320px;
    padding: 20px;
}

.withdraw-content {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

/* Left Side - Account Info */
.withdraw-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.withdraw-phone {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.withdraw-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.withdraw-phone-number {
    font-size: 16px;
    font-weight: 700;
    color: #ffe3aa;
}

.withdraw-tunnel {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tunnel-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #00a8e8 0%, #0077b6 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.tunnel-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.withdraw-balance-badge {
    display: inline-block;
    background: linear-gradient(90deg, #c9a861 0%, #ffe3aa 50%, #c9a861 100%);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
}

.withdraw-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
}

.withdraw-info-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.withdraw-info-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffe3aa;
}

.withdraw-coin-amount {
    font-size: 18px;
    font-weight: 700;
    color: #ffe3aa;
}

/* Right Side - Withdraw Options */
.withdraw-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.withdraw-options-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

.withdraw-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.withdraw-option {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.withdraw-option:hover {
    background: rgba(201, 168, 97, 0.15);
}

.withdraw-option input[type="radio"] {
    display: none;
}

/* Selected option - darker background for visibility */
.withdraw-option:has(input[type="radio"]:checked) {
    background: rgba(201, 168, 97, 0.3);
    border: 1px solid #c9a861;
    border-radius: 6px;
}

.withdraw-option input[type="radio"]:checked~.withdraw-option-coins,
.withdraw-option input[type="radio"]:checked~.withdraw-option-htg {
    color: #ffe3aa;
}

.withdraw-option-coins {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 80px;
    text-align: right;
}

.withdraw-option-coins .coins-text {
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 3px;
}

.withdraw-option-htg {
    font-size: 13px;
    font-weight: 700;
    color: #ffe3aa;
    min-width: 55px;
    text-align: right;
}

.withdraw-option-htg .htg-text {
    font-size: 10px;
    font-weight: 400;
    color: #c9a861;
}

/* Withdraw Button */
.withdraw-btn {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    background: linear-gradient(180deg, #FFFFFF 0%, #E1C59C 100%);
    border: 2px solid #000;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Kanit', sans-serif;
}

.withdraw-btn:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #d4b68a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(225, 197, 156, 0.4);
}

/* ========================================
   Message Popup Styles (Success/Error)
   ======================================== */

.message-popup {
    width: 500px;
    /* Match register-popup actual visual width */
    min-height: 280px;
    /* Match register-popup actual visual height */
    padding: 20px 24px;
    /* More padding for larger popup */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.message-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.message-icon {
    font-size: 40px;
    line-height: 1;
}

.message-icon.success {
    color: #4cd964;
    text-shadow: 0 0 10px rgba(76, 217, 100, 0.5);
}

.message-icon.error {
    color: #ff3b30;
    text-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.message-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

/* ========================================
   OTP Popup Styles
   ======================================== */
.otp-popup {
    width: 500px;
    text-align: center;
    background: #000;
    /* Ensure black background */
    border: 2px solid #c9a861;
}

.otp-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
}

.otp-content p {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.otp-box {
    width: 50px;
    height: 60px;
    background: #000;
    border: 1px solid #c9a861;
    border-radius: 8px;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    outline: none;
    font-family: 'Kanit', sans-serif;
}

.otp-box:focus {
    border-color: #ffe3aa;
    box-shadow: 0 0 10px rgba(201, 168, 97, 0.4);
}

.otp-content .popup-btn {
    width: 140px;
    padding: 10px;
    border-radius: 25px;
    font-size: 16px;
    flex: none;
}

.withdraw-amount-display {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 10px 0;
}

.amount-highlight {
    color: #ffe3aa;
    font-size: 32px;
}

.withdraw-details {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-top: 5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 18px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: rgba(255, 255, 255, 0.6);
}

.detail-value {
    color: #fff;
    font-weight: 600;
}

/* ========================================
   Custom Exchange Success Popup Styles
   ======================================== */

.exchange-popup-container-custom {
    position: relative;
    width: 500px;
    height: 320px;
    background-color: #7b0d1e;
    background-image: url('../img/exchange_success_bg.png');
    background-size: cover;
    background-position: center;
    border-radius: 25px;
    border: 3px solid #dac486;
    /* Gold/Beige border */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Push content to bottom */
    padding-bottom: 30px;
    align-items: center;
    font-family: 'Kanit', sans-serif;
    animation: popupPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close Button (Top Right Red Circle) */
.exchange-close-btn-custom {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 44px;
    height: 44px;
    background: #ff0000;
    /* Bright red */
    border: 3px solid #dac486;
    /* Gold border */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 10;
    transition: transform 0.2s;
}

.exchange-close-btn-custom:hover {
    transform: scale(1.1);
}

/* Content Container */
.exchange-success-content-custom {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

/* Title "Congratulations!" */
.exchange-title-custom {
    font-family: 'Kanit', sans-serif;
    font-size: 42px;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(180deg, #fff8e7 0%, #dac486 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #dac486;
    -webkit-text-stroke: 1.5px #000;
    filter: drop-shadow(3px 3px 0 #000);
    margin-bottom: 10px;
    line-height: 1;
    transform: rotate(-2deg);
}

/* Message Text */
.exchange-message-custom {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(180deg, #fff8e7 0%, #dac486 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #dac486;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    margin-bottom: 25px;
    max-width: 80%;
    line-height: 1.4;
}

/* Bottom Action Button "Close" */
.exchange-action-btn-custom {
    min-width: 160px;
    padding: 10px 0;
    font-family: 'Kanit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #000;
    background: linear-gradient(180deg, #fff8e7 0%, #dac486 100%);
    border: 2px solid #000;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 0 #000, 0 5px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
    text-transform: capitalize;
}

.exchange-action-btn-custom:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #000, 0 3px 6px rgba(0, 0, 0, 0.5);
}

.exchange-action-btn-custom:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #000, 0 0 0 rgba(0, 0, 0, 0.5);
}

/* ========================================
   Custom Message Popup Styles (Redesigned)
   Matches Exchange Success Popup design
   ======================================== */

.message-popup-container-custom {
    position: relative;
    width: 500px;
    height: 320px;
    /* Default background - User can replace with their own image */
    background-color: #7b0d1e;
    background-image: url('../img/message_popup_bg.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 25px;
    border: 3px solid #dac486;
    /* Gold/Beige border */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    font-family: 'Kanit', sans-serif;
    animation: messagePopupPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Success State - Green tinted background */
.message-popup-container-custom.success {
    background-color: #7b0d1e;
    background-image: url('../img/exchange_success_bg.png');
}

/* Error State - Semi-transparent background */
.message-popup-container-custom.error {
    background-color: rgba(22, 20, 20, 0.85);
    background-image: url('../img/message_error_bg.png');
}

@keyframes messagePopupPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close Button (Top Right Red Circle) */
.message-close-btn-custom {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 44px;
    height: 44px;
    background: #E05F60;
    /* Bright red */
    border: 3px solid #dac486;
    /* Gold border */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 10;
    transition: transform 0.2s;
}

.message-close-btn-custom:hover {
    transform: scale(1.1);
}

/* Dice Set Container - Ensure it doesn't affect flex layout */
.dice-set {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Dice Decorations - Positioned as per design */
.message-dice-bottom-left {
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: 60px;
    height: auto;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
    transform: rotate(-15deg);
}

.message-dice-bottom-right {
    position: absolute;
    /* bottom: 5px; */
    right: 5px;
    width: 60px;
    height: auto;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
    transform: rotate(15deg);
}

.message-dice-top-left {
    position: absolute;
    top: 15px;
    left: 50px;
    width: 30px;
    height: auto;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
    transform: rotate(-25deg);
}

.message-dice-top-right {
    position: absolute;
    top: 30px;
    right: 160px;
    width: 25px;
    height: auto;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
    transform: rotate(15deg);
}

/* Content Container */
.message-content-custom {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    gap: 10px;
    padding-bottom: 25px;
    z-index: 10;
}

/* Icon */
.message-icon-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.message-icon-custom svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Title "Success!" or "Failed!" - Positioned at top-left */
.message-title-custom {
    position: absolute;
    top: 60px;
    left: 30px;
    font-family: 'Kanit', sans-serif;
    font-size: 36px;
    font-weight: 900;
    /* font-style: italic; */
    background: linear-gradient(180deg, #fff8e7 0%, #dac486 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #dac486;
    -webkit-text-stroke: 1px #000;
    filter: drop-shadow(2px 2px 0 #000);
    line-height: 1;
    text-transform: uppercase;
    z-index: 15;
}

/* Message Text */
.message-text-custom {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(180deg, #fff8e7 0%, #dac486 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #dac486;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    max-width: 85%;
    line-height: 1.4;
}

/* Bottom Action Button "OK" */
.message-action-btn-custom {
    min-width: 140px;
    /* padding: 10px 30px; */
    font-family: 'Kanit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #000;
    background: linear-gradient(180deg, #fff8e7 0%, #dac486 100%);
    border: 2px solid #000;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 0 #000, 0 5px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
    text-transform: uppercase;
    margin-top: 10px;
}

.message-action-btn-custom:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #000, 0 3px 6px rgba(0, 0, 0, 0.5);
}

.message-action-btn-custom:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #000, 0 0 0 rgba(0, 0, 0, 0.5);
}