/* ========== 自定义字体 ========== */
@font-face {
    font-family: 'MiSans';
    src: url('../fonts/MiSans-Heavy.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+2F00-2FDF, U+2E80-2EFF, U+3000-303F, U+FF00-FFEF;
}

@font-face {
    font-family: 'MiSans';
    src: url('../fonts/MiSansLatin-Heavy.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    unicode-range: U+0020-007F, U+00A0-00FF, U+0100-024F, U+0250-02AF, U+0300-036F;
}

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MiSans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow: hidden;
    position: relative;
}

/* 背景光晕 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.02) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 80%, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 6s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.container {
    width: 100%;
    max-width: 960px;
    padding: 40px 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.title {
    font-size: 42px;
    font-weight: 300;
    margin-bottom: 8px;
    letter-spacing: 8px;
    color: #fff;
    text-shadow: 0 0 40px rgba(255,255,255,0.3), 0 0 80px rgba(255,255,255,0.1);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 30px rgba(255,255,255,0.2), 0 0 60px rgba(255,255,255,0.05); }
    100% { text-shadow: 0 0 50px rgba(255,255,255,0.4), 0 0 100px rgba(255,255,255,0.15); }
}

.subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 40px;
    letter-spacing: 3px;
    font-weight: 300;
}

/* ========== 横向轮盘 ========== */
.roulette-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 36px;
}

.roulette-track {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    height: 160px;
    box-shadow: inset 0 0 60px rgba(255,255,255,0.02);
}

.roulette-strip {
    display: flex;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    will-change: left;
}

.prize-slot {
    flex-shrink: 0;
    width: 130px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.prize-slot.active {
    transform: scale(1.1);
    z-index: 2;
    background: rgba(255,255,255,0.08) !important;
    box-shadow: 0 0 30px rgba(255,255,255,0.15), 0 0 60px rgba(255,255,255,0.05);
}

/* 空闲滚动时 active 效果更柔和 */
.roulette-strip.idle-scroll .prize-slot.active {
    transform: scale(1.04);
    background: rgba(255,255,255,0.05) !important;
    box-shadow: 0 0 20px rgba(255,255,255,0.08), 0 0 40px rgba(255,255,255,0.02);
}

.prize-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 6px;
    filter: grayscale(30%);
    transition: filter 0.3s;
}

.prize-slot img {
    margin-bottom: 6px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    padding: 2px;
}

.prize-slot.active .prize-icon {
    filter: grayscale(0%);
    animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.prize-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    color: rgba(255,255,255,0.7);
    transition: color 0.3s;
}

.prize-slot.active .prize-name {
    color: #fff;
}

/* 指针线 */
.pointer {
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    z-index: 10;
    pointer-events: none;
}

.pointer::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 16px solid #fff;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.9)) drop-shadow(0 0 24px rgba(255,255,255,0.5));
    animation: pointerPulse 1.5s ease-in-out infinite alternate;
}

@keyframes pointerPulse {
    0% { filter: drop-shadow(0 0 8px rgba(255,255,255,0.6)) drop-shadow(0 0 16px rgba(255,255,255,0.3)); }
    100% { filter: drop-shadow(0 0 16px rgba(255,255,255,1)) drop-shadow(0 0 32px rgba(255,255,255,0.7)); }
}

.pointer::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #fff, transparent);
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.8));
}

/* ========== 按钮 ========== */
.btn-wrap {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 52px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    letter-spacing: 4px;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    position: relative;
    overflow: hidden;
}

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

.btn-draw {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px rgba(255,255,255,0.25), 0 0 40px rgba(255,255,255,0.1);
}

.btn-draw:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255,255,255,0.4), 0 0 60px rgba(255,255,255,0.2), 0 10px 30px rgba(255,255,255,0.1);
}

.btn-draw:active:not(:disabled) {
    transform: translateY(0);
}

/* 按钮光晕扫描 */
.btn-draw::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-draw:hover:not(:disabled)::after {
    opacity: 1;
    animation: btnShine 1.5s ease-in-out infinite;
}

@keyframes btnShine {
    0% { transform: translate(-30%, -30%) scale(0.8); }
    50% { transform: translate(10%, 10%) scale(1.2); }
    100% { transform: translate(-30%, -30%) scale(0.8); }
}

.btn-history {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-history:hover:not(:disabled) {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
    color: #fff;
}

.btn-stock {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 15px;
    padding: 14px 32px;
}

.btn-stock:hover:not(:disabled) {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
    color: #fff;
}

.btn-card {
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 14px;
    padding: 13px 28px;
}

.btn-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
    box-shadow: 0 0 15px rgba(255,255,255,0.08);
}

