@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --panel: #35104d;
  --muted: #a18aa9;
  --purple: #4a1767;
  --aqua: #27d0bf;
}

* { box-sizing: border-box; }

.launch-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 43%, rgba(125, 22, 173, .42), transparent 38%),
    radial-gradient(ellipse at 50% 100%, rgba(61, 0, 91, .5), transparent 55%),
    #160020;
  opacity: 1;
  transition: opacity .42s ease, visibility .42s ease;
}

.launch-screen::before,
.launch-screen::after {
  position: absolute;
  width: min(88vw, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(198, 110, 255, .07);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.launch-screen::after {
  width: min(68vw, 300px);
  border-color: rgba(198, 110, 255, .1);
}

.launch-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.launch-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100% - 36px, 320px);
  flex-direction: column;
  align-items: center;
  padding-bottom: 22px;
  animation: launch-content-enter .7s cubic-bezier(.2,.8,.2,1) both;
}

.launch-emblem {
  position: relative;
  display: grid;
  width: 172px;
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 25px;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, .32));
}

.launch-wheel {
  position: absolute;
  inset: 7px;
  overflow: hidden;
  border: 1px solid rgba(230, 181, 255, .65);
  border-radius: 50%;
  background: conic-gradient(
    from -30deg,
    #a838d1 0deg 54deg,
    #6e26a3 54deg 108deg,
    #b440d3 108deg 162deg,
    #7023a0 162deg 216deg,
    #a838d1 216deg 270deg,
    #7023a0 270deg 324deg,
    #a838d1 324deg 360deg
  );
  box-shadow: 0 0 40px rgba(177, 61, 222, .28), inset 0 0 20px rgba(22, 0, 37, .32);
  animation: launch-wheel-spin 3.2s cubic-bezier(.3,.05,.65,.95) infinite;
}

.launch-wheel span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 50%;
  background: rgba(237, 204, 255, .42);
  transform-origin: top center;
}

.launch-wheel span:nth-child(1) { transform: rotate(0deg); }
.launch-wheel span:nth-child(2) { transform: rotate(60deg); }
.launch-wheel span:nth-child(3) { transform: rotate(120deg); }
.launch-wheel span:nth-child(4) { transform: rotate(180deg); }
.launch-wheel span:nth-child(5) { transform: rotate(240deg); }
.launch-wheel span:nth-child(6) { transform: rotate(300deg); }

.launch-pointer {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 9px solid transparent;
  border-bottom: 17px solid #fff;
  border-left: 9px solid transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45));
  transform: translateX(-50%) rotate(180deg);
}

.launch-logo-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  width: 62px;
  aspect-ratio: 1;
  place-items: center;
  border: 5px solid #21032f;
  border-radius: 50%;
  background: #21032f;
  box-shadow: 0 0 0 1px rgba(245, 223, 255, .38), 0 0 26px rgba(224, 142, 255, .48);
}

