/* final viewport + bottom-nav fix */
html, body {
  min-height: 100svh;
  height: 100svh;
  background:
    radial-gradient(circle at top, rgba(13,63,123,.55), transparent 35%),
    linear-gradient(180deg, #06152d 0%, #041022 42%, #020912 100%) fixed;
}
body { overflow: hidden; }
.app-shell.app-shell-redesign {
  width: 100%;
  max-width: 100%;
  height: var(--tg-vh, 100svh);
  min-height: var(--tg-vh, 100svh);
  padding: calc(var(--safe-top) + 72px) 8px 0 8px !important;
  gap: 8px;
}
.main-layout.redesigned-main-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.screen.active {
  height: 100%;
  min-height: 0;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 22px) !important;
  margin-bottom: 0 !important;
}
.redesign-bottom-nav {
  bottom: 0 !important;
  width: calc(100% - 12px);
  max-width: 560px;
}
#games-screen .redesign-screen-head {
  align-items: center;
}
#games-screen .screen-title {
  margin-bottom: 0;
}
#games-screen .screen-subtitle,
#games-screen .screen-kicker,
#cases-screen .screen-subtitle,
#free-screen .screen-subtitle,
#tasks-screen .screen-subtitle,
#tournament-screen .screen-subtitle,
#profile-screen .section-subtext {
  display: none !important;
}
#games-screen .game-select-grid.redesign-games-grid {
  gap: 10px;
}
#games-screen .game-pick-card.game-pick-visual {
  min-height: 84px;
  border-radius: 24px;
}
#games-screen .game-pick-card .game-pick-content {
  padding: 16px 18px;
}
#games-screen .game-pick-card .game-pick-title {
  font-size: 18px;
}
#games-screen .game-pick-card .game-pick-text {
  display: none;
}
@media (max-width: 480px) {
  .app-shell.app-shell-redesign {
    padding-left: 6px !important;
    padding-right: 6px !important;
    padding-top: calc(var(--safe-top) + 68px) !important;
  }
  .screen.active {
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px) !important;
  }
  .redesign-bottom-nav {
    width: calc(100% - 8px);
    border-radius: 26px 26px 0 0;
  }
}


/* games cards stretch fix */
#games-screen .game-select-grid.redesign-games-grid {
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  width: 100%;
}
#games-screen .game-pick-card.game-pick-visual {
  width: 100%;
  min-height: 108px !important;
  border-radius: 28px;
}
#games-screen .game-pick-card .game-pick-content {
  padding: 18px 20px !important;
}
#games-screen .game-pick-card .game-pick-title {
  font-size: 20px !important;
}
#games-screen .cards-stack.redesign-games-stack {
  gap: 14px;
}
#games-screen .redesign-screen-head {
  margin-bottom: 14px;
}
#games-screen .chip-btn {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 34px;
  line-height: 1;
}
@media (max-width: 480px) {
  #games-screen .game-pick-card.game-pick-visual {
    min-height: 96px !important;
  }
  #games-screen .game-pick-card .game-pick-title {
    font-size: 18px !important;
  }
}

/* full width fix for Games and Free screens */
.app-shell.app-shell-redesign {
  width: 100% !important;
  max-width: none !important;
}
.main-layout.redesigned-main-layout {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.screen,
.screen.active {
  width: 100% !important;
  max-width: none !important;
}
#games-screen,
#free-screen,
#games-screen.screen.active,
#free-screen.screen.active {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
#games-screen .cards-stack.redesign-games-stack,
#free-screen .cards-stack.redesign-free-stack {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
#games-screen .game-select-grid.redesign-games-grid,
#games-screen .game-pick-card.game-pick-visual,
#free-screen .reward-card,
#free-screen .panel-card.glass-soft.redesign-promo-card,
#free-screen .promo-row,
#free-screen .promo-input,
#free-screen #applyPromoBtn {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}
#games-screen .game-select-grid.redesign-games-grid,
#free-screen .reward-card,
#free-screen .panel-card.glass-soft.redesign-promo-card {
  justify-self: stretch !important;
}
.redesign-bottom-nav {
  width: calc(100% - 12px) !important;
  max-width: none !important;
}
@media (max-width: 520px) {
  .redesign-bottom-nav {
    width: calc(100% - 8px) !important;
  }
  #free-screen .promo-row {
    grid-template-columns: 1fr !important;
  }
}

/* final polish patch */
.redesign-bottom-nav {
  background:
    linear-gradient(180deg, rgba(78,54,15,.96), rgba(24,18,10,.98)) !important;
  border: 1px solid rgba(255,210,120,.16) !important;
  box-shadow:
    0 -8px 28px rgba(0,0,0,.34),
    0 0 32px rgba(255,190,70,.10),
    inset 0 1px 0 rgba(255,236,180,.10) !important;
}
.redesign-bottom-nav .tab {
  color: rgba(255,236,205,.72) !important;
  background: rgba(255,215,120,.035) !important;
}
.redesign-bottom-nav .tab.active {
  color: #fff7e5 !important;
  background: linear-gradient(180deg, rgba(255,210,120,.14), rgba(255,185,70,.08)) !important;
  box-shadow: 0 0 24px rgba(255,196,76,.16), inset 0 1px 0 rgba(255,244,205,.14) !important;
}

.trophy-mini-btn {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
  align-self: center;
  padding: 0 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(255,216,119,.16), rgba(95,71,20,.22)) !important;
  border: 1px solid rgba(255,220,140,.18) !important;
  color: #ffe7a7 !important;
  font-size: 18px !important;
  box-shadow: 0 0 16px rgba(255,200,80,.10) !important;
}

#games-screen .redesign-screen-head {
  display: none !important;
}
#games-screen .cards-stack.redesign-games-stack {
  gap: 16px !important;
  padding-top: 2px;
}
#games-screen .game-select-grid.redesign-games-grid {
  gap: 16px !important;
}
#games-screen .game-pick-card.game-pick-visual {
  min-height: 118px !important;
}
#games-screen .game-pick-card.game-pick-visual[data-solo-game="plinko"] .game-pick-title {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}
#games-screen .game-pick-card .game-pick-title {
  color: #ffffff !important;
}
#games-screen .redesign-feed-card {
  display: none !important;
}

#free-screen,
#free-screen.screen.active {
  overflow: hidden !important;
}
#free-screen .cards-stack.redesign-free-stack {
  height: 100%;
  justify-content: flex-start;
  gap: 14px !important;
  padding-top: 6px;
}
#free-screen .redesign-screen-head {
  display: none !important;
}
#free-screen .reward-card {
  padding: 18px !important;
}
#free-screen .panel-badge.gold {
  margin-bottom: 12px;
}
#free-screen .reward-stars {
  font-size: 30px !important;
  line-height: 1.05 !important;
}
#free-screen .section-subtext {
  margin-top: 2px !important;
  font-size: 12px !important;
}
#free-screen .reward-claim-btn {
  min-height: 62px !important;
  margin-top: 14px !important;
}
#free-screen .reward-timer {
  margin-top: 10px !important;
}
#free-screen .redesign-promo-card {
  padding: 16px !important;
}
#free-screen .redesign-promo-card .panel-head {
  margin-bottom: 10px !important;
}
#free-screen .promo-row {
  gap: 12px !important;
}
#free-screen .promo-input,
#free-screen #applyPromoBtn {
  min-height: 58px !important;
}

@media (max-width: 480px) {
  .trophy-mini-btn {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
    font-size: 17px !important;
  }
  #games-screen .game-pick-card.game-pick-visual {
    min-height: 124px !important;
  }
  #free-screen .reward-card {
    padding: 16px !important;
  }
  #free-screen .reward-stars {
    font-size: 28px !important;
  }
  #free-screen .reward-claim-btn,
  #free-screen .promo-input,
  #free-screen #applyPromoBtn {
    min-height: 56px !important;
  }
}


