:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f0f0f0;
  --glass: #e6e6e6;
  --accent: #8a8a8a;
  --accent-2: #9a9a9a;
  --text: #000000;
  --muted: #000000;
  --danger: #ff0000;
  --success: #0000ff;
  font-family: "Coinbase Sans", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

img {
  padding-left: 0;
  padding-right: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 20px;
  background: transparent;
  border-bottom: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  justify-self: start;
  grid-column: 1;
}

.logo img {
  width: 22px;
  height: 22px;
}

.account-logo {
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #e6e6e6;
  object-fit: cover;
}

.account-line {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

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

.balances {
  display: flex;
  gap: 16px;
  justify-self: end;
  grid-column: 3;
}

.balance {
  background: transparent;
  padding: 8px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.balance .value {
  font-size: 14px;
  font-weight: 600;
}

.balance img {
  width: 18px;
  height: 18px;
}

.screen {
  flex: 1;
  padding: 20px;
}

.screen-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.screen-panel.active {
  display: block;
}

.hero {
  text-align: center;
  padding: 24px;
  background: transparent;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: none;
}

.hero h1 {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.demo-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid #0000ff;
  color: #0000ff;
  cursor: pointer;
}

.home-center {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.home-center h1 {
  width: 190px;
  height: 0;
  margin: 9px 0;
  padding: 0;
}

.home-plate {
  width: 216px;
  height: 216px;
  border-radius: 8px;
  background: #ededed;
  animation: homePlatePulse 5s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.08);
}

.home-config {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 29px;
  margin: -5px 0;
  padding: 0;
  text-transform: uppercase;
  font-weight: 700;
}

.home-bet,
.home-mines {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-bet img {
  width: 18px;
  height: 18px;
}

.icon-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.icon-button img {
  width: 22px;
  height: 22px;
}

#settingsButton {
  padding-top: 1px;
  padding-bottom: 1px;
  padding-left: 6px;
  padding-right: 6px;
}

#settingsButtonHome {
  width: 23px;
  height: 23px;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 6px;
  padding-right: 6px;
}

#settingsButtonHome img {
  height: 22px;
  margin-top: -1px;
}

.settings-home {
  transform: translateY(2px);
}

.demo-toggle input {
  display: none;
}

.demo-toggle input:checked + span {
  color: #ffffff;
}

.demo-toggle:has(input:checked) {
  background: #0000ff;
  color: #ffffff;
}

.settings {
  display: grid;
  gap: 16px;
}

.setting {
  background: transparent;
  padding: 16px;
  border-radius: 14px;
}

.setting label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.setting.merged {
  padding: 0;
}

.bet-row {
  display: grid;
  gap: 12px;
}

#betSlider {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #d0d0d0;
  outline: none;
  box-shadow: 0 0 10px rgba(0, 0, 255, 0.2);
}

#betSlider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0000ff;
  box-shadow: 0 0 12px rgba(0, 0, 255, 0.35);
}

#betSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0000ff;
  border: none;
  box-shadow: 0 0 12px rgba(0, 0, 255, 0.35);
}

.bet-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
}

.bet-value img {
  width: 16px;
  height: 16px;
}

.mines-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mines-compact input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text);
}

.mines-compact button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.input-row {
  display: grid;
  gap: 12px;
}

.input-row input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: #e1e1e1;
  color: var(--text);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chips button {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: #e1e1e1;
  color: var(--text);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #e1e1e1;
  color: var(--text);
  font-size: 18px;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.disclaimer {
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.info-plain {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  text-transform: uppercase;
  font-weight: 700;
}

.bet-info {
  gap: 6px;
}

.bet-info .usdc-icon {
  width: 16px;
  height: 16px;
}

.info-plain .label {
  font-size: 12px;
  color: var(--text);
}

.info-plain .value {
  font-weight: 600;
}

.mines-tiles {
  gap: 6px;
}

.plate-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-block;
}

.plate-swatch.closed {
  background: #0000ff;
}

.plate-swatch.mine {
  background: #ff0000;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.grid-wrap {
  position: relative;
}

.next-box {
  position: absolute;
  left: 0;
  bottom: -12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: transparent;
  font-weight: 700;
  text-transform: uppercase;
  height: 17px;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -17px;
  margin-bottom: -17px;
  margin-left: 0;
  margin-right: 0;
}

.next-box .label {
  font-size: 8px;
}

.next-box .value {
  font-size: 14px;
}

.tile {
  position: relative;
  padding-top: 100%;
  border-radius: 5px;
  background: #f2f2f2;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.tile.open.safe {
  background: #0000ff;
  box-shadow: 0 0 6px rgba(0, 0, 255, 0.18);
}

.tile.open.mine {
  background: #ff0000;
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.18);
}

.tile.open {
  animation: platePop 0.2s ease-out;
}

