:root {
  --bg: #041022;
  --bg-2: #071a35;
  --yak-app-bg-image: url("/static/img/fonyakzen.webp?v=20260605a");
  --panel: rgba(7, 24, 48, 0.84);
  --panel-2: rgba(9, 31, 63, 0.88);
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(19,223,255,.2);
  --text: #f5f8ff;
  --muted: #89a4cf;
  --cyan: #13dfff;
  --cyan-2: #6dfff4;
  --violet: #d545ff;
  --green: #27ff98;
  --red: #ff6a7f;
  --yellow: #ffd76a;
  --shadow: 0 18px 40px rgba(0,0,0,.32);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 78px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 10, 24, 0.44), rgba(4, 10, 24, 0.68)),
    var(--yak-app-bg-image) center top / cover no-repeat fixed;
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}

img,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select,
a {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

button {
  border: 0;
  cursor: pointer;
}

input {
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.glass {
  background: linear-gradient(180deg, rgba(10,38,82,.95), rgba(5,18,36,.92));
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0,0,0,.24);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.glass-soft {
  background: linear-gradient(180deg, rgba(10,33,66,.68), rgba(5,18,36,.82));
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(0,0,0,.20);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-shell {
  width: min(100%, 900px);
  height: 100dvh;
  margin: 0 auto;
  padding: calc(8px + var(--safe-top)) 10px calc(var(--nav-h) + 10px + var(--safe-bottom));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 22px;
  padding: 10px 12px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.topbar-compact {
  justify-content: space-between;
}.eyebrow,
.small-note,
.history-meta,
.list-meta {
  color: var(--muted);
}.eyebrow,
.small-note {
  font-size: 12px;
}

.balance-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  min-width: 92px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--cyan-2);
  font-weight: 800;
  font-size: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: #f5f8ff;
}

.main-layout {
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 0;
}

.screen.active {
  display: block;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.screen.active::-webkit-scrollbar {
  width: 0;
  height: 0;
}.hero-card,
.panel-card {
  border-radius: 26px;
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-head > * {
  min-width: 0;
}

.panel-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.status-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  color: var(--green);
  background: rgba(39,255,152,.08);
  border: 1px solid rgba(39,255,152,.16);
}

.game-layout-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.game-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chip-btn {
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.05);
  font-size: 12px;
  padding: 0 12px;
  font-weight: 700;
}

.board-card {
  background: linear-gradient(180deg, rgba(4,24,52,.84), rgba(3,13,28,.92));
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 24px;
  padding: 10px 8px 8px;
  overflow: hidden;
}

.board-card-full {
  flex: 1 1 auto;
  min-height: 0;
}

.control-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 22px;
}

.control-card-simple {
  flex: 0 0 auto;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

input {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.97);
  color: #07111f;
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: rgba(19,223,255,.55);
  box-shadow: 0 0 0 3px rgba(19,223,255,.12);
}

.wallet-field input {
  font-size: 13px;
}.primary-btn,
.secondary-btn,
.buy-btn,
.ton-btn,
.danger-btn,
.small-btn {
  min-height: 46px;
  border-radius: 16px;
  padding: 0 14px;
  font-weight: 800;
  transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
}.primary-btn:active,
.secondary-btn:active,
.buy-btn:active,
.ton-btn:active,
.danger-btn:active,
.small-btn:active,
.chip-btn:active,
.quick-bet-btn:active {
  transform: scale(.985);
}

.primary-btn {
  background: linear-gradient(135deg, var(--cyan), #34cfff);
  color: #03111f;
}

.secondary-btn {
  background: linear-gradient(135deg, #6438ff, var(--violet));
  color: #fff;
}.buy-btn,
.ton-btn {
  background: linear-gradient(135deg, #21daff, #27ffaf);
  color: #02111f;
}

.danger-btn {
  background: linear-gradient(135deg, #ff8b77, var(--red));
  color: #fff;
}


.full-width {
  width: 100%;
}

button:disabled {
  opacity: .65;
  cursor: default;
  transform: none;
}

.quick-bet-btn {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
}

.quick-bet-btn:hover {
  border-color: rgba(19,223,255,.22);
  box-shadow: 0 8px 20px rgba(19,223,255,.08);
}

.wallet-layout {
  display: grid;
  gap: 14px;
}

.summary-chip {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  font-size: 14px;
  max-width: 100%;
  word-break: break-word;
}

.action-stack,
.history-list,
.list-box {
  display: grid;
  gap: 10px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 10px;
  align-items: end;
}

.field-row-wide {
  grid-template-columns: 140px 1fr;
}

.history-item,
.list-item,
.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(4,13,28,.56);
  border: 1px solid rgba(255,255,255,.05);
  min-width: 0;
}

.history-item > *,
.list-item > *,
.admin-item > * {
  min-width: 0;
}

.history-item div,
.list-item div,
.admin-item div {
  word-break: break-word;
}

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-btn {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 12px;
}

.payment-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(19,223,255,.14);
  color: var(--cyan-2);
  font-size: 13px;
  font-weight: 700;
}

.payment-status.is-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--cyan-2);
  animation: payment-spinner .75s linear infinite;
}

@keyframes payment-spinner {
  to { transform: rotate(360deg); }
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(8px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 16px), 900px);
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  z-index: 40;
}

