:root{
  --tg-blue:#2AABEE;
  --tg-blue2:#229ED9;
  --tg-indigo:#1B57FF;
  --bg0:#06142B;
  --bg1:#0A2452;
  --text:#F2F7FF;
  --muted:rgba(234,241,255,.72);
  --glass:rgba(255,255,255,.10);
  --glass2:rgba(255,255,255,.14);
  --stroke:rgba(255,255,255,.18);
  --danger:#FF4D6D;
  --shadow: 0 22px 70px rgba(0,0,0,.45);
  --radius:18px;

  /* roulette */
  --item-w:64px;
  --slot-count:7;
  --frame-w:calc(var(--item-w) * var(--slot-count));
  --frame-h:120px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--text);
  background: linear-gradient(180deg, #071A3A, var(--bg1));
  overflow-x:hidden;
}

/* Telegram-ish background: gradient + soft blobs */
#tg-bg{
  position:fixed;
  inset:0;
  background:
    radial-gradient(1200px 800px at 20% 5%, rgba(42,171,238,.35), transparent 55%),
    radial-gradient(900px 700px at 85% 10%, rgba(34,158,217,.22), transparent 50%),
    radial-gradient(650px 500px at 35% 90%, rgba(27,87,255,.16), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  filter:saturate(1.18);
}

#app{
  position:relative;
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:74px 14px 28px;
}

.topbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:56px;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}
.topbar-link{
  pointer-events:auto;
  text-decoration:none;
  font-weight:950;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(242,247,255,.92);
  padding:10px 14px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(42,171,238,.35);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

.screen{
  width:100%;
  max-width:430px;
}

.card{
  border-radius:var(--radius);
  background:
    radial-gradient(600px 260px at 20% 0%, rgba(42,171,238,.18), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.glass{
  background: linear-gradient(180deg, var(--glass), rgba(255,255,255,.03));
}

.narrow{max-width:390px}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 14px 0;
}
.brand.compact{padding:10px 12px 0}
.brand-mark{
  width:42px;
  height:42px;
  border-radius:14px;
  background: rgba(42,171,238,.18);
  border:1px solid rgba(42,171,238,.25);
  display:grid;
  place-items:center;
}
.brand-icon{width:24px;height:24px}
.brand-title{line-height:1}
.brand-kicker{
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
}
.brand-main{
  font-size:22px;
  font-weight:850;
}

.title{
  margin:0;
  padding:12px 18px 0;
  font-size:22px;
  font-weight:900;
  line-height:1.2;
}
.title.mtop{margin-top:6px}
.title-sub{
  display:block;
  margin-top:8px;
  font-size:15px;
  color:rgba(234,241,255,.86);
  font-weight:700;
}
.em{color:#fff}
.mtop{margin-top:10px}

.hint{
  padding:10px 18px 0;
  color:var(--muted);
  font-size:14px;
}

.fineprint{
  padding:14px 18px 18px;
  color:rgba(234,241,255,.65);
  font-size:12px;
  text-align:center;
}

.cta-wrap{
  padding:18px 18px 10px;
  display:flex;
  justify-content:center;
}

.tg-btn{
  -webkit-tap-highlight-color: transparent;
  appearance:none;
  border:0;
  border-radius:14px;
  padding:14px 18px;
  font-weight:900;
  font-size:16px;
  color:#06204a;
  background: linear-gradient(180deg, rgba(125,177,255,.96), var(--tg-blue));
  box-shadow: 0 16px 38px rgba(42,171,238,.30);
  cursor:pointer;
  width:100%;
  max-width:320px;
}

.tg-btn:active{
  transform: translateY(1px);
  filter:saturate(1.05);
}

.tg-btn-primary{
  background: linear-gradient(180deg, #7DB1FF 0%, var(--tg-blue) 55%, var(--tg-blue2) 100%);
}

.fineprint{user-select:none}

.callout{
  margin:12px 18px 0;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  color:rgba(234,241,255,.9);
  font-weight:700;
  line-height:1.35;
}
.callout.warning{
  border-color: rgba(255,77,109,.35);
  background: rgba(255,77,109,.10);
}

.steps-text{
  padding:14px 18px 4px;
  color:rgba(234,241,255,.86);
  font-size:14px;
  line-height:1.35;
}
.steps-text ol{
  margin:10px 0 0;
  padding-left:18px;
}
.steps-text li{margin:10px 0}

.case-media{
  padding:16px 18px 0;
  display:flex;
  justify-content:center;
}
.case-image{
  width:100%;
  max-width:320px;
  height:auto;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.20);
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
}

.case-preview{
  padding:10px 18px 0;
  display:flex;
  justify-content:center;
}
.case-preview-img{
  width:100%;
  max-width:300px;
  height:auto;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 16px 46px rgba(0,0,0,.35);
  transform: translateZ(0);
}

.opening-title{
  padding:10px 18px 0;
  font-size:22px;
  font-weight:980;
  text-align:center;
}
.opening-sub{
  padding:8px 18px 0;
  color:var(--muted);
  font-weight:700;
  text-align:center;
  font-size:13px;
}
.opening-loader{
  height:92px;
}

.case-open-stage{
  position:relative;
  width:100%;
  max-width:320px;
  height:180px;
  margin:12px auto 0;
}
.case-open-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.20);
  box-shadow: 0 18px 48px rgba(0,0,0,.35);
  object-fit:cover;
  opacity:1;
  transform: translateY(0) scale(1);
}
.case-open-close{
  opacity:1;
}
.case-open-open-img{
  opacity:0;
  transform: translateY(8px) scale(.985);
}
.case-open-stage.play .case-open-close{
  opacity:0;
  transform: translateY(-6px) scale(.99);
  transition: opacity .38s ease, transform .38s ease;
}
.case-open-stage.play .case-open-open-img{
  opacity:1;
  transform: translateY(0) scale(1);
  transition: opacity .48s ease, transform .48s ease;
}

.upload-meta{
  padding:14px 18px 18px;
}
.upload-count{
  font-weight:900;
  font-size:13px;
  color:rgba(234,241,255,.88);
}
.upload-message{
  margin-top:8px;
  color:rgba(234,241,255,.78);
  font-size:13px;
  min-height:18px;
}

.thumbs{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.thumb{
  width:70px;
  height:70px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  overflow:hidden;
  position:relative;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.thumb .x{
  position:absolute;
  top:6px;
  right:6px;
  width:22px;
  height:22px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:14px;
  cursor:pointer;
  user-select:none;
}

/* Checking UI */
.check-title{
  padding:6px 18px 0;
  font-size:22px;
  font-weight:950;
  text-align:center;
}
.check-sub{
  padding:8px 18px 12px;
  color:var(--muted);
  text-align:center;
  font-weight:650;
}
.loader{
  height:120px;
  display:grid;
  place-items:center;
}
.loader:before{
  content:"";
  width:54px;
  height:54px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.18);
  border-top-color: rgba(42,171,238,.95);
  animation: spin 1s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* Roulette */
.spin-card{
  padding-bottom:18px;
}
.roulette{
  position:relative;
  padding:10px 10px 6px;
}
.roulette-viewport{
  width:100%;
  height:140px;
  overflow:hidden;
  position:relative;
  border-radius:16px;
  border:1px solid rgba(42,171,238,.28);
  background:
    radial-gradient(260px 120px at 50% 0%, rgba(42,171,238,.12), transparent 60%),
    rgba(255,255,255,.02);
}

.roulette-guide{
  position:absolute;
  top:10px;
  bottom:10px;
  left:50%;
  transform: translateX(-1px);
  width:2px;
  border-radius:2px;
  background: linear-gradient(180deg, rgba(42,171,238,.0), rgba(42,171,238,.95), rgba(42,171,238,.0));
  box-shadow: 0 0 0 1px rgba(42,171,238,.25), 0 0 20px rgba(42,171,238,.35);
  pointer-events:none;
  z-index:3;
}

.roulette-track{
  height:140px;
  display:flex;
  align-items:flex-start;
  will-change: transform;
  position:relative;
  z-index:2;
}
.star-item{
  width: var(--item-w);
  padding-top:14px;
  text-align:center;
  flex: 0 0 auto;
}
.star-badge{
  width:42px;
  height:42px;
  margin:0 auto;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.16), transparent 55%),
    rgba(42,171,238,.10);
  display:grid;
  place-items:center;
}
.star-svg{
  width:22px;
  height:22px;
}
.star-num{
  margin-top:7px;
  font-weight:950;
  font-size:12px;
  color:rgba(234,241,255,.85);
}
.spin-footer{
  text-align:center;
  padding:10px 0 0;
}
.spin-label{
  color:rgba(234,241,255,.78);
  font-weight:800;
}

/* Small screens */
@media (max-width: 380px){
  .title{font-size:20px}
  :root{--item-w:60px}
}

