* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none
}

:root {
  --p: #7C3AED;
  --pd: #5b21b6;
  --s: #F97316;
  --acc: #FBBF24;
  --bg: #0F0A1E;
  --card: #1C1535;
  --card2: #251d42;
  --t: #fff;
  --t2: #9CA3AF;
  --red: #E53935;
  --blue: #1E88E5;
  --grn: #43A047;
  --yel: #FDD835;
  --rbg: rgba(229, 57, 53, .18);
  --bbg: rgba(30, 136, 229, .18);
  --gbg: rgba(67, 160, 71, .18);
  --ybg: rgba(253, 216, 53, .18);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Poppins', sans-serif;
  color: var(--t)
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden
}

/* ── SCREENS ── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screen::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none
}

.screen.active {
  display: flex
}

/* ── HOME ── */
#homeScreen {
  background: linear-gradient(160deg, #0F0A1E 0%, #1a0a3a 55%, #0a1a30 100%)
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  opacity: .35
}

.home-top {
  padding: 16px;
  position: relative;
  z-index: 1
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(124, 58, 237, .25);
  border: 1px solid rgba(124, 58, 237, .5);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  margin-bottom: 50px
}

.badge i {
  color: var(--acc)
}

.home-title {
  font-size: 40px;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--acc) 55%, #F97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  text-align: center;
}

.home-coins {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--acc);
  flex-wrap: wrap;
  justify-content: center;
}


.home-preview {
  margin: 0 20px 16px;
  background: rgba(255, 255, 255, .04);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .07);
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center
}

.preview-board-thumb {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden
}

.preview-info {
  flex: 1
}

.preview-info h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px
}

.preview-info p {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5
}

.home-btns {
  padding: 0 20px 14px;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1
}

.home-grid {
  padding: 0 20px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1
}

.feat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .06);
  cursor: pointer;
  transition: .18s
}

.feat-card:active {
  transform: scale(.96)
}

.feat-card i {
  font-size: 22px;
  margin-bottom: 7px;
  display: block
}

.feat-card .ft {
  font-size: 13px;
  font-weight: 700
}

.feat-card .fs {
  font-size: 11px;
  color: var(--t2);
  margin-top: 2px
}

/* ── BUTTONS ── */
.btn-p {
  background: linear-gradient(135deg, var(--p), var(--pd));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 22px;
  font-size: 17px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: .18s;
  box-shadow: 0 6px 20px rgba(124, 58, 237, .4);
  width: 100%
}

.btn-p:active {
  transform: scale(.97);
  box-shadow: none
}

.btn-s {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: .18s;
  width: 100%
}

.btn-s:active {
  transform: scale(.97);
  background: rgba(255, 255, 255, .12)
}

/* ── BOTTOM NAV ── */
.bnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(15, 10, 30, .95);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100
}

.nv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 12px;
  transition: .18s;
  flex: 1
}

.nv i {
  font-size: 19px;
  color: var(--t2);
  transition: .18s
}

.nv span {
  font-size: 10px;
  color: var(--t2);
  font-weight: 600;
  transition: .18s
}

.nv.active i,
.nv.active span {
  color: var(--p)
}

.nv.active {
  background: rgba(124, 58, 237, .15)
}

/* ── LOBBY ── */
#lobbyScreen {
  background: var(--bg);
  padding-bottom: 80px
}

.sh {
  padding: 50px 20px 14px;
  display: flex;
  align-items: center;
  gap: 11px
}

.bk {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .07);
  border-radius: 12px;
  border: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center
}

.bk:active {
  transform: scale(.94)
}

.st {
  font-size: 19px;
  font-weight: 700;
  flex: 1
}

.mc {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin: 0 20px 10px;
  border: 1px solid rgba(255, 255, 255, .06);
  cursor: pointer;
  transition: .18s;
  display: flex;
  align-items: center;
  gap: 13px
}