.bottom-nav-compact {
  grid-template-columns: repeat(3, 1fr);
}

.tab {
  min-height: 54px;
  min-width: 0;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  color: #d4e1fb;
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.tab span:first-child {
  font-size: 18px;
}

.tab.active {
  background: rgba(36, 62, 96, .78);
  color: #f5f8ff;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 8px + var(--safe-bottom));
  transform: translateX(-50%) translateY(18px);
  background: rgba(5,18,36,.96);
  border: 1px solid var(--line-strong);
  color: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  box-shadow: var(--shadow);
  z-index: 60;
  max-width: calc(100% - 24px);
  text-align: center;
  word-break: break-word;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.win-fx {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -50%) scale(.88);
  z-index: 70;
  min-width: 180px;
  max-width: calc(100% - 32px);
  text-align: center;
  padding: 14px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(39,255,152,.18), rgba(19,223,255,.2));
  border: 1px solid rgba(39,255,152,.28);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
  box-shadow: 0 18px 42px rgba(0,0,0,.34), 0 0 32px rgba(39,255,152,.16);
  opacity: 0;
  pointer-events: none;
}

/* ============================= */
/* BET MODE SWITCH (Stars / TON) */

@media (max-width: 640px){
  .app-shell {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: calc(var(--nav-h) + 10px + var(--safe-bottom));
  }

  .topbar {
    padding: 10px;
    border-radius: 18px;
  }

  .balance-card {
    min-height: 38px;
    min-width: 82px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 12px;
  }

  .balance-pill {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }.hero-card,
.panel-card {
    padding: 12px;
    border-radius: 22px;
  }.field-row,
.field-row-wide {
    grid-template-columns: 1fr;
  }.history-item,
.list-item,
.admin-item,
.panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-actions .small-btn {
    flex: 1 1 0;
  }.primary-btn,
.secondary-btn,
.buy-btn,
.ton-btn,
.danger-btn {
    width: 100%;
  }

  .win-fx {
    top: 18%;
    font-size: 18px;
    min-width: 150px;
    padding: 12px 14px;
  }
}

@media (max-width: 430px){
  .app-shell {
    padding-bottom: calc(var(--nav-h) + 8px + var(--safe-bottom));
  }

  .topbar {
    gap: 8px;
  }

  .balance-card {
    min-width: 74px;
    font-size: 13px;
  }

  .balance-pill {
    font-size: 11px;
    min-height: 26px;
    padding: 0 7px;
  }

  .status-pill {
    min-height: 34px;
    font-size: 11px;
    padding: 0 10px;
  }

  .chip-btn {
    min-height: 32px;
    font-size: 11px;
    padding: 0 10px;
  }

  .board-card {
    padding: 8px 6px 6px;
  }

  

  

  .bottom-nav {
    gap: 6px;
    padding: 6px;
    width: min(calc(100% - 10px), 900px);
  }

  .tab {
    min-height: 50px;
    font-size: 11px;
  }

  .tab span:first-child {
    font-size: 16px;
  }

  .quick-bet-btn {
    min-height: 34px;
    font-size: 12px;
  }

  .win-fx {
    top: 16%;
    font-size: 16px;
  }
}/* compact stable game screen overrides */
.balance-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: auto !important;
}

