/* ============ shared page bits ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; font-size: 26px; }
.ph-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-actions .play-btn { height: 44px; padding: 0 18px; font-size: 14px; }
.sec-title { font-size: 18px; margin: 8px 0 -8px; }
.empty, .loading { padding: 40px; text-align: center; color: var(--muted); background: var(--bg-2); border-radius: 12px; font-weight: 600; }
.empty a { color: var(--blue-2); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; }
.back-link:hover { color: #fff; }
.link-btn { color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; margin-top: 4px; }
.ghost-btn { padding: 0 16px; }
.ghost-btn.sm, .btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.page-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 30px; border-radius: 16px; background: radial-gradient(circle at 85% 50%, #1f7bff55, transparent 55%), linear-gradient(135deg, #15284a, #0f1a2c);
}
.page-hero h1 { font-size: 36px; line-height: 1.05; margin: 10px 0; }
.page-hero p { color: var(--muted); max-width: 520px; line-height: 1.5; }
.page-hero img { width: 200px; filter: drop-shadow(0 18px 30px #0009); animation: float 4s ease-in-out infinite; }
.battles-hero { background: radial-gradient(circle at 85% 50%, #ff2e3f55, transparent 55%), linear-gradient(135deg, #3a1428, #0f1a2c); }

/* ============ item tiles ============ */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.itile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 28%, transparent), transparent 70%), var(--panel);
  box-shadow: inset 0 -3px 0 var(--rc), inset 0 0 0 1px #ffffff0c; text-align: center; transition: transform .15s;
}
.itile img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 6px 8px #0008); }
.itile.glint img { filter: drop-shadow(0 0 10px #c084fc) drop-shadow(0 6px 8px #0008); animation: glint 2s infinite; }
@keyframes glint { 50% { filter: drop-shadow(0 0 18px #e879f9) drop-shadow(0 6px 8px #0008); } }
.it-name { font-size: 12px; font-weight: 700; color: #d6e2f5; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; }
.it-val { font-size: 13px; color: var(--green); }
.it-chance { position: absolute; top: 6px; right: 8px; font-size: 10px; font-weight: 800; color: var(--muted); }
.itile.sel { box-shadow: inset 0 0 0 3px var(--blue), inset 0 -3px 0 var(--rc); transform: translateY(-3px); }
.item-grid.inv .itile { cursor: pointer; }
.itile.won { animation: wonPop .5s cubic-bezier(.2, 1.6, .4, 1); box-shadow: inset 0 0 0 3px var(--rc), 0 0 30px var(--rc); }
@keyframes wonPop { 50% { transform: scale(1.12); } }

/* ============ reel ============ */
.reels { display: flex; flex-direction: column; gap: 10px; }
.reel { position: relative; height: 170px; overflow: hidden; border-radius: 14px; background: #0a1322; box-shadow: inset 0 0 0 2px #ffffff0a, inset 0 0 40px #000a; }
.reel::before, .reel::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18%; z-index: 2; pointer-events: none; }
.reel::before { left: 0; background: linear-gradient(90deg, #0a1322, transparent); }
.reel::after { right: 0; background: linear-gradient(270deg, #0a1322, transparent); }
.reel-strip { display: flex; gap: 8px; padding: 13px 0; will-change: transform; }
.reel-strip .itile { flex: none; width: 128px; }
.reel-line { position: absolute; left: 50%; top: 6px; bottom: 6px; width: 3px; margin-left: -1.5px; background: var(--blue-2); border-radius: 3px; z-index: 3; box-shadow: 0 0 14px var(--blue-2); }
.reel-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-weight: 700; }

/* ============ cases ============ */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.case-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 14px 14px; border-radius: 16px;
  background: radial-gradient(circle at 50% 35%, var(--cc, #1f7bff44), transparent 65%), var(--panel); box-shadow: inset 0 0 0 1px #ffffff0d;
  transition: transform .18s, box-shadow .18s;
}
.case-card:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 2px var(--cc2, #1f7bff), 0 12px 30px #0007; }
.case-card > img { width: 78%; filter: drop-shadow(0 14px 18px #000a); transition: transform .25s; }
.case-card:hover > img { transform: rotate(-4deg) scale(1.06); }
.cc-name { font-weight: 800; font-size: 16px; }
.cc-top { display: flex; gap: 4px; }
.cc-top img { width: 28px; height: 28px; image-rendering: pixelated; object-fit: contain; }
.cc-price { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--bg); font-weight: 800; }
.cc-price .coin-dot { margin: 0; }
.c-wood { --cc: #c2771f55; --cc2: #e0a050; } .c-stone { --cc: #94a3b855; --cc2: #cbd5e1; } .c-nether { --cc: #ff2e3f55; --cc2: #ff5a68; }
.c-end { --cc: #a855f755; --cc2: #c084fc; } .c-spawner { --cc: #19d3c555; --cc2: #2dd4bf; } .c-donut { --cc: #1f7bff66; --cc2: #ff4fa8; }
.case-top { display: flex; align-items: center; gap: 30px; padding: 24px; border-radius: 16px; background: radial-gradient(circle at 20% 50%, var(--cc), transparent 60%), var(--panel); }
.case-big { width: 220px; filter: drop-shadow(0 18px 24px #000a); animation: float 4s ease-in-out infinite; }
.case-info { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.case-info h1 { font-size: 30px; }
.case-meta { display: flex; gap: 14px; color: var(--muted); font-weight: 600; font-size: 14px; }
.count-seg { max-width: 320px; }
.case-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.case-actions .play-btn { min-width: 240px; padding: 0 24px; }
.won-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border-radius: 14px; background: var(--panel); flex-wrap: wrap; animation: popIn2 .3s; }
.wb-items { display: flex; gap: 8px; flex-wrap: wrap; }
.wb-items .itile { width: 128px; }
.wb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.wb-actions .play-btn { height: 46px; padding: 0 18px; font-size: 14px; }
.wb-actions .ghost-btn { display: inline-flex; align-items: center; }
@keyframes popIn2 { from { transform: scale(.95); opacity: 0; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #c2d1ea; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* ============ battles ============ */
.battle-list { display: flex; flex-direction: column; gap: 10px; }
.bcard { display: grid; grid-template-columns: 110px 1fr auto 110px 100px; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--panel); }
.bcard.st-done { opacity: .6; }
.bcard.st-running { box-shadow: inset 3px 0 0 #ffc23d; }
.bcard.st-open { box-shadow: inset 3px 0 0 var(--green); }
.bc-mode { display: flex; flex-direction: column; } .bc-mode span { color: var(--muted); font-size: 13px; font-weight: 700; }
.bc-cases { display: flex; gap: 4px; align-items: center; overflow: hidden; }
.bc-cases img { width: 44px; height: 44px; object-fit: contain; }
.bc-cases span { color: var(--muted); font-weight: 700; font-size: 13px; }
.bc-seats { display: flex; gap: 4px; }
.seat { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--panel-2); }
.seat.p { background: var(--blue); } .seat.bot { background: #4b5563; } .seat.empty { border: 2px dashed var(--line); background: none; color: var(--muted); }
.bc-cost { display: flex; flex-direction: column; font-size: 13px; } .bc-cost b { font-size: 15px; }
.m-battle { width: min(720px, 100%); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 330px; overflow: auto; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 10px; background: var(--bg); text-align: center; font-size: 12px; font-weight: 700; }
.pick.on { box-shadow: inset 0 0 0 2px var(--blue); }
.pick img { width: 64px; } .pick b { color: var(--green); }
.pick-n { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.pick-n button { width: 26px; height: 26px; border-radius: 6px; background: var(--panel-2); font-weight: 800; }
.bt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bt-head h1 { font-size: 28px; }
.bt-pot { display: flex; flex-direction: column; align-items: flex-end; } .bt-pot b { font-size: 26px; color: var(--green); }
.bt-rounds { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.rnd { flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--panel); font-size: 12px; font-weight: 700; color: var(--muted); opacity: .6; }
.rnd img { width: 48px; } .rnd.done { opacity: 1; } .rnd.now { opacity: 1; box-shadow: inset 0 0 0 2px #ffc23d; color: #ffc23d; }
.bt-seats { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 10px; }
.seat-col { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--panel); min-width: 0; transition: box-shadow .3s, opacity .3s; }
.seat-col.team-a { box-shadow: inset 0 3px 0 var(--blue); } .seat-col.team-b { box-shadow: inset 0 3px 0 var(--red); }
.seat-col.winner { box-shadow: inset 0 0 0 3px var(--green), 0 0 30px #22e07a44; }
.seat-col.loser { opacity: .55; }
.seat-head { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.seat-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-av { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--blue); font-weight: 800; }
.s-av.bot { background: #4b5563; }
.bot-tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #4b5563; }
.s-tot { margin-left: auto; font-weight: 800; color: var(--green); }
.seat-empty { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; min-height: 200px; }
.vreel { height: 150px; }
.vreel .reel-strip .itile { width: 110px; }
.vreel .itile img { width: 52px; height: 52px; }
.seat-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; }
.seat-items .itile { padding: 6px 4px; } .seat-items .itile img { width: 36px; height: 36px; } .seat-items .it-name { font-size: 10px; min-height: 0; }
.seat-result { text-align: center; font-weight: 800; display: flex; flex-direction: column; gap: 2px; min-height: 24px; }
.seat-result .win { font-size: 18px; letter-spacing: .1em; }

/* ============ rewards ============ */
.reward-tabs { max-width: 480px; }
.rw-hero { position: relative; overflow: hidden; display: flex; align-items: center; min-height: 230px; padding: 30px; border-radius: 16px; background: var(--panel) right center / cover no-repeat; }
.rw-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #000c, #0007 45%, transparent 75%); }
.rw-hero > div { position: relative; max-width: 560px; }
.rw-hero h1 { font-size: 36px; margin: 10px 0; }
.rw-hero p { color: #dbe6f7; line-height: 1.5; }
.rw-hero.vip { background: radial-gradient(circle at 85% 40%, #ffc23d44, transparent 50%), linear-gradient(135deg, #2b2240, #0f1a2c); }
.rw-hero.vip::before { display: none; }
.race-cd { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #0008; font-weight: 700; }
.rw-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-radius: 14px; background: var(--panel); flex-wrap: wrap; }
.rw-card .play-btn { min-width: 260px; padding: 0 24px; }
.rb-amount { display: flex; flex-direction: column; } .rb-amount b { font-size: 34px; color: var(--green); }
.race-me b { font-size: 22px; }
.race-table tr.me td { background: #1f7bff22; }
.place { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); font-weight: 800; }
.place.p1 { background: #ffc23d; color: #3a2200; } .place.p2 { background: #cbd5e1; color: #1f2937; } .place.p3 { background: #d08a4a; color: #2a1200; }
.vip-bar { height: 12px; border-radius: 12px; background: #0008; overflow: hidden; margin-top: 18px; max-width: 520px; }
.vip-bar div { height: 100%; background: linear-gradient(90deg, #ffc23d, #ff6a3d); border-radius: 12px; }
.vip-bar-l { display: flex; justify-content: space-between; max-width: 520px; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.vip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.vip-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px; background: var(--panel); position: relative; }
.vip-card > i { font-size: 34px; }
.vip-card b { font-size: 18px; }
.vip-card ul { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 13px; color: #c2d1ea; }
.vip-card.got { box-shadow: inset 0 0 0 2px var(--green); }
.vip-card.next { box-shadow: inset 0 0 0 2px #ffc23d; }
.vip-card .vip-pill { position: absolute; top: 14px; right: 14px; }
.lv1 > i { color: #d08a4a; } .lv2 > i { color: #cbd5e1; } .lv3 > i { color: #ffc23d; } .lv4 > i { color: #7dd3fc; } .lv5 > i { color: #67e8f9; } .lv6 > i { color: #ff4fa8; }
.vip-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #ffc23d22; color: #ffc23d; font-size: 11px; font-weight: 800; }

/* ============ admin ============ */
.admin-tabs { max-width: 720px; overflow-x: auto; }
.admin-body { display: flex; flex-direction: column; gap: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.stat-grid.sm { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: var(--panel); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { font-size: 20px; } .stat small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.good b { color: var(--green); } .stat.bad b { color: #ff6b78; } .stat.warn b { color: #ffc23d; }
.admin-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-bar .input-group { flex: 1; min-width: 160px; height: 42px; }
.admin-bar.seg { max-width: 100%; overflow-x: auto; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.st { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; background: var(--panel-2); text-transform: capitalize; }
.st.pending, .st.review { background: #ffc23d22; color: #ffc23d; } .st.approved, .st.sending { background: #1f7bff22; color: #7cc4ff; }
.st.sent { background: #22e07a22; color: var(--green); } .st.rejected, .st.failed { background: #ff2e3f22; color: #ff6b78; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.set { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--panel); }
.set.wide { grid-column: 1 / -1; }
.set > span { display: flex; flex-direction: column; gap: 2px; } .set small { color: var(--muted); font-size: 12px; }
.inp-box { width: 100%; padding: 10px; border-radius: 8px; border: 2px solid var(--line); background: var(--bg); color: var(--text); font: 600 14px 'Outfit', sans-serif; outline: 0; }
textarea.inp-box { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.inp-box:focus { border-color: var(--blue); }
.bot-log { padding: 14px; border-radius: 12px; background: #050a14; color: #9fb4d6; font-size: 12px; max-height: 340px; overflow: auto; white-space: pre-wrap; }
.tx-list { display: flex; flex-direction: column; max-height: 360px; overflow: auto; border-radius: 10px; background: var(--bg-2); }
.tx-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 8px; padding: 9px 12px; font-size: 13px; align-items: center; }
.tx-row:nth-child(odd) { background: #ffffff05; }
.tx-type { font-weight: 800; text-transform: capitalize; }
.tx-row .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .bcard { grid-template-columns: 1fr auto; } .bc-cases { grid-column: 1 / -1; order: 3; } .bc-cost { order: 4; } .bcard .btn { order: 5; }
  .bt-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-top { flex-direction: column; text-align: center; } .case-info { align-items: center; } .case-big { width: 170px; }
}
@media (max-width: 640px) {
  .page-hero { flex-direction: column-reverse; align-items: flex-start; padding: 20px; } .page-hero img { width: 120px; align-self: center; } .page-hero h1 { font-size: 28px; }
  .rw-hero { padding: 20px; } .rw-hero h1 { font-size: 28px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .itile img { width: 48px; height: 48px; }
  .reel-strip .itile { width: 104px; }
  .stat-grid.sm { grid-template-columns: repeat(2, 1fr); }
  .case-actions .play-btn, .rw-card .play-btn { min-width: 0; width: 100%; }
}
.seat-col.winner .vreel, .seat-col.loser .vreel { display: none; }

/* gentle float (the old 'bob' moved things by half their own height) */
@keyframes float { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.case-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.case-tools .search { flex: 1; min-width: 220px; }
.price-seg { flex: none; }
.price-seg button { padding: 0 14px; font-size: 13px; }
.sort-sel { width: auto; height: 46px; }
@media (max-width: 640px) { .price-seg { width: 100%; overflow-x: auto; } .sort-sel { width: 100%; } }
.aff-hero { background: radial-gradient(circle at 85% 50%, #22e07a44, transparent 55%), linear-gradient(135deg, #14382a, #0f1a2c); }
.aff-grid { display: flex; flex-direction: column; gap: 12px; }
.aff-code { align-items: flex-end; }
.aff-code .cmd { font-size: 13px; padding: 11px 14px; }
.aff-code .cmd code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aff-stats { grid-template-columns: repeat(4, 1fr); }
.aff-stats .play-btn { height: 38px; font-size: 14px; margin-top: 6px; }
@media (max-width: 900px) { .aff-stats { grid-template-columns: repeat(2, 1fr); } }
.recent-msgs .tx-row { grid-template-columns: 150px 1fr auto; }
.recent-msgs .tx-row span:nth-child(2) { white-space: normal; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
