/* ========================================
   Megaways 万线连线游戏 - 全局样式
   配色方案: 深空蓝黑 + 奢华金 + 科技青
   ======================================== */

:root {
    /* 主色调 */
    --bg-primary: #0a0a1a;
    --bg-secondary: #141428;
    --bg-highlight: #1e1e3a;
    --accent-gold: #ffd700;
    --accent-gold-dark: #ff8c00;
    --accent-cyan: #00d4ff;
    --accent-cyan-dark: #0099cc;
    
    /* 功能色 */
    --success: #00e676;
    --warning: #ff9100;
    --danger: #ff1744;
    
    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    /* 边框与阴影 */
    --border-gold: rgba(255, 215, 0, 0.3);
    --shadow-gold: 0 4px 20px rgba(255, 215, 0, 0.4);
    --shadow-dark: 0 0 60px rgba(0, 0, 0, 0.8);
}

/* ========================================
   粒子背景动画 - 优化版
   ======================================== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0.2;
    animation: particleFloat 20s infinite ease-in-out;
    box-shadow: 0 0 6px var(--accent-gold);
}

@keyframes particleFloat {
    0% {
        transform: translateY(110vh) translateX(0) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-50px) translateX(30px) scale(0.8);
        opacity: 0;
    }
}

/* 移动端粒子更少更淡 */
@media (max-width: 768px) {
    .particle-dot {
        width: 2px;
        height: 2px;
        opacity: 0.1;
        box-shadow: 0 0 3px var(--accent-gold);
    }
}

/* 网格背景 - 优化版 */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: 
        linear-gradient(rgba(255, 215, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* 移动端网格更稀疏 */
@media (max-width: 768px) {
    .grid-bg {
        background-size: 80px 80px;
        background-image: 
            linear-gradient(rgba(255, 215, 0, 0.015) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 215, 0, 0.015) 1px, transparent 1px);
    }
}

/* 光晕效果 */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 10s ease-in-out infinite;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-gold);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    bottom: 20%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -30px) scale(1.1);
    }
    50% {
        transform: translate(0, 50px) scale(0.9);
    }
    75% {
        transform: translate(-50px, -20px) scale(1.05);
    }
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 加载画面 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--bg-highlight);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 登录/注册容器 */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f0f24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-dark), 0 0 20px rgba(255, 215, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.game-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 2px;
}

/* 表单样式 */
.auth-form h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-primary);
}

.form-group {
    position: relative;
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-highlight);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.captcha-group {
    display: flex;
    gap: 10px;
}

.captcha-group input {
    flex: 1;
}

.captcha-img {
    width: 100px;
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 100px;
    flex-shrink: 0;
}

.captcha-img:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.check-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.check-icon.valid::after {
    content: '✓';
    color: var(--success);
}

.check-icon.invalid::after {
    content: '✗';
    color: var(--danger);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: var(--bg-primary);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
}

.btn-welfare {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: none;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-welfare:hover {
    background: linear-gradient(135deg, #ff8585, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-welfare-large {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-welfare-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* 切换链接 */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-switch a {
    color: var(--accent-cyan);
    text-decoration: none;
    margin-left: 4px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* 游戏主容器 */
.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

/* 顶部信息栏 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-highlight);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-id-box,
.user-points-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-label {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
}

.uid-value {
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 1px;
}

.points-value {
    color: var(--accent-gold);
    font-size: 18px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.top-actions {
    display: flex;
    gap: 10px;
}

/* Phaser游戏容器 - 增大尺寸 */
.phaser-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 10px;
}

.phaser-container canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.15), inset 0 0 60px rgba(0, 0, 0, 0.3);
}

/* 移动端游戏区域适配 - 更大画面 */
@media (max-width: 768px) {
    .phaser-container {
        min-height: 72vh; /* 更高的画布 */
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .phaser-container {
        min-height: 75vh;
        padding: 4px;
    }
}

@media (max-width: 375px) {
    .phaser-container {
        min-height: 78vh;
        padding: 3px;
    }
}

@media (max-height: 900px) {
    .phaser-container {
        min-height: 70vh;
    }
}

@media (max-height: 800px) {
    .phaser-container {
        min-height: 68vh;
    }
}

@media (max-height: 700px) {
    .phaser-container {
        min-height: 65vh;
    }
}

/* 底部控制栏 */
.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-highlight);
    gap: 16px;
}