.tile-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-content img {
  display: none;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

button.primary,
button.secondary,
button.ghost {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  flex: 0;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.primary {
  background: #0000ff;
  color: #ffffff;
  padding: 16px 32px;
  font-size: 16px;
  box-shadow: 0 0 16px rgba(0, 0, 255, 0.35);
  animation: playGlow 2s ease-in-out infinite;
}

button.primary.wide {
  min-width: 240px;
}

button.secondary {
  background: #0000ff;
  color: #ffffff;
  padding: 20px 28px;
  min-width: 200px;
  font-size: 18px;
  box-shadow: 0 0 8px rgba(0, 0, 255, 0.2);
}

button.primary.small,
button.secondary.small {
  padding: 15px 24px;
  min-width: 140px;
  font-size: 21px;
  border-radius: 20px;
  animation: none;
  box-shadow: none;
}

button.secondary.small {
  background: #d8d8d8;
  color: #000000;
}

button.ghost {
  background: #f3f3f3;
  border: none;
  color: var(--text);
}

.status {
  margin-top: 12px;
  color: var(--text);
  font-size: 13px;
}

.card {
  background: transparent;
  padding: 16px;
  border-radius: 16px;
  display: grid;
  gap: 12px;
}

.card.referral {
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
  border-radius: 21px;
  border-top-left-radius: 21px;
  column-gap: 23px;
  gap: 11px;
  padding-left: 0;
  padding-right: 0;
  height: 219px;
}

#shareReferral {
  width: 338px;
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 44px;
  padding-right: 44px;
  border-radius: 58px;
  border-top-left-radius: 58px;
  border-top-right-radius: 58px;
  border-bottom-right-radius: 58px;
  border-bottom-left-radius: 58px;
}

.referral-reward {
  width: 493px;
}

.balance-line {
  display: flex;
  gap: 6px;
  align-items: center;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 21px;
}

.balance-card {
  align-items: flex-start;
  justify-self: start;
  text-align: left;
  grid-template-columns: repeat(1, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: 109px;
  width: 252px;
  padding: 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

#screenBalance .balance-line {
  font-size: 28px;
  gap: 10px;
}

#screenBalance .balance-actions {
  width: 100%;
  display: flex;
  gap: 12px;
  margin-top: 0;
}

.balance-button {
  flex: 1;
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.balance-button.deposit {
  background: #f2f2f2;
  color: #000000;
}

.balance-button.withdraw {
  background: #0000ff;
  color: #ffffff;
}

.balance-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 49px;
}

.leaderboard {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 220px;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  background: transparent;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  height: 40px;
  align-items: center;
}

.leaderboard-item .entry {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  width: 128px;
  height: 25px;
  padding: 0;
  margin: 0 -16px;
  text-align: left;
}

.leaderboard-item img.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d8d8d8;
}

.referral-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

button.secondary.full {
  width: 100%;
}

.referral {
  align-items: flex-start;
  gap: 6px;
}

.referral h3,
.referral p,
.referral button {
  margin: 0;
}

.referral-reward {
  margin-top: 6px;
}

.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 12px;
  background: #f0f0f0;
  border-top: none;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
}

.nav-item.active {
  color: var(--text);
}

.nav-item img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px rgba(0, 0, 255, 0.25));
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  width: min(320px, 90vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-body {
  display: grid;
  gap: 8px;
}

.modal-body input {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.win-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}

.win-popup.hidden {
  opacity: 0;
}

.win-popup.show {
  animation: popupFade 2s ease-in-out forwards;
}

.win-popup-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  padding: 24px 36px;
  border-radius: 16px;
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  overflow: hidden;
}

.win-popup-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 255, 0.2), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0, 0, 255, 0.15), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(0, 0, 255, 0.12), transparent 50%);
  animation: popupParticles 2s linear infinite;
  z-index: 0;
}

.win-popup-inner span {
  position: relative;
  z-index: 1;
}

@keyframes popupFade {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  15% {
    opacity: 1;
    transform: scale(1);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes popupParticles {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-10px);
  }
}

h1,
h2,
h3 {
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3 {
  text-transform: uppercase;
  font-weight: 700;
}

h3 {
  height: 23px;
  margin-top: -15px;
  margin-bottom: -15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  vertical-align: top;
  box-sizing: content-box;
  padding-top: 0;
  padding-bottom: 0;
}

p {
  height: 19px;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -15px;
  margin-bottom: -15px;
}

.reward-box {
  margin: 10px 0 8px;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  background: transparent;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
}

.reward-box .label {
  font-size: 12px;
}

.reward-box .value {
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.demo-notice {
  text-transform: uppercase;
  font-size: 12px;
  color: #0000ff;
  margin-top: 4px;
}

.settings-game {
  transform: translateY(3px);
}

#cashoutButton {
  background: #0000ff;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 255, 0.25);
}

@keyframes platePop {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  70% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes playGlow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(0, 0, 255, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 0, 255, 0.45);
  }
}

@keyframes homePlatePulse {
  0% {
    background: #ededed;
    transform: scale(0.97);
  }
  33% {
    background: #0000ff;
    transform: scale(1.01);
  }
  66% {
    background: #ff0000;
    transform: scale(0.99);
  }
  100% {
    background: #ededed;
    transform: scale(0.97);
  }
}

.home-center p {
  height: 0;
  margin: 10px 0;
  padding-top: 7px;
  padding-bottom: 7px;
}

.reward-box .value img {
  width: 16px;
  height: 16px;
}

@keyframes playGlow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(0, 0, 255, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 0, 255, 0.45);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

