:root {
  --bg: #07111f;
  --panel: rgba(11, 24, 42, 0.9);
  --panel-strong: linear-gradient(135deg, #0d2138 0%, #15395f 100%);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #ecf4ff;
  --muted: #9db3cc;
  --accent: #5be7c4;
  --accent-strong: #34c4ff;
  --warning: #ffb86b;
  --danger: #ff7b7b;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(91, 231, 196, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(52, 196, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #08111d 0%, #050b14 100%);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  padding: 18px 16px 110px;
}

.hero-card,
.panel,
.stat-card,
.profile-row,
.modal-card {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  background: var(--panel-strong);
}

.hero-card h1,
.panel h2,
.modal-card h3 {
  margin: 0;
}

.eyebrow,
.panel-label,
.muted,
.stat-card span,
.profile-row span,
.mini-stat span,
.small-text {
  color: var(--muted);
}

.eyebrow,
.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.hero-text {
  margin: 10px 0 0;
  max-width: 290px;
  line-height: 1.45;
  color: rgba(236, 244, 255, 0.88);
}

.hero-badge {
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(91, 231, 196, 0.16);
  color: var(--accent);
  font-weight: 700;
}

.content {
  margin-top: 18px;
}

.app-shell.locked {
  padding-bottom: 28px;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.screen.active {
  display: flex;
}

.panel {
  padding: 18px;
  border-radius: 24px;
}

.primary-panel {
  background: linear-gradient(135deg, rgba(24, 50, 80, 0.94), rgba(12, 24, 42, 0.94));
}

.metric-row,
.panel-header,
.progress-top,
.profile-row,
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metric-value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 800;
}

.metric-subtitle {
  margin-top: 6px;
  color: rgba(236, 244, 255, 0.7);
}

.mini-stat {
  min-width: 110px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.mini-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 10px rgba(91, 231, 196, 0.12);
}

.stats-grid,
.action-grid,
.shop-grid,
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stats-grid .stat-card:last-child {
  grid-column: 1 / -1;
}

.stat-card {
  padding: 16px;
  border-radius: 22px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.action-button,
.submit-button,
.nav-item,
.close-button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.action-button {
  padding: 16px;
  border-radius: 20px;
  font-weight: 700;
  color: #07111f;
}

.action-button.deposit {
  background: linear-gradient(135deg, var(--accent), #84ffd8);
}

.action-button.withdraw {
  background: linear-gradient(135deg, var(--warning), #ffd79b);
}

.shop-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(14, 31, 53, 0.96), rgba(10, 22, 37, 0.96));
  box-shadow: var(--shadow);
}

.ticket-option {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.ticket-option-title {
  margin: 8px 0 10px;
  font-size: 26px;
  line-height: 1.15;
}

.ticket-option-subtitle {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.ticket-option-description {
  margin: 0 0 14px;
  line-height: 1.5;
  color: rgba(236, 244, 255, 0.82);
}

.ticket-feature-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: rgba(236, 244, 255, 0.9);
}

.ticket-feature-list li {
  line-height: 1.45;
}

.ticket-price {
  margin: 16px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.ticket-black {
  background: linear-gradient(180deg, rgba(19, 24, 32, 0.98), rgba(7, 12, 20, 0.98));
}

.ticket-silver {
  background: linear-gradient(180deg, rgba(62, 76, 96, 0.98), rgba(21, 33, 49, 0.98));
}

.ticket-gold {
  background: linear-gradient(180deg, rgba(100, 70, 10, 0.98), rgba(38, 24, 6, 0.98));
}

.shop-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.shop-card h3 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.shop-copy {
  margin: 6px 0;
  color: rgba(236, 244, 255, 0.82);
}

.shop-button {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #06111b;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.history-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.history-type {
  font-weight: 700;
}

.history-type.deposit {
  color: var(--accent);
}

.history-type.withdraw {
  color: var(--warning);
}

.history-type.ticket,
.history-type.pending_ticket {
  color: var(--accent-strong);
}

.info-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
  color: rgba(236, 244, 255, 0.88);
}

.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-row {
  padding: 18px;
  border-radius: 22px;
}

.profile-row strong {
  font-size: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(5, 11, 20, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.nav-item {
  min-height: 54px;
  padding: 8px 6px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-item.active {
  background: rgba(91, 231, 196, 0.12);
  color: var(--text);
}

.ticket-gate {
  display: none;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
}

.ticket-gate.active {
  display: flex;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.hidden,
.hidden {
  display: none;
}

.modal-card {
  width: min(100%, 420px);
  padding: 20px;
  border-radius: 24px;
  margin: auto 0;
  max-height: calc(100vh - 32px - env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wide-modal {
  width: min(100%, 460px);
}

.close-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 26px;
}

#actionForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.flow-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.flow-section.hidden {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field input,
.field select {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.submit-button {
  margin-top: 6px;
  padding: 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #06111b;
  font-weight: 800;
}

.deposit-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.deposit-network-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.network-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.qr-image {
  display: block;
  width: min(100%, 280px);
  margin: 0 auto;
  border-radius: 24px;
  background: white;
}

.address-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.address-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.address-value {
  margin-top: 8px;
  word-break: break-all;
  font-weight: 700;
  line-height: 1.45;
}

.address-memo {
  margin-top: 8px;
  color: rgba(236, 244, 255, 0.76);
}

.ticket-selected {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(52, 196, 255, 0.12);
  border: 1px solid rgba(52, 196, 255, 0.2);
  color: var(--text);
  font-weight: 800;
}

.deposit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mini-button {
  padding: 14px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.upload-box {
  padding: 16px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

.status-banner {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(91, 231, 196, 0.12);
  border: 1px solid rgba(91, 231, 196, 0.22);
  color: var(--text);
  font-weight: 700;
}

.ticket-card {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.ticket-panel {
  overflow: hidden;
  position: relative;
}

.ticket-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
}

.ticket-panel.black {
  background: linear-gradient(145deg, #0b1320 0%, #121f33 55%, #080d16 100%);
}

.ticket-panel.black::before {
  background: radial-gradient(circle at top right, rgba(255,255,255,0.22), transparent 28%);
}

.ticket-panel.silver {
  background: linear-gradient(145deg, #2c394d 0%, #52657f 45%, #172335 100%);
}

.ticket-panel.silver::before {
  background: radial-gradient(circle at top right, rgba(255,255,255,0.28), transparent 30%);
}

.ticket-panel.gold {
  background: linear-gradient(145deg, #58400a 0%, #b0841f 45%, #251704 100%);
}

.ticket-panel.gold::before {
  background: radial-gradient(circle at top right, rgba(255,232,170,0.32), transparent 30%);
}

.ticket-panel.lock {
  background: linear-gradient(145deg, #10213a 0%, #162f50 50%, #0b1728 100%);
}

.ticket-tier-badge.black {
  background: rgba(255, 255, 255, 0.12);
}

.ticket-tier-badge.silver {
  background: rgba(226, 232, 240, 0.2);
}

.ticket-tier-badge.gold {
  background: rgba(255, 214, 102, 0.22);
  color: #ffe2a1;
}

.ticket-qr {
  width: 100%;
  border-radius: 22px;
  background: white;
  padding: 8px;
}

.ticket-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-row {
  padding: 14px;
  border-radius: 18px;
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 12px;
  }

  .hero-card {
    padding: 18px;
  }

  .metric-value {
    font-size: 28px;
  }

  .modal {
    padding: 10px 10px calc(18px + env(safe-area-inset-bottom));
  }

  .modal-card {
    padding: 16px;
    max-height: calc(100vh - 20px - env(safe-area-inset-bottom));
  }

  .deposit-actions {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .action-grid,
  .shop-grid,
  .ticket-grid,
  .ticket-card {
    grid-template-columns: 1fr;
  }
}