/* ===== final ios premium patch ===== */
:root{
  --ios-shell-side:10px;
  --ios-panel-radius:26px;
  --ios-card-radius:24px;
}
html,body{
  background:
    radial-gradient(circle at 50% -10%, rgba(24,86,166,.30), transparent 34%),
    linear-gradient(180deg, #071425 0%, #041022 52%, #030913 100%) fixed !important;
}
.app-shell.app-shell-redesign{
  width:100% !important;
  max-width:none !important;
  min-height:var(--tg-vh,100svh) !important;
  height:var(--tg-vh,100svh) !important;
  padding:calc(var(--safe-top) + 72px) var(--ios-shell-side) 0 !important;
  gap:6px !important;
}
.main-layout.redesigned-main-layout{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
  display:block !important;
  overflow:hidden !important;
}
.screen,.screen.active{
  width:100% !important;
  max-width:none !important;
}
#games-screen.screen.active{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:4px 0 calc(var(--nav-h) + var(--safe-bottom) + 12px) !important;
}
#free-screen.screen.active{
  overflow:hidden !important;
  padding:4px 0 calc(var(--nav-h) + var(--safe-bottom) + 10px) !important;
}
#games-screen .cards-stack.redesign-games-stack,
#free-screen .cards-stack.redesign-free-stack{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 !important;
}
#games-screen .cards-stack.redesign-games-stack{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:14px !important;
}
#free-screen .cards-stack.redesign-free-stack{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  gap:12px !important;
  height:100% !important;
}
#games-screen .game-select-grid.redesign-games-grid{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:14px !important;
  width:100% !important;
}
#games-screen .game-pick-card.game-pick-visual{
  width:100% !important;
  min-height:124px !important;
  border-radius:26px !important;
  border:1px solid rgba(255,255,255,.06) !important;
  box-shadow:0 14px 34px rgba(0,0,0,.24) !important;
}
#games-screen .game-pick-art{
  background-position:center center !important;
}
#games-screen .game-pick-overlay{
  background:linear-gradient(180deg, rgba(0,0,0,.06) 0%, rgba(0,0,0,.18) 36%, rgba(0,0,0,.64) 100%) !important;
}
#games-screen .game-pick-card .game-pick-content{
  padding:18px 20px !important;
  justify-content:flex-end !important;
}
#games-screen .game-pick-card .game-pick-title{
  font-size:19px !important;
  font-weight:800 !important;
  color:#fff !important;
  text-shadow:0 1px 8px rgba(0,0,0,.32) !important;
}
#games-screen .game-pick-card .game-pick-text{display:none !important;}
#games-screen .redesign-screen-head,
#games-screen .redesign-feed-card{display:none !important;}
#games-screen .game-pick-card.game-pick-visual[data-solo-game="plinko"] .game-pick-title{
  color:#fff !important;
}
#free-screen .reward-card,
#free-screen .panel-card.glass-soft.redesign-promo-card{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  align-self:stretch !important;
  border-radius:26px !important;
  box-sizing:border-box !important;
}
#free-screen .reward-card{
  flex:1 1 auto !important;
  min-height:0 !important;
  padding:18px !important;
  gap:12px !important;
  background:
    radial-gradient(circle at 50% 10%, rgba(255,216,97,.14), transparent 40%),
    linear-gradient(180deg, rgba(8,28,58,.92), rgba(4,17,35,.98)) !important;
  border:1px solid rgba(255,255,255,.06) !important;
}
#free-screen .reward-glow{
  inset:auto -16% 56% -16% !important;
  height:140px !important;
  background:radial-gradient(circle, rgba(255,219,113,.22), transparent 66%) !important;
}
#free-screen .panel-badge.gold{
  align-self:flex-start !important;
  padding:7px 18px !important;
  margin:0 0 6px 0 !important;
  color:#f3f2ea !important;
  font-size:13px !important;
  font-weight:800 !important;
  background:linear-gradient(90deg, rgba(111,108,53,.76), rgba(140,128,60,.38)) !important;
  border:1px solid rgba(214,188,104,.16) !important;
}
#free-screen .reward-stars{
  font-size:34px !important;
  line-height:1.02 !important;
  letter-spacing:-.03em !important;
}
#free-screen .section-subtext{
  display:block !important;
  font-size:12px !important;
  color:rgba(255,255,255,.74) !important;
  margin:0 !important;
}
#free-screen .reward-claim-btn{
  width:100% !important;
  min-height:64px !important;
  margin-top:auto !important;
  border-radius:18px !important;
}
#free-screen .reward-timer{
  margin-top:2px !important;
  font-size:12px !important;
}
#free-screen .redesign-promo-card{
  flex:0 0 auto !important;
  padding:16px !important;
  background:linear-gradient(180deg, rgba(7,27,58,.92), rgba(4,17,35,.98)) !important;
  border:1px solid rgba(255,255,255,.06) !important;
}
#free-screen .redesign-promo-card .panel-head{
  margin-bottom:10px !important;
}
#free-screen .redesign-promo-card .panel-title{
  font-size:28px !important;
  line-height:1 !important;
  letter-spacing:-.03em !important;
}
#free-screen .redesign-promo-card .section-subtext{
  font-size:12px !important;
}
#free-screen .promo-row{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:6px !important;
  width:100% !important;
}
#free-screen .promo-input,
#free-screen #applyPromoBtn{
  width:100% !important;
  min-height:58px !important;
  border-radius:18px !important;
}
.redesign-bottom-nav{
  width:calc(100% - 16px) !important;
  max-width:none !important;
  bottom:8px !important;
  padding:7px !important;
  border-radius:30px !important;
  background:linear-gradient(180deg, rgba(88,64,22,.88), rgba(37,28,13,.96)) !important;
  border:1px solid rgba(214,175,92,.14) !important;
  box-shadow:0 12px 28px rgba(0,0,0,.28), 0 0 14px rgba(214,175,92,.08), inset 0 1px 0 rgba(255,240,196,.08) !important;
}
.redesign-bottom-nav .tab{
  min-height:70px !important;
  border-radius:18px !important;
  color:rgba(255,236,205,.72) !important;
  background:linear-gradient(180deg, rgba(255,220,150,.03), rgba(255,220,150,.015)) !important;
}
.redesign-bottom-nav .tab.active{
  color:#fff7ea !important;
  background:linear-gradient(180deg, rgba(255,221,153,.10), rgba(255,195,98,.05)) !important;
  box-shadow:0 0 12px rgba(224,182,96,.14), inset 0 1px 0 rgba(255,242,214,.10) !important;
}
.redesign-bottom-nav .tab .nav-icon{
  opacity:.95;
}
.floating-balance-card{
  background:linear-gradient(180deg, rgba(8,28,57,.92), rgba(5,18,37,.96)) !important;
  border:1px solid rgba(122,220,255,.12) !important;
  box-shadow:0 14px 32px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
.trophy-mini-btn{
  width:32px !important;
  height:32px !important;
  flex:0 0 32px !important;
  border-radius:12px !important;
  font-size:16px !important;
  color:#ffe5a0 !important;
  background:linear-gradient(180deg, rgba(255,218,122,.14), rgba(107,78,20,.18)) !important;
  border:1px solid rgba(255,222,143,.14) !important;
  box-shadow:0 0 8px rgba(255,200,80,.06) !important;
}
@media (max-width:480px){
  .app-shell.app-shell-redesign{padding:calc(var(--safe-top) + 68px) 8px 0 !important;}
  .redesign-bottom-nav{width:calc(100% - 12px) !important; bottom:6px !important;}
  #games-screen .game-pick-card.game-pick-visual{min-height:128px !important;}
  #free-screen .reward-card{padding:16px !important;}
  #free-screen .redesign-promo-card{padding:14px !important;}
}

/* ===== premium ios motion patch ===== */
:root{
  --premium-ease:cubic-bezier(.22,.61,.36,1);
  --premium-fast:180ms;
  --premium-med:320ms;
  --premium-slow:560ms;
  --premium-gold-1:rgba(255,222,154,.16);
  --premium-gold-2:rgba(206,161,79,.08);
  --premium-line:rgba(255,255,255,.08);
  --premium-shadow:0 18px 50px rgba(0,0,0,.30);
  --premium-glow:0 10px 24px rgba(255,210,120,.08);
  --premium-inset:inset 0 1px 0 rgba(255,255,255,.10), inset 0 -1px 0 rgba(255,255,255,.02);
}

.app-shell.app-shell-redesign{
  width:100% !important;
  max-width:none !important;
  padding-left:10px !important;
  padding-right:10px !important;
  background:
    radial-gradient(circle at 50% -12%, rgba(255,214,122,.08), transparent 26%),
    radial-gradient(circle at 10% 18%, rgba(114,152,255,.08), transparent 24%),
    linear-gradient(180deg,#05101f 0%,#071523 56%,#05101e 100%);
}

.main-layout.redesigned-main-layout,
.redesigned-main-layout,
.cards-stack,
.redesign-games-stack,
.redesign-free-stack{
  width:100% !important;
  max-width:none !important;
}

.redesigned-main-layout{
  margin:0 !important;
  padding:18px 0 112px !important;
}

#games-screen .cards-stack,
#free-screen .cards-stack{
  gap:14px !important;
}

#games-screen .redesign-games-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:14px !important;
  width:100% !important;
}