/* 移动端底部栏更紧凑 */
@media (max-width: 768px) {
    .bottom-bar {
        padding: 8px 10px;
        gap: 8px;
    }
}

.bet-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.bet-label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.bet-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bet-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-highlight);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.bet-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.bet-btn.active {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border-color: transparent;
    color: var(--bg-primary);
    font-weight: 600;
}

.spin-section {
    display: flex;
    justify-content: center;
}

.btn-spin {
    padding: 18px 48px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border: none;
    border-radius: 50px;
    color: var(--bg-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    transition: all 0.3s;
    min-width: 140px;
}

.btn-spin:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.btn-spin:active {
    transform: scale(0.98);
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.spin-text {
    letter-spacing: 4px;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
    text-align: right;
}

.info-item {
    font-size: 13px;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

.win-value {
    color: var(--success);
}

/* 自动旋转按钮 */
.btn-auto-spin {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-cyan-dark) 100%);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    transition: all 0.3s;
    margin-left: 8px;
    letter-spacing: 2px;
}

.btn-auto-spin:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5);
}

.btn-auto-spin:active {
    transform: scale(0.98);
}

.btn-auto-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 自动旋转控制栏 */
.auto-spin-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-bottom: 1px solid var(--accent-cyan);
    animation: autoSpinPulse 2s ease-in-out infinite;
}

@keyframes autoSpinPulse {
    0%, 100% { border-color: var(--accent-cyan); }
    50% { border-color: rgba(0, 212, 255, 0.4); }
}

.auto-spin-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auto-spin-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.auto-spin-countdown {
    color: var(--text-secondary);
    font-size: 14px;
}

.countdown-num {
    color: var(--accent-cyan);
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    display: inline-block;
    text-align: center;
}

.cost-num {
    color: var(--accent-gold);
}

.auto-spin-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.auto-spin-divider {
    color: var(--text-muted);
    margin: 0 4px;
}

.btn-auto-stop {
    padding: 8px 24px;
    background: var(--danger);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(255, 23, 68, 0.4);
}

.btn-auto-stop:hover {
    background: #ff3d6a;
    transform: scale(1.05);
}

.btn-auto-stop:active {
    transform: scale(0.95);
}

/* 自动旋转弹窗 */
.autospin-content .modal-body {
    text-align: center;
}

.autospin-bet-info {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 16px;
}

.autospin-bet-val {
    color: var(--accent-gold);
    font-size: 22px;
    font-weight: 700;
}

.autospin-quick-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.autospin-quick-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--bg-highlight);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.autospin-quick-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.autospin-quick-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 600;
}

.autospin-summary {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 16px;
}

.autospin-total-val {
    color: var(--accent-gold);
    font-size: 20px;
    font-weight: 700;
    transition: color 0.3s;
}

.autospin-balance {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

.autospin-balance-val {
    color: var(--accent-gold);
    font-weight: 600;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    background: rgba(20, 20, 40, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    box-shadow: var(--shadow-dark);
    overflow: hidden;
}

.modal-large {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--bg-highlight);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.transfer-tip {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--bg-highlight);
}

.modal-footer .btn {
    width: auto;
    padding: 10px 24px;
    font-size: 14px;
}

/* 游戏规则内容 */
.rules-body {
    line-height: 1.8;
}

.rules-section {
    margin-bottom: 20px;
}

.rules-section h4 {
    color: var(--accent-gold);
    font-size: 16px;
    margin-bottom: 10px;
}

.rules-section p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 6px;
}

/* 中奖显示（画面内） */
.win-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
}

.win-effect-container {
    position: relative;
    text-align: center;
    padding: 40px 60px;
}

/* 发光背景 */
.win-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: winGlowPulse 1.5s ease-in-out infinite;
}

@keyframes winGlowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* 粒子效果容器 */
.win-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* 粒子 */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* 文字包装 */
.win-text-wrapper {
    position: relative;
    z-index: 10;
}

