:root {
  --bg: #0b2f86;
  --bg2: #0a2772;
  --panel: #1340a8;
  --panel2: #1a4bb8;
  --line: rgba(255,255,255,0.14);
  --text: #f4f7ff;
  --muted: #b7c7ef;
  --gold: #f0c75e;
  --gold2: #ffb347;
  --accent: #3dde9d;
  --danger: #ff6b7a;
  --bottom-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Outfit", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.05), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(255,210,90,0.08), transparent 22%),
    linear-gradient(180deg, #0d348f, #08256d 55%, #071d57);
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, select { -webkit-tap-highlight-color: transparent; font: inherit; }
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-h) + var(--safe-b) + 8px);
  position: relative;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 12px 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
}
.brand img { border-radius: 10px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.lang-select {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  max-width: 100px;
}
.lang-select option { color: #111; background: #fff; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
}

.views { padding: 0 0 18px; }
.view { display: none; }
.view.is-on { display: block; }

.promo-host {
  position: relative;
  margin: 0 12px 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(180,210,255,0.28);
  aspect-ratio: 16 / 9;
  max-height: 180px;
  background: #071a4a;
}
.promo-track { position: absolute; inset: 0; }
.promo-slide {
  position: absolute; inset: 0; border: 0; padding: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity .4s ease; pointer-events: none; cursor: pointer; text-align: left; color: #fff;
}
.promo-slide.is-on { opacity: 1; pointer-events: auto; z-index: 1; }
.promo-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: ken 9s ease-in-out infinite alternate; }
@keyframes ken { from { transform: scale(1.02); } to { transform: scale(1.08) translate(-1%,1%); } }
.promo-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5,18,55,.88), rgba(5,18,55,.25) 55%, rgba(5,18,55,.4));
}
.promo-copy { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 14px 16px 26px; max-width: 66%; }
.promo-brand {
  display: inline-flex; margin: 0 0 6px; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.4); border: 1px solid rgba(240,199,94,.5); color: var(--gold);
  font-size: 11px; font-weight: 800; width: max-content;
}
.promo-title {
  margin: 0 0 4px; font-family: var(--display); font-size: clamp(16px, 5vw, 24px); line-height: 1.15;
  text-shadow: 0 0 10px rgba(140,90,255,.45), 0 2px 8px rgba(0,0,0,.5);
}
.promo-sub { margin: 0; color: #e8efff; font-size: 12px; }
.promo-dots { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 3; display: flex; justify-content: center; gap: 5px; }
.promo-dots button { width: 6px; height: 6px; border: 0; border-radius: 50%; background: rgba(255,255,255,.35); padding: 0; }
.promo-dots button.is-on { width: 14px; border-radius: 999px; background: #fff; }

.ticker {
  margin: 0 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(8, 28, 82, 0.65);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ticker-ico { flex: none; }
.ticker-mask { overflow: hidden; flex: 1; }
#ticker-text {
  margin: 0;
  white-space: nowrap;
  font-size: 12px;
  color: #dce7ff;
  animation: marquee 18s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(40%); }
  to { transform: translateX(-100%); }
}

.auth-row {
  display: flex;
  gap: 10px;
  padding: 0 12px 12px;
  align-items: center;
}
.btn-outline, .btn-solid {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}
.btn-outline {
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  color: #fff;
}
.btn-solid {
  border: 0;
  background: linear-gradient(135deg, #ffe08a, #f0c75e 45%, #e39a2f);
  color: #2a1a05;
}
.user-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.user-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip em { font-style: normal; color: var(--gold); font-weight: 700; }
.ghost-mini {
  margin-left: auto;
  border: 1px solid var(--line);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
}

.quick-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 12px 14px;
}
.qico {
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  gap: 6px;
  justify-items: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.qico i {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 20px;
  background: linear-gradient(160deg, #3d6dff, #1d4fd0);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.provider-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 12px 10px;
  scrollbar-width: none;
}
.provider-tabs::-webkit-scrollbar { display: none; }
.ptab {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-width: 52px;
}
.ptab i {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
  font-style: normal;
  font-size: 18px;
}
.ptab.is-on { color: #fff; }
.ptab.is-on i { background: linear-gradient(160deg, #ffd56a, #f0a93a); color: #2a1a05; }

.provider-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 12px 12px;
}
.prov {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 1;
  padding: 0;
  position: relative;
  cursor: pointer;
  background: #0c245f;
}
.prov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prov span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 4px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  font-size: 11px; font-weight: 800; text-align: center;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 12px;
}
.game {
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0c245f;
  color: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
}
.game-art { position: relative; aspect-ratio: 1; overflow: hidden; }
.game-cover {
  position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover;
  animation: ken 10s ease-in-out infinite alternate;
}
.game-tag {
  position: absolute; left: 4px; top: 4px; z-index: 1;
  padding: 2px 5px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 9px; font-weight: 800;
}
.game-fav {
  position: absolute; right: 4px; top: 4px; z-index: 1; font-size: 12px; color: #ffd76a;
}
.game-name {
  display: block; padding: 6px 5px 7px; font-size: 10px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(5,20,60,.85);
}
.game-meta {
  margin: 10px 12px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.wins {
  margin: 0 12px 18px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18,52,140,.9), rgba(8,28,90,.95));
  border: 1px solid var(--line);
  min-height: 140px;
  position: relative;
}
.wins-head { padding: 12px 14px 6px; }
.wins-head h2 { margin: 0; font-size: 16px; font-family: var(--display); }
.wins-list { padding: 0 12px 12px; display: grid; gap: 8px; }
.win-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06);
  font-size: 12px;
}
.win-item img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.win-item strong { color: var(--gold); }

.sub-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 10px;
  scrollbar-width: none;
  background: rgba(0,0,0,.12);
}
.sub-tabs::-webkit-scrollbar { display: none; }
.stab {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.stab.is-on { color: #fff; background: rgba(255,255,255,.1); }

.promo-side, .mission-actions {
  display: grid;
  gap: 8px;
  padding: 12px;
  width: 96px;
}
.promo-list {
  display: grid;
  gap: 10px;
  padding: 0 12px 16px 0;
}
#view-promo {
  display: none;
  grid-template-columns: 96px 1fr;
  grid-template-rows: auto 1fr;
}
#view-promo.is-on { display: grid; }
#view-promo .sub-tabs { grid-column: 1 / -1; }
.side-pill {
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  background: #f3e2a8;
  color: #2a1a05;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}
.side-pill.is-on { background: #fff3c8; }
.pcard {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  min-height: 108px;
  padding: 0;
  text-align: left;
  color: #fff;
  cursor: pointer;
  background: #0c245f;
}
.pcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,18,55,.82), rgba(5,18,55,.15)); }
.pcard .copy { position: relative; z-index: 1; padding: 14px; max-width: 70%; }
.pcard h3 { margin: 0 0 4px; font-size: 15px; font-family: var(--display); }
.pcard p { margin: 0; font-size: 12px; color: #e7eeff; }

.pa-board {
  margin: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(12, 40, 120, .7);
  border: 1px solid var(--line);
}
.pa-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pa-top strong { color: var(--accent); font-size: 20px; }
.pa-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
  margin-bottom: 10px;
}
.pa-track::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%; top: 18px;
  height: 3px; background: rgba(255,255,255,.25); border-radius: 999px;
}
.pa-node { position: relative; z-index: 1; text-align: center; }
.pa-node .chest {
  width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #ffd56a, #e39a2f); color: #2a1a05; font-size: 16px;
}
.pa-node .val {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.12); font-size: 11px; font-weight: 700;
}
.pa-reset {
  margin: 0;
  text-align: center;
  display: inline-block;
  width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.2);
  color: var(--muted);
  font-size: 12px;
}
.mission-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  padding: 0 12px 16px;
}
.mission-rules {
  background: rgba(30, 70, 170, .55);
  border-radius: 14px;
  padding: 12px;
  color: #dce7ff;
  font-size: 12px;
  line-height: 1.55;
}
.mission-rules p { margin: 0 0 8px; }