#games-screen .game-pick-card.game-pick-visual{
  width:100% !important;
  min-height:168px !important;
  border-radius:30px !important;
  justify-self:stretch !important;
  background:linear-gradient(180deg,rgba(16,22,35,.72),rgba(8,11,19,.88)) !important;
  border:1px solid rgba(255,255,255,.08) !important;
  box-shadow:0 18px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(255,255,255,.02) !important;
  transition:transform var(--premium-fast) var(--premium-ease), box-shadow var(--premium-med) var(--premium-ease), border-color var(--premium-fast) var(--premium-ease), filter var(--premium-fast) var(--premium-ease);
  isolation:isolate;
}

#games-screen .game-pick-card.game-pick-visual::before,
#games-screen .game-pick-card.game-pick-visual::after,
.reward-card::before,
.redesign-promo-card::before,
.redesign-bottom-nav::before,
.floating-balance-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
}

#games-screen .game-pick-card.game-pick-visual::before,
.reward-card::before,
.redesign-promo-card::before,
.floating-balance-card::before{
  border-radius:inherit;
  background:linear-gradient(180deg,rgba(255,255,255,.10),rgba(255,255,255,0) 26%, rgba(255,255,255,.04) 100%);
  opacity:.9;
}

#games-screen .game-pick-card.game-pick-visual::after,
.reward-card::after,
.redesign-promo-card::after{
  content:"";
  position:absolute;
  inset:auto -20% -42% auto;
  width:58%;
  height:62%;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,220,140,.18) 0%, rgba(255,220,140,0) 72%);
  filter:blur(16px);
  opacity:.55;
  pointer-events:none;
}

#games-screen .game-pick-card .game-pick-art{
  transform:scale(1.025);
  transition:transform var(--premium-slow) var(--premium-ease), filter var(--premium-med) var(--premium-ease);
  filter:saturate(1.02) contrast(1.02);
}

#games-screen .game-pick-card .game-pick-overlay{
  background:linear-gradient(180deg,rgba(7,10,17,.10) 0%, rgba(7,10,17,.20) 34%, rgba(5,8,14,.76) 100%) !important;
  transition:background var(--premium-med) var(--premium-ease), opacity var(--premium-med) var(--premium-ease);
}

#games-screen .game-pick-card .game-pick-content{
  padding:18px !important;
  gap:4px !important;
}

#games-screen .game-pick-card .game-pick-title{
  color:#ffffff !important;
  text-shadow:0 1px 0 rgba(0,0,0,.28), 0 10px 24px rgba(0,0,0,.22);
}

#games-screen .game-pick-card .game-pick-text{
  color:rgba(244,247,255,.84) !important;
}

#games-screen .game-pick-card.active,
#games-screen .game-pick-card.game-pick-visual:focus-visible{
  border-color:rgba(255,232,188,.18) !important;
  box-shadow:0 22px 46px rgba(0,0,0,.34), 0 10px 24px rgba(255,210,120,.10), inset 0 1px 0 rgba(255,255,255,.10) !important;
}

#games-screen .game-pick-card.active .game-pick-overlay{
  background:linear-gradient(180deg,rgba(14,12,8,.06) 0%, rgba(18,14,8,.16) 34%, rgba(10,8,6,.68) 100%) !important;
}

#free-screen.screen.active{
  overflow:hidden !important;
}

#free-screen .cards-stack{
  min-height:calc(100dvh - var(--safe-top) - var(--nav-h) - 104px);
  justify-content:flex-start;
}

#free-screen .reward-card,
#free-screen .redesign-promo-card{
  position:relative;
  width:100% !important;
  max-width:none !important;
  border-radius:30px !important;
  border:1px solid rgba(255,255,255,.08) !important;
  box-shadow:var(--premium-shadow), var(--premium-glow), var(--premium-inset) !important;
  backdrop-filter:blur(18px) saturate(1.08);
  -webkit-backdrop-filter:blur(18px) saturate(1.08);
  overflow:hidden;
  transition:transform var(--premium-fast) var(--premium-ease), box-shadow var(--premium-med) var(--premium-ease), border-color var(--premium-fast) var(--premium-ease);
}

#free-screen .reward-card{
  padding:18px 18px 16px !important;
  background:linear-gradient(180deg,rgba(42,31,12,.86),rgba(19,17,12,.92)) !important;
}

#free-screen .redesign-promo-card{
  padding:16px !important;
  background:linear-gradient(180deg,rgba(10,23,42,.90),rgba(7,18,35,.95)) !important;
}

#free-screen .panel-badge.gold,
#free-screen .panel-head{
  display:none !important;
}

#free-screen .reward-stars{
  margin-top:2px;
}

#free-screen .promo-row{
  display:grid !important;
  grid-template-columns:1fr auto !important;
  gap:6px !important;
  width:100% !important;
}

#free-screen .promo-input,
#free-screen .dark-btn,
#free-screen .primary-btn,
.mini-action-btn,
.bottom-nav .tab,
button,
.chip-btn,
.ton-btn{
  transition:transform var(--premium-fast) var(--premium-ease), box-shadow var(--premium-fast) var(--premium-ease), filter var(--premium-fast) var(--premium-ease), background var(--premium-med) var(--premium-ease), border-color var(--premium-fast) var(--premium-ease), opacity var(--premium-fast) var(--premium-ease);
}

#free-screen .promo-input,
#free-screen .dark-btn,
#free-screen .primary-btn,
.floating-balance-main,
.mini-action-btn,
.bottom-nav .tab,
.redesign-bottom-nav,
.floating-balance-card,
.reward-card,
.redesign-promo-card,
.game-pick-card.game-pick-visual,
.glass-soft{
  backdrop-filter:blur(18px) saturate(1.06);
  -webkit-backdrop-filter:blur(18px) saturate(1.06);
}

.redesign-bottom-nav{
  position:fixed;
  overflow:hidden;
  background:linear-gradient(180deg, rgba(70,52,23,.82), rgba(31,23,12,.92)) !important;
  border:1px solid rgba(255,224,169,.10) !important;
  box-shadow:0 12px 30px rgba(0,0,0,.30), 0 0 0 1px rgba(255,255,255,.03), inset 0 1px 0 rgba(255,247,220,.10) !important;
}

.redesign-bottom-nav::before{
  border-radius:inherit;
  background:linear-gradient(180deg,rgba(255,246,216,.14),rgba(255,246,216,0) 38%, rgba(255,208,120,.03) 100%);
}

.redesign-bottom-nav .tab{
  position:relative;
  color:rgba(255,239,214,.72) !important;
  background:linear-gradient(180deg, rgba(255,233,180,.025), rgba(255,233,180,.012)) !important;
  border:1px solid transparent;
}

.redesign-bottom-nav .tab.active{
  color:#fffaf1 !important;
  background:linear-gradient(180deg, rgba(255,233,180,.10), rgba(255,196,104,.04)) !important;
  border-color:rgba(255,227,179,.10);
  box-shadow:0 8px 18px rgba(255,208,120,.09), inset 0 1px 0 rgba(255,248,225,.10) !important;
}

.redesign-bottom-nav .tab.active .nav-icon,
.redesign-bottom-nav .tab.active span:last-child{
  filter:drop-shadow(0 0 10px rgba(255,222,147,.12));
}

.floating-balance-card{
  overflow:hidden;
  background:linear-gradient(180deg, rgba(10,26,48,.80), rgba(7,18,35,.88)) !important;
  border:1px solid rgba(255,255,255,.07) !important;
  box-shadow:0 16px 36px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.07), 0 0 24px rgba(112,152,255,.06) !important;
}

.floating-balance-main{
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(255,255,255,.02);
}

.compact-balance-toolbar .mini-action-btn,
.trophy-mini-btn{
  background:linear-gradient(180deg, rgba(255,231,181,.14), rgba(255,194,102,.06)) !important;
  border:1px solid rgba(255,228,184,.10) !important;
  box-shadow:0 8px 16px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,249,232,.10) !important;
}

