/**
 * Theme-E Lucky Wheel Spin Stylesheet
 * Matches Photo 2 (theme e.anotechsolutions.shop/lucky-spinner) pixel-perfectly
 */

/* 1. Global Page Active Scope */
body.wheel-page-active {
    background-color: #030c26 !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.wheel-page-active #app > *:not(#theme-e-wheel-root) {
    display: none !important;
}

body.wheel-page-active .page-wrapper,
body.wheel-page-active .tabbar-container,
body.wheel-page-active .turntable-wrapper,
body.wheel-page-active .rechargeTurntable {
    display: none !important;
}

/* 2. Main Root Container */
#theme-e-wheel-root {
    background-color: #030c26;
    color: #edf3ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    padding-bottom: 50px;
}

/* 3. Sticky App Bar Header */
.theme-e-wheel-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0 14px;
    background: linear-gradient(90deg, #1a55c8 0%, #11358d 52%, #05184d 100%);
    border-bottom: 1px solid #ffd66e;
    box-shadow: 0 0 26px rgba(255,217,104,0.5), 0 0 48px rgba(255,180,46,0.28), inset 0 1px 0 rgba(255,255,255,0.34);
}

.theme-e-wheel-back {
    color: #f7d067;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-e-wheel-back:active {
    transform: scale(0.9);
}

.theme-e-wheel-title {
    color: #f7d067;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    flex: 1;
    margin-right: 36px;
    text-shadow: 0 1px 0 rgba(64,35,0,0.8);
}

/* 4. Festive Red Banner */
.theme-e-wheel-banner {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.theme-e-wheel-banner-img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
}

/* 5. "Today" Card */
.theme-e-today-card {
    margin: 12px 14px 16px 14px;
    padding: 16px;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 6%, rgba(110,176,255,0.62) 0%, rgba(22,66,155,0.96) 40%, rgba(7,20,61,1) 100%);
    border: 1px solid #ffd66e;
    box-shadow: 0 0 22px rgba(255,220,110,0.46), 0 0 42px rgba(255,186,52,0.26), inset 0 1px 0 rgba(255,255,255,0.34);
    box-sizing: border-box;
}

.theme-e-today-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #f7d067;
    margin: 0 0 14px 0;
    text-shadow: 0 1px 0 rgba(64,35,0,0.8);
    letter-spacing: 0.3px;
}

.theme-e-today-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0f347f;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ffd66e;
    box-sizing: border-box;
}

.theme-e-today-row.first-row {
    margin-bottom: 12px;
    padding: 7px 12px;
}

.theme-e-today-label {
    color: #edf3ff;
    font-size: 14px;
    font-weight: 500;
}

.theme-e-recharge-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, #f7d87e 0%, #c99a2b 100%);
    border-radius: 20px;
    padding: 4px 12px;
    border: 1px solid #ffe08a;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: filter 0.15s ease, transform 0.1s ease;
}

.theme-e-recharge-badge:active {
    transform: scale(0.96);
    filter: brightness(1.1);
}

.theme-e-recharge-amount {
    color: #0a245f;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
}

.theme-e-refresh-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.theme-e-refresh-icon svg {
    width: 14px;
    height: 14px;
    fill: #0a245f;
}

.theme-e-refreshing {
    animation: themeERotate 0.6s linear infinite;
}

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

.theme-e-spins-val {
    color: #f7d067;
    font-weight: 700;
    font-size: 14px;
}

/* 6. Wheel Section */
.theme-e-wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px 18px 14px;
    position: relative;
    box-sizing: border-box;
}

.theme-e-wheel-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    max-width: 92vw;
    max-height: 92vw;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.theme-e-wheel-canvas,
.theme-e-wheel-disc {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 2;
    transform-origin: center center;
    pointer-events: none;
}

.theme-e-wheel-bg-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    border-radius: 50%;
    transform-origin: center center;
}

.theme-e-wheel-go-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 90px;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.theme-e-wheel-go-btn:active {
    transform: translate(-50%, -50%) scale(0.94);
}

.theme-e-wheel-go-btn img {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* 7. Action Buttons (Event Description, Event Details, Activity Rules) */
.theme-e-action-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 12px 14px;
    padding: 12px 6px;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 6%, rgba(110,176,255,0.62) 0%, rgba(22,66,155,0.96) 40%, rgba(7,20,61,1) 100%);
    border: 1px solid #ffd66e;
    box-shadow: 0 0 18px rgba(255,210,96,0.32), inset 0 1px 0 rgba(255,255,255,0.22);
    box-sizing: border-box;
}

