/**
 * 翻牌器组件样式
 * 实现机场翻牌效果的样式定义
 */

/* 翻牌器容器样式 */
.flipboard-container {
    display: flex; /* 保持 flex 布局 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: transparent; /* 恢复为透明，因为辉光容器会紧贴 */
    color: #fff; 
    font-family: "黑体", SimHei, "Microsoft YaHei", sans-serif; 
    font-weight: 900; 
    /* border-radius: 2px; */ /* 背景透明后圆角无意义 */
    /* padding: 2px 4px; */ /* 移除内边距 */
    padding: 0px; /* 修改：设置内边距为0 */
    /* margin: 25px auto; */ /* 移除：外层容器将处理边距和居中 */
    box-shadow: none; /* 修改：移除阴影 */
    border: none; /* 确保无边框 */
    width: fit-content; /* 修改：让容器宽度自适应内容，消除因justify-content:center产生的侧边空白 */
    /* min-width: 280px; */ /* 移除 min-width */
    position: relative;
    --flip-element-height: 65px; 
    border-radius: 8px; /* 新增：与外部辉光容器匹配的圆角 */
    overflow: hidden; /* 新增：裁剪内部内容以适应圆角 */
}

/* 翻牌器行样式 */
.flipboard-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; 
    height: var(--flip-element-height);
    position: relative;
    flex-direction: row;
    flex-wrap: nowrap; 
    /* margin-left: -1px; */ /* 移除：负margin方案无效 */
    /* margin-right: -1px; */ /* 移除：负margin方案无效 */
}

/* 翻牌区域样式 */
.flipboard-section {
    display: inline-flex; 
    justify-content: center;
    align-items: center;
    height: 100%;
    white-space: nowrap; 
}

/* 翻牌元素基础样式 */
.flip-element {
    height: var(--flip-element-height); 
    perspective: 1000px;
    margin: 0 1px; /* 恢复牌面间1px的水平间距 */
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.7); 
    border-radius: 3px; 
    background-color: #333; 
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); 
    display: inline-block; 
    vertical-align: top; 
    min-width: 10px; 
}

/* 移除最外侧翻牌元素的 margin 和特定方向的 border */
.flipboard-row > .flipboard-section:first-of-type > .flip-element:first-child {
    margin-left: 0;
    border-left: none; /* 移除第一个元素的左边框 */
}

.flipboard-row > .flipboard-section:last-of-type > .flip-element:last-child {
    margin-right: 0;
    border-right: none; /* 移除最后一个元素的右边框 */
}

/* 彩种类型的翻牌元素样式调整 */
/* .flipboard-section.lottery-type .flip-element { */
    /* width: 48px;  */ /* 移除特定宽度，让其使用 .text 的宽度 */
/* } */

/* 数字类型的翻牌元素样式 */
.flip-element.number {
    /* width: 45px; */ /* 原宽度 */
    /* width: 42px; */ /* 上次修改宽度 */
    /* width: 44px; */ /* 上上次修改宽度 */
    width: 45px; /* 修改：再增加1px宽度 */
    font-weight: 900;
    font-size: 34px; /* 字体大小不变 */
}

/* 文本类型的翻牌元素样式 (如生肖、彩种名称) */
.flip-element.text {
    /* width: 50px; */ /* 原宽度 */
    /* width: 47px; */ /* 上次修改宽度 */
    /* width: 48px; */ /* 上上次修改宽度 */
    width: 49px; /* 修改：再增加1px宽度 */
    font-weight: 900;
    font-size: 34px; /* 字体大小不变 */
}

/* 间隔符类型的翻牌元素样式 - 移除 */
/* 
.flip-element.spacer {
    width: 20px; 
    background-color: transparent; 
    border: none; 
    box-shadow: none; 
}
*/

/* 翻牌卡片样式 */
.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border-radius: 3px; 
    background: transparent; 
}

/* 翻牌前面样式 */
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 3px; 
    overflow: hidden;
}

/* 翻牌背面样式 - 用于翻转动画 */
.flip-card-back {
    transform: rotateX(180deg);
}