.primary-btn,
.dark-btn,
.ton-btn,
.chip-btn{
  position:relative;
  overflow:hidden;
}

.primary-btn::after,
.dark-btn::after,
.ton-btn::after,
.chip-btn::after,
.mini-action-btn::after,
.bottom-nav .tab::after{
  content:"";
}

.primary-btn::before,
.dark-btn::before,
.ton-btn::before,
.chip-btn::before,
.mini-action-btn::before,
.bottom-nav .tab::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(110deg, transparent 0%, rgba(255,255,255,.12) 45%, transparent 70%);
  transform:translateX(-130%);
  opacity:0;
  pointer-events:none;
}

@keyframes premiumShimmer{
  0%{transform:translateX(-130%);opacity:0}
  18%{opacity:.55}
  100%{transform:translateX(130%);opacity:0}
}

@keyframes premiumFadeUp{
  from{opacity:0;transform:translateY(10px) scale(.985);filter:blur(6px)}
  to{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}
}

@keyframes premiumFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-2px)}
}

.screen.active{
  animation:premiumFadeUp .34s var(--premium-ease);
}

#games-screen .game-pick-card:nth-child(1){animation:premiumFadeUp .34s var(--premium-ease) .02s both}
#games-screen .game-pick-card:nth-child(2){animation:premiumFadeUp .34s var(--premium-ease) .06s both}
#games-screen .game-pick-card:nth-child(3){animation:premiumFadeUp .34s var(--premium-ease) .10s both}
#games-screen .game-pick-card:nth-child(4){animation:premiumFadeUp .34s var(--premium-ease) .14s both}
#free-screen .reward-card{animation:premiumFadeUp .34s var(--premium-ease) .02s both}
#free-screen .redesign-promo-card{animation:premiumFadeUp .34s var(--premium-ease) .09s both}

@media (hover:hover){
  #games-screen .game-pick-card.game-pick-visual:hover,
  #free-screen .reward-card:hover,
  #free-screen .redesign-promo-card:hover,
  .bottom-nav .tab:hover,
  .mini-action-btn:hover,
  .primary-btn:hover,
  .dark-btn:hover,
  .ton-btn:hover,
  .chip-btn:hover{
    transform:translateY(-2px);
  }

  #games-screen .game-pick-card.game-pick-visual:hover .game-pick-art{
    transform:scale(1.045);
    filter:saturate(1.06) contrast(1.04);
  }

  #games-screen .game-pick-card.game-pick-visual:hover::before,
  #free-screen .reward-card:hover::before,
  #free-screen .redesign-promo-card:hover::before,
  .primary-btn:hover::before,
  .dark-btn:hover::before,
  .ton-btn:hover::before,
  .chip-btn:hover::before,
  .mini-action-btn:hover::before,
  .bottom-nav .tab:hover::before{
    animation:premiumShimmer 900ms var(--premium-ease) 1;
  }
}

#games-screen .game-pick-card.game-pick-visual:active,
#free-screen .reward-card:active,
#free-screen .redesign-promo-card:active,
.primary-btn:active,
.dark-btn:active,
.ton-btn:active,
.chip-btn:active,
.mini-action-btn:active,
.bottom-nav .tab:active{
  transform:scale(.985);
}

.bottom-nav .tab.active,
.trophy-mini-btn,
#dailyClaimMainBtn,
#applyPromoBtn{
  animation:premiumFloat 3.2s ease-in-out infinite;
}

#games-screen .redesign-screen-head,
#free-screen .redesign-screen-head,
#games-screen .screen-kicker,
#games-screen .screen-title,
#games-screen .screen-subtitle{
  display:none !important;
}

@media (max-width:640px){
  .app-shell.app-shell-redesign{
    padding-left:8px !important;
    padding-right:8px !important;
  }

  .redesigned-main-layout{
    padding-top:16px !important;
    padding-bottom:104px !important;
  }

  #games-screen .redesign-games-grid,
  #free-screen .cards-stack{
    gap:12px !important;
  }

  #games-screen .game-pick-card.game-pick-visual{
    min-height:150px !important;
  }

  #free-screen .cards-stack{
    min-height:calc(100dvh - var(--safe-top) - var(--nav-h) - 96px);
  }

  #free-screen .promo-row{
    grid-template-columns:1fr auto !important;
  }
}


.redesign-quick-links-large{display:grid;gap:14px}
.profile-link-row-large{min-height:86px;padding:0 22px;font-size:20px;font-weight:800;border-radius:24px}
.profile-link-row-large .masked-icon{width:24px;height:24px}
.profile-action-modal{position:fixed;inset:0;z-index:120;display:grid;place-items:end center;padding:18px;background:rgba(0,0,0,.01)}
.profile-action-modal.hidden{display:none!important}
.profile-action-backdrop{position:absolute;inset:0;background:rgba(2,9,20,.72);backdrop-filter:blur(8px)}
.profile-action-card{position:relative;width:min(100%,640px);max-height:min(86vh,880px);overflow:auto;border-radius:30px;padding:18px;background:linear-gradient(180deg,rgba(9,24,54,.98),rgba(5,17,38,.98));border:1px solid rgba(255,255,255,.08);box-shadow:0 30px 90px rgba(0,0,0,.45)}
.profile-action-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.profile-action-close{width:44px;height:44px;border:none;border-radius:13px;background:rgba(255,255,255,.08);color:#fff;font-size:20px;font-weight:800}
.profile-action-body{display:grid;gap:14px}
.profile-action-modal .panel-card{margin:0}
.profile-action-modal .finance-switcher,.profile-action-modal #finance-tab-withdraw,.profile-action-modal .withdraw-focus-card{display:none!important}
.profile-action-modal[data-mode="deposit"] .redesign-convert-card,
.profile-action-modal[data-mode="deposit"] .redesign-wallet-functions,
.profile-action-modal[data-mode="deposit"] .redesign-referral-card{display:none!important}
.profile-action-modal[data-mode="withdraw"] #finance-tab-deposit,
.profile-action-modal[data-mode="withdraw"] .redesign-referral-card{display:none!important}
.profile-action-modal[data-mode="referral"] #finance-tab-deposit,
.profile-action-modal[data-mode="referral"] .redesign-convert-card,
.profile-action-modal[data-mode="referral"] .redesign-wallet-functions{display:none!important}
.profile-action-modal .section-subtext,
.profile-action-modal .eyebrow{display:none!important}
.profile-action-modal[data-mode="withdraw"]{
  padding:4px 6px max(4px,var(--safe-bottom));
}
.profile-action-modal[data-mode="withdraw"] .profile-action-card{
  width:min(100%,496px) !important;
  max-height:min(88dvh,720px) !important;
  border-radius:22px !important;
  padding:10px !important;
}
.profile-action-modal[data-mode="withdraw"] .profile-action-head{
  margin-bottom:6px !important;
}
.profile-action-modal[data-mode="withdraw"] .profile-action-body,
.profile-action-modal[data-mode="withdraw"] .wallet-layout,
.profile-action-modal[data-mode="withdraw"] .redesign-wallet-functions,
.profile-action-modal[data-mode="withdraw"] .wallet-function-grid,
.profile-action-modal[data-mode="withdraw"] .field-row,
.profile-action-modal[data-mode="withdraw"] .withdraw-summary-grid{
  gap:4px !important;
}
.profile-action-modal[data-mode="withdraw"] .redesign-convert-card,
.profile-action-modal[data-mode="withdraw"] .redesign-wallet-functions{
  padding:8px !important;
  border-radius:16px !important;
}
.profile-action-modal[data-mode="withdraw"] .compact-panel-head,
.profile-action-modal[data-mode="withdraw"] .panel-head{
  margin-bottom:4px !important;
}
.profile-action-modal[data-mode="withdraw"] .panel-title{
  font-size:15px !important;
  line-height:1.15 !important;
}
.profile-action-modal[data-mode="withdraw"] .wallet-function-grid{
  margin-bottom:4px !important;
}
.profile-action-modal[data-mode="withdraw"] .field label{
  margin-bottom:2px !important;
  font-size:10px !important;
}
.profile-action-modal[data-mode="withdraw"] .field input,
.profile-action-modal[data-mode="withdraw"] .profile-info-chip{
  min-height:34px !important;
  height:34px !important;
  padding:0 10px !important;
  border-radius:12px !important;
  font-size:12px !important;
}
.profile-action-modal[data-mode="withdraw"] #convertStarsBtn,
.profile-action-modal[data-mode="withdraw"] #unbindTonWalletBtn,
.profile-action-modal[data-mode="withdraw"] .danger-btn{
  min-height:36px !important;
  height:36px !important;
  padding:0 10px !important;
  border-radius:12px !important;
  font-size:12px !important;
}
.profile-action-modal[data-mode="withdraw"] #withdrawAmount{
  min-height:34px !important;
  height:34px !important;
}
.profile-action-modal[data-mode="withdraw"] .summary-chip{
  padding:5px 8px !important;
  font-size:10px !important;
  border-radius:12px !important;
}
.profile-action-modal[data-mode="withdraw"] #walletConnectNote,
.profile-action-modal[data-mode="withdraw"] #withdrawTonHint{
  display:none !important;
}
#wallet-screen.profile-history-only{margin-top:18px}
#wallet-screen.profile-history-only .wallet-layout{display:block}
#wallet-screen.profile-history-only .finance-switcher,
#wallet-screen.profile-history-only #finance-tab-deposit,
#wallet-screen.profile-history-only .redesign-convert-card,
#wallet-screen.profile-history-only .redesign-wallet-functions,
#wallet-screen.profile-history-only #finance-tab-withdraw,
#wallet-screen.profile-history-only .redesign-referral-card{display:none!important}
#wallet-screen.profile-history-only .wallet-layout > .panel-card:last-child{margin-top:0}
@media (max-width:640px){.profile-link-row-large{min-height:78px;font-size:18px;padding:0 18px}.profile-action-card{width:min(100%,100vw);max-height:88vh;border-radius:26px 26px 0 0;padding:16px}}