.mc:active {
  transform: scale(.98)
}

.mi {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0
}

.mn {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px
}

.ms {
  font-size: 11px;
  color: var(--t2)
}

.mbg {
  background: var(--s);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: auto;
  flex-shrink: 0
}

.rcard {
  background: var(--card);
  border-radius: 13px;
  padding: 13px 15px;
  margin-bottom: 9px;
  border: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: .18s
}

.rcard:active {
  transform: scale(.98)
}

.rdots {
  display: flex;
  gap: 4px
}

.rdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18)
}

.rdot.on {
  background: var(--p)
}

.rinfo {
  flex: 1
}

.rn {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 1px
}

.rk {
  font-size: 11px;
  color: var(--acc);
  font-weight: 600
}

.rjb {
  background: var(--p);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer
}

/* ── GAME SCREEN ── */
#gameScreen {
  background: #1a1a2e;
  padding-bottom: 0;
  overflow: hidden
}

.ghud {
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.phud {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 5px 8px;
  border: 2px solid transparent;
  transition: border-color .3s;
  min-width: 90px
}

.phud .av {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0
}

.phud .pn {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap
}

.phud .ps {
  font-size: 10px;
  color: var(--t2);
  margin-top: 1px
}

.tind {
  background: linear-gradient(135deg, var(--p), #a855f7);
  border-radius: 11px;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0
}

.bwrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  position: relative
}

#ludoBoard {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6)
}

#bsvg {
  display: block;
  width: 100%;
  height: 100%
}

.gbot {
  padding: 8px 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px
}

.dbtn {
  width: 66px;
  height: 66px;
  background: linear-gradient(145deg, #fff, #ddd);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
  transition: .18s;
  font-size: 30px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden
}

#dDisp {
  position: relative;
  z-index: 2;
  transition: opacity .2s
}

#d3dDice {
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  display: none;
  z-index: 1
}

.dbtn.d3d-ready #d3dDice {
  display: block
}

.dbtn.d3d-ready #dDisp {
  opacity: 0
}

.dbtn:active {
  transform: scale(.91)
}

.tok {
  transition: transform var(--step-speed, 0.2s) cubic-bezier(0.4, 0, 0.2, 1);
}

.tok-inner.jumping {
  animation: singleJump var(--step-speed, 0.2s) ease-in-out;
}

@keyframes singleJump {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: translateY(-25px) scale(1.2);
  }
}

.dbtn.roll {
  animation: droll .45s ease
}

@keyframes droll {
  0% {
    transform: rotate(0)
  }

  25% {
    transform: rotate(-18deg) scale(.9)
  }

  50% {
    transform: rotate(18deg) scale(1.1)
  }

  75% {
    transform: rotate(-9deg)
  }

  100% {
    transform: scale(1)
  }

}

.gstat {
  background: rgba(255, 255, 255, .05);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .07)
}

.gst {
  font-size: 10px;
  color: var(--t2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px
}

.gss {
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.3
}

.skpb {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  color: #fff;
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  flex-shrink: 0
}

.exitb {
  background: rgba(229, 57, 53, .18);
  border-color: rgba(229, 57, 53, .45);
  color: #ffd7d7
}

/* ── LEADERBOARD ── */
#leaderboardScreen {
  background: var(--bg);
  padding-bottom: 80px
}

.lbh {
  padding: 50px 20px 16px;
  text-align: center
}

.lbt {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 3px
}

.lbs {
  font-size: 12px;
  color: var(--t2)
}

.lbtabs {
  display: flex;
  margin: 0 20px 14px;
  background: rgba(255, 255, 255, .05);
  border-radius: 13px;
  padding: 4px;
  gap: 4px
}

.lbtab {
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--t2);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: .18s
}

.lbtab.active {
  background: var(--p);
  color: #fff
}

.lbrow {
  background: var(--card);
  border-radius: 13px;
  padding: 11px 13px;
  margin: 0 20px 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, .05)
}

