* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.app-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.header h1 {
    color: #fff;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.coin-display {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(10px);
}

.coin-icon {
    font-size: 18px;
}

#coinCount {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

/* 游戏区 */
.game-area {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.lottery-card {
    position: relative;
    width: 300px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.result-overlay.show {
    opacity: 1;
}

.prize-amount {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.prize-text {
    color: #fff;
    font-size: 14px;
    margin-top: 5px;
}

.game-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.cost-info {
    margin-top: 8px;
}

.cost {
    color: #f5576c;
    font-weight: bold;
    font-size: 16px;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245,87,108,0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,87,108,0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.3);
}

.btn-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 18px;
}

/* 历史记录 */
.history-section {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.history-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.history-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-item:last-child {
    border-bottom: none;
}

.history-item.empty {
    color: #999;
    justify-content: center;
}

.history-prize {
    font-weight: bold;
}

.history-prize.win {
    color: #f5576c;
}

.history-prize.lose {
    color: #999;
}

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

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 12px;
    gap: 4px;
    transition: color 0.3s;
}

.nav-item.active {
    color: #f5576c;
}

.nav-icon {
    font-size: 20px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    animation: scaleIn 0.3s;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header h2 {
    color: #f5576c;
    margin-bottom: 20px;
}

.win-amount {
    font-size: 48px;
    font-weight: bold;
    color: #f5576c;
    margin: 20px 0;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.modal-body p {
    color: #666;
    margin-bottom: 20px;
}

.modal-footer .btn {
    width: 100%;
}

/* 响应式 */
@media (max-width: 360px) {
    .lottery-card {
        width: 260px;
        height: 130px;
    }
    
    .header h1 {
        font-size: 20px;
    }
}