/* performance + adaptive profile patch */
:root{
  --yak-fast-shadow:0 10px 28px rgba(0,0,0,.22);
}
.app-shell.app-shell-redesign,
.profile-action-backdrop,
.panel-card,
.glass-soft,
.redesign-bottom-nav,
.floating-balance-card,
.game-pick-card.game-pick-visual,
.profile-link-row,
.profile-link-row-large,
.reward-card,
.redesign-promo-card,
.profile-action-card{
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
.panel-card,
.glass-soft,
.redesign-bottom-nav,
.floating-balance-card,
.profile-action-card,
.game-pick-card.game-pick-visual,
.profile-link-row,
.profile-link-row-large,
.reward-card,
.redesign-promo-card{
  box-shadow:var(--yak-fast-shadow) !important;
}
.screen.active,
#games-screen .game-pick-card:nth-child(1),
#games-screen .game-pick-card:nth-child(2),
#games-screen .game-pick-card:nth-child(3),
#games-screen .game-pick-card:nth-child(4),
#free-screen .reward-card,
#free-screen .redesign-promo-card,
.bottom-nav .tab.active,
.trophy-mini-btn,
#dailyClaimMainBtn,
#applyPromoBtn{
  animation:none !important;
}
*{
  scroll-behavior:auto;
}
#profile-screen.screen.active{
  overflow-y:hidden !important;
  overflow-x:hidden !important;
  padding:4px 0 0 !important;
}
.redesign-profile-stack{
  gap:12px !important;
}
.redesign-profile-hero,
.redesign-quick-links,
#wallet-screen.profile-history-only .wallet-layout > .panel-card:last-child{
  border-radius:24px !important;
}
.redesign-profile-hero{
  padding:16px !important;
}
.profile-wallet-label{
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.profile-wallet-label span,
#profileWalletLabel{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.redesign-balance-card{
  margin-top:12px !important;
  padding:14px !important;
  border-radius:18px !important;
}
.redesign-balance-values{
  gap:6px !important;
}
.redesign-balance-item{
  min-height:84px;
  padding:9px !important;
  border-radius:18px !important;
}
.balance-badge{
  width:38px !important;
  height:38px !important;
  font-size:18px !important;
}
.balance-value{
  font-size:clamp(22px,6vw,30px) !important;
}
.redesign-balance-actions{
  gap:6px !important;
  margin-top:14px !important;
}
.redesign-balance-actions .primary-btn,
.redesign-balance-actions .secondary-btn{
  min-height:54px;
}
.redesign-quick-links-large{
  gap:6px !important;
  padding:7px !important;
}
.profile-link-row-large{
  min-height:64px !important;
  padding:0 18px !important;
  font-size:17px !important;
  border-radius:18px !important;
}
.profile-link-row-large .masked-icon{
  width:22px !important;
  height:22px !important;
}
#wallet-screen.profile-history-only{
  margin-top:0 !important;
}
#wallet-screen.profile-history-only .wallet-layout > .panel-card:last-child{
  padding:16px !important;
}
.profile-action-modal{
  align-items:end;
  padding:7px 8px max(8px,var(--safe-bottom));
}
.profile-action-card{
  width:min(100%,560px) !important;
  max-height:min(92vh,820px) !important;
  border-radius:24px !important;
  padding:14px !important;
}
.profile-action-head{
  margin-bottom:10px !important;
}
.profile-action-close{
  width:40px !important;
  height:40px !important;
  border-radius:13px !important;
}
.history-list.compact-history-list,
#transactions.history-list{
  max-height:none !important;
}
@media (max-width:640px){
  .app-shell.app-shell-redesign{
    padding-top:calc(var(--safe-top) + 62px) !important;
    padding-left:8px !important;
    padding-right:8px !important;
  }
  .floating-balance-card.compact-balance-toolbar,
  .compact-balance-toolbar{
    top:calc(var(--safe-top) + 10px) !important;
  }
  .redesigned-main-layout{
    margin-top:8px !important;
    padding-top:8px !important;
  }
  .redesign-profile-hero{
    padding:14px !important;
  }
  .redesign-profile-header-row{
    margin-bottom:10px !important;
  }
  .redesign-balance-values,
  .redesign-balance-actions{
    grid-template-columns:1fr !important;
  }
  .redesign-balance-item{
    min-height:76px;
  }
  .profile-link-row-large{
    min-height:64px !important;
    font-size:16px !important;
  }
  .profile-action-card{
    width:100% !important;
    max-height:calc(100dvh - 8px) !important;
    border-radius:18px 22px 0 0 !important;
    padding:14px 12px calc(14px + var(--safe-bottom)) !important;
  }
  .profile-action-modal[data-mode="withdraw"]{
    padding:4px 6px max(4px,var(--safe-bottom));
  }
  .profile-action-modal[data-mode="withdraw"] .profile-action-card{
    width:min(100%,96vw) !important;
    max-height:calc(100dvh - 6px) !important;
    border-radius:18px 18px 0 0 !important;
    padding:10px 10px calc(10px + var(--safe-bottom)) !important;
  }
  .profile-action-body{
    gap:6px !important;
  }
}
@media (max-width:380px){
  .balance-value{
    font-size:22px !important;
  }
  .profile-link-row-large{
    min-height:64px !important;
    font-size:15px !important;
    padding:0 16px !important;
  }
}


/* ===== global top offset patch ===== */
.app-shell {
  padding-top: calc(var(--safe-top) + 102px) !important;
}

.app-shell.app-shell-redesign {
  padding-top: calc(var(--safe-top) + 124px) !important;
}

.redesigned-main-layout {
  margin-top: 12px !important;
  padding-top: 12px !important;
}

.floating-balance-card {
  top: calc(var(--safe-top) + 42px) !important;
}

.top-right-actions {
  top: calc(var(--safe-top) + 42px) !important;
}

.compact-balance-toolbar {
  top: calc(var(--safe-top) + 116px) !important;
}

