/* Rewards page: daily wheel, reward chests, points shop */
.rw {
  --seg-gold: #eab308; --seg-purple: #7c3aed; --seg-blue: #2563eb; --seg-grey: #334155; --seg-none: #1e293b;
  --tier-gold: #facc15; --tier-purple: #a78bfa; --tier-blue: #60a5fa; --tier-grey: #cbd5e1;
}
.rw .tier-gold { color: var(--tier-gold); } .rw .tier-purple { color: var(--tier-purple); }
.rw .tier-blue { color: var(--tier-blue); } .rw .tier-grey, .rw .tier-none { color: var(--tier-grey); }
.tier-bg-gold   { background: linear-gradient(160deg, rgba(234,179,8,.38), rgba(234,179,8,.08)); border-color: rgba(234,179,8,.7) !important; box-shadow: 0 0 14px rgba(234,179,8,.22); }
.tier-bg-purple { background: linear-gradient(160deg, rgba(124,58,237,.38), rgba(124,58,237,.08)); border-color: rgba(167,139,250,.65) !important; box-shadow: 0 0 10px rgba(124,58,237,.18); }
.tier-bg-blue   { background: linear-gradient(160deg, rgba(37,99,235,.32), rgba(37,99,235,.07)); border-color: rgba(96,165,250,.5) !important; }
.tier-bg-grey   { background: linear-gradient(160deg, rgba(148,163,184,.14), rgba(148,163,184,.03)); }
/* Extra sparkle on rare prize tiles */
.rw-prize-rare .rw-icon { filter: drop-shadow(0 0 6px currentColor); animation: rwRarePulse 2.4s ease-in-out infinite; }
@keyframes rwRarePulse { 0%,100% { opacity: 1; } 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .rw-prize-rare .rw-icon { animation: none; } }

.rw-points { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 16px; border: 1px solid var(--accent-border);
  background: var(--accent-soft); border-radius: 999px; font-size: 15px; }
.rw-points a { color: var(--gold); font-weight: 600; }
.rw-coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fde68a, #ca8a04); box-shadow: 0 0 6px rgba(234,179,8,.6); }
.rw-h2 { font-size: 22px; font-weight: 700; margin: 48px 0 16px; }
.rw-sub { margin: -8px 0 16px; font-size: 14px; }
.rw-small { font-size: 12px; margin-top: 12px; }
.rw-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }

/* Wheel */
.rw-wheel-panel + .rw-wheel-panel { margin-top: 20px; }
.rw-wheel-panel { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; justify-content: center; }
.rw-wheel-wrap { position: relative; width: min(340px, 82vw); aspect-ratio: 1; flex-shrink: 0; }
.rw-wheel { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #ca8a04; box-shadow: 0 0 0 4px #422006, 0 10px 40px rgba(0,0,0,.5), inset 0 0 30px rgba(0,0,0,.4);
  transition: transform 5s cubic-bezier(0.15, 0.85, 0.2, 1); overflow: hidden; }
