/* ===== App shell ===== */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* sidebar */
.sidebar {
  background: var(--bg-0); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 6px 8px 20px; }
.side-label { font-size: 11px; letter-spacing: 2px; color: var(--muted-2); font-weight: 700; padding: 16px 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-md);
  color: var(--muted); font-weight: 600; transition: .15s; cursor: pointer; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }
.nav-item .ic { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px; }

/* topbar */
.topbar {
  height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 26px; border-bottom: 1px solid var(--border); background: var(--bg-1);
  position: sticky; top: 0; z-index: 30;
}
.wallet-box {
  display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
}
.wallet-box .bal { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.wallet-box .bal-num { display: flex; flex-direction: column; line-height: 1.15; }
.wallet-box .bal-num b { font-weight: 800; font-size: 15px; }
.wallet-box .bal-num small { color: var(--muted); font-size: 11px; font-weight: 600; }
.wallet-box .wbtn { background: var(--grad-gold); color: #251400; padding: 10px 20px; font-weight: 800; }
.wallet-box .wbtn:hover { filter: brightness(1.05); }
.rate-chip { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--r-md); font-size: 13px; font-weight: 700; color: var(--muted); }
.rate-chip b { color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px; border-radius: var(--r-md); }
.user-chip:hover { background: var(--panel); }
.user-chip .av { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 14px;
  font-weight: 800; color: #0b1024; background: var(--gold); border: 1px solid var(--border-strong); position: relative; }
.user-chip .lvl { position: absolute; bottom: -6px; right: -6px; background: var(--gold); color: #231400;
  font-size: 10px; font-weight: 900; border-radius: 999px; padding: 1px 5px; border: 2px solid var(--bg-1); }

.content { padding: 26px; max-width: 1180px; margin: 0 auto; width: 100%; }
.hamburger { display: none; }

/* ===== Home ===== */
.activity-head { font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.activity-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.act-card {
  flex: none; width: 150px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px; border-bottom: 2px solid var(--purple);
}
.act-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.act-card .av { width: 28px; height: 28px; border-radius: 7px; background: var(--panel-2); display: grid; place-items: center; font-size: 15px; }
.act-card .nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-card .emoji { font-size: 40px; text-align: center; margin: 6px 0; }
.act-card .amt { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }

/* promo banner */
.promo {
  margin: 24px 0; border-radius: var(--r-xl); padding: 40px; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 80% 0%, #4a2fa8, #2a1c66 55%, #1a1442);
  border: 1px solid var(--border-strong);
}
.promo .new { color: var(--gold-1); font-weight: 900; letter-spacing: 3px; font-size: 13px;
  display: flex; align-items: center; gap: 10px; }
.promo .new .bar { width: 2px; height: 12px; background: var(--gold-1); display: inline-block; }
.promo h2 { font-size: clamp(32px,4vw,52px); font-weight: 900; line-height: .95; margin: 6px 0; }
.promo h2 .live { color: var(--purple-2); }
.promo .amt-box { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); text-align: right; }
.promo .amt-box .big { font-size: 40px; font-weight: 900;
  background: linear-gradient(90deg,var(--cyan),var(--purple-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.promo .cta { margin-top: 16px; }

/* game grid */
.grid-head { font-weight: 800; font-size: 20px; margin: 30px 0 16px; }
.og-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.og-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 200px; padding: 22px;
  display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--border); cursor: pointer;
  transition: transform .18s ease;
}
.og-card:hover { transform: translateY(-4px); }
.og-card.mines { background: linear-gradient(150deg,#2a1b5e,#16173c); }
.og-card.slide { background: linear-gradient(150deg,#5e1b3a,#16173c); }
.og-card.cases { background: linear-gradient(150deg,#1b3a5e,#16173c); }
.og-card .tag { font-size: 12px; color: var(--gold-1); font-weight: 800; letter-spacing: 1px; }
.og-card h3 { font-size: 24px; font-weight: 900; }
.og-card .card-icon { position: absolute; top: 16px; right: 18px; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: var(--gold-1); }
.og-card.soon::after { content: "SOON"; position: absolute; top: 14px; left: 14px; background: var(--panel-2);
  border: 1px solid var(--border-strong); color: var(--muted); font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }

/* ===== generic panels ===== */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.page-title { display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--panel-2), var(--panel)); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 26px; margin-bottom: 22px; }
.page-title h1 { font-size: 26px; font-weight: 900; }
.page-title .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--bg-2); display: grid; place-items: center;
  font-size: 22px; border: 1px solid var(--border); }

/* ===== Mines ===== */
.mines-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.bet-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.bet-panel h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.amt-input { position: relative; }
.amt-input .coin { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; }
.amt-input input { padding-left: 40px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 18px; }
.quick button { padding: 9px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-weight: 700; color: var(--muted); transition: .15s; }
.quick button:hover { background: var(--panel-2); color: var(--text); }

.board-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.board {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  max-width: 560px; margin: 0 auto; aspect-ratio: 1;
}
.tile {
  border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 30px; cursor: pointer;
  transition: transform .12s ease, background .2s ease; user-select: none;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.tile:not(.revealed):hover { background: var(--panel-3); transform: translateY(-2px); }
.tile.disabled { cursor: default; }
.tile.revealed { animation: flip .3s ease; box-shadow: none; }
.tile.gem { background: linear-gradient(160deg,#123b2c,#0d2a1f); border-color: rgba(47,208,123,.4); color: var(--green); }
.tile.bomb { background: linear-gradient(160deg,#3a1622,#2a1018); border-color: rgba(255,92,122,.4); color: var(--red); }
.tile.dim { opacity: .35; }
@keyframes flip { from { transform: rotateY(90deg) scale(.8); opacity: .3; } }

.cashout-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 16px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 16px; }
.cashout-bar .mult { font-size: 22px; font-weight: 900; color: var(--green); }
.stat-mini { display: flex; gap: 16px; margin-top: 14px; }
.stat-mini .m { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; }
.stat-mini .m span { color: var(--muted); font-size: 12px; display: block; }
.stat-mini .m b { font-size: 16px; }

.links-row { display: flex; gap: 20px; justify-content: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.links-row a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.links-row a:hover { color: var(--gold-1); }

/* ===== Roll ===== */
.tabs2 { display: flex; gap: 10px; margin-bottom: 20px; background: var(--bg-2); padding: 5px; border-radius: 12px; }
.tab2 { flex: 1; padding: 9px; border-radius: 9px; font-weight: 700; font-size: 14px; background: transparent;
  border: 1px solid transparent; color: var(--muted); transition: .15s; }
.tab2[data-tab="manual"].active { background: var(--panel-2); border-color: var(--gold); color: var(--gold-1); }
.tab2[data-tab="auto"].active { background: var(--panel-2); border-color: var(--purple); color: var(--purple-2); }

.suffixed { position: relative; }
.suffixed input { padding-right: 36px; }
.suffixed .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; font-size: 13px; pointer-events: none; }

.toggle2 { display: flex; gap: 8px; margin-bottom: 18px; align-items: stretch; }
.toggle2 .t2btn { flex: 1; padding: 0 8px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--border);
  color: var(--muted); font-weight: 700; font-size: 12.5px; white-space: nowrap; transition: .15s; }
.toggle2 .t2btn.active { background: var(--panel-3); color: var(--text); border-color: var(--border-strong); }
.toggle2 .pct-wrap { flex: 1.1; min-width: 0; }

.amt-input input:disabled, .rstat-box input:disabled { opacity: .65; cursor: default; }

.roll-board { position: relative; overflow: hidden; min-height: 420px; display: flex; flex-direction: column; justify-content: center; padding: 60px 30px; }
.dice-bg { position: absolute; inset: 0; pointer-events: none; }
.bgdice { position: absolute; color: var(--muted-2); opacity: .16; }
.bgdice.d1 { top: 8%; left: 6%; transform: rotate(-18deg); }
.bgdice.d2 { top: 10%; right: 8%; transform: rotate(12deg); }
.bgdice.d3 { bottom: 6%; right: 4%; transform: rotate(-8deg); }
.bgdice.d4 { bottom: 12%; left: 10%; transform: rotate(15deg); }

.roll-slider-wrap { position: relative; z-index: 1; margin: 0 8px; }
.roll-track { position: relative; height: 10px; border-radius: 999px; background: var(--bg-2); cursor: pointer; touch-action: none; }
.roll-fill { position: absolute; top: 0; height: 100%; border-radius: 999px; }
.roll-fill.red { background: linear-gradient(90deg, #ff5c7a, #c8324f); }
.roll-fill.green { background: linear-gradient(90deg, #2fd07b, #1c9c5c); }
.roll-handle { position: absolute; top: 50%; width: 28px; height: 28px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  display: grid; place-items: center; color: var(--muted); transform: translate(-50%,-50%); cursor: grab; }
.roll-handle:active { cursor: grabbing; }
.roll-handle.flash-win { animation: flashWin .6s ease; }
.roll-handle.flash-lose { animation: flashLose .6s ease; }
@keyframes flashWin { 0% { box-shadow: 0 0 0 0 rgba(47,208,123,.6); } 100% { box-shadow: 0 0 0 18px rgba(47,208,123,0); } }
@keyframes flashLose { 0% { box-shadow: 0 0 0 0 rgba(255,92,122,.6); } 100% { box-shadow: 0 0 0 18px rgba(255,92,122,0); } }
.roll-scale { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 12px; z-index: 1; position: relative; }

.roll-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; position: relative; z-index: 1; }
.rstat label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.rstat-box { position: relative; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.rstat-box input { width: 100%; background: transparent; border: none; padding: 12px 36px 12px 14px; color: var(--text);
  font-weight: 700; outline: none; }
.rsuffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.rsuffix-btn { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; color: var(--muted); background: var(--panel-2); transition: .15s; }
.rsuffix-btn:hover { color: var(--gold-1); background: var(--panel-3); }

/* ===== cheat indicator ===== */
#cheatDot {
  position: fixed; left: 14px; bottom: 14px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px 2px rgba(47,208,123,.7);
  z-index: 9999; pointer-events: none; display: none;
}
#cheatDot.on { display: block; }

/* ===== Settings / Tip ===== */
.tip-preview { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 16px; margin: 6px 0 18px; }
.tip-preview > div { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 4px 0; }
.tip-preview span { color: var(--muted); }
.tip-preview b { display: flex; align-items: center; gap: 6px; font-weight: 800; }

/* ===== Coinflip ===== */
.flip-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 420px; padding: 40px; position: relative; z-index: 1; }
.coin3d { width: 150px; height: 150px; perspective: 900px; margin-bottom: 28px; }
.coin3d-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.coin3d-inner.spin { transform: rotateY(1800deg); }
.coin3d-inner.spin.tails { transform: rotateY(1980deg); }
.coin-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  backface-visibility: hidden; background: var(--grad-gold); box-shadow: inset 0 0 0 6px rgba(0,0,0,.15), var(--shadow-gold); }
.coin-face span { font-size: 46px; font-weight: 900; color: #251400; }
.coin-face.back { transform: rotateY(180deg); }
.flip-choices { display: flex; gap: 14px; margin-bottom: 20px; }
.flip-choice { padding: 12px 30px; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--border);
  font-weight: 800; color: var(--muted); transition: .15s; }
.flip-choice.active { background: rgba(246,185,59,.14); border-color: var(--gold); color: var(--gold-1); }
.flip-result { min-height: 26px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.flip-streak { display: flex; gap: 6px; margin-top: 18px; }
.flip-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--border); }
.flip-dot.win { background: var(--green); border-color: var(--green); }
.flip-dot.lose { background: var(--red); border-color: var(--red); }

/* ===== Wallet / Rewards / Profile ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.stat-card .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-card .val { font-size: 28px; font-weight: 900; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.stat-card .usd { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.xp-bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.xp-bar > i { display: block; height: 100%; background: var(--grad-gold); border-radius: 999px; transition: width .4s ease; }

.reward-card { text-align: center; padding: 40px; }
.reward-card .big-coin { font-size: 56px; margin-bottom: 8px; }
.reward-timer { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 10px 0 20px; }

.streak-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 22px 0; }
.streak-day { width: 68px; padding: 10px 6px; border-radius: var(--r-md); background: var(--bg-2);
  border: 1px solid var(--border); text-align: center; }
.streak-day .dnum { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; }
.streak-day .amt { font-weight: 800; font-size: 13px; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.streak-day.done { background: rgba(47,208,123,.12); border-color: rgba(47,208,123,.35); }
.streak-day.done .dnum { color: var(--green); }
.streak-day.next { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(246,185,59,.2); }
.streak-day.next .dnum { color: var(--gold-1); }

/* dropdown menu */
.menu {
  position: absolute; right: 26px; top: 62px; background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); width: 200px; padding: 8px; z-index: 60; display: none;
}
.menu.open { display: block; animation: popIn .15s ease; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-weight: 600; text-align: left; }
.menu button:hover { background: var(--panel-2); color: var(--text); }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 100; width: 240px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: grid; }
  .mines-layout { grid-template-columns: 1fr; }
  .og-grid { grid-template-columns: 1fr; }
  .promo .amt-box { display: none; }
}