.theme-e-action-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
    text-align: center;
    transition: transform 0.15s ease, opacity 0.15s ease;
    user-select: none;
}

.theme-e-action-item:active {
    transform: scale(0.95);
    opacity: 0.85;
}

.theme-e-action-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.theme-e-action-icon svg {
    width: 36px;
    height: 36px;
}

.theme-e-action-text {
    color: #edf3ff;
    font-size: 12px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

/* 8. History Section */
.theme-e-history-card {
    margin: 16px 14px 30px 14px;
    padding: 14px;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 6%, rgba(110,176,255,0.62) 0%, rgba(22,66,155,0.96) 40%, rgba(7,20,61,1) 100%);
    border: 1px solid #ffd66e;
    box-shadow: 0 0 18px rgba(255,210,96,0.32), inset 0 1px 0 rgba(255,255,255,0.22);
    box-sizing: border-box;
}

.theme-e-history-head {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #f7d067;
    margin-bottom: 12px;
    text-shadow: 0 1px 0 rgba(64,35,0,0.8);
}

.theme-e-history-head svg {
    width: 24px;
    height: 24px;
    margin-right: 6px;
}

.theme-e-history-table-wrap {
    background-color: #0c2c7a;
    border-radius: 12px;
    border: 1px solid #ffd66e;
    overflow: hidden;
    width: 100%;
}

.theme-e-history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.theme-e-history-table th {
    color: #f7d067;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255,208,96,0.34);
    background: rgba(0, 0, 0, 0.15);
}

.theme-e-history-table td {
    padding: 10px 4px;
    color: #edf3ff;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,208,96,0.2);
}

.theme-e-history-table tr:last-child td {
    border-bottom: none;
}

.theme-e-history-prize {
    color: #f7d067;
    font-weight: 700;
}

.theme-e-history-empty {
    padding: 24px 16px;
    text-align: center;
}

.theme-e-history-empty img {
    width: 130px;
    max-width: 60%;
    display: block;
    margin: 0 auto 10px auto;
}

.theme-e-history-empty p {
    color: #edf3ff;
    font-size: 13px;
    margin: 0;
}

/* 9. Winning Popup & Alerts */
.theme-e-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.theme-e-modal-box {
    background: radial-gradient(circle at 50% 6%, #194cb0 0%, #0c2b75 45%, #05143d 100%);
    border: 1.5px solid #ffd66e;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(255,217,104,0.5), 0 8px 32px rgba(0,0,0,0.6);
    width: 100%;
    max-width: 360px;
    color: #edf3ff;
    overflow: hidden;
    position: relative;
    animation: themeEModalIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes themeEModalIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.theme-e-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 214, 110, 0.3);
    background: rgba(0, 0, 0, 0.2);
}

.theme-e-modal-title {
    color: #f7d067;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 0 rgba(64,35,0,0.8);
}

.theme-e-modal-close {
    background: none;
    border: none;
    color: #f7d067;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.theme-e-modal-body {
    padding: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    max-height: 65vh;
    overflow-y: auto;
}

.theme-e-modal-body p {
    margin: 0 0 10px 0;
}

.theme-e-win-banner {
    text-align: center;
    padding: 10px 0;
}

.theme-e-win-title {
    font-size: 20px;
    font-weight: 800;
    color: #f7d067;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(247, 208, 103, 0.5);
}

.theme-e-win-amount {
    font-size: 32px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.theme-e-btn-confirm {
    display: block;
    width: 80%;
    margin: 16px auto 6px auto;
    padding: 10px;
    border-radius: 24px;
    background: linear-gradient(180deg, #f7d87e 0%, #c99a2b 100%);
    color: #0a245f;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid #ffe08a;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-e-btn-confirm:active {
    transform: scale(0.96);
}

/* Toast message matching Theme-E */
.theme-e-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(29, 29, 23, 0.9);
    border: 1px solid #ffd66e;
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10001;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    max-width: 85%;
    pointer-events: none;
    animation: themeEToastIn 0.25s ease-out;
}

@keyframes themeEToastIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
