:root {
  --zec-yellow: #f4b728;
  --zec-yellow-glow: rgba(244, 183, 40, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: radial-gradient(circle at 50% -20%, #1a1a1a 0%, #000 70%);
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  /* Prevent bounce on mobile */
}

/* Splash screen */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 100;
  transition: opacity 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash span {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: #fff;
  opacity: 0.6;
  text-transform: uppercase;
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-dots {
  margin-top: 24px;
  font-size: 18px;
  letter-spacing: 0.4em;
  color: var(--zec-yellow);
  opacity: 0.8;
}

.loading-dots::after {
  content: '.';
  animation: dots 1.5s steps(1, end) infinite;
}

@keyframes dots {
  0% {
    content: '.';
  }

  33% {
    content: '..';
  }

  66% {
    content: '...';
  }
}

main {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 600px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.container.ready {
  opacity: 1;
  transform: translateY(0);
}

/* Headlines container */
.headlines {
  position: relative;
  height: 180px;
  margin-bottom: 20px;
}

/* Individual headline */
.headline {
  position: absolute;
  width: 100%;
  left: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Price headline */
.headline-price {
  top: 0;
  opacity: 0;
  transform: translateY(-40px) scale(0.8);
  pointer-events: none;
}

.headline-price.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Shielded headline */
.headline-shielded {
  top: 0;
  opacity: 0;
  transform: translateY(40px) scale(0.8);
  pointer-events: none;
}

.headline-shielded.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ticker-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ticker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  margin-bottom: 0;
}

.currency-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--zec-yellow);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.currency-toggle:hover {
  opacity: 1;
  border-color: var(--zec-yellow);
}

.ticker .shielded-percent {
  color: var(--zec-yellow);
  opacity: 0.8;
}

/* 24h Stats */
.stats-container {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 10px 0 30px;
  opacity: 0.6;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.stat-value {
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .stats-container {
    gap: 16px;
  }

  .stat-label {
    font-size: 9px;
  }

  .stat-value {
    font-size: 12px;
  }
}

/* Price display */
.price-wrapper {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.controls-wrapper {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.price-change-btn,
.shielded-change-btn {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.price-change-btn:hover,
.shielded-change-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.price-change-btn:active,
.shielded-change-btn:active {
  transform: scale(0.96);
}

.price-change-btn.up,
.shielded-change-btn.up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
}

.price-change-btn.down,
.shielded-change-btn.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

.shielded-change-btn.loading {
  animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.currency {
  font-size: 32px;
  font-weight: 200;
  opacity: 0.4;
  margin-right: 8px;
  color: var(--zec-yellow);
}

.price {
  display: inline-flex;
  font-size: 84px;
  font-weight: 200;
  letter-spacing: -0.04em;
}

/* Shielded display */
.shielded-wrapper {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  text-shadow: 0 0 30px var(--zec-yellow-glow);
}

.shielded-value {
  font-size: 64px;
  font-weight: 200;
  letter-spacing: -0.04em;
  color: #fff;
}

.shielded-suffix {
  font-size: 24px;
  font-weight: 300;
  opacity: 0.3;
  letter-spacing: 0.1em;
}

@media (max-width: 480px) {
  .price {
    font-size: 64px;
  }

  .shielded-value {
    font-size: 48px;
  }

  .currency {
    font-size: 24px;
  }

  .headlines {
    height: 140px;
  }
}

/* Rolling digits */
.digit-slot {
  display: inline-block;
  height: 1.15em;
  overflow: hidden;
  position: relative;
}

.digit-roll {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.digit-roll span {
  height: 1.15em;
  line-height: 1.15em;
}

/* Price direction flash */
.price.flash-up .digit-roll span {
  color: #22c55e;
}

.price.flash-down .digit-roll span {
  color: #ef4444;
}

.price .digit-roll span {
  transition: color 1s ease;
}

.shielded-value {
  transition: color 1s ease;
}

.shielded-value.flash-up {
  color: #22c55e;
}

.shielded-value.flash-down {
  color: #ef4444;
}

/* Charts wrapper */
.charts-wrapper {
  margin-top: 60px;
  padding: 0 10px;
}

.chart-views {
  position: relative;
  height: 240px;
}

.chart-view {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart-view.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chart-container {
  position: relative;
  height: 100%;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.05));
}

.live-indicator {
  position: absolute;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.live-indicator::before,
.live-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--zec-yellow);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px var(--zec-yellow);
}

.live-indicator::after {
  opacity: 0.6;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4);
  }
}

/* View Toggle Button */
.view-toggle {
  position: fixed;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 50;
}

.container.ready+.view-toggle {
  transform: translateX(-50%) translateY(0);
}

.view-toggle:hover {
  background: rgba(30, 30, 30, 0.8);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.view-toggle:active {
  transform: translateX(-50%) translateY(4px);
}

.toggle-arrow {
  width: 14px;
  height: 14px;
  stroke: var(--zec-yellow);
  transition: transform 0.4s ease;
}

.view-toggle.flipped .toggle-arrow {
  transform: rotate(180deg);
}

/* Poll progress bar */
.poll-progress {
  position: absolute;
  bottom: -20px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  border-radius: 10px;
}

.poll-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--zec-yellow);
  opacity: 0.3;
  transition: width 0.5s linear;
}

.poll-progress-bar.polling {
  opacity: 0.6;
}

/* View visibility */
.view-content {
  display: none;
  width: 100%;
}

.view-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
}

.mode-tab {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.3);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-tab:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-tab.active {
  background: var(--glass-bg);
  border-color: var(--zec-yellow);
  color: var(--zec-yellow);
  box-shadow: 0 0 15px rgba(244, 183, 40, 0.1);
}

/* Predict View */
.predict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.wallet-balance {
  font-size: 20px;
  font-weight: 200;
  color: var(--zec-yellow);
  letter-spacing: -0.02em;
}

.round-timer-wrapper {
  text-align: right;
}

.timer-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.4;
  margin-bottom: 2px;
}

.round-timer-wrapper span:not(.timer-label) {
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rounds-container {
  perspective: 1000px;
  margin-bottom: 40px;
}

.round-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.round-card.active-round {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.round-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 20px;
}

.round-price-info {
  display: flex;
  gap: 40px;
  margin-bottom: 24px;
}

.round-price-info .label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  opacity: 0.3;
  margin-bottom: 4px;
}

.round-price-info .val {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.pool-stats {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.pool-label {
  font-size: 12px;
  opacity: 0.4;
}

.pool-value {
  font-size: 12px;
  color: var(--zec-yellow);
  font-weight: 600;
}

.bet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.bet-btn.up {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

.bet-btn.up:hover {
  background: rgba(34, 197, 94, 0.2);
  transform: translateY(-2px);
}

.bet-btn.down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.bet-btn.down:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

.bet-btn .arrow {
  font-size: 18px;
}

.bet-btn .text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bet-btn:active {
  transform: scale(0.95);
}

.history-section {
  text-align: left;
}

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.3;
  margin-bottom: 16px;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 12px;
}

.history-item .outcome {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
}

.history-item.win {
  border-color: rgba(34, 197, 94, 0.3);
}

.history-item.loss {
  border-color: rgba(239, 68, 68, 0.3);
}

.history-item .win-text {
  color: #22c55e;
}

.history-item .loss-text {
  color: #ef4444;
}

.history-item .round-num {
  opacity: 0.3;
  font-size: 10px;
}