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

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

.hilo-page {
  background: linear-gradient(180deg, #dff4ff 0%, #9fdbff 28%, #1570ef 100%);
  padding: 0;
  overflow: visible;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

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

.hilo-shell {
  width: min(100%, 390px);
  height: 100dvh;
  min-height: 100dvh;
  max-height: none;
  margin: 0 auto;
  padding: 14px 10px max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  position: relative;
  background: linear-gradient(180deg, #7dd3fc 0%, #4da8ff 38%, #1570ef 100%);
}

.hilo-shell::before,
.hilo-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
}

.hilo-shell::before {
  width: 260px;
  height: 260px;
  top: -72px;
  left: -72px;
  background: rgba(196, 244, 255, 0.32);
}

.hilo-shell::after {
  width: 220px;
  height: 220px;
  right: -54px;
  bottom: 80px;
  background: rgba(138, 133, 255, 0.22);
}

.hilo-topbar,
.hilo-info-card,
.hilo-streak-bar,
.hilo-cards-row,
.hilo-chances-row,
.hilo-guess-row,
.hilo-description,
.hilo-bet-panel,
.hilo-result-overlay {
  position: relative;
  z-index: 1;
}

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

.hilo-brand {
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.4px;
  font-style: italic;
  text-shadow: 0 6px 18px rgba(8, 52, 132, 0.25);
}

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

.hilo-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 142px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.34);
  box-shadow: 0 10px 24px rgba(12, 50, 119, 0.18);
}

.hilo-wallet-coin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffd95b, #ff9f1f);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

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

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

.hilo-menu-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

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

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

.hilo-quick-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(17, 28, 64, 0.96);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 18px 32px rgba(0,0,0,0.32);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 120;
}

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

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

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

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

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

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

.hilo-info-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 28px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 34px rgba(9, 59, 161, 0.18);
}

.hilo-info-label,
.hilo-streak-label,
.hilo-chance-label,
.hilo-bet-label {
  color: rgba(255,255,255,0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hilo-multiplier {
  margin-top: 4px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.hilo-streak-box {
  width: 88px;
  min-width: 88px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #9eff7d, #3acb32);
  border: 1px solid rgba(255,255,255,0.42);
  box-shadow: 0 10px 30px rgba(80,255,100,0.36);
}

.hilo-streak-label {
  color: rgba(6, 52, 0, 0.6);
}

.hilo-streak-value {
  margin-top: 2px;
  color: #063400;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.hilo-streak-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.2);
}

.hilo-streak-fill {
  width: 12%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fde047, #86efac, #67e8f9);
  transition: width .3s ease;
}

.hilo-cards-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.hilo-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0,0,0,0.18);
}

.hilo-card-current {
  width: 150px;
  height: 220px;
  border: 6px solid #fff;
  background: linear-gradient(135deg, #ffffff, #d9f0ff);
  animation: hiloFloat 3s ease-in-out infinite;
}

.hilo-card-next {
  width: 115px;
  height: 170px;
  border-radius: 24px;
  animation: hiloFloat 3s ease-in-out infinite .4s;
}

.hilo-next-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1.6s cubic-bezier(.22,1,.36,1);
}

.hilo-next-card.is-flipping .hilo-next-card-inner,
.hilo-next-card.is-revealed .hilo-next-card-inner {
  transform: rotateY(180deg);
}

.hilo-card-back,
.hilo-card-front {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
}

.hilo-card-back {
  border: 5px solid #fff;
  background: linear-gradient(135deg, #29b6ff, #1d4ed8);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hilo-card-back::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 16px 16px;
}

.hilo-card-back span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 48px;
  font-weight: 900;
}

.hilo-card-front {
  transform: rotateY(180deg);
  border: 5px solid #fff;
  background: linear-gradient(135deg, #ffffff, #d9f0ff);
}

.hilo-card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.hilo-card-corner.top {
  top: 12px;
  left: 12px;
}

.hilo-card-corner.bottom {
  right: 12px;
  bottom: 12px;
  transform: rotate(180deg);
}

.hilo-card-corner .value {
  font-weight: 900;
}

.hilo-card-current .hilo-card-corner .value {
  font-size: 32px;
}

.hilo-card-current .hilo-card-corner .suit {
  font-size: 24px;
}

.hilo-card-front .hilo-card-corner .value {
  font-size: 24px;
}

.hilo-card-front .hilo-card-corner .suit {
  font-size: 20px;
}

.hilo-card-suit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.hilo-card-current .hilo-card-suit {
  font-size: 72px;
}

.hilo-card-front .hilo-card-suit {
  font-size: 58px;
}

.theme-red .value,
.theme-red .suit {
  color: #ef4444;
}

.theme-dark .value,
.theme-dark .suit {
  color: #1e293b;
}

.hilo-chances-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hilo-chance-box {
  padding: 14px 12px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(10px);
}

.hilo-chance-value {
  margin-top: 6px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.hilo-guess-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hilo-guess-button {
  position: relative;
  overflow: hidden;
  height: 78px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 15px 40px rgba(0,0,0,0.18);
  color: #fff;
}

.hilo-guess-button span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.82;
}

.hilo-guess-button strong {
  display: block;
  margin-top: 2px;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 2px;
}

.hilo-guess-button.is-low {
  background: linear-gradient(90deg, #3b82f6, #0f5ee8);
  box-shadow: 0 15px 40px rgba(0,90,255,0.28);
}

.hilo-guess-button.is-high {
  background: linear-gradient(90deg, #ff9d3b, #ff6b1d);
  box-shadow: 0 15px 40px rgba(255,120,40,0.28);
}

.hilo-guess-button:disabled {
  opacity: 0.78;
}

.hilo-description {
  margin: 0;
  padding: 0 8px;
  text-align: center;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.hilo-bet-panel {
  margin-top: auto;
  padding: 14px;
  border-radius: 28px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(12px);
}

.hilo-bet-label {
  text-align: center;
  margin-bottom: 12px;
}

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

.hilo-amount-display,
.hilo-bet-adjust {
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(4, 28, 75, 0.42);
  color: #fff;
}

.hilo-amount-display {
  width: 100%;
  text-align: center;
  font-size: 30px;
  line-height: 56px;
  font-weight: 900;
  padding: 0 10px;
  box-sizing: border-box;
}

.hilo-bet-adjust {
  font-size: 30px;
  font-weight: 700;
}

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

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

.hilo-result-card {
  position: relative;
  width: 320px;
  max-width: 100%;
  padding: 28px 22px;
  border-radius: 34px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.34);
  box-shadow: 0 26px 46px rgba(0,0,0,0.24);
}

.hilo-result-card.is-win {
  background: linear-gradient(180deg, #1eff82, #0b9b4b);
}

.hilo-result-card.is-loss {
  background: linear-gradient(180deg, #ff7f7f, #db3131);
}

.hilo-result-emoji {
  font-size: 86px;
  line-height: 1;
}

.hilo-result-title {
  margin-top: 8px;
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 4px;
}

.hilo-result-meta {
  margin-top: 12px;
  color: rgba(255,255,255,0.92);
  font-size: 18px;
}

.hilo-result-chip-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hilo-result-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 14px;
  font-weight: 900;
}

@keyframes hiloFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