/* 上半部分文本样式 */
.upper-text {
    position: absolute;
    top: 0;
    width: 100%;
    height: calc(50% - 0.5px);
    display: flex;
    justify-content: center;
    font-weight: 900; 
    overflow: hidden;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background: linear-gradient(to bottom, #383838, #282828); 
}

.upper-text span {
    display: block; 
    line-height: var(--flip-element-height);
    transform: scale(1.1, 1.2);
}

/* 下半部分文本样式 */
.lower-text {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: calc(50% - 0.5px);
    display: flex;
    justify-content: center;
    font-weight: 900; 
    overflow: hidden;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    background: linear-gradient(to top, #383838, #282828); 
}

.lower-text span {
    display: block; 
    transform: translateY(-50%) scale(1.1, 1.2);
}

/* 空白牌面样式 - 移除空的规则块以消除IDE提示 */
/* 
.flip-element.blank {
    // .blank 元素会自动继承其类型（number或text）的宽度 
    // 无需特殊设置宽度，但要确保其内容透明 
}
*/

.flip-element.blank .upper-text span,
.flip-element.blank .lower-text span {
    color: transparent;
}

/* 悬停效果 */
.flip-element:hover {
    border-color: rgba(100, 100, 100, 0.8); 
    background-color: #333; 
}

/* 中间分隔线效果 */
.flip-element::after {
    content: '';
    position: absolute;
    width: 100%; 
    height: 1px;
    background-color: rgba(0, 0, 0, 0.8); 
    top: 50%;
    left: 0; 
    transform: translateY(-50%); 
    z-index: 2;
}

/* 响应式样式调整 - 多断点适配，避免滚动条 */

/* 大桌面屏幕 - 1400px以上 - 保持默认尺寸 */
/* 默认：number: 45px, text: 49px, height: 65px, font: 34px */

/* 中大屏幕 - 1300-1399px - 轻微缩小 */
@media (max-width: 1399px) {
    .flipboard-container {
        --flip-element-height: 60px;
    }
    
    .flip-element.number {
        width: 42px;
        font-size: 32px;
    }
    
    .flip-element.text {
        width: 46px;
        font-size: 32px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 中大屏幕 - 1200-1299px - 进一步缩小 */
@media (max-width: 1299px) {
    .flipboard-container {
        --flip-element-height: 58px;
    }
    
    .flip-element.number {
        width: 40px;
        font-size: 31px;
    }
    
    .flip-element.text {
        width: 44px;
        font-size: 31px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 中屏幕 - 1000-1199px - 中度缩小 */
@media (max-width: 1199px) {
    .flipboard-container {
        --flip-element-height: 55px;
    }
    
    .flip-element.number {
        width: 38px;
        font-size: 29px;
    }
    
    .flip-element.text {
        width: 42px;
        font-size: 29px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 小桌面/平板横屏 - 800-999px - 显著缩小 */
@media (max-width: 999px) {
    .flipboard-container {
        --flip-element-height: 50px;
    }
    
    .flip-element.number {
        width: 36px;
        font-size: 28px;
    }
    
    .flip-element.text {
        width: 40px;
        font-size: 28px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 平板竖屏 - 600-799px - 大幅缩小 */
@media (max-width: 799px) {
    .flipboard-container {
        --flip-element-height: 45px;
    }
    
    .flip-element.number {
        width: 33px;
        font-size: 26px;
    }
    
    .flip-element.text {
        width: 37px;
        font-size: 26px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 大手机横屏/小平板 - 480-599px - 进一步缩小 */
@media (max-width: 599px) {
    .flipboard-container {
        --flip-element-height: 40px;
    }
    
    .flip-element.number {
        width: 30px;
        font-size: 24px;
    }
    
    .flip-element.text {
        width: 34px;
        font-size: 24px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 手机屏幕 - 360-479px - 大幅缩小 */
@media (max-width: 479px) {
    .flipboard-container {
        --flip-element-height: 35px;
    }
    
    .flip-element.number {
        width: 27px;
        font-size: 22px;
    }
    
    .flip-element.text {
        width: 31px;
        font-size: 22px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 小手机屏幕 - 320-359px - 最小尺寸 */
@media (max-width: 359px) {
    .flipboard-container {
        --flip-element-height: 30px;
    }
    
    .flip-element.number {
        width: 24px;
        font-size: 20px;
    }
    
    .flip-element.text {
        width: 28px;
        font-size: 20px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
}

/* 超小屏幕 - 280px以下 - 极限缩小 */
@media (max-width: 279px) {
    .flipboard-container {
        --flip-element-height: 28px;
    }
    
    .flip-element.number {
        width: 22px;
        font-size: 18px;
    }
    
    .flip-element.text {
        width: 26px;
        font-size: 18px;
    }
    
    .flipboard-row {
        height: var(--flip-element-height);
    }
} 