.lbr {
  font-size: 15px;
  font-weight: 800;
  width: 26px;
  text-align: center
}

.lbr.g {
  color: var(--acc)
}

.lbr.s {
  color: #C0C0C0
}

.lbr.b {
  color: #CD7F32
}

.lbav {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: rgba(124, 58, 237, .2)
}

.lbni {
  flex: 1
}

.lbnn {
  font-size: 13px;
  font-weight: 700
}

.lbns {
  font-size: 11px;
  color: var(--t2)
}

.lbsc {
  text-align: right
}

.lbpt {
  font-size: 15px;
  font-weight: 800;
  color: var(--acc)
}

.lbwn {
  font-size: 10px;
  color: var(--t2)
}

/* ── PROFILE ── */
#profileScreen {
  background: var(--bg);
  padding-bottom: 80px
}

.proh {
  background: linear-gradient(160deg, var(--pd), var(--bg));
  padding: 50px 20px 26px;
  text-align: center
}

.proav {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 10px;
  border: 3px solid rgba(255, 255, 255, .18)
}

.pron {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 2px
}

.prol {
  font-size: 12px;
  color: var(--acc);
  font-weight: 600
}

.prost {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px
}

.stc {
  background: var(--card);
  border-radius: 13px;
  padding: 13px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .05)
}

.stn {
  font-size: 21px;
  font-weight: 800;
  color: var(--p)
}

.stl {
  font-size: 11px;
  color: var(--t2);
  margin-top: 2px
}

.prsec {
  padding: 0 20px 14px
}

.prsec h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 11px
}

.sitem {
  background: var(--card);
  border-radius: 13px;
  padding: 13px 15px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .05);
  transition: .18s
}

.sitem:active {
  transform: scale(.98)
}

.sitem i {
  font-size: 17px;
  color: var(--p);
  width: 22px;
  text-align: center
}

.sil {
  flex: 1;
  font-size: 13px;
  font-weight: 600
}

.siv {
  font-size: 12px;
  color: var(--t2)
}

.srange {
  margin-left: auto;
  width: 90px;
  height: 4px;
  accent-color: var(--p);
  cursor: pointer;
  outline: none
}

.tog {
  width: 42px;
  height: 22px;
  background: rgba(255, 255, 255, .14);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0
}

.tog.on {
  background: var(--p)
}

.tog::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s
}

.tog.on::after {
  left: 23px
}

/* ── WALLET ── */
#walletScreen {
  background: var(--bg);
  padding-bottom: 80px
}

.wh {
  background: linear-gradient(135deg, #1C1535, #251d42);
  margin: 50px 20px 14px;
  border-radius: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .07)
}

.wl {
  font-size: 11px;
  color: var(--t2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px
}

.wb {
  font-size: 38px;
  font-weight: 900;
  color: var(--acc);
  margin: 3px 0;
  display: flex;
  align-items: center;
  gap: 7px
}

.ws {
  font-size: 12px;
  color: var(--t2)
}

.wacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0 20px 18px
}

.wab {
  background: var(--card);
  border-radius: 13px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  cursor: pointer;
  transition: .18s
}

.wab:active {
  transform: scale(.97)
}

.wab i {
  font-size: 19px;
  color: var(--p)
}

.wbl {
  font-size: 12px;
  font-weight: 700
}

.wbs {
  font-size: 10px;
  color: var(--t2)
}

.wtx {
  padding: 0 20px
}

.slbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px
}

.txi {
  background: var(--card);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, .05)
}

.txic {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px
}

.txn {
  font-size: 12px;
  font-weight: 600
}

.txd {
  font-size: 10px;
  color: var(--t2)
}

.txa {
  font-size: 14px;
  font-weight: 800
}

.txa.p {
  color: #43A047
}

.txa.m {
  color: #E53935
}

