/*
 * Some general styling
 */

* {
    box-sizing: border-box;
}

:root {
    --item-height: 100px;
}

/*
 * Style the orange box
 */

.start-button {
    display: block;
    margin: 1em auto;
    background: linear-gradient(to bottom, #fcf8ad, #f8f3cd, #f9e13d);
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 6px 4px -5px #eca654 inset;
}

.start-button:hover {
    transform: translateY(-2px);
}

.start-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#slot-machine-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#slot-machine-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#slot-machine {
    background-color: #fd9b03;
  
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border-radius: 10px;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 新增：老虎机滚轮容器样式 */
#slot-reels {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* 三行滚动样式 */
.slot-reel {
    position: relative;
    width: 100px;
    height: 240px;
    overflow: hidden;
    display: inline-block;
    margin: 0 10px;
    border: 2px solid #333;
    border-radius: 5px;
    background: white;
}

.slot-reel::before,
.slot-reel::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.slot-reel::before {
    top: 0;
}

.slot-reel::after {
    bottom: 0;
}

/* 滚轮内颜色块的容器样式 - 更新以支持平滑动画 */
.reel-colors-container {
    transition: transform 0.6s ease-out;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 单个颜色块样式 - 添加视觉优化 */
.reel-color-patch {
    width: 100%;
    height: 80px; /* 三行高度240px/3=80px */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 0 3px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    border-radius: 2px;
    margin: 0; /* 去掉margin确保三行完全可见 */
    transition: all 0.2s ease;
}

.window {
    position: relative;
    overflow: hidden;
    height: calc(3 * var(--item-height));
}

.window::before {
    content: "";
    clear: both;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

.window::after {
    content: "";
    clear: both;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4));
}

.window-border {
    padding: 5px;
    background-image: linear-gradient(to bottom, #fcf8ad, #f8f3cd, #f9e13d);
    box-shadow: 0 6px 4px -5px #eca654 inset;
}

/*
 * Reels and icon styling
 */

.icon {
    width: 80px;
    height: var(--item-height);
    display: block;
    position: relative;
}

.outer-col {
    overflow-y: hidden;
    width: 100px;
    float: left;
    background-color: #eee;
    background-image: linear-gradient(#16013c, #741a5e, #430155, #16013c);
    height: calc(var(--item-height) * 3);
}

.outer-spacer {
    width: 8px;
    height: 100%;
    float: left;
    border-right: 2px solid #f7ce6c38;
    background-image: linear-gradient(#be4d01, #893802);
}

.col {
    padding: 0 10px;
    will-change: transform;
    transform: translateY(calc(-100% + var(--item-height) * 3));
}

/* shadow effect behind the items */
.col .icon::after {
    content: "";
    clear: both;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    background-color: white;
    box-shadow: 0 0 35px 30px rgba(12, 0, 14, 0.69);
    z-index: 2;
    border-radius: 100%;
}

/*
 * Spinning animation
 */

#slot-machine.spinning .outer-col:nth-of-type(2) .col {
    animation-delay: 0.01s;
}

#slot-machine.spinning .outer-col:nth-of-type(3) .col {
    animation-delay: 0.02s;
}

#slot-machine.spinning .outer-col:nth-of-type(4) .col {
    animation-delay: 0.03s;
}

#slot-machine.spinning .col {
    animation-name: scroll;
    animation-iteration-count: 1;
    animation-timing-function: cubic-bezier(.65, .97, .72, 1);
}

@keyframes scroll {
    to {
        transform: translateY(0);
    }
}
