:root {
  --bg: #0a0f1a;
  --panel: #101b2e;
  --panel-2: #0e1628;
  --line: #223251;
  --text: #e9eefb;
  --muted: #a7b6d9;
  --accent: #ff4f1f;
  --accent-2: #ff8f3a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: "Segoe UI", Tahoma, sans-serif; background: var(--bg); color: var(--text); }

.bg-orb { position: fixed; border-radius: 50%; filter: blur(90px); z-index: 0; opacity: .35; pointer-events: none; }
.orb-1 { width: 320px; height: 320px; background: var(--accent); top: -80px; left: -80px; }
.orb-2 { width: 380px; height: 380px; background: #2b7fff; bottom: -110px; right: -90px; }

.app { max-width: 980px; margin: 0 auto; padding: 28px 18px 100px; position: relative; z-index: 1; }
.hero { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { width: 56px; height: 56px; }
h1 { margin: 0; font-size: 1.55rem; letter-spacing: .2px; }
p { margin: 6px 0 0; color: var(--muted); }
.chip { border: 1px solid var(--line); background: #0c1526; border-radius: 999px; padding: 8px 12px; color: #c6d6fa; font-size: .86rem; }

.panel {
  background: linear-gradient(170deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 12px 30px rgba(2, 6, 16, .35);
}

.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: #0d172a; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat span { display: block; font-size: .8rem; color: #95a7cd; margin-bottom: 6px; }
.stat strong { font-size: 1.28rem; }
.trx-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 1.22rem; }
.trx-inline span {
  font-size: 1.36rem;
  font-weight: 800;
  line-height: 1.1;
}
.trx-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: .72;
  background: transparent !important;
  mix-blend-mode: screen;
  filter: brightness(1.2) contrast(1.05);
}

.profile-card { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 53, .4);
  background: #0d172a;
  object-fit: cover;
}
.profile-copy { min-width: 0; }
.profile-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.profile-sub { color: var(--muted); font-size: .92rem; margin-top: 3px; }

.muted { color: var(--muted); margin-bottom: 14px; }
.card-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.network-card { background: #0d172a; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.network-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.network-top h3 { margin: 0; }
.badge { background: rgba(255, 79, 31, .15); border: 1px solid rgba(255, 79, 31, .35); color: #ffb38d; border-radius: 999px; padding: 4px 8px; font-size: .75rem; }

.btn {
  border: 1px solid #ff6b35;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: white;
  width: 100%;
  border-radius: 10px;
  padding: 11px 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.bet-input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0a1222;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
}
.screen { display: none; }
.screen.active { display: block; }
body.game-mode .hero,
body.game-mode .panel:not(.game-panel),
body.game-mode #logPanel,
body.game-mode [data-screen="ads"] { display: none !important; }
body.game-mode .app { max-width: 100%; padding: 0 0 74px; }
body.game-mode .game-panel {
  display: block !important;
  position: fixed;
  inset: 0 0 64px 0;
  margin: 0;
  border-radius: 0;
  border: 0;
  overflow: auto;
}
.game-wrap {
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 120, 196, .50), transparent 34%),
    radial-gradient(circle at 85% 14%, rgba(117, 217, 255, .50), transparent 36%),
    radial-gradient(circle at 55% 100%, rgba(255, 223, 114, .22), transparent 42%),
    linear-gradient(165deg, #2d1b80 0%, #2642a2 48%, #1e307a 100%);
  border: 1px solid rgba(185, 218, 255, .46);
  border-radius: 22px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 20px 40px rgba(8, 13, 45, .56);
}
.game-panel h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: .3px;
  background: linear-gradient(90deg, #ff97d5, #ffe18b, #95deff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.game-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.game-pill {
  border: 1px solid rgba(255,255,255,.4);
  background: linear-gradient(145deg, #ff6bb4, #ff8f6b);
  color: #fff;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .7px;
  padding: 7px 12px;
  box-shadow: 0 8px 14px rgba(255, 112, 161, .32);
}
.game-topbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.top-chip {
  border: 1px solid rgba(180, 208, 255, .42);
  background: linear-gradient(160deg, rgba(35, 58, 136, .8), rgba(35, 47, 104, .76));
  border-radius: 12px;
  padding: 9px 11px;
}
.top-chip span {
  display: block;
  color: #bad3ff;
  font-size: .76rem;
  margin-bottom: 4px;
}
.top-chip strong {
  color: #fff;
  font-size: 1.2rem;
}
.top-chip .trx-inline span {
  font-size: 1.48rem;
  font-weight: 900;
}
.candy-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.candy-strip span {
  border: 1px solid rgba(255,255,255,.42);
  color: #fff;
  background: linear-gradient(140deg, rgba(255,255,255,.28), rgba(255,255,255,.10));
  border-radius: 999px;
  padding: 5px 11px;
  font-size: .72rem;
  letter-spacing: .25px;
  font-weight: 700;
}
.slot-reel {
  min-height: 340px;
  border: 1px solid rgba(146, 186, 255, .45);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #e7f3ff 100%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #35538f;
  margin-bottom: 14px;
  transition: transform .25s ease, box-shadow .25s ease;
  padding: 8px 10px;
}
.slot-reel span {
  display: inline-flex;
  width: 100%;
  height: 44px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cadeff;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 8px 14px rgba(37, 73, 141, .13);
  font-size: 1.25rem;
}
.slot-reel span.win {
  border-color: #ffd15f;
  background: linear-gradient(180deg, #fff5ce 0%, #ffe79a 100%);
  box-shadow: 0 0 0 2px rgba(255, 209, 95, .45), 0 10px 16px rgba(255, 196, 70, .32);
  animation: winPulse .9s ease-in-out infinite;
}
.slot-reel.no-win span {
  border-color: #cadeff;
  background: linear-gradient(180deg, #edf5ff 0%, #deebff 100%);
  box-shadow: 0 6px 12px rgba(37, 73, 141, .10);
  animation: none;
}
@keyframes winPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.slot-reel.spinning {
  transform: scale(1.03);
  box-shadow: 0 0 0 4px rgba(140, 197, 255, .22);
}
.game-panel .stat {
  background: linear-gradient(180deg, rgba(13, 25, 62, .66), rgba(11, 20, 52, .66));
  border-color: rgba(148, 182, 255, .45);
}
.game-panel .stat span { color: #bdd4ff; }
.game-panel .stat strong { color: #fff; }
.game-btn {
  margin-top: 12px;
  border: 1px solid #ffd57b;
  background: linear-gradient(145deg, #ff72b8 0%, #ff8f6a 44%, #ffca69 100%);
  color: #2a2051;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-radius: 14px;
  box-shadow: 0 14px 24px rgba(255, 139, 123, .36);
}
.spin-icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid #ffd57b;
  background: linear-gradient(145deg, #ff72b8 0%, #ff8f6a 44%, #ffca69 100%);
  color: #2a2051;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 0;
  box-shadow: 0 12px 20px rgba(255, 139, 123, .36);
}
.spin-icon-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
.spin-icon-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.game-bottom-ui {
  position: sticky;
  bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.bottom-chip {
  border: 1px solid rgba(180, 208, 255, .42);
  background: linear-gradient(160deg, rgba(35, 58, 136, .84), rgba(35, 47, 104, .82));
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 46%;
}
.bottom-chip span {
  display: block;
  color: #bad3ff;
  font-size: .74rem;
  margin-bottom: 4px;
}
.bottom-chip strong {
  font-size: 1.2rem;
}
.bottom-chip .trx-inline span {
  font-size: 1.48rem;
  font-weight: 900;
}
.bet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.preset-toggle {
  width: 30px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px;
}
.preset-toggle span {
  display: block;
  height: 2px;
  border-radius: 4px;
  background: #fff;
}
.preset-menu {
  display: none;
  margin-top: 8px;
  gap: 6px;
  flex-wrap: wrap;
}
.preset-menu.open { display: flex; }
.preset-item {
  border: 1px solid rgba(255,255,255,.36);
  background: linear-gradient(145deg, rgba(255,255,255,.2), rgba(255,255,255,.1));
  color: #fff;
  border-radius: 999px;
  font-size: .75rem;
  padding: 5px 9px;
  font-weight: 700;
}
.bet-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.4);
  background: linear-gradient(145deg, #ff7fbd, #ffb26b);
  color: #251d4f;
  font-size: 1.2rem;
  font-weight: 800;
}
.win-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, .62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25;
}
.win-modal.open { display: flex; }
.win-card {
  width: min(88vw, 360px);
  border-radius: 18px;
  border: 1px solid rgba(255, 228, 143, .65);
  background: linear-gradient(170deg, #311e77, #2740a4 55%, #263785);
  box-shadow: 0 22px 50px rgba(7, 11, 35, .6);
  padding: 18px 16px;
  text-align: center;
  animation: popIn .28s ease;
}
.win-title { color: #ffe18b; font-weight: 800; letter-spacing: .8px; }
.win-amount { color: #fff; font-size: 1.5rem; font-weight: 900; margin-top: 6px; }
.win-hint { color: #bdd0ff; font-size: .8rem; margin-top: 8px; }
@keyframes popIn {
  from { transform: translateY(12px) scale(.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: linear-gradient(180deg, rgba(16, 27, 57, .98), rgba(13, 22, 47, .98));
  border-top: 1px solid rgba(137, 176, 255, .34);
  z-index: 10;
  backdrop-filter: blur(6px);
  box-shadow: 0 -8px 30px rgba(5, 8, 24, .42);
}
.nav-btn {
  border: 0;
  background: transparent;
  color: #a9bee6;
  font-weight: 700;
  padding: 10px 10px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-btn svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}
.nav-btn.active {
  color: #fff;
  background:
    radial-gradient(circle at 50% 0%, rgba(131, 201, 255, .22), transparent 55%),
    linear-gradient(180deg, rgba(255, 121, 182, .26), rgba(255, 121, 182, .08));
}

.log-box {
  background: #0a1222;
  border: 1px dashed #2a3d61;
  border-radius: 10px;
  min-height: 130px;
  padding: 12px;
  overflow: auto;
  font-size: .9rem;
  line-height: 1.45;
}
.log-item { margin-bottom: 6px; color: #ccdaf6; }
.log-item b { color: #fff; }

@media (max-width: 780px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .stat-grid, .stat-grid-wide, .card-grid { grid-template-columns: 1fr; }
  .profile-card { align-items: flex-start; }
  .game-hero { align-items: flex-start; flex-direction: column; }
  .game-topbar { grid-template-columns: 1fr; }
  .game-bottom-ui { flex-direction: column; }
  .bottom-chip { min-width: 100%; }
}
