.page.dice-page {
  display: none;
}

.page.dice-page.active {
  display: flex;
  min-height: 100dvh;
  height: 100dvh;
}

.dice-page {
  background: #0f1117;
  padding: 0;
  overflow: visible;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.dice-page::before {
  display: none;
}

.dice-root {
  height: 100dvh;
  min-height: 100dvh;
  overflow: visible;
  background: #0f1117;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.dice-shell {
  width: min(100%, 390px);
  height: 100dvh;
  min-height: 100dvh;
  max-height: none;
  margin: 0 auto;
  padding: 12px 10px max(12px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  position: relative;
  box-sizing: border-box;
  background:
    radial-gradient(circle at top, rgba(164,100,255,0.14), transparent 28%),
    linear-gradient(180deg, #17191f, #111318);
}

.dice-topbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 60;
}

.dice-brand {
  color: #f4f6ff;
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  font-style: italic;
  text-shadow: 0 0 20px rgba(255,255,255,0.14);
}

.dice-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dice-wallet-pill {
  min-width: 146px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1b2b87, #122061);
  border: 1px solid #7ca4ff;
  box-shadow: 0 0 20px rgba(0,0,0,0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dice-wallet-coin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffd767, #ff9f2f);
  color: #15225e;
  font-size: 16px;
  font-weight: 900;
}

.dice-wallet-pill strong {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.dice-menu-wrap {
  position: relative;
  z-index: 80;
}

.dice-menu-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #3a4560;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(34,39,53,0.98), rgba(19,23,33,0.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.dice-menu-button span {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  display: block;
}

.dice-menu-button span + span {
  margin-top: 3px;
}

.dice-quick-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(19, 24, 33, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 32px rgba(0,0,0,0.42);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 120;
}

.dice-quick-menu.hidden {
  display: none;
}

.dice-quick-icon-action {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
}

.dice-quick-icon-action img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

.dice-quick-icon-action.is-blue {
  background: linear-gradient(180deg, #2279ff, #0a43a6);
}

.dice-quick-icon-action.is-green {
  background: linear-gradient(180deg, #2fd35c, #0d8e33);
}

.dice-quick-icon-action.is-gold {
  background: linear-gradient(180deg, #f4c442, #cc8b0b);
}

.dice-bet-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dice-mode-button {
  height: 66px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.72);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
}

.dice-mode-button.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: inset 0 0 18px rgba(255,255,255,0.06);
}

.dice-chance-label {
  text-align: center;
  color: rgba(255,255,255,0.65);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.dice-slider-wrap {
  position: relative;
  padding: 0 8px;
  height: 24px;
  cursor: pointer;
}

.dice-slider-track {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}

.dice-slider-fill {
  width: 14%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff70d5, #ffe078, #8cff86);
  transition: width .24s ease;
}

.dice-slider-knob {
  position: absolute;
  top: 50%;
  left: 14%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 4px solid #9dff7a;
  box-shadow: 0 0 25px rgba(170,255,120,0.9);
  transition: left .24s ease;
  pointer-events: none;
}

.dice-stage-card {
  flex: 1;
  min-height: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.22));
}

.dice-stage-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 55%);
  filter: blur(8px);
}

.dice-stage-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
}

.dice-stage-ring.ring-a {
  width: 310px;
  height: 310px;
}

.dice-stage-ring.ring-b {
  width: 230px;
  height: 230px;
}

.dice-display-value {
  position: relative;
  z-index: 2;
  font-size: 104px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 20px rgba(255,255,255,0.28);
}

.dice-play-row {
  position: relative;
  z-index: 2;
}

.dice-play-button {
  width: 100%;
  height: 72px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(90deg, #d6a8ff, #ffe394, #9eff7a);
  color: #111;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 20px 40px rgba(255,220,120,0.25);
}

.dice-play-button:disabled {
  filter: grayscale(0.18);
  opacity: 0.82;
}

.dice-bet-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  padding: 12px;
  backdrop-filter: blur(12px);
}

.dice-bet-label {
  text-align: center;
  color: rgba(255,255,255,0.62);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.dice-bet-controls {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 10px;
}

.dice-amount-display,
.dice-bet-adjust {
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.3);
  color: #fff;
}

.dice-amount-display {
  width: 100%;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
  outline: none;
}

.dice-bet-adjust {
  display: grid;
  place-items: center;
  font-size: 30px;
  color: rgba(255,255,255,0.7);
}

.dice-result-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.dice-result-overlay.hidden {
  display: none;
}

.dice-result-card {
  width: 100%;
  max-width: 320px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  text-align: center;
  box-shadow: 0 24px 42px rgba(0,0,0,0.4);
  padding: 26px 22px 28px;
}

.dice-result-card.is-win {
  background: linear-gradient(180deg, #1eff82, #046c32);
  border-color: #baffcf;
}

.dice-result-card.is-loss {
  background: linear-gradient(180deg, #ff6363, #941111);
  border-color: #ffc0c0;
}

.dice-result-emoji {
  font-size: 82px;
  margin-bottom: 6px;
}

.dice-result-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.dice-result-meta {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 14px;
}

.dice-result-chip-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dice-result-chip {
  min-width: 92px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
