:root {
  --bg: #f4f7fb;
  --card: #fff;
  --text: #1a2332;
  --muted: #6b7a90;
  --blue: #2f6bff;
  --blue-dark: #1e4fd6;
  --pink: #ff6b9d;
  --orange: #ff8a00;
  --radius: 16px;
  --nav-h: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.dapp-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

.dapp-header {
  background: linear-gradient(135deg, #3d7cff 0%, #6a5cff 55%, #8b5cf6 100%);
  color: #fff;
  padding: 12px 16px 16px;
  border-radius: 0 0 20px 20px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-width: 0;
  font-size: 0.95rem;
}

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

.lang-picker {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lang-trigger:hover,
.lang-picker.is-open .lang-trigger {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

.lang-trigger-label {
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-chevron {
  opacity: 0.85;
  transition: transform 0.2s;
}

.lang-picker.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 168px;
  max-height: min(280px, 50vh);
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 40px rgba(15, 30, 60, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow-y: auto;
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu li {
  margin: 0;
}

.lang-menu button {
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-menu button:hover {
  background: #eef3ff;
}

.lang-menu button.is-active {
  background: linear-gradient(135deg, rgba(61, 124, 255, 0.12), rgba(106, 92, 255, 0.12));
  color: var(--blue-dark);
  font-weight: 600;
}

.wallet-chip {
  font-size: 0.72rem;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  font: inherit;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s;
}

.wallet-chip:hover {
  background: rgba(255, 255, 255, 0.22);
}

.brand-mini img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.view {
  display: none;
  padding: 16px;
}

.view.active {
  display: block;
}

.hero-card {
  text-align: center;
  padding: 28px 16px 20px;
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-logo img {
  width: 64px;
  height: 64px;
}

.hero-logo h1 {
  margin: 0;
  font-size: 2.4rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.hero-lead {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto 22px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.35);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 8px 28px rgba(20, 40, 80, 0.08);
  margin-bottom: 14px;
}

.pool-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0 0 14px;
}

.mine-arc-wrap {
  position: relative;
  padding: 8px 0 4px;
  text-align: center;
}

.mine-arc {
  width: 220px;
  height: 110px;
  margin: 0 auto;
  display: block;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.35rem;
}

.countdown span {
  min-width: 42px;
  padding: 6px 8px;
  background: #f0f4fa;
  border-radius: 8px;
}

.btn-mine {
  border: none;
  border-radius: 999px;
  padding: 12px 36px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff7eb3, #ff758c, #ff8a00);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 120, 80, 0.35);
}

.btn-mine:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.est-line {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.est-line strong {
  color: var(--orange);
}

.tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.88rem;
}

.tier-row:last-child {
  border-bottom: none;
}

.tier-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-bar {
  width: 4px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(180deg, #ff7eb3, #ff8a00);
}

.tier-rate {
  font-weight: 700;
  color: var(--blue);
}

.pool-grid {
  display: grid;
  gap: 12px;
}

.pool-card h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.pool-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.82rem;
}

.pool-card dt {
  color: var(--muted);
}

.pool-card dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.pool-card dd.green {
  color: #16a34a;
}

.pool-card dd.blue {
  color: var(--blue);
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  margin-top: -28px;
  position: relative;
  z-index: 2;
}

.stat-item {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 6px;
  box-shadow: 0 8px 24px rgba(20, 40, 80, 0.1);
}

.stat-item .label {
  font-size: 0.72rem;
  color: var(--muted);
}

.stat-item .val {
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 4px;
}

.invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #5b8cff, #7c5cff);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
}

.invite-banner button {
  border: none;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.prose {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #e8edf4;
  display: flex;
  z-index: 50;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.bottom-nav a.active {
  color: var(--blue);
  font-weight: 600;
}

.bottom-nav svg {
  width: 22px;
  height: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 20px);
  transform: translateX(-50%);
  background: rgba(20, 30, 50, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 20px 18px 14px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.modal p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.modal button {
  margin-top: 14px;
  border: none;
  background: transparent;
  color: #e11d48;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.chain-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.chain-switch button {
  flex: 1;
  border: 1px solid #dbe3ef;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  font-weight: 600;
  cursor: pointer;
}

.chain-switch button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef4ff;
}

@media (min-width: 520px) {
  .dapp-shell {
    max-width: 420px;
    margin: 0 auto;
    border-left: 1px solid #e5eaf2;
    border-right: 1px solid #e5eaf2;
  }
}