@media (max-width: 640px) {
  .app-shell {
    padding-top: calc(var(--safe-top) + 84px) !important;
  }

  .app-shell.app-shell-redesign {
    padding-top: calc(var(--safe-top) + 118px) !important;
  }

  .redesigned-main-layout {
    margin-top: 10px !important;
    padding-top: 10px !important;
  }

  .floating-balance-card {
    top: calc(var(--safe-top) + 36px) !important;
  }

  .top-right-actions {
    top: calc(var(--safe-top) + 36px) !important;
  }

  .compact-balance-toolbar {
    top: calc(var(--safe-top) + 108px) !important;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding-top: calc(var(--safe-top) + 80px) !important;
  }

  .app-shell.app-shell-redesign {
    padding-top: calc(var(--safe-top) + 112px) !important;
  }

  .redesigned-main-layout {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  .compact-balance-toolbar {
    top: calc(var(--safe-top) + 102px) !important;
  }
}



/* ===== canonical layout: single source of truth ===== */
:root{
  --layout-shell-max-width: 900px;
  --layout-side-gap: 10px;
  --layout-top-gap: 10px;
  --layout-bottom-gap: 28px;
  --layout-toolbar-height: 54px;
  --layout-toolbar-radius: 20px;
  --layout-content-gap: 12px;
  --layout-nav-height: 76px;
  --layout-nav-radius: 24px;
  --tg-top-ui-offset: 0px;
  --layout-shell-top: calc(var(--safe-top) + var(--tg-top-ui-offset) + var(--layout-top-gap) + var(--layout-toolbar-height) + var(--layout-content-gap));
  --layout-shell-bottom: calc(var(--safe-bottom) + var(--layout-bottom-gap) + var(--layout-nav-height) + 10px);
}

html,
body{
  width:100%;
  height:var(--tg-vh, 100svh) !important;
  min-height:var(--tg-vh, 100svh) !important;
  max-height:var(--tg-vh, 100svh) !important;
  overflow:hidden !important;
}

body{
  overscroll-behavior:none;
}

html.is-tg-fullscreen{
  --tg-top-ui-offset: 52px;
}

html.is-tg-fullscreen.is-short-screen{
  --tg-top-ui-offset: 48px;
}

html.is-tg-fullscreen.is-tiny-screen{
  --tg-top-ui-offset: 44px;
}

.app-shell,
.app-shell.app-shell-redesign,
.app-shell-redesign{
  position:relative !important;
  width:min(100%, var(--layout-shell-max-width)) !important;
  max-width:var(--layout-shell-max-width) !important;
  height:var(--tg-vh, 100svh) !important;
  min-height:var(--tg-vh, 100svh) !important;
  margin:0 auto !important;
  padding:var(--layout-shell-top) var(--layout-side-gap) var(--layout-shell-bottom) !important;
  display:flex !important;
  flex-direction:column !important;
  gap:var(--layout-content-gap) !important;
  overflow:hidden !important;
}

.floating-balance-card,
.floating-balance-card.compact-balance-toolbar,
.compact-balance-toolbar{
  position:fixed !important;
  top:calc(var(--safe-top) + var(--tg-top-ui-offset) + var(--layout-top-gap)) !important;
  left:max(var(--layout-side-gap), env(safe-area-inset-left)) !important;
  right:max(var(--layout-side-gap), env(safe-area-inset-right)) !important;
  width:auto !important;
  max-width:none !important;
  min-height:var(--layout-toolbar-height) !important;
  padding:6px 8px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  border-radius:var(--layout-toolbar-radius) !important;
  z-index:70 !important;
}

.floating-balance-row{
  display:flex !important;
  align-items:center !important;
  flex:1 1 0 !important;
  min-width:0 !important;
}

.floating-balance-main{
  width:100% !important;
  min-width:0 !important;
  min-height:calc(var(--layout-toolbar-height) - 12px) !important;
  padding:0 12px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border-radius:14px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

.balance-actions-inline,
.global-balance-actions,
.compact-balance-actions{
  display:flex !important;
  align-items:center !important;
  gap:6px !important;
  flex:0 0 auto !important;
}

.mini-action-btn,
.trophy-mini-btn,
.balance-actions-inline .mini-action-btn,
.compact-balance-toolbar .mini-action-btn{
  width:42px !important;
  height:42px !important;
  min-width:42px !important;
  min-height:42px !important;
  flex:0 0 42px !important;
  border-radius:14px !important;
  padding:0 !important;
}

.live-feed-card,
.game-shortcuts-bar,
.premium-shortcuts-bar{
  margin-top:0 !important;
  flex:0 0 auto !important;
}

.main-layout,
.main-layout.redesigned-main-layout,
.redesigned-main-layout{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:100% !important;
  margin-top:0 !important;
  padding-top:0 !important;
  display:block !important;
  overflow:hidden !important;
}

.screen,
.screen.active{
  min-height:0 !important;
}

.screen.active{
  height:100% !important;
  padding:0 0 calc(var(--safe-bottom) + 8px) !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}

#games-screen,
#games-screen.screen,
#games-screen.screen.active{
  overflow:hidden !important;
  padding-bottom:0 !important;
}

#games-screen .cards-stack.redesign-games-stack{
  height:100% !important;
  min-height:0 !important;
  display:grid !important;
  grid-template-rows:1fr !important;
  gap:0 !important;
}

#games-screen .redesign-screen-head,
#games-screen .redesign-feed-card{
  display:none !important;
}

#games-screen .game-select-grid.redesign-games-grid{
  height:100% !important;
  min-height:0 !important;
  display:grid !important;
  grid-template-columns:1fr !important;
  grid-template-rows:repeat(4, minmax(0, 1fr)) !important;
  gap:12px !important;
  align-content:stretch !important;
}

#games-screen .game-pick-card.game-pick-visual{
  min-height:0 !important;
  height:100% !important;
}

.redesign-bottom-nav,
.bottom-nav{
  position:fixed !important;
  left:max(var(--layout-side-gap), env(safe-area-inset-left)) !important;
  right:max(var(--layout-side-gap), env(safe-area-inset-right)) !important;
  bottom:calc(var(--safe-bottom) + var(--layout-bottom-gap)) !important;
  width:auto !important;
  min-height:var(--layout-nav-height) !important;
  padding:6px !important;
  display:grid !important;
  grid-auto-flow:column !important;
  grid-auto-columns:minmax(0, 1fr) !important;
  gap:6px !important;
  border-radius:var(--layout-nav-radius) !important;
  transform:none !important;
  z-index:80 !important;
}

.redesign-bottom-nav .tab,
.bottom-nav .tab,
.tab{
  min-width:0 !important;
  min-height:60px !important;
  padding:6px 4px !important;
  border-radius:18px !important;
}

.redesign-bottom-nav .tab span:last-child,
.bottom-nav .tab span:last-child,
.tab span:last-child{
  font-size:11px !important;
}

.fullscreen-game-overlay{
  position:fixed !important;
  inset:0 !important;
  z-index:120 !important;
  padding:0 !important;
  overflow:hidden !important;
  background:
    radial-gradient(circle at 50% -16%, rgba(89, 112, 255, 0.22), transparent 28%),
    linear-gradient(180deg, #041022 0%, #061731 54%, #041022 100%) !important;
}

.fullscreen-game-shell{
  width:min(100%, var(--layout-shell-max-width)) !important;
  height:var(--tg-vh, 100svh) !important;
  min-height:var(--tg-vh, 100svh) !important;
  margin:0 auto !important;
  display:flex !important;
  flex-direction:column !important;
  gap:0 !important;
  overflow:hidden !important;
}

.fullscreen-game-topbar{
  display:grid !important;
  grid-template-columns:auto 1fr auto !important;
  align-items:center !important;
  gap:10px !important;
  min-height:58px !important;
  padding:calc(var(--safe-top) + 6px) 12px 10px !important;
  background:linear-gradient(180deg, rgba(3, 15, 32, 0.96), rgba(3, 15, 32, 0.78) 72%, rgba(3, 15, 32, 0)) !important;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.fullscreen-floating-balance{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:6px !important;
  min-width:0 !important;
}

.fullscreen-balance-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  min-height:34px !important;
  padding:0 10px !important;
  border-radius:999px !important;
  background:rgba(255, 255, 255, 0.08) !important;
  border:1px solid rgba(255, 255, 255, 0.07) !important;
  font-size:13px !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}

.fullscreen-panel{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  padding:0 10px calc(var(--safe-bottom) + 10px) !important;
  -webkit-overflow-scrolling:touch;
}

.overlay-back-btn{
  min-width:98px !important;
  min-height:40px !important;
  padding:0 14px !important;
  border-radius:16px !important;
}

.fullscreen-game-title{
  font-size:18px !important;
  font-weight:800 !important;
  text-align:center !important;
  letter-spacing:-0.02em !important;
}

html.is-short-screen{
  --layout-top-gap: 8px;
  --layout-bottom-gap: 22px;
  --layout-toolbar-height: 50px;
  --layout-content-gap: 10px;
  --layout-nav-height: 72px;
}

html.is-tiny-screen{
  --layout-top-gap: 6px;
  --layout-bottom-gap: 20px;
  --layout-toolbar-height: 48px;
  --layout-content-gap: 8px;
  --layout-nav-height: 68px;
}

@media (max-width: 640px){
  :root{
    --layout-side-gap: 8px;
    --layout-toolbar-height: 50px;
    --layout-content-gap: 10px;
    --layout-nav-height: 72px;
  }

  .floating-balance-card,
  .floating-balance-card.compact-balance-toolbar,
  .compact-balance-toolbar{
    padding:5px 6px !important;
    gap:6px !important;
  }

  .floating-balance-main{
    min-height:calc(var(--layout-toolbar-height) - 10px) !important;
    padding:0 10px !important;
    font-size:13px !important;
  }

  .mini-action-btn,
  .trophy-mini-btn,
  .balance-actions-inline .mini-action-btn,
  .compact-balance-toolbar .mini-action-btn{
    width:38px !important;
    height:38px !important;
    min-width:38px !important;
    min-height:38px !important;
    flex-basis:38px !important;
  }

  .fullscreen-game-topbar{
    padding:calc(var(--safe-top) + 4px) 10px 10px !important;
    gap:8px !important;
  }

  .overlay-back-btn{
    min-width:92px !important;
    padding:0 12px !important;
    font-size:14px !important;
  }

  .fullscreen-game-title{
    font-size:17px !important;
  }

  .fullscreen-balance-pill{
    min-height:32px !important;
    padding:0 8px !important;
    font-size:12px !important;
  }

  .redesign-bottom-nav .tab,
  .bottom-nav .tab,
  .tab{
    min-height:56px !important;
  }

  #games-screen .game-select-grid.redesign-games-grid{
    gap:10px !important;
  }
}

