:root {
  --primary-blue: #3b82f6;
  --primary-green: #10b981;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-cyan: #67beda;
  --danger: #f87171;
  --bg: #041018;
  --card: #0a1c1f1a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background: #02080c;
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

.phone-shell {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg);
  background-image: url("../assets/bg.webp");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.phone-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 16, 24, 0.35) 0%, rgba(4, 16, 24, 0.55) 100%);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: calc(12px + var(--safe-top)) 16px calc(10px + var(--safe-bottom));
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.lang-switcher {
  position: relative;
}

.lang-switcher select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 6px 28px 6px 14px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  outline: none;
  min-height: 36px;
}

.lang-switcher::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.lang-switcher select option {
  background: #1a1a24;
  color: #fff;
}

.card {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
  border-radius: 28px;
  padding: 22px 18px 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  border: 1.5px solid #ffffff1a;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.screen.active {
  display: flex;
  animation: fadeUp 0.35s ease;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  color: var(--accent-cyan);
  font-weight: 500;
  margin: 0 auto 14px;
}

.badge svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent-cyan);
}

.hero-title {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 10px;
  padding-right: 34px;
  font-size: 28px;
  background: linear-gradient(91.63deg, #d3f6fb 3.43%, #94ebee 97.27%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  position: relative;
  line-height: 1.25;
}

.trx-badge {
  position: absolute;
  width: 28px;
  height: 14px;
  top: 6px;
  right: 0;
}

.hero-subtitle {
  font-size: 11px;
  color: #a8abb4;
  margin-bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-subtitle span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-subtitle svg {
  width: 13px;
  height: 13px;
  stroke: var(--accent-cyan);
}

.panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 14px 12px;
  text-align: left;
  margin-bottom: 12px;
}

.panel h2,
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.panel p,
.intro-desc {
  font-size: 13px;
  line-height: 1.65;
  color: #c5c9d3;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.compare-item {
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.compare-item.good {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.compare-item .label {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.compare-item .value {
  font-size: 18px;
  font-weight: 700;
}

.compare-item.good .value {
  color: #34d399;
}

.compare-item.bad .value {
  color: #f87171;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.save-pill {
  display: inline-flex;
  margin: 4px auto 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #7df641;
  background: #85fc521a;
  border: 1px solid #85fc521a;
}

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

.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.step-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #041018;
  background: linear-gradient(90deg, #1f80ee 0%, #04c6d5 100%);
  margin-top: 1px;
}

.step h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step p {
  font-size: 12px;
  color: #a8abb4;
  line-height: 1.5;
}

.cta-bar {
  flex-shrink: 0;
  padding: 10px 0 calc(14px + var(--safe-bottom));
}

.cta-bar.hidden {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 60px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}

.btn-primary {
  background: linear-gradient(90deg, #1f80ee 0%, #04c6d5 100%);
  box-shadow: 0 8px 24px rgba(99, 140, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-ghost {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  font-weight: 600;
}

.cta-hint {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.faq {
  margin-top: 14px;
  text-align: left;
}

.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent-cyan);
  font-weight: 400;
  font-size: 16px;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  padding: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #9ca3af;
}

.subtitle {
  font-size: 20px;
  font-weight: 500;
  margin: 8px 0 4px;
}

.match-status {
  min-height: 20px;
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.countdown-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 16px;
}

.countdown-circle {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 8px;
}

.countdown-circle svg {
  transform: rotate(-90deg);
  width: 132px;
  height: 132px;
}

.countdown-circle .bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 6;
}

.countdown-circle .progress {
  fill: none;
  stroke: url(#gradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(99, 140, 255, 0.4));
}

.countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.countdown-label {
  font-size: 13px;
  color: #fff;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  margin: 8px 0 16px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #268bff 0%, #00eeff 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
  width: 100%;
  transition: width 0.3s ease;
}

@keyframes shimmer {
  to {
    background-position: 200% 0;
  }
}

.nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.node {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.node.active {
  color: #7df641;
  border-color: #85fc5233;
  background: #85fc521a;
}

.footnote {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 4px auto 12px;
}

.success-icon svg {
  width: 100%;
  height: 100%;
  stroke: #10b981;
  fill: none;
  stroke-width: 2;
}

.success-title {
  font-size: 22px;
  font-weight: 600;
  color: #10b981;
  margin-bottom: 6px;
}

.success-subtitle {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.wallet-address-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 12px;
  width: 100%;
  margin-bottom: 8px;
}

.wallet-address-box span {
  color: #fff;
  font-size: 13px;
  word-break: break-all;
  text-align: left;
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.valid-row {
  font-size: 12px;
  color: #a8abb4;
  margin-bottom: 12px;
}

.valid-row.expired {
  color: var(--danger);
}

.fee-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
}

.fee-info svg {
  width: 20px;
  height: 20px;
  stroke: #10b981;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.fee-text {
  font-size: 13px;
  color: #a0a0a0;
  text-align: left;
}

.fee-text strong {
  color: #10b981;
}

.tips-list {
  margin-top: 16px;
  text-align: left;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.tip-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-cyan);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 1px;
}

.splash {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(4, 16, 24, 0.72);
  backdrop-filter: blur(12px);
}

.splash.hidden {
  display: none;
}

.splash-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #04c6d5;
  box-shadow: 0 0 16px #04c6d5;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  background: rgba(16, 185, 129, 0.95);
  color: #041018;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 360px) {
  .hero-title {
    font-size: 24px;
  }

  .countdown-number {
    font-size: 44px;
  }
}