/* ── MODALS ── */
.mov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(5px)
}

.mov.show {
  display: flex
}

.msh {
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px 40px;
  width: 100%;
  max-width: 480px;
  animation: sup .28s ease
}

@keyframes sup {
  from {
    transform: translateY(100%)
  }

  to {
    transform: translateY(0)
  }

}

.mhnd {
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, .18);
  border-radius: 2px;
  margin: 0 auto 18px;
  display: block
}

.msh {
  text-align: center;
}

.mtt {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px
}

.msb {
  font-size: 12px;
  color: var(--t2);
  margin-bottom: 16px
}

.minp {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  padding: 13px 15px;
  font-size: 15px;
  color: #fff;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 11px;
  outline: none
}

.minp:focus {
  border-color: var(--p)
}

.minp::placeholder {
  color: rgba(255, 255, 255, .28)
}

.psel {
  display: flex;
  gap: 7px;
  margin-bottom: 14px
}

.psb {
  flex: 1;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: .18s
}

.psb.ac {
  background: var(--p);
  border-color: var(--p)
}

.tgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px
}

.tcard {
  border-radius: 13px;
  padding: 13px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: .18s;
  text-align: center;
  background: var(--card2)
}

.tcard.sel {
  border-color: var(--p)
}

.tnm {
  font-size: 12px;
  font-weight: 700;
  margin-top: 7px
}

/* ── WIN OVERLAY ── */
#wov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  flex-direction: column;
  gap: 14px
}

#wov.show {
  display: flex
}

.wem {
  font-size: 72px;
  animation: bnc 1s ease infinite
}

@keyframes bnc {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-18px)
  }

}

.wtl {
  font-size: 34px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--acc), #F97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.wsb {
  font-size: 14px;
  color: var(--t2)
}

.wrew {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(251, 191, 36, .14);
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: 13px;
  padding: 11px 18px;
  font-size: 18px;
  font-weight: 800;
  color: var(--acc)
}

.cnf {
  position: absolute;
  border-radius: 2px;
  animation: cfl linear forwards
}

@keyframes cfl {
  0% {
    transform: translateY(-20px) rotate(0);
    opacity: 1
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0
  }

}

/* ── AI THINKING ── */
.aith {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .82);
  border-radius: 14px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  border: 1px solid rgba(255, 255, 255, .1)
}

.aith.sh {
  opacity: 1
}

.adt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p);
  animation: adot 1.2s ease infinite
}

.adt:nth-child(2) {
  animation-delay: .2s
}

.adt:nth-child(3) {
  animation-delay: .4s
}

@keyframes adot {

  0%,
  60%,
  100% {
    transform: translateY(0)
  }

  30% {
    transform: translateY(-8px)
  }

}

/* ── TOAST ── */
.toast {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 21, 53, .96);
  color: #fff;
  padding: 9px 18px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  border: 1px solid rgba(255, 255, 255, .1);
  white-space: nowrap;
  backdrop-filter: blur(10px)
}

.toast.sh {
  opacity: 1
}

/* ── TOKEN ANIMATION ── */
.tok {
  cursor: pointer;
  transition: .18s
}

.tok.movable {
  animation: tpulse .7s ease infinite
}

@keyframes tpulse {

  0%,
  100% {
    filter: drop-shadow(0 0 0 transparent)
  }

  50% {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, .9))
  }

}

/* ── THEMES ── */
body.neon {
  --bg: #000510;
  --card: #040D20;
  --p: #00D4FF;
  --pd: #0088CC;
  --s: #FF0080
}

body.jungle {
  --bg: #0A1A0A;
  --card: #0D1F0D;
  --p: #4CAF50;
  --pd: #2E7D32;
  --s: #FF8F00
}

body.space {
  --bg: #02001A;
  --card: #08002E;
  --p: #9C27B0;
  --pd: #6A0080;
  --s: #E91E63
}