.rw-seg { position: absolute; left: 50%; top: 0; width: 0; height: 50%; transform-origin: 0 100%; }
.rw-seg span { position: absolute; left: 0; top: 14px; transform: translateX(-50%); writing-mode: vertical-rl; text-orientation: mixed;
  font-size: 12px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.rw-seg.tier-gold span { color: #111827; text-shadow: none; }
.rw-pointer { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 2; width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #f8fafc; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.rw-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 35%, #fde68a, #ca8a04); color: #422006; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.rw-wheel-side { flex: 1; min-width: 260px; max-width: 420px; }
.rw-wheel-side h2 { font-size: 24px; margin-bottom: 8px; }
.rw-wheel-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.rw-wheel-btns .gc-buy { display: block; text-align: center; text-decoration: none; }
.rw-wheel-btns button:disabled { opacity: .5; cursor: not-allowed; }
.rw-result { min-height: 28px; margin-top: 16px; font-size: 18px; font-weight: 700; opacity: 0; transition: opacity .3s; }
.rw-result.show { opacity: 1; }
.rw-streak { margin-top: 12px; }
.rw-streak-dots { display: flex; gap: 6px; }
.rw-streak-dots span { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; border: 2px solid var(--seg-grey); color: var(--text-muted); }
.rw-streak-dots span.on { background: var(--seg-gold); border-color: var(--seg-gold); color: #111827; }
.rw-streak-dots span:last-child { border-color: var(--seg-gold); }
.rw-odds { margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.rw-odds summary { cursor: pointer; }
.rw-odds-title { margin: 10px 0 4px; font-weight: 600; color: var(--text); }
.rw-odds ul { list-style: none; }
.rw-odds li { display: flex; justify-content: space-between; padding: 2px 0; }

/* Chests */
.rw-chests { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.rw-chest { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
/* Gold Chest: all-GP, no Try Again — highlighted border + warm glow */
.rw-chest-gold { border-color: rgba(234,179,8,.55) !important; background: linear-gradient(180deg, rgba(234,179,8,.06) 0%, var(--bg-card) 60%); box-shadow: 0 0 24px rgba(234,179,8,.14); }
.rw-chest-gold .rw-chest-head h3 { color: var(--tier-gold); }
.rw-chest-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rw-chest-head h3 { font-size: 18px; }
.rw-cost { color: var(--gold); font-weight: 700; font-size: 14px; white-space: nowrap; }
.rw-badge-gp { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 999px; background: rgba(234,179,8,.18); border: 1px solid rgba(234,179,8,.5); color: var(--tier-gold); }
.rw-prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; flex: 1; }
.rw-prize, .rw-shop-item, .rw-tile { border: 1px solid var(--border); border-radius: var(--radius); text-align: center; padding: 10px 6px; }
.rw-icon { font-size: 28px; line-height: 1.2; }
.rw-plabel { font-size: 12px; font-weight: 600; margin-top: 4px; }
.rw-podds { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.rw-chest-btns { display: flex; gap: 8px; }
.rw-chest-btns .gc-buy { flex: 1; }
.rw-chest-btns .btn-secondary { padding: 0 14px; font-size: 13px; }
.rw-open:disabled { opacity: .5; cursor: not-allowed; }

/* Shop */
.rw-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.rw-shop-item { background: var(--bg-card); padding: 18px 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rw-shop-item .btn-secondary { width: 100%; font-size: 13px; }
.rw-shop-osrs { border-color: rgba(124,58,237,.35) !important; }
.rw-ge-price { font-size: 11px; color: var(--text-muted); }
.rw-in-game { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tier-purple); border: 1px solid rgba(124,58,237,.35); border-radius: 999px; padding: 2px 8px; }

/* Feed + how it works */
.rw-feed { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rw-feed-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.rw-feed-row:first-child { border-top: 0; }
.rw-how ol { margin-left: 20px; line-height: 1.9; }

/* Chest opening: one card window, items scroll through it like a slot reel */
.rw-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(2,6,23,.82); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rw-modal[hidden] { display: none; }
.rw-modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 380px; text-align: center; }
.rw-modal-title { font-size: 22px; font-weight: 800; color: var(--gold); margin-bottom: 18px; }
.rw-reel-card { width: 160px; height: 160px; margin: 0 auto; overflow: hidden; border-radius: 14px; border: 2px solid var(--border-hover);
  background: linear-gradient(180deg, #1c2742, #0f172a); box-shadow: inset 0 0 24px rgba(0,0,0,.6), 0 0 30px rgba(234,179,8,.12); position: relative; }
.rw-reel-card::before, .rw-reel-card::after { content: ''; position: absolute; left: 0; right: 0; height: 26px; z-index: 1; pointer-events: none; }
.rw-reel-card::before { top: 0; background: linear-gradient(#0f172a, transparent); }
.rw-reel-card::after { bottom: 0; background: linear-gradient(transparent, #0f172a); }
.rw-reel { will-change: transform; }
.rw-tile { height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 0; border: 0; }
.rw-tile .rw-icon { font-size: 64px; }
.rw-tile .rw-plabel { font-size: 14px; }
.rw-landed { animation: rwGlow 1.2s ease-in-out 2; }
@keyframes rwGlow { 50% { box-shadow: inset 0 0 40px rgba(250,204,21,.55); } }
.rw-won { min-height: 30px; margin: 18px 0 6px; font-size: 20px; font-weight: 800; opacity: 0; transform: scale(.9); transition: all .3s; }
.rw-won.show { opacity: 1; transform: none; }
.rw-modal-btns { display: flex; gap: 10px; margin-top: 12px; }
.rw-modal-btns > * { flex: 1; }
.rw-modal-btns button:disabled { opacity: .5; }

@media (max-width: 600px) {
  .rw-panel { padding: 20px 16px; }
  .rw-wheel-panel { gap: 24px; }
}

/* Level: OSRS-style XP bar and milestone chests */
.rw-level { margin-bottom: 20px; }
.rw-level-top { display: flex; gap: 18px; align-items: center; }
.rw-level-badge { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 35%, #fde68a, #ca8a04); color: #422006; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.rw-level-badge span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.rw-level-badge strong { font-size: 32px; line-height: 1; font-weight: 800; }
.rw-level-info { flex: 1; min-width: 0; }
.rw-level-xp { font-size: 15px; margin-bottom: 8px; }
.rw-level-xp a { color: var(--gold); font-weight: 600; }
.rw-xpbar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--border); overflow: hidden; }
.rw-xpbar div { height: 100%; background: linear-gradient(90deg, #ca8a04, #facc15); border-radius: 999px; transition: width .6s ease; }
.rw-level-chests { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 20px; }
.rw-lchest { background: var(--bg-card2, rgba(255,255,255,.03)); border: 1px solid var(--border); border-radius: 10px; padding: 10px 6px; color: var(--text); text-align: center; font: inherit; }
.rw-lchest-icon { font-size: 24px; }
.rw-lchest-lvl { font-size: 13px; font-weight: 700; margin-top: 4px; }
.rw-lchest-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-lchest.ready { border-color: var(--seg-gold); background: rgba(234,179,8,.12); cursor: pointer; animation: rwPulse 1.6s ease-in-out infinite; }
.rw-lchest.ready .rw-lchest-sub { color: var(--tier-gold); font-weight: 700; }
.rw-lchest.locked { opacity: .5; }
.rw-lchest:disabled { cursor: default; }
@keyframes rwPulse { 50% { box-shadow: 0 0 0 4px rgba(234,179,8,.18); } }
@media (prefers-reduced-motion: reduce) { .rw-lchest.ready { animation: none; } }
.rw-perk { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: rgba(39,174,96,.1); border: 1px solid rgba(39,174,96,.35); font-size: 14px; }
@media (max-width: 480px) { .rw-level-badge { width: 68px; height: 68px; } .rw-level-badge strong { font-size: 26px; } }