.balance-pill {
  background: transparent !important;
  border: 0 !important;
  padding: 0 6px 0 0 !important;
  min-height: 26px !important;
}

.app-shell {
  padding: calc(6px + var(--safe-top)) 8px calc(var(--nav-h) + 8px + var(--safe-bottom));
}

.topbar {
  margin-bottom: 8px;
  padding: 8px 10px;
}

.main-layout {
  overflow: hidden !important;
}

.screen.active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-bottom: 10px !important;
}.hero-card,
.panel-card {
  padding: 10px;
}

.game-layout-card {
  justify-content: flex-start;
}

.compact-head,
.game-mini-head {
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 6px;
}

.board-card {
  padding: 8px 6px 6px;
  border-radius: 20px;
}


.control-card {
  margin-top: 8px;
  padding: 10px;
}

.wallet-connect-note {
  margin-top: 6px;
}

.live-feed-card {
  display: none !important;
}

.bottom-nav {
  padding-top: 8px;
}


.live-feed-card {
  overflow: hidden;
  border-radius: 18px;
  padding: 8px 10px;
  margin: 0 0 10px;
  flex: 0 0 auto;
}

.live-feed-track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  white-space: nowrap;
  animation: live-feed-run 24s linear infinite;
}

@keyframes live-feed-run {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.win-fx {
  top: 20%;
  background: linear-gradient(135deg, #13dfff, #8dffb8, #ffd76a);
  color: #03111f;
  border: 0;
  box-shadow: 0 18px 42px rgba(0,0,0,.34), 0 0 32px rgba(19,223,255,.24);
}

.win-fx.animate {
  animation: stake-win-pop 1.7s ease forwards;
}

@keyframes stake-win-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -38%) scale(.65);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  42% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -64%) scale(.94);
  }
}

.win-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 68;
}

.win-particle {
  position: absolute;
  width: 8px;
  height: 18px;
  border-radius: 999px;
  opacity: 0;
  animation: win-particle-fly 1.2s ease-out forwards;
}

@keyframes win-particle-fly {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(.7);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)) scale(1.2);
  }
}


.small-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
}

/* HTML cleanup: icon and tile assets moved from inline styles to CSS classes */
.masked-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask-image: var(--icon);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: var(--icon);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.masked-icon.small {
  width: 18px;
  height: 18px;
}

.masked-icon.icon-cases { --icon: url('/static/icons/cases.svg?v=20260519a'); }
.masked-icon.icon-free { --icon: url('/static/icons/free.svg?v=20260519a'); }
.masked-icon.icon-games { --icon: url('/static/icons/games.svg?v=20260519a'); }
.masked-icon.icon-drop { --icon: url('/static/icons/drop.svg?v=20260608a'); }
.masked-icon.icon-inventory { --icon: url('/static/icons/inventory.svg?v=20260519a'); }
.masked-icon.icon-profile { --icon: url('/static/icons/profile.svg?v=20260519a'); }
.masked-icon.icon-tasks { --icon: url('/static/icons/tasks.svg'); }
.masked-icon.icon-wallet-connect { --icon: url('/static/icons/wallet-connect.svg'); }
.masked-icon.icon-wallet-disconnect { --icon: url('/static/icons/wallet-disconnect.svg'); }

#games-screen .game-pick-card.game-tile-pvp { --tile-image: url('/static/img/pvp.webp?v=20260423a'); }
#games-screen .game-pick-card.game-tile-crash { --tile-image: url('/static/img/crash.webp?v=20260423a'); }
#games-screen .game-pick-card.game-tile-lucky { --tile-image: url('/static/img/laki.webp?v=20260423a'); }
#games-screen .game-pick-card.game-tile-mines { --tile-image: url('/static/img/mine.webp?v=20260423a'); }
#games-screen .game-pick-card.game-tile-plinko { --tile-image: url('/static/img/plinko.webp?v=20260423a'); }

/* Mobile safety guardrails */
html,
body {
  overflow-x: hidden;
}

.screen,
.cards-stack,
.main-layout {
  min-width: 0;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

input,
select,
textarea,
button {
  max-width: 100%;
}