@media (max-width: 420px){
  :root{
    --layout-side-gap: 6px;
    --layout-toolbar-height: 46px;
    --layout-content-gap: 8px;
    --layout-nav-height: 66px;
  }

  .floating-balance-main{
    font-size:12px !important;
    padding:0 8px !important;
  }

  .mini-action-btn,
  .trophy-mini-btn,
  .balance-actions-inline .mini-action-btn,
  .compact-balance-toolbar .mini-action-btn{
    width:34px !important;
    height:34px !important;
    min-width:34px !important;
    min-height:34px !important;
    flex-basis:34px !important;
    border-radius:12px !important;
  }

  .fullscreen-game-topbar{
    gap:6px !important;
  }

  .overlay-back-btn{
    min-width:84px !important;
  }

  .fullscreen-balance-pill{
    min-height:30px !important;
    padding:0 7px !important;
    font-size:11px !important;
  }

  .redesign-bottom-nav .tab span:last-child,
  .bottom-nav .tab span:last-child,
  .tab span:last-child{
    font-size:10px !important;
  }

  #games-screen .game-select-grid.redesign-games-grid{
    gap:8px !important;
  }
}





/* cases screen bottom nav stability fix */
.bottom-nav.bottom-nav-4,
.redesign-bottom-nav.bottom-nav-4{
  grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
  grid-auto-flow:unset !important;
  grid-auto-columns:auto !important;
}

#cases-screen.screen.active{
  padding-bottom:calc(var(--layout-nav-height) + var(--safe-bottom) + 18px) !important;
}

.bottom-nav,
.redesign-bottom-nav{
  z-index:200 !important;
}

/* exact modal wallet button color overrides v2026-04-04 */
.profile-action-modal #buyStarsBtn,
#wallet-screen #buyStarsBtn{
  background:linear-gradient(135deg,#d79a2e 0%,#f0c76d 52%,#fff0b8 100%) !important;
  color:#3a2400 !important;
  border:1px solid rgba(255,220,140,.42) !important;
  box-shadow:0 10px 24px rgba(216,154,47,.22), inset 0 1px 0 rgba(255,255,255,.34) !important;
}
.profile-action-modal #depositTonBtn,
#wallet-screen #depositTonBtn,
.profile-action-modal #unbindTonWalletBtn,
#wallet-screen #unbindTonWalletBtn{
  background:linear-gradient(135deg,#6438ff 0%, var(--violet) 100%) !important;
  color:#fff !important;
  border:1px solid rgba(145,120,255,.34) !important;
}
.profile-action-modal #convertStarsBtn,
#wallet-screen #convertStarsBtn{
  background:linear-gradient(135deg,#d79a2e 0%,#f0c76d 52%,#fff0b8 100%) !important;
  color:#3a2400 !important;
  border:1px solid rgba(255,220,140,.42) !important;
  box-shadow:0 10px 24px rgba(216,154,47,.22), inset 0 1px 0 rgba(255,255,255,.34) !important;
}
.profile-action-modal #unbindTonWalletBtn .masked-icon,
#wallet-screen #unbindTonWalletBtn .masked-icon{
  color:currentColor !important;
}

/* final viewport + modal priority fix */
:root{
  --yak-fullscreen-top-offset: 58px;
  --yak-fullscreen-top-offset-short: 52px;
  --yak-fullscreen-top-offset-tiny: 46px;
  --yak-screen-bottom-pad: calc(var(--layout-nav-height, var(--nav-h, 78px)) + var(--safe-bottom) + 20px);
  --yak-profile-modal-top-gap: max(10px, calc(var(--safe-top) + 8px));
  --yak-profile-modal-bottom-gap: max(10px, calc(var(--safe-bottom) + 8px));
}

html.is-tg-fullscreen{
  --tg-top-ui-offset: var(--yak-fullscreen-top-offset) !important;
}

html.is-tg-fullscreen.is-short-screen{
  --tg-top-ui-offset: var(--yak-fullscreen-top-offset-short) !important;
}

html.is-tg-fullscreen.is-tiny-screen{
  --tg-top-ui-offset: var(--yak-fullscreen-top-offset-tiny) !important;
}

.screen.active{
  scroll-padding-top: 8px;
  scroll-padding-bottom: var(--yak-screen-bottom-pad);
}

#profile-screen.screen.active{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:0 0 var(--yak-screen-bottom-pad) !important;
}

#profile-screen .cards-stack.redesign-profile-stack{
  min-height:min-content;
  padding-bottom:6px;
}

#profile-screen .redesign-profile-hero,
#profile-screen .redesign-quick-links,
#profile-screen #wallet-screen.profile-history-only{
  scroll-margin-top: calc(var(--safe-top) + var(--tg-top-ui-offset, 0px) + 82px);
}

.profile-action-modal{
  position:fixed;
  inset:0;
  z-index:120;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:center !important;
  padding:
    var(--yak-profile-modal-top-gap)
    max(8px, env(safe-area-inset-right, 0px) + 8px)
    var(--yak-profile-modal-bottom-gap)
    max(8px, env(safe-area-inset-left, 0px) + 8px) !important;
  overflow:hidden !important;
}

.profile-action-card{
  width:min(100%, 560px) !important;
  max-height:calc(var(--tg-vh, 100dvh) - var(--yak-profile-modal-top-gap) - var(--yak-profile-modal-bottom-gap)) !important;
  min-height:0 !important;
  margin:0 auto !important;
  display:grid !important;
  grid-template-rows:auto minmax(0, 1fr) !important;
  overflow:hidden !important;
}

.profile-action-head{
  position:sticky;
  top:0;
  z-index:2;
  flex:0 0 auto;
}

.profile-action-body{
  min-height:0 !important;
  overflow:hidden !important;
  display:block !important;
}

.profile-action-body > #wallet-screen{
  height:100%;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  padding-right:2px;
  padding-bottom:2px;
  -webkit-overflow-scrolling:touch;
}

.profile-action-body > #wallet-screen .wallet-layout{
  min-height:min-content;
}