.profile-head {
  margin: 10px 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(12,40,120,.65);
  border: 1px solid var(--line);
}
.profile-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.tool {
  border: 0; background: transparent; color: #dce7ff; font-size: 11px; cursor: pointer;
}
.profile-user { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(160deg, #3d6dff, #1d4fd0);
}
.profile-user p { margin: 0 0 8px; }
.profile-auth { display: flex; gap: 8px; }
.profile-auth .btn-outline, .profile-auth .btn-solid { flex: none; padding: 0 14px; min-height: 34px; }
.wallet-icons {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.menu-list { padding: 0 12px 16px; display: grid; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px; border-radius: 12px;
  background: rgba(12,40,120,.55); border: 1px solid var(--line);
  color: #fff; cursor: pointer;
}
.menu-item span { margin-left: auto; color: var(--muted); }
.menu-item small { display: block; color: var(--muted); font-size: 11px; }

.to-top {
  position: fixed;
  right: max(12px, calc(50% - 228px));
  bottom: calc(var(--bottom-h) + var(--safe-b) + 12px);
  z-index: 25;
  border: 0;
  border-radius: 14px;
  padding: 8px 10px;
  background: #2b63e8;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: var(--bottom-h);
  padding: 4px 4px calc(4px + var(--safe-b));
  background: rgba(8, 30, 90, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.bnav {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.bnav.is-on { color: #fff; }
.bnav .ico { font-size: 18px; line-height: 1; }
.bnav-center {
  position: relative;
  top: -14px;
}
.bnav-center .ico {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #5f8cff, #1d4fd0 60%, #0f2f8a);
  border: 3px solid #f0c75e;
  color: #fff; font-size: 20px;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

.mask {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.58); backdrop-filter: blur(6px);
}
.modal {
  width: min(480px, 100%);
  max-height: min(92dvh, 640px);
  overflow: auto;
  padding: 22px 18px calc(18px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #163a9a, #0b2468);
  border: 1px solid var(--line); border-bottom: 0;
  animation: sheet .25s ease both;
}
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 26px; width: 40px; height: 40px; cursor: pointer; }
.modal { position: relative; }
.badge {
  display: inline-flex; margin: 0 0 10px; padding: 6px 10px; border-radius: 999px;
  background: rgba(240,199,94,.16); color: var(--gold); font-size: 12px; font-weight: 700;
}
.modal h2 { margin: 0 0 8px; font-family: var(--display); font-size: 24px; }
.tip { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tip strong { color: var(--gold); }
#reg-form { display: grid; gap: 12px; }
#reg-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
#reg-form input {
  width: 100%; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: #fff;
  border-radius: 12px; padding: 13px 14px; font-size: 16px; outline: none;
}
.err { margin: 0; color: var(--danger); font-size: 13px; }
.primary {
  border: 0; border-radius: 12px; min-height: 48px;
  background: linear-gradient(135deg, #ffe08a, #f0c75e 40%, #3dde9d);
  color: #241806; font-weight: 800; cursor: pointer;
}
.foot { margin: 14px 0 0; text-align: center; color: #9bb0e0; font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + var(--safe-b) + 14px);
  transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 28px);
  padding: 12px 16px; border-radius: 12px; background: #12307f; border: 1px solid var(--line); font-size: 13px;
}

html[dir="rtl"] .app { direction: rtl; }
@media (prefers-reduced-motion: reduce) {
  .promo-bg, .game-cover, #ticker-text { animation: none !important; }
}
@media (min-width: 900px) {
  body { background: #06153f; }
  .app {
    margin: 18px auto;
    border-radius: 22px;
    overflow: clip;
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.08);
  }
  .bottom-nav, .to-top { max-width: 480px; }
  .mask { align-items: center; padding: 18px; }
  .modal { border-radius: 20px; border-bottom: 1px solid var(--line); width: min(400px, 100%); }
}