.launch-logo { display: block; width: 100%; height: 100%; border-radius: 50%; }
.launch-title { color: #fff; font-size: 25px; font-weight: 800; letter-spacing: .22em; text-indent: .22em; }
.launch-subtitle { margin-top: 6px; color: #bd8bd0; font-size: 9px; font-weight: 800; letter-spacing: .2em; }

.launch-progress {
  width: 126px;
  height: 3px;
  margin-top: 29px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(213, 166, 236, .15);
}

.launch-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a82de0, #53d6ff);
  box-shadow: 0 0 12px rgba(83, 214, 255, .65);
  animation: launch-progress-run 1.15s ease-in-out infinite;
}

.launch-caption { margin-top: 11px; color: #9875a7; font-size: 10px; font-weight: 600; letter-spacing: .06em; }

@keyframes launch-wheel-spin {
  to { transform: rotate(352deg) scale(.96); }
}

@keyframes launch-progress-run {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(250%); }
}

@keyframes launch-content-enter {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .launch-wheel, .launch-progress span, .launch-content { animation-duration: .01ms; }
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 48%, #49006e 0%, #28003f 47%, #190026 100%);
}

button, input { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app {
  position: relative;
  display: flex;
  width: min(100%, 460px);
  min-height: 100vh;
  flex-direction: column;
  margin: 0 auto;
  padding: max(9px, env(safe-area-inset-top)) 14px max(86px, calc(82px + env(safe-area-inset-bottom)));
  overflow: hidden;
}

.topbar {
  display: grid;
  height: 42px;
  flex: 0 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.avatar, .icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  background: #3d1b54;
  cursor: pointer;
}

.avatar {
  border: 2px solid #c6b24b;
  background: radial-gradient(circle at 30% 25%, #86ad46, #315331 55%, #1a322e);
  color: #fff1af;
  font-size: 12px;
  font-weight: 800;
}

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

.online {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
}

.online-dot, .live-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2ce78a;
  box-shadow: 0 0 7px #2ce78a;
}

.online-dot--offline { background: #ffb946; box-shadow: none; }

.game {
  width: 100%;
  max-width: 384px;
  margin: 8px auto 0;
}

.account-row {
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: space-between;
}

.account-label, .stake-panel > label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .4px;
}

.balance-button {
  display: flex;
  height: 32px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 11px;
  background: #41195a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.balance-button:hover, .balance-button:focus-visible { border-color: rgba(255,255,255,.22); background: #552173; }
.balance-button:active { transform: scale(.97); }
.balance-button:focus-visible { outline: 2px solid #81d7ff; outline-offset: 2px; }

.gram-logo { display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.balance-gram-logo { width: 15px; height: 15px; }
.balance-button > span:nth-child(3) { color: #c3b4cc; font-size: 9px; }
.balance-button .plus { padding-left: 4px; font-size: 16px; }

.promo {
  display: flex;
  width: 100%;
  height: 28px;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding: 0 9px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(100deg, #f20b8c, #9a00dc 56%, #d00aa7);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.promo-emojis { font-size: 13px; }
.promo-arrow { font-size: 24px; line-height: 1; }

.stats-row {
  display: grid;
  height: 39px;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 8px;
}

.stat-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 3px 7px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(68, 31, 89, .83);
}

.stat-right { align-items: flex-start; }
.stat-caption { color: #a68aad; font-size: 8px; font-weight: 800; }
.stat-main { display: flex; width: 100%; align-items: center; gap: 4px; overflow: hidden; font-size: 9px; font-weight: 800; white-space: nowrap; }
.stat-main > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.stat-main strong { margin-left: auto; color: #ffda36; font-size: 8px; }
.tiny-avatar { display: grid; width: 12px; height: 12px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #647c32; font-size: 7px; }
.tiny-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.pot-row {
  display: flex;
  height: 36px;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
}

.round-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: #42195d;
  color: #eee3f5;
  font-size: 21px;
  cursor: pointer;
  text-decoration: none;
}

.pot-label {
  padding: 8px 13px;
  border-radius: 12px;
  background: #42195d;
  font-size: 10px;
  font-weight: 800;
}

.pot-label strong { color: #36d9ee; }

.wheel-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 21px;
}

.pointer {
  position: absolute;
  z-index: 3;
  top: 11px;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 0;
  border-right: 12px solid transparent;
  border-bottom: 16px solid #fff;
  border-left: 12px solid transparent;
  filter: drop-shadow(0 2px 1px #140a19);
  transform: translateX(-50%) rotate(180deg);
}

.wheel-stage {
  position: relative;
  width: min(84vw, 344px);
  aspect-ratio: 1;
  flex: 0 0 auto;
}

.wheel {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
  place-items: center;
  border: 6px solid #571b78;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 2px rgba(147, 70, 185, .18), 0 14px 35px rgba(12, 0, 22, .18);
  transition: transform 4.8s cubic-bezier(.12,.7,.12,1);
}

.wheel.is-spinning {
  will-change: transform;
  transition-duration: 5.4s;
}

.wheel.is-waiting::before,
.wheel.is-waiting::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.wheel.is-waiting::before {
  background: conic-gradient(
    from -22.5deg,
    #542879 0deg 45deg,
    #48206e 45deg 90deg,
    #5b2d82 90deg 135deg,
    #492171 135deg 180deg,
    #5b2d82 180deg 225deg,
    #48206e 225deg 270deg,
    #5b2d82 270deg 315deg,
    #48206e 315deg 360deg
  );
  animation: idle-wheel-spin 24s linear infinite;
}

.wheel.is-waiting::after {
  inset: 3%;
  background: transparent;
  animation: idle-wheel-spin 24s linear infinite;
}

@keyframes idle-wheel-spin {
  to { transform: rotate(360deg); }
}

.wheel-empty {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 28%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #101014;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  transform: translate(-50%, -50%);
}

.wheel-empty[hidden] { display: none; }

.wheel-center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  width: 28%;
  aspect-ratio: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #101014;
  transform: translate(-50%, -50%);
  text-align: center;
}

.wheel-center[hidden] { display: none; }
.wheel-center span { max-width: 90%; overflow: hidden; font-size: clamp(8px, 2.4vw, 11px); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.wheel-center small { margin-top: 3px; color: #aaa2b0; font-size: 8px; }

.wheel-avatars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wheel-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--avatar-color, #6a9636);
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.wheel-avatar img, .player-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.wheel-caption {
  display: flex;
  min-height: 19px;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #d4c1df;
  font-size: 9px;
  font-weight: 700;
}

.live-dot { width: 5px; height: 5px; }

.join-section { margin-top: 4px; }

.bet-utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 9px;
}

.bet-utility {
  display: flex;
  min-width: 0;
  height: 35px;
  align-items: center;
  gap: 0;
  padding: 0 3px;
  border: 0;
  border-radius: 13px;
  background: #42195d;
  color: #eee3f5;
  transition: background .16s ease;
}

.bet-utility-wallet, .bet-utility-toggle {
  display: grid;
  width: 25px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #eee3f5;
  cursor: pointer;
}

.bet-utility .gram-logo { width: 17px; height: 17px; }
.bet-utility-star { display: grid; width: 25px; height: 27px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; background: transparent; color: #ffc928; font-size: 16px; cursor: pointer; }
.bet-utility-star[hidden] { display: none; }
.bet-utility-wallet[hidden] { display: none; }
.bet-utility.is-star-mode { padding-left: 8px; }
.bet-utility-wallet.is-active, .bet-utility-star.is-active { border-radius: 9px; background: rgba(255,255,255,.1); }
.settings-utility { width: 35px; min-width: 35px; padding: 0; font-size: 17px; }
.settings-utility[hidden], .quick-bets[hidden], .action-button[hidden] { display: none; }
.bet-utility-toggle { font-size: 23px; line-height: 1; }
.bet-utility-wallet:focus-visible, .bet-utility-star:focus-visible, .bet-utility-toggle:focus-visible { outline: 2px solid #81d7ff; outline-offset: 1px; border-radius: 8px; }

.quick-bets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.quick-bet {
  display: flex;
  min-width: 0;
  height: 43px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 4px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 13px;
  background: #39234e;
  color: #f0e9f5;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.quick-bet > span { color: #bdc4d5; font-size: 10px; }
.quick-bet > .gram-logo { width: 13px; height: 13px; }
.quick-bet:active:not(:disabled) { transform: translateY(1px); }
.quick-bet:disabled { opacity: .45; cursor: not-allowed; }
.quick-bet.all-in { background: linear-gradient(180deg, #20a8f2, #087de2); color: #fff; font-size: 12px; }

#star-bets[hidden], #quick-bets-gram[hidden] { display: none !important; }

.star-bets { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.star-bets.is-active { display: grid; }
.star-bets .quick-bet { height: 52px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #ffca20, #ffa900); color: #291900; font-size: 15px; }
.star-bets .quick-bet > span { color: #382000; font-size: 15px; }

.bet-actions {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.bet-actions .action-button { height: 52px; border-radius: 14px; font-size: 14px; }
.bet-actions .action-icon { font-size: 15px; }

.action-button {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.03);
  border-radius: 13px;
  background: linear-gradient(120deg, #39104f, #4a1767);
  color: #f7f0fa;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.action-button > span { font-size: 15px; }
#configure-label { font-size: inherit !important; }
.action-button.is-selected { background: #542377; }
.action-button.is-enabled { background: linear-gradient(120deg, #087de2, #20a8f2); }

.stake-panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 13px;
  background: rgba(52, 20, 71, .84);
}

.stake-panel[hidden] { display: none; }
.stake-panel > label { font-size: 8px; }

.stake-control {
  display: flex;
  height: 30px;
  align-items: center;
  gap: 8px;
}

.stake-adjust {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: #50216b;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#stake {
  width: 0;
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
}

#stake::-webkit-inner-spin-button, #stake::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
#stake[type="number"] { appearance: textfield; }
.stake-currency { color: #c3b4cc; font-size: 10px; font-weight: 800; }

.join-button {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffc62e, #ff9814);
  box-shadow: 0 4px 0 #d76c0b;
  color: #251300;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.stake-panel .join-button { margin-top: 4px; }

.join-button:active { transform: translateY(2px); }
.join-button:disabled { background: #6d5877; box-shadow: 0 4px 0 #4c3957; color: #e4dbe7; cursor: default; }
.join-plus { font-size: 19px; }
.join-amount { opacity: .7; font-size: 10px; }

.demo-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 0;
  color: #c4a9cd;
  font-size: 9px;
  font-weight: 700;
}

.demo-note span { color: #ffd34d; }

.players-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 17px;
  background: rgba(48, 18, 67, .82);
}

.players-heading { display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.players-heading > span { color: #a990b5; font-size: 9px; font-weight: 700; }
.player-list { display: flex; flex-direction: column; gap: 10px; margin-top: 11px; }

.player-card {
  position: relative;
  display: flex;
  min-height: 90px;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
  padding: 13px 14px 11px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 96% 8%, color-mix(in srgb, var(--player-color) 38%, transparent), transparent 35%),
    linear-gradient(112deg, #351344 0%, #48166b 55%, #3a1557 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 5px 15px rgba(14,0,23,.12);
}

.player-card-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255,255,255,.68);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, color-mix(in srgb, var(--player-color) 55%, white), transparent 48%),
    var(--player-color, #789141);
  box-shadow: 0 0 12px color-mix(in srgb, var(--player-color) 35%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.player-identity { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.player-name { overflow: hidden; color: #fbf7ff; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.player-chance { color: #65d4ff; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }

.player-stake, .player-stake-small {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px;
  background: rgba(131, 43, 190, .78);
  box-shadow: 0 4px 14px rgba(20,0,35,.16);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gram-icon { width: 12px; height: 12px; }

.player-card-footer { display: flex; align-items: center; gap: 9px; }

.player-stake-small {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #38b9f4, #168fe5);
  box-shadow: 0 3px 10px rgba(0,133,240,.22);
  font-size: 10px;
}

.player-stake-small .gram-icon { width: 12px; height: 12px; }
.player-stake-group { display: inline-flex; align-items: center; gap: 4px; }

.player-share {
  position: relative;
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.1);
}

.player-share-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--player-color) 72%, white), var(--player-color));
  box-shadow: 0 0 8px color-mix(in srgb, var(--player-color) 65%, transparent);
}

.player-chevron { color: #c9b5d5; font-size: 24px; font-weight: 400; line-height: 16px; }

.bottom-nav {
  position: fixed;
  z-index: 4;
  bottom: max(13px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  width: min(calc(100% - 32px), 350px);
  height: 60px;
  align-items: center;
  justify-content: space-around;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 23px;
  background: rgba(55, 43, 70, .97);
  box-shadow: 0 8px 30px rgba(10,0,18,.4);
  transform: translateX(-50%);
}

.nav-item {
  display: flex;
  width: 54px;
  height: 50px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #f5eff8;
  cursor: pointer;
}

.nav-item.active { background: #594569; }
.nav-item > span { font-size: 19px; font-weight: 800; line-height: 1.1; }
.nav-item small { font-size: 8px; font-weight: 700; }

.round-hash {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  margin: 13px 0 0;
  padding: 4px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b89ac5;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

.round-hash:hover:not(:disabled), .round-hash:focus-visible {
  background: rgba(255,255,255,.06);
  color: #f1dfff;
}

.round-hash:disabled { cursor: wait; opacity: .75; }
.copy-icon { color: #d0bbdb; font-size: 13px; line-height: 1; }

.history-view {
  position: fixed;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 17px max(96px, calc(90px + env(safe-area-inset-bottom)));
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(96, 20, 137, .32), transparent 47%),
    linear-gradient(180deg, #210035, #190026 75%);
  overscroll-behavior: contain;
}

.history-view[hidden] { display: none; }
#history-search-field[hidden], #history-list[hidden], .history-detail[hidden] { display: none; }

.history-header {
  display: grid;
  min-height: 37px;
  flex: 0 0 auto;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 7px;
}

.history-back {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: #3b1552;
  color: #fff;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.history-header h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.4px; }

.history-search {
  display: flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 13px;
  background: #37134e;
  color: #b99ac8;
}

.history-search > span { font-size: 20px; line-height: 1; }
.history-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 12px; font-weight: 600; }
.history-search input::placeholder { color: #ab8db9; opacity: 1; }
.history-search input::-webkit-search-cancel-button { cursor: pointer; }

.history-list { display: flex; flex-direction: column; gap: 11px; }

.history-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(141, 48, 197, .22), transparent 44%),
    linear-gradient(120deg, #351344, #461660);
  box-shadow: 0 6px 20px rgba(8,0,15,.16);
}

.history-card-heading, .history-winner-row, .history-card-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-card-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) 25px; }
.history-mode { display: inline-flex; align-items: center; gap: 5px; color: #f7f0fb; font-size: 11px; font-weight: 800; white-space: nowrap; }
.history-mode > span { color: #cfb6db; }
.history-metadata { overflow: hidden; color: #ae8dbd; font-size: 9px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.history-open-detail {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.09);
  color: #d9c3e4;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.history-open-detail:hover, .history-open-detail:focus-visible { background: rgba(255,255,255,.18); outline: none; }

.history-winner-row { justify-content: flex-start; }

.history-winner-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: linear-gradient(145deg, #a95be1, #522176);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.history-winner-avatar img,
.history-participant-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.history-winner-details { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.history-winner-details strong { overflow: hidden; color: #fbf7ff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-winner-details > span { color: #62d4ff; font-size: 10px; font-weight: 800; }
.history-prize { color: #60e2ef; font-size: 11px; font-weight: 800; text-align: right; white-space: nowrap; }

.history-card-details { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); color: #c1a9cd; font-size: 10px; font-weight: 700; }
.history-players { display: flex; flex-direction: column; gap: 6px; }
.history-participant { display: flex; min-height: 28px; align-items: center; gap: 8px; color: #cfbbd8; font-size: 10px; }
.history-participant > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-participant strong { color: #76d8ff; font-size: 10px; white-space: nowrap; }
.history-participant-avatar { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: linear-gradient(145deg, #a95be1, #522176); color: #fff; font-size: 10px; font-weight: 800; }
.history-hash { padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); color: #a98ab7; font-size: 9px; font-weight: 600; }

.history-empty {
  margin: 0;
  padding: 36px 15px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 16px;
  background: rgba(55, 19, 76, .7);
  color: #b89ac5;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.history-detail { display: flex; flex: 0 0 auto; flex-direction: column; gap: 13px; }
.history-detail-date { margin: -5px 0 0 44px; color: #ac8abb; font-size: 10px; font-weight: 700; }
.history-proof-list { display: flex; flex-direction: column; gap: 8px; }

.history-proof-row {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 13px;
  background: #351344;
}

.history-proof-label { color: #b594c4; font-size: 11px; font-weight: 700; }
.history-proof-value { overflow: hidden; padding: 7px 0 7px 8px; border: 0; background: transparent; color: #f5ecfb; font-family: inherit; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }

.history-detail-winner {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 19px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(88, 176, 255, .25), transparent 50%),
    linear-gradient(120deg, #3a1c66, #24477a);
  box-shadow: 0 7px 22px rgba(8,0,15,.18);
}

.history-detail-section-title { color: #f7f0fb; font-size: 11px; font-weight: 800; }
.history-detail-player { display: flex; align-items: center; gap: 10px; }
.history-detail-player-info { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.history-detail-player-info strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-detail-player-info span { color: #bda5cf; font-size: 10px; font-weight: 700; }
.history-detail-payout { max-width: 47%; color: #61e0ec; font-size: 11px; font-weight: 800; text-align: right; }

.history-detail-players {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 17px;
  background: rgba(55, 19, 76, .86);
}

.history-detail-section-heading { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.08); }
.history-detail-section-heading strong { color: #f5ecfb; font-size: 11px; }
.history-detail-section-heading span { color: #c5a9d2; font-size: 10px; font-weight: 700; }
.history-detail-player-row { display: flex; min-height: 30px; align-items: center; gap: 8px; color: #d5c2dd; font-size: 11px; }
.history-detail-player-row > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-detail-player-row .history-participant-avatar { width: 28px; height: 28px; }
.history-detail-player-row strong { color: #69d5ff; font-size: 10px; white-space: nowrap; }
.history-detail-empty { margin: 0; color: #b89ac5; font-size: 11px; text-align: center; }

.toast {
  position: fixed;
  z-index: 5;
  bottom: 88px;
  left: 50%;
  max-width: calc(100vw - 30px);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: #24142e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.bottom-nav { z-index: 8; }
.toast { z-index: 10; }

@media (max-height: 740px) and (min-width: 390px) {
  .game { margin-top: 2px; }
  .stats-row { margin-top: 4px; }
  .pot-row { margin-top: 3px; }
  .wheel-section { padding-top: 16px; }
  .pointer { top: 6px; }
  .wheel-stage { width: min(74vw, 280px); }
  .join-section { margin-top: 0; }
  .stake-panel { padding-top: 6px; padding-bottom: 6px; }
  .players-panel { margin-top: 6px; }
}

@media (max-width: 360px) {
  .app { padding-right: 11px; padding-left: 11px; }
  .game { margin-top: 3px; }
  .wheel-stage { width: min(82vw, 310px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
