/* 全新抽奖轮盘样式 - 精致版 */

/* 重置所有默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 顶部菜单栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.game-title h1 {
    font-size: 22px;
    color: #2c3e50;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-font-smoothing: antialiased;
}

.nav-btn:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(52, 152, 219, 0.3);
}

/* 主游戏区域 */
.game-container {
    flex: 1;
    display: flex;
    gap: 30px;
    padding: 20px 30px 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* 左侧轮盘区域 */
.wheel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 500px;
}

/* 游戏信息卡片 */
.game-info {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.balance-card,
.bet-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    min-width: 150px;
    transition: transform 0.2s ease;
}

.balance-card:hover,
.bet-card:hover {
    transform: translateY(-2px);
}

.info-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-bottom: 8px;
    -webkit-font-smoothing: antialiased;
}

.info-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
}

.wheel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
    background: #fff;
    /* 🎯 仅保留旋转必需的CSS属性 */
    transform-origin: center center;
    transition: none;
    /* 默认无过渡，通过JS动态设置 */
}

.wheel-pointer {
    position: absolute;
    top: 15px;
    /* 调整到轮盘内边缘 */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 25px solid #e74c3c;
    z-index: 10;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.spin-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: 4px solid #fff;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spin-button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.probability-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    color: #2c3e50;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* 右侧控制面板 */
.control-panel {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    flex-shrink: 0;
}

.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* 轮盘旋转特效已完全移除 */

/* 按钮点击反馈动画 */
.spin-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.spin-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
}

/* 控制面板通用样式 */
.bet-controls,
.recent-results {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bet-controls h3,
.recent-results h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    -webkit-font-smoothing: antialiased;
}

/* 充值相关样式 */
.recharge-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.recharge-btn {
    padding: 15px 20px;
    border: 2px solid #27ae60;
    background: #fff;
    color: #27ae60;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    -webkit-font-smoothing: antialiased;
}

.recharge-btn:hover {
    background: #27ae60;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.custom-recharge {
    display: flex;
    gap: 10px;
}

#custom-recharge-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

#custom-recharge-input:focus {
    outline: none;
    border-color: #27ae60;
}

#custom-recharge-btn {
    padding: 12px 20px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

#custom-recharge-btn:hover {
    background: #229954;
    transform: translateY(-1px);
}

/* 投注控制 */
.bet-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.bet-btn {
    padding: 12px 20px;
    border: 2px solid #3498db;
    background: #fff;
    color: #3498db;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    -webkit-font-smoothing: antialiased;
}

.bet-btn:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.bet-btn.active {
    background: #3498db;
    color: #fff;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.custom-bet {
    display: flex;
    gap: 8px;
}

#custom-bet-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#custom-bet-input:focus {
    outline: none;
    border-color: #3498db;
}

#custom-bet-btn {
    padding: 10px 16px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#custom-bet-btn:hover {
    background: #229954;
    transform: translateY(-1px);
}

/* 统计网格样式 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(52, 152, 219, 0.2);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    -webkit-font-smoothing: antialiased;
}

/* 最近结果样式 */
.results-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px 0;
}

.results-list::-webkit-scrollbar {
    width: 4px;
}

.results-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.results-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.result-item:hover {
    background: rgba(0, 0, 0, 0.08);
}

.result-time {
    color: #666;
    font-size: 12px;
    -webkit-font-smoothing: antialiased;
}

.result-amount {
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
}

.result-amount.win {
    color: #27ae60;
}

.result-amount.lose {
    color: #e74c3c;
}

.no-results,
.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* 弹窗样式 */
.modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

/* 最近结果 */
.results-list {
    max-height: 200px;
    overflow-y: auto;
}

.results-list::-webkit-scrollbar {
    width: 4px;
}

.results-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.results-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-size: 14px;
}

.result-time {
    color: #666;
    font-size: 12px;
}

.result-amount {
    font-weight: 600;
}

.result-amount.win {
    color: #27ae60;
}

.result-amount.lose {
    color: #e74c3c;
}

.no-results,
.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.win-amount-display {
    font-size: 48px;
    font-weight: 700;
    color: #27ae60;
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.win-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.modal-btn.primary {
    background: #3498db;
    color: #fff;
}

.modal-btn.primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.modal-btn.secondary {
    background: #95a5a6;
    color: #fff;
}

.modal-btn.secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* 历史记录 */
.history-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.history-info {
    flex: 1;
}

.history-time {
    font-size: 12px;
    color: #666;
}

.history-bet {
    font-size: 14px;
    color: #2c3e50;
    margin-top: 2px;
}

.history-result {
    font-weight: 700;
    font-size: 16px;
}

.history-result.win {
    color: #27ae60;
}

.history-result.lose {
    color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }

    .wheel-section {
        min-width: auto;
    }

    .control-panel {
        width: 100%;
        max-height: 400px;
    }

    #wheel-canvas {
        width: 300px;
        height: 300px;
    }

    .header-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .bet-amounts {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin var(--spin-duration, 3s) cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* 辅助类 */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    backdrop-filter: blur(10px);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toast-info {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.toast-error {
    background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
}

/* 💰 浮动金额提示（扣减时显示）*/
.balance-card {
    position: relative;
}

.floating-amount {
    position: absolute;
    top: 20%;
    right: 10px;
    font-size: 16px;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 10;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-40px);
        opacity: 0;
    }
}

/* 💰 数字滚动效果（中奖时）- 金色高亮 */
.balance-rolling {
    color: #FFD700 !important;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4);
    font-weight: 700;
    animation: goldGlow 0.1s ease-in-out infinite;
}

@keyframes goldGlow {

    0%,
    100% {
        text-shadow:
            0 0 20px rgba(255, 215, 0, 0.8),
            0 0 30px rgba(255, 215, 0, 0.6),
            0 0 40px rgba(255, 215, 0, 0.4);
    }

    50% {
        text-shadow:
            0 0 25px rgba(255, 215, 0, 1),
            0 0 35px rgba(255, 215, 0, 0.8),
            0 0 50px rgba(255, 215, 0, 0.6);
    }
}

/* 💰 金额变化完成动画 - 金色闪光 */
.balance-change {
    animation: balanceChange 0.6s ease-out;
}

@keyframes balanceChange {
    0% {
        transform: scale(1);
        color: inherit;
    }

    40% {
        transform: scale(1.35);
        color: #FFD700;
        text-shadow:
            0 0 25px rgba(255, 215, 0, 1),
            0 0 40px rgba(255, 215, 0, 0.8),
            0 0 60px rgba(255, 215, 0, 0.5);
    }

    100% {
        transform: scale(1);
        color: inherit;
    }
}

/* 🎉 欢迎弹窗样式 */
.welcome-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.welcome-animation {
    animation: welcomeFadeIn 0.6s ease-out;
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: welcomeIconBounce 1s ease-in-out infinite;
}

@keyframes welcomeIconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-message {
    font-size: 18px;
    color: #555;
    margin-bottom: 25px;
}

.welcome-reward {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
    animation: welcomeRewardPulse 2s ease-in-out infinite;
}

@keyframes welcomeRewardPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(245, 87, 108, 0.5);
    }
}

.reward-amount {
    font-size: 56px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: block;
}

.welcome-tip {
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 15px 50px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
}

.start-btn:active {
    transform: translateY(-1px);
}

/* 调整充值选项布局（支持6个按钮） */
.recharge-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}