/* ── ROOM LOBBY ── */
#roomLobbyScreen {
  background: var(--bg);
  padding-bottom: 80px
}

.rl-code-box {
  margin: 10px 20px 18px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(249, 115, 22, .12));
  border: 1px solid rgba(124, 58, 237, .4);
  border-radius: 18px;
  padding: 20px;
  text-align: center
}

.rl-code-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--t2);
  margin-bottom: 10px
}

.rl-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px
}

.rl-code {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--acc);
  font-family: monospace
}

.rl-copy-btn {
  background: rgba(124, 58, 237, .25);
  border: 1px solid rgba(124, 58, 237, .5);
  color: var(--p);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: .18s;
  display: flex;
  align-items: center;
  gap: 6px
}

.rl-copy-btn:active {
  transform: scale(.94)
}

.rl-code-hint {
  font-size: 11px;
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px
}

.rl-section {
  padding: 0 20px 14px
}

.rl-player-row {
  background: var(--card);
  border-radius: 13px;
  padding: 11px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .06)
}

.rl-player-row.rl-empty {
  opacity: .5;
  border-style: dashed
}

.rl-pav {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0
}

.rl-pname {
  flex: 1;
  font-size: 13px;
  font-weight: 600
}

.rl-wait-p {
  color: var(--t2);
  font-weight: 400
}

.rl-you {
  color: var(--p);
  font-size: 11px
}

.rl-host-badge {
  background: rgba(251, 191, 36, .18);
  color: var(--acc);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px
}

.rl-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .04);
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .07);
  color: var(--t2);
  font-size: 13px;
  font-weight: 600
}

.rl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--p);
  display: inline-block;
  animation: rlPulse 1.2s ease infinite
}

.rl-dot:nth-child(2) {
  animation-delay: .2s
}

.rl-dot:nth-child(3) {
  animation-delay: .4s
}

@keyframes rlPulse {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 1
  }

  30% {
    transform: translateY(-6px);
    opacity: .6
  }
}

/* Spectator badge in header */
.spec-badge {
  background: rgba(251, 191, 36, .18);
  border: 1px solid rgba(251, 191, 36, .4);
  color: var(--acc);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px
}

/* Room divider */
.room-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0
}

.room-divider::before,
.room-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .1)
}

.room-divider span {
  font-size: 11px;
  color: var(--t2);
  font-weight: 600;
  white-space: nowrap
}

/* Room info explanation box */
.room-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 11px;
  padding: 11px 13px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5
}

.room-info-box strong {
  color: #fff
}

/* ── GAME HISTORY ── */
.h-list { padding: 15px; }
.h-card {
  background: var(--card);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.05);
}
.h-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.h-title { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.h-time { font-size: 11px; color: var(--t2); display: flex; align-items: center; gap: 5px; }
.h-status { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.h-status.finished { background: rgba(67,160,71,.15); color: #43A047; }
.h-status.exited { background: rgba(229,57,53,.15); color: #E53935; }
.h-status.paused, .h-status.in.progress { background: rgba(251,191,36,.15); color: #FBBF24; }
.h-details { font-size: 11px; color: var(--t2); margin-top: 5px; border-top: 1px solid rgba(255,255,255,.03); padding-top: 5px; }
.h-btn {
  width: 100%;
  margin-top: 10px;
  background: var(--p);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.empty-state { text-align: center; padding: 50px 20px; color: var(--t2); font-size: 14px; }

/* ── AUTH & GOOGLE LOGIN ── */
#authContainer {
  margin-top: 5px;
}

#loginBtn {
  background: linear-gradient(135deg, #4285F4, #34A853);
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
  border: none;
  border-radius: 12px;
  padding: 12px;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  width: 100%;
}

#loginBtn:active {
  transform: scale(0.98);
}

#logoutBtn i {
  color: var(--red) !important;
}

.proav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.proav {
  overflow: hidden;
  position: relative;
}