@media (max-width: 720px){
  .profile-action-modal{
    padding:
      max(8px, calc(var(--safe-top) + 6px))
      6px
      max(8px, calc(var(--safe-bottom) + 6px))
      6px !important;
  }

  .profile-action-card{
    width:100% !important;
    max-height:calc(var(--tg-vh, 100dvh) - max(8px, calc(var(--safe-top) + 6px)) - max(8px, calc(var(--safe-bottom) + 6px))) !important;
    border-radius:22px !important;
    padding:12px !important;
  }

  .profile-action-head{
    margin-bottom:8px !important;
  }

  .profile-action-close{
    width:38px !important;
    height:38px !important;
  }

  .profile-action-body > #wallet-screen .wallet-layout{
    gap:8px !important;
  }

  .profile-action-body > #wallet-screen .panel-card{
    padding:10px !important;
  }

  .profile-action-body > #wallet-screen .panel-title{
    font-size:15px !important;
    line-height:1.1 !important;
  }

  .profile-action-body > #wallet-screen .field input,
  .profile-action-body > #wallet-screen .buy-btn,
  .profile-action-body > #wallet-screen .ton-btn,
  .profile-action-body > #wallet-screen .danger-btn,
  .profile-action-body > #wallet-screen .dark-btn,
  .profile-action-body > #wallet-screen .profile-info-chip{
    min-height:40px !important;
  }
}

/* modal body scroll fix */
.profile-action-modal{
  overflow-y:auto !important;
  overscroll-behavior:contain;
}

.profile-action-card{
  display:grid !important;
  grid-template-rows:auto minmax(0,1fr) !important;
  overflow:hidden !important;
}

.profile-action-body{
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

/* final withdraw modal exact viewport fit */
.profile-action-modal[data-mode="withdraw"]{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:center !important;
  padding:
    max(4px, env(safe-area-inset-top, 0px) + 4px)
    max(6px, env(safe-area-inset-right, 0px) + 6px)
    0
    max(6px, env(safe-area-inset-left, 0px) + 6px) !important;
  overflow:hidden !important;
}

.profile-action-modal[data-mode="withdraw"] .profile-action-card{
  width:min(100%, 560px) !important;
  height:calc(100dvh - max(4px, env(safe-area-inset-top, 0px) + 4px)) !important;
  max-height:calc(100dvh - max(4px, env(safe-area-inset-top, 0px) + 4px)) !important;
  min-height:calc(100dvh - max(4px, env(safe-area-inset-top, 0px) + 4px)) !important;
  margin:0 auto !important;
  padding:12px !important;
  border-radius:22px 22px 0 0 !important;
  display:grid !important;
  grid-template-rows:auto minmax(0, 1fr) !important;
  overflow:hidden !important;
}

.profile-action-modal[data-mode="withdraw"] .profile-action-head{
  margin-bottom:8px !important;
}

.profile-action-modal[data-mode="withdraw"] .profile-action-body{
  min-height:0 !important;
  height:100% !important;
  overflow:hidden !important;
  display:block !important;
}

.profile-action-modal[data-mode="withdraw"] .profile-action-body > #wallet-screen{
  height:100% !important;
  max-height:100% !important;
  min-height:0 !important;
  margin-top:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-right:2px !important;
  padding-bottom:calc(env(safe-area-inset-bottom, 0px) + 14px) !important;
  -webkit-overflow-scrolling:touch;
}

@media (max-width: 640px){
  .profile-action-modal[data-mode="withdraw"]{
    padding:
      max(2px, env(safe-area-inset-top, 0px) + 2px)
      0
      0
      0 !important;
  }

  .profile-action-modal[data-mode="withdraw"] .profile-action-card{
    width:100% !important;
    height:calc(100dvh - max(2px, env(safe-area-inset-top, 0px) + 2px)) !important;
    max-height:calc(100dvh - max(2px, env(safe-area-inset-top, 0px) + 2px)) !important;
    min-height:calc(100dvh - max(2px, env(safe-area-inset-top, 0px) + 2px)) !important;
    padding:10px !important;
    border-radius:20px 20px 0 0 !important;
  }
}

@media (min-width: 1024px){
  :root{
    --layout-shell-max-width: 1180px;
    --layout-side-gap: 18px;
    --layout-content-gap: 16px;
  }

  .app-shell,
  .app-shell.app-shell-redesign,
  .app-shell-redesign{
    width:min(calc(100% - (var(--layout-side-gap) * 2)), var(--layout-shell-max-width)) !important;
  }

  .floating-balance-card,
  .floating-balance-card.compact-balance-toolbar,
  .compact-balance-toolbar,
  .redesign-bottom-nav,
  .bottom-nav{
    left:50% !important;
    right:auto !important;
    width:min(calc(100% - (var(--layout-side-gap) * 2)), var(--layout-shell-max-width)) !important;
    max-width:var(--layout-shell-max-width) !important;
    transform:translateX(-50%) !important;
  }

  #games-screen,
  #games-screen.screen,
  #games-screen.screen.active{
    overflow-y:auto !important;
    padding-bottom:calc(var(--safe-bottom) + 8px) !important;
  }

  #games-screen .cards-stack.redesign-games-stack{
    height:auto !important;
    min-height:100% !important;
    display:block !important;
  }

  #games-screen .game-select-grid.redesign-games-grid{
    height:auto !important;
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows:none !important;
    align-content:start !important;
    gap:18px !important;
  }

  #games-screen .game-pick-card.game-pick-visual{
    height:auto !important;
    min-height:220px !important;
  }

  #games-screen .game-pick-card .game-pick-content{
    padding:22px !important;
  }

  #games-screen .game-pick-card .game-pick-title{
    font-size:28px !important;
  }

  #games-screen .game-pick-card .game-pick-text{
    display:block !important;
    max-width:260px !important;
  }
}

@media (min-width: 1280px){
  :root{
    --layout-shell-max-width: 1280px;
    --layout-side-gap: 24px;
  }

  #games-screen .game-pick-card.game-pick-visual{
    min-height:240px !important;
  }
}

@media (min-width: 1024px){
  #solo-plinko-panel,
  #solo-crash-panel,
  #solo-lucky-panel,
  #solo-pvp-panel{
    display:none;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    padding-bottom:calc(var(--safe-bottom) + 20px) !important;
  }

  #solo-plinko-panel.active,
  #solo-crash-panel.active,
  #solo-lucky-panel.active,
  #solo-pvp-panel.active{
    display:block !important;
  }

  #solo-plinko-panel .fullscreen-game-card,
  #solo-crash-panel .crash-shell,
  #solo-lucky-panel .lucky-shell,
  #solo-pvp-panel .pvp-shell{
    min-height:max-content !important;
    height:auto !important;
  }

  #solo-plinko-panel .fullscreen-game-card{
    display:grid !important;
    grid-template-rows:auto auto auto !important;
    align-content:start !important;
  }

  #solo-plinko-panel .fullscreen-board-card{
    height:auto !important;
    min-height:clamp(340px, 44vh, 560px) !important;
  }

  #solo-plinko-panel .fullscreen-controls{
    position:static !important;
  }

  #solo-lucky-panel{
    overflow-y:auto !important;
  }

  #solo-lucky-panel .lucky-shell{
    overflow:visible !important;
  }

  #solo-pvp-panel .pvp-players-list,
  #solo-pvp-panel .pvp-history-list{
    max-height:none !important;
  }
}

@media (min-width: 1024px){
  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar{
    box-sizing:border-box !important;
    position:fixed !important;
    top:calc(var(--safe-top) + var(--tg-top-ui-offset) + var(--layout-top-gap)) !important;
    left:50% !important;
    right:auto !important;
    width:min(calc(100% - (var(--layout-side-gap) * 2)), var(--layout-shell-max-width)) !important;
    max-width:var(--layout-shell-max-width) !important;
    margin:0 !important;
    transform:translateX(-50%) !important;
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr) auto !important;
    align-items:center !important;
    gap:10px !important;
    padding:6px 8px !important;
    overflow:visible !important;
    z-index:70 !important;
  }

  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar .floating-balance-row{
    display:flex !important;
    align-items:center !important;
    min-width:0 !important;
    flex:1 1 0 !important;
  }

  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar .floating-balance-main{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;
    width:100% !important;
    min-width:0 !important;
    min-height:calc(var(--layout-toolbar-height) - 12px) !important;
    padding:0 12px !important;
    white-space:nowrap !important;
  }

  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar .trophy-mini-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    flex:0 0 42px !important;
  }

  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar .balance-actions-inline,
  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar .global-balance-actions{
    display:grid !important;
    grid-template-columns:repeat(2, 42px) !important;
    gap:6px !important;
    align-items:center !important;
    justify-content:end !important;
  }

  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar .mini-action-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    flex:0 0 42px !important;
  }

  .app-shell.app-shell-redesign #balance.floating-balance-card.compact-balance-toolbar::before{
    display:block !important;
  }
}