/* ========== 结果弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.modal {
    background: #0a0a0a;
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 60px rgba(255,255,255,0.08), 0 0 120px rgba(255,255,255,0.03);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-icon {
    font-size: 72px;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
    animation: floatIcon 2s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.modal-title {
    font-size: 16px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    letter-spacing: 4px;
    font-weight: 300;
}

.modal-prize {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
    letter-spacing: 2px;
}

.modal-detail {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    word-break: break-all;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.modal-close {
    padding: 12px 40px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

/* ========== 验证弹窗 ========== */
.verify-modal {
    max-width: 420px;
}

.verify-title {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: 4px;
}

.verify-hint {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.verify-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
    color: #fff;
    font-size: 15px;
    text-align: center;
    outline: none;
    margin-bottom: 8px;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.verify-input:focus {
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 20px rgba(255,255,255,0.08);
}

.verify-input::placeholder {
    color: rgba(255,255,255,0.2);
}

.verify-error {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 4px;
}

.verify-btns {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.verify-cancel {
    flex: 1;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    padding: 11px 0;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.verify-cancel:hover {
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
}

.verify-submit {
    flex: 2;
    background: #fff;
    color: #000;
    font-size: 14px;
    padding: 11px 0;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    letter-spacing: 2px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(255,255,255,0.15);
}

.verify-submit:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(255,255,255,0.25);
}

.verify-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Turnstile 在验证弹窗内 */
#turnstileWidget iframe {
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

/* ========== 记录面板 ========== */
.record-panel {
    display: none;
    position: fixed;
    top: 30px;
    right: 20px;
    bottom: 30px;
    width: 300px;
    background: rgba(0,0,0,0.92);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    z-index: 99;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    box-shadow: 0 0 40px rgba(255,255,255,0.04);
}

.record-panel.show {
    display: flex;
    animation: slideIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.record-header {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.record-header h3 {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.6);
}

.record-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.record-close:hover {
    color: #fff;
}

.record-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px;
}

.record-list::-webkit-scrollbar {
    width: 3px;
}

.record-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
    animation: recordFade 0.4s ease;
}

@keyframes recordFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.record-item .r-name {
    color: rgba(255,255,255,0.8);
    font-weight: 400;
    letter-spacing: 1px;
}

.record-item .r-time {
    color: rgba(255,255,255,0.25);
    font-size: 11px;
}

.empty-text {
    text-align: center;
    color: rgba(255,255,255,0.25);
    padding: 40px 0;
    font-size: 13px;
    letter-spacing: 1px;
}

/* ========== 库存面板（左侧滑入） ========== */
.stock-panel {
    display: none;
    position: fixed;
    top: 30px;
    left: 20px;
    bottom: 30px;
    width: 300px;
    background: rgba(0,0,0,0.92);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    z-index: 99;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    box-shadow: 0 0 40px rgba(255,255,255,0.04);
}

.stock-panel.show {
    display: flex;
    animation: slideInLeft 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.stock-header {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.stock-header h3 {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.6);
}

.stock-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.stock-close:hover {
    color: #fff;
}

.stock-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px;
}

.stock-list::-webkit-scrollbar {
    width: 3px;
}

.stock-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}

.stock-item .s-name {
    color: rgba(255,255,255,0.8);
    font-weight: 400;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-item .s-name .s-icon {
    font-size: 22px;
    width: 28px;
    text-align: center;
}

.stock-item .s-count {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.05);
    padding: 3px 12px;
    border-radius: 20px;
    flex-shrink: 0;
}

.stock-item .s-count.low {
    color: #ff7875;
    background: rgba(255,77,79,0.1);
}

/* ========== 撒花 ========== */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(-100px) rotate(0deg) scale(1); opacity: 0.9; }
    50% { opacity: 0.7; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.3); opacity: 0; }
}

/* ========== 水印 ========== */
.watermark {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 3px;
    font-weight: 400;
    z-index: 1;
    pointer-events: none;
    text-shadow: 0 0 12px rgba(255,255,255,0.5), 0 0 30px rgba(255,255,255,0.2);
    white-space: nowrap;
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .title { font-size: 28px; letter-spacing: 5px; }
    .subtitle { font-size: 12px; margin-bottom: 28px; }
    .roulette-track { height: 110px; }
    .prize-slot { width: 90px; }
    .prize-icon { font-size: 28px; }
    .prize-name { font-size: 11px; max-width: 80px; }
    .btn { padding: 12px 32px; font-size: 14px; letter-spacing: 2px; }
    .record-panel { width: 260px; right: 5px; top: 15px; bottom: 15px; }
    .stock-panel { width: 260px; left: 5px; top: 15px; bottom: 15px; }
    .modal { padding: 35px 25px; }
    .modal-prize { font-size: 24px; }
    .watermark { font-size: 11px; letter-spacing: 1px; bottom: 10px; }
}
