/* =====================================================================
   SF 大轉盤 — 深色活動站
   ===================================================================== */
:root {
    --rl-bg: #0d0f14;
    --rl-card: #171a22;
    --rl-line: #2a2f3c;
    --rl-text: #e8eaf0;
    --rl-dim: #9aa1b0;
    --rl-primary: #2f7df6;
    --rl-primary-d: #1e63d0;
    --rl-danger: #d64545;
    --rl-gold: #f5b942;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: radial-gradient(1200px 500px at 50% -100px, #1c2333, var(--rl-bg));
    color: var(--rl-text);
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', -apple-system, sans-serif;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--rl-primary); text-decoration: none; }

/* ── Topbar ── */
.rl-top { height: 58px; display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--rl-line); background: rgba(13,15,20,.8); }
.rl-brand { font-size: 20px; font-weight: 800; color: var(--rl-text); letter-spacing: 1px; }
.rl-brand span { color: var(--rl-gold); }
.rl-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.rl-user { color: var(--rl-dim); font-size: 14px; }
.rl-login-btn { border: 1px solid var(--rl-primary); border-radius: 8px; padding: 6px 18px; color: var(--rl-primary); }
.rl-login-btn:hover { background: var(--rl-primary); color: #fff; }
.rl-logout-btn { border: 1px solid var(--rl-line); border-radius: 8px; padding: 5px 14px; color: var(--rl-dim); font-size: 13px; }
.rl-logout-btn:hover { border-color: var(--rl-danger); color: var(--rl-danger); }

/* ── Layout ── */
/* 1310 = 輪盤欄 640 + 間距 28 + 主圖原尺寸 600 + 左右 padding 40：寬螢幕主圖不被縮 */
.rl-wrap { max-width: 1310px; width: 100%; margin: 0 auto; padding: 26px 20px 40px; flex: 1; }
.rl-foot { text-align: center; color: #565d6b; font-size: 12.5px; padding: 20px; border-top: 1px solid var(--rl-line); }
.rl-page-title { font-size: 24px; margin: 4px 0 20px; }

/* ── 活動列表 ── */
.rl-event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.rl-event-card { background: var(--rl-card); border: 1px solid var(--rl-line); border-radius: 14px; padding: 22px; transition: .15s; }
.rl-event-card:hover { border-color: var(--rl-gold); transform: translateY(-2px); }
.rl-event-name { font-size: 18px; font-weight: 700; color: var(--rl-text); margin-bottom: 8px; }
.rl-event-date { color: var(--rl-dim); font-size: 13px; }
.rl-event-go { margin-top: 14px; color: var(--rl-gold); font-weight: 600; font-size: 14px; }
.rl-empty { color: var(--rl-dim); padding: 60px 0; text-align: center; grid-column: 1 / -1; }

/* ── 活動頁 ── */
.rl-event-head { text-align: center; margin-bottom: 20px; }
.rl-event-head h1 { font-size: 26px; margin: 0 0 6px; }
.rl-stage { display: grid; grid-template-columns: minmax(0, 640px) minmax(280px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 960px) { .rl-stage { grid-template-columns: 1fr; } }

.rl-wheel-col { text-align: center; }
.Roulette { display: inline-block; max-width: 100%; }
.Roulette-message { min-height: 30px; margin-top: 12px; font-size: 16px; }
.rl-msg-err { color: #ff7b7b; }
.rl-msg-win { color: var(--rl-gold); }
.Roulette-button { margin-top: 8px; }

.rl-side-col .rl-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.rl-side-col .rl-actions .rl-btn { flex: 1; padding-left: 8px; padding-right: 8px; white-space: nowrap; text-align: center; }
.rl-side-col .rl-actions-coins { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.rl-side-col .rl-actions-coins .rl-coin-chip { flex: 1; text-align: center; }
.rl-coin-chip { background: var(--rl-card); border: 1px solid var(--rl-line); border-radius: 999px; padding: 8px 16px; font-size: 14px; color: var(--rl-dim); }
.rl-coin-chip b { color: var(--rl-gold); font-size: 16px; }

/* 活動主圖（主視覺/獎品大圖） */
.rl-main-visual { width: 100%; border-radius: 12px; border: 1px solid var(--rl-line); margin-bottom: 14px; display: block; }

/* 獎品清單（取代舊站合成圖） */
.rl-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rl-prize { background: var(--rl-card); border: 1px solid var(--rl-line); border-radius: 10px; padding: 10px; text-align: center; }
.rl-prize img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #0d0f14; }
.rl-prize.noimg img { display: none; }
.rl-prize-name { font-size: 12px; color: var(--rl-dim); margin-top: 6px; line-height: 1.4; }

/* 規則 */
.rl-rules { margin-top: 34px; color: #c3cad4; font-size: 14px; line-height: 2; border-top: 1px solid var(--rl-line); padding-top: 18px; }
.rl-rules p { margin: 0; }

/* ── 按鈕 ── */
.rl-btn { display: inline-block; border: 1px solid var(--rl-line); background: var(--rl-card); color: var(--rl-text); border-radius: 9px; padding: 9px 20px; font-size: 15px; cursor: pointer; font-family: inherit; }
.rl-btn:hover { border-color: var(--rl-dim); }
.rl-btn-primary { background: var(--rl-primary); border-color: var(--rl-primary); color: #fff; font-weight: 700; }
.rl-btn-primary:hover { background: var(--rl-primary-d); }
.rl-btn-secondary { background: #3a3f4b; border-color: #3a3f4b; color: #9aa1b0; }
.rl-btn-danger { background: var(--rl-danger); border-color: var(--rl-danger); color: #fff; font-weight: 600; }
.rl-btn-lg { font-size: 18px; padding: 12px 44px; }
.rl-btn-block { display: block; width: 100%; margin-bottom: 10px; }
.rl-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Modal ── */
.rl-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 60; align-items: center; justify-content: center; padding: 20px; }
.rl-modal-box { background: #14161d; border: 1px solid var(--rl-line); border-radius: 14px; width: 440px; max-width: 100%; max-height: 86vh; overflow-y: auto; padding: 24px; text-align: center; scrollbar-width: none; }
.rl-modal-box::-webkit-scrollbar { display: none; }   /* 卷軸隱藏但仍可滾動（滾輪/觸控） */
/* 機率表彈窗加寬：圖原始 760px，440px 盒子會壓縮到模糊 */
#probModal .rl-modal-box { width: auto; min-width: 440px; max-width: min(92vw, 830px); }
.rl-modal-box h3 { margin: 0 0 16px; font-size: 19px; }
.rl-modal-box h4 { color: var(--rl-gold); }
#winBody h4 { font-size: 26px; font-weight: 800; margin: 4px 0 6px; }
#winBody img { max-width: 300px; width: 100%; margin: 10px 0 16px; }

/* 機率表 */
.rl-prob-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 14px; }
.rl-prob-table th, .rl-prob-table td { border: 1px solid var(--rl-line); padding: 7px 12px; }
.rl-prob-table th { background: #1b1f29; color: var(--rl-dim); font-weight: 600; }
.rl-prob-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* 抽獎紀錄 modal：彈窗加寬；卷軸細條深色且預先留位（載入更多後不擠壓內容） */
#recModal .rl-modal-box { width: 560px; }
.rl-rec-list { max-height: 52vh; overflow-y: auto; margin-bottom: 12px; text-align: left;
    scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #3a4150 transparent; }
.rl-rec-list::-webkit-scrollbar { width: 6px; }
.rl-rec-list::-webkit-scrollbar-thumb { background: #3a4150; border-radius: 3px; }
.rl-rec-list::-webkit-scrollbar-track { background: transparent; }
.rl-rec-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 4px; border-bottom: 1px solid var(--rl-line); font-size: 14px; }
.rl-rec-time { color: var(--rl-dim); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; }
.rl-rec-name { flex: 1; min-width: 0; }
.rl-rec-status { color: var(--rl-dim); white-space: nowrap; }
.rl-rec-status.ok { color: var(--rl-gold); }
.rl-rec-empty { color: var(--rl-dim); text-align: center; padding: 20px 0; margin: 0; }

/* 大獎特效：金框呼吸光暈（中獎彈窗）＋ 紀錄金色列 ＋ 彩帶 */
.rl-win-rare { border-color: var(--rl-gold) !important; animation: rl-rare-glow 1.6s ease-in-out infinite; }
.rl-win-rare h3 { color: var(--rl-gold); }
@keyframes rl-rare-glow {
    0%, 100% { box-shadow: 0 0 18px rgba(245, 197, 24, .45); }
    50%      { box-shadow: 0 0 42px rgba(245, 197, 24, .85); }
}
.rl-rec-row.rare { background: rgba(245, 197, 24, .08); }
.rl-rec-row.rare .rl-rec-name { color: var(--rl-gold); font-weight: 700; }
.rl-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.rl-confetti i { position: absolute; top: -20px; display: block; border-radius: 2px; opacity: .95; animation: rl-confetti-fall linear forwards; }
@keyframes rl-confetti-fall {
    to { transform: translateY(105vh) rotate(720deg); opacity: .7; }
}
