: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;
  align-items: center;
  gap: 8px;
  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 {
  position: relative;
  min-width: 0;
  border-radius: 14px;
  padding: 30px 10px 14px;
  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 {
  position: absolute;
  top: 0;
  right: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 3px 7px;
  border-radius: 0 13px 0 9px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  color: #a3f875;
  background: #213e2c;
  overflow-wrap: anywhere;
}

.rental-options {
  min-width: 0;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.rental-options legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #c5c9d3;
}

.rental-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rental-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.rental-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rental-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 100%;
  min-height: 40px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: #b8c3cd;
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background 0.15s, border-color 0.15s;
}

.rental-option:hover span {
  border-color: rgba(52, 211, 153, 0.5);
}

.rental-option input:checked + span {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  font-weight: 600;
}

.rental-option input:focus-visible + span {
  outline: 2px solid #93c5fd;
  outline-offset: 3px;
}

.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;
  }
}

.rental-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #c5c9d3;
}
.rental-total strong { color: #34d399; font-size: 18px; }

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  padding: 8px 10px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.back-button:hover { background: rgba(255, 255, 255, 0.1); }
.back-button:focus-visible { outline: 2px solid #34d399; outline-offset: 2px; }

.back-button[hidden] { display: none; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  min-height: 36px;
  flex-shrink: 0;
  user-select: none;
}
.brand-symbol { flex-shrink: 0; }
.brand-wordmark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: Arial, sans-serif;
  font-weight: 800;
  line-height: 1.1;
}
.brand-energy { color: #e2fbff; font-size: 12px; letter-spacing: 1px; }
.brand-flash { color: #61e8cc; font-size: 11px; letter-spacing: 2.6px; margin-top: 3px; }
.brand-logo[hidden] { display: none; }

.cta-bar { position: relative; }
#screenIntro { padding-bottom: 62px; }
.share-float {
  position: absolute;
  right: 10px;
  bottom: calc(100% + 12px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  max-width: calc(100% - 20px);
  padding: 10px 14px;
  border: 1px solid rgba(103, 232, 249, 0.45);
  border-radius: 24px;
  background: linear-gradient(135deg, #14546a, #103c47);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  color: #c8fff3;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.share-float svg { flex-shrink: 0; }
.share-float:hover { background: #196073; }
.share-float:focus-visible { outline: 2px solid #6ee7b7; outline-offset: 3px; }
.share-float:disabled { opacity: 0.6; cursor: wait; }

.share-dialog {
  margin: auto;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 28px 24px 16px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 26px;
  background: radial-gradient(ellipse at 10% 0%, #143b46 0%, transparent 60%), #0b1b24;
  color: #e2fbff;
  box-shadow: 0 24px 80px #0009, inset 0 1px 0 #ffffff0d;
}
.share-dialog::backdrop { background: rgba(0, 8, 14, 0.76); backdrop-filter: blur(5px); }
.share-emblem { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-bottom: 20px; border: 1px solid #67e8f933; border-radius: 17px; background: linear-gradient(135deg, #22d3ee26, #34d3990d); color: #77edd8; }
.share-dialog-heading { margin-bottom: 10px; padding-right: 12px; }
.share-dialog-heading h2 { font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -0.4px; }
.share-close { position: absolute; right: 16px; top: 16px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #ffffff06; border: 1px solid #ffffff0d; border-radius: 50%; color: #a6bec8; cursor: pointer; }
.share-close:hover { color: #fff; background: #ffffff12; }
.share-url-label { display: block; margin-bottom: 9px; font-size: 11px; font-weight: 600; color: #8ea9b5; }
.share-link-box { display: flex; align-items: center; gap: 10px; padding: 0 13px; margin-bottom: 16px; border: 1px solid #294550; border-radius: 12px; background: #06141c; color: #619ca9; }
.share-link-box > svg { flex-shrink: 0; }
.share-url { min-width: 0; width: 100%; padding: 15px 0; border: 0; background: transparent; color: #daf7f6; font-size: 13px; text-overflow: ellipsis; }
#shareCopyBtn { gap: 9px; min-height: 48px; border-radius: 12px; font-size: 14px; background: linear-gradient(105deg, #238ce8, #06b4c7); box-shadow: 0 5px 16px #009dcc20; }
#shareCopyBtn:disabled { opacity: 0.65; cursor: wait; }
.share-copy-status { min-height: 18px; margin-top: 12px; text-align: center; font-size: 12px; line-height: 1.5; color: #6ee7b7; }
.share-dialog :focus-visible { outline: 2px solid #6ee7b7; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.share-result { right: 26px; bottom: calc(24px + var(--safe-bottom)); }
.share-result[hidden] { display: none; }
#screenResult { padding-bottom: 68px; }
.share-description { margin: 0 0 24px; font-size: 13px; line-height: 1.6; color: #a6bec8; }
