/* 翻翻乐主容器 */
.zibll-ffl-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 头部区域 */
.ffl-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ffl-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    text-align: center;
    letter-spacing: 2px;
}

.ffl-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ffl-plays {
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
}

.ffl-plays span {
    font-size: 22px;
    font-weight: bold;
}

.ffl-rules-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    padding: 8px 20px;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.ffl-rules-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* 倒计时区域 */
.ffl-countdown-area {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border-radius: 20px;
    padding: 25px 15px;
    margin-bottom: 30px;
    text-align: center;
}

.ffl-countdown-title {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

/* 倒计时容器 - 强制一行显示，自动缩放 */
.ffl-countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    white-space: nowrap;
}

/* 每个时间块 */
.ffl-countdown-timer > span {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    display: inline-block;
    font-weight: bold;
    color: white;
    text-align: center;
}

/* 时间数字 */
.ffl-countdown-timer .ffl-days,
.ffl-countdown-timer .ffl-hours,
.ffl-countdown-timer .ffl-minutes,
.ffl-countdown-timer .ffl-seconds {
    padding: 8px 12px;
    min-width: 70px;
    font-size: 36px;
}

/* 单位文字（天、时、分、秒） */
.ffl-countdown-timer .ffl-unit {
    padding: 0 4px;
    font-size: 20px;
    font-weight: normal;
}

/* 默认桌面端样式 */
@media (min-width: 1025px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 10px 16px;
        min-width: 80px;
        font-size: 40px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 22px;
        padding: 0 8px;
    }
}

/* 平板端 */
@media (max-width: 1024px) and (min-width: 769px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 8px 12px;
        min-width: 65px;
        font-size: 32px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 18px;
        padding: 0 6px;
    }
}

/* 移动端 - 逐步缩放 */
@media (max-width: 768px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 6px 10px;
        min-width: 55px;
        font-size: 24px;
        border-radius: 8px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 16px;
        padding: 0 3px;
    }
}

@media (max-width: 600px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 5px 8px;
        min-width: 48px;
        font-size: 20px;
        border-radius: 8px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 14px;
        padding: 0 2px;
    }
}

@media (max-width: 500px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 4px 6px;
        min-width: 42px;
        font-size: 16px;
        border-radius: 6px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 12px;
        padding: 0 2px;
    }
}

@media (max-width: 420px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 3px 5px;
        min-width: 36px;
        font-size: 14px;
        border-radius: 5px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 10px;
        padding: 0 1px;
    }
}

@media (max-width: 360px) {
    .ffl-countdown-timer .ffl-days,
    .ffl-countdown-timer .ffl-hours,
    .ffl-countdown-timer .ffl-minutes,
    .ffl-countdown-timer .ffl-seconds {
        padding: 2px 4px;
        min-width: 32px;
        font-size: 12px;
        border-radius: 4px;
    }
    .ffl-countdown-timer .ffl-unit {
        font-size: 9px;
        padding: 0 1px;
    }
}

/* 游戏区域 */
.ffl-game-area {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 30px 20px;
}

/* 卡片网格 - 一行4个 */
.ffl-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* 卡片样式 */
.ffl-card {
    aspect-ratio: 1 / 1;
    cursor: pointer;
    perspective: 1000px;
}

.ffl-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 15px;
}

.ffl-card.flipped .ffl-card-inner {
    transform: rotateY(180deg);
}

.ffl-card-front,
.ffl-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 卡片正面（图案面） */
.ffl-card-front {
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    transform: rotateY(180deg);
}

/* 卡片背面（未翻开面） */
.ffl-card-back {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    transform: rotateY(0deg);
}

.ffl-card-pattern {
    font-size: 48px;
}

.ffl-card-back-pattern {
    font-size: 56px;
}

.ffl-card-front img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* 禁用卡片（次数用完） */
.ffl-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.ffl-card.disabled .ffl-card-back {
    background: #999;
}

/* 卡片已翻开（中奖效果） */
.ffl-card.won .ffl-card-front {
    background: linear-gradient(135deg, #f6d365, #fda085);
    animation: winPulse 0.5s ease;
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 提示弹窗 */
.ffl-result-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    animation: fadeInUp 0.3s ease;
}

.ffl-toast-content {
    background: white;
    border-radius: 20px;
    padding: 25px 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    min-width: 280px;
}

.ffl-toast-message {
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 加载遮罩 */
.ffl-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.ffl-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* 规则弹窗 */
.ffl-rules-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
}

.ffl-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.ffl-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.ffl-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px 20px 0 0;
}

.ffl-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.ffl-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}

.ffl-modal-close:hover {
    opacity: 1;
}

.ffl-modal-body {
    padding: 20px;
    line-height: 1.8;
    color: #333;
}

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

.ffl-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.ffl-modal-confirm {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    padding: 10px 30px;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.ffl-modal-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

/* 移动端卡片响应式 */
@media (max-width: 768px) {
    .zibll-ffl-container {
        padding: 10px;
    }
    
    .ffl-header {
        padding: 15px 20px;
    }
    
    .ffl-title {
        font-size: 22px;
    }
    
    .ffl-info {
        flex-direction: column;
        text-align: center;
    }
    
    .ffl-countdown-title {
        font-size: 16px;
    }
    
    /* 移动端卡片一行3个 */
    .ffl-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .ffl-card-pattern {
        font-size: 32px;
    }
    
    .ffl-toast-content {
        padding: 15px 25px;
    }
    
    .ffl-toast-message {
        font-size: 16px;
    }
}

/* 平板端卡片间隙调整 */
@media (min-width: 769px) and (max-width: 1024px) {
    .ffl-cards-grid {
        gap: 15px;
    }
    
    .ffl-card-pattern {
        font-size: 40px;
    }
}

/* 卡片hover效果（仅桌面端） */
@media (min-width: 769px) {
    .ffl-card:hover .ffl-card-back {
        transform: scale(1.02);
        transition: transform 0.2s;
    }
}

/* 中奖积分标记 */
.ffl-points-badge {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #ffd700;
    white-space: nowrap;
}

@media (max-width: 500px) {
    .ffl-points-badge {
        font-size: 10px;
        padding: 2px 8px;
        bottom: 5px;
    }
}