.win-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    animation: winTitleBounce 0.6s ease-out;
}

@keyframes winTitleBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.win-amount {
    font-size: 56px;
    font-weight: 900;
    color: var(--success);
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(0, 230, 118, 0.8);
    animation: winAmountZoom 0.8s ease-out;
}

@keyframes winAmountZoom {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.win-lines {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 230, 118, 0.5);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 100, 0, 0.4));
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid rgba(0, 230, 118, 0.5);
    animation: winLinesFade 1s ease-out 0.3s both;
    display: inline-block;
    margin-top: 10px;
    white-space: nowrap; /* 确保文字横向显示不换行 */
    writing-mode: horizontal-tb; /* 强制横向文字 */
    text-orientation: mixed;
    letter-spacing: 2px;
}

@keyframes winLinesFade {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    50% { transform: translateY(-5px) scale(1.1); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 小奖特效（< 50金币） */
.win-display.small-win .win-glow {
    background: radial-gradient(ellipse, rgba(160, 160, 160, 0.2) 0%, transparent 70%);
}
.win-display.small-win .win-amount {
    font-size: 32px;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

/* 中奖特效（50-500金币） */
.win-display.medium-win .win-glow {
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    animation: winGlowPulse 1s ease-in-out infinite;
}
.win-display.medium-win .win-amount {
    font-size: 48px;
    text-shadow: 0 0 20px rgba(0, 230, 118, 0.6);
}

/* 大奖特效（500-2000金币） */
.win-display.big-win .win-glow {
    background: radial-gradient(ellipse, rgba(255, 140, 0, 0.5) 0%, rgba(255, 215, 0, 0.3) 50%, transparent 70%);
    animation: winGlowPulse 0.8s ease-in-out infinite;
}
.win-display.big-win .win-title {
    font-size: 32px;
}
.win-display.big-win .win-amount {
    font-size: 64px;
    color: #ffd700;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.9), 0 0 80px rgba(255, 140, 0, 0.5);
}

/* 超级大奖特效（> 2000金币） */
.win-display.mega-win .win-glow {
    background: radial-gradient(ellipse, rgba(255, 0, 100, 0.6) 0%, rgba(255, 215, 0, 0.4) 40%, transparent 70%);
    animation: megaGlowPulse 0.5s ease-in-out infinite;
}
@keyframes megaGlowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
}
.win-display.mega-win .win-title {
    font-size: 40px;
    background: linear-gradient(135deg, #ff0080 0%, #ffd700 50%, #ff0080 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 1s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.win-display.mega-win .win-amount {
    font-size: 80px;
    color: #fff;
    text-shadow: 0 0 50px rgba(255, 0, 128, 1), 0 0 100px rgba(255, 215, 0, 0.8), 0 0 150px rgba(255, 0, 128, 0.5);
    animation: megaAmountPulse 0.5s ease-in-out infinite;
}
@keyframes megaAmountPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 2000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .auth-box {
        padding: 30px 20px;
        margin: 10px;
        max-width: none;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .game-subtitle {
        font-size: 13px;
    }
    
    /* 移动端顶部栏优化 - 更紧凑 */
    .top-bar {
        padding: 4px 8px;
        flex-wrap: nowrap;
        gap: 6px;
        min-height: 40px;
    }
    
    .user-info {
        gap: 8px;
        flex: 1;
    }
    
    .user-id-box,
    .user-points-box {
        gap: 0px;
    }
    
    .user-label {
        font-size: 8px;
    }
    
    .user-value {
        font-size: 11px;
    }
    
    .uid-value {
        font-size: 12px;
    }
    
    .points-value {
        font-size: 13px;
    }
    
    .top-actions {
        gap: 3px;
    }
    
    .btn-small {
        padding: 4px 6px;
        font-size: 9px;
    }
    
    /* 移动端底部栏 - 超紧凑 */
    .bottom-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 6px 8px;
        justify-content: space-between;
    }
    
    .bet-section {
        flex: 1;
        order: 1;
        justify-content: flex-start;
    }
    
    .bet-label {
        font-size: 10px;
        display: none; /* 隐藏"金币"标签节省空间 */
    }
    
    .bet-options {
        gap: 2px;
    }
    
    .bet-btn {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 10px;
    }
    
    .spin-section {
        order: 2;
        width: auto;
    }
    
    .btn-spin {
        padding: 6px 16px;
        font-size: 12px;
        min-width: 70px;
        border-radius: 20px;
    }

    .btn-auto-spin {
        padding: 5px 10px;
        font-size: 10px;
        margin-left: 4px;
        border-radius: 15px;
    }
    
    .info-section {
        display: none; /* 移动端隐藏线路和奖励信息，节省空间 */
    }

    .auto-spin-bar {
        flex-direction: row;
        gap: 6px;
        padding: 5px 8px;
    }

    .auto-spin-left {
        gap: 8px;
    }

    .countdown-num {
        font-size: 14px;
    }
    
    /* 移动端中奖显示优化 */
    .win-effect-container {
        padding: 15px 20px;
    }
    
    .win-title {
        font-size: 16px;
    }
    
    .win-amount {
        font-size: 32px;
    }
    
    .win-lines {
        font-size: 12px;
        padding: 5px 12px;
    }
}

@media (max-width: 375px) {
    .game-title {
        font-size: 20px;
    }
    
    .top-bar {
        padding: 6px 8px;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .uid-value {
        font-size: 12px;
        letter-spacing: 0;
    }
    
    .points-value {
        font-size: 13px;
    }
    
    .btn-small {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .phaser-container {
        min-height: 260px;
    }
    
    .bottom-bar {
        padding: 8px;
        gap: 8px;
    }
    
    .bet-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .btn-spin {
        padding: 8px 24px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .btn-auto-spin {
        padding: 6px 14px;
        font-size: 11px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 320px) {
    .top-actions {
        display: none;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}

/* 横屏提示 */
.landscape-hint {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9998;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

@media (max-width: 768px) and (orientation: portrait) {
    .landscape-hint {
        display: flex;
    }
}

.landscape-hint-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: rotateHint 2s ease-in-out infinite;
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

/* ========================================
   底部导航
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(20, 20, 40, 0.98), rgba(10, 10, 26, 0.98));
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: var(--accent-gold);
}

.nav-item:hover {
    color: var(--accent-gold);
    transform: translateY(-2px);
}

.nav-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.nav-text {
    font-size: 11px;
    font-weight: 500;
}

/* ========================================
   页面容器
   ======================================== */
.page-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: var(--bg-primary);
    overflow-y: auto;
    z-index: 200;
}

/* 福利页面 */
.welfare-content {
    padding: 40px 20px;
    text-align: center;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welfare-header {
    margin-bottom: 40px;
}

.welfare-header h2 {
    font-size: 28px;
    color: var(--accent-gold);
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.welfare-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.welfare-card {
    background: linear-gradient(135deg, rgba(30, 30, 58, 0.8), rgba(20, 20, 40, 0.8));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.welfare-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.welfare-card h3 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.welfare-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 我的页面 */
.profile-content {
    padding: 20px;
    min-height: 100%;
}

.profile-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(30, 30, 58, 0.6), rgba(20, 20, 40, 0.6));
    border-radius: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.profile-avatar {
    font-size: 64px;
    margin-bottom: 15px;
}

.profile-header h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.profile-menu {
    background: rgba(30, 30, 58, 0.4);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(255, 215, 0, 0.05);
}

.menu-icon {
    font-size: 20px;
    margin-right: 15px;
}

.menu-text {
    flex: 1;
    text-align: left;
    font-size: 15px;
}

.menu-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

/* 游戏容器调整 */
.game-container {
    padding-bottom: 60px;
}

/* 适配底部导航 */
@media (max-width: 768px) {
    .bottom-nav {
        height: 55px;
    }
    
    .page-container {
        bottom: 55px;
    }
    
    .game-container {
        padding-bottom: 55px;
    }
    
    .nav-text {
        font-size: 10px;
    }
    
    .nav-icon {
        width: 22px;
        height: 22px;
    }
}
