:root {
  --yellow: #fdbe08;
  --yellow-dark: #e0a800;
  --cream: #f7f4ea;
  --white: #ffffff;
  --text: #1a1a1a;
  --muted: #666666;
  --danger: #d32f2f;
  --ok: #1b8a3a;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Raleway, system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 78px;
}

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

img {
  max-width: 100%;
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--yellow);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
}

.login-btn {
  background: #fff;
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 12px 8px;
}

.action-card {
  background: var(--yellow);
  color: #fff;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.78rem;
}

.action-card i {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.banner {
  margin: 8px 12px 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  font-size: 0.85rem;
}

.banner .urgent {
  color: var(--danger);
  font-weight: 800;
}

.starline {
  margin: 0 12px 16px;
  background: var(--yellow);
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.starline h2 {
  font-size: 1.05rem;
  font-weight: 800;
}

.starline p {
  opacity: 0.95;
  font-size: 0.85rem;
  margin-top: 4px;
}

.starline .play {
  background: #fff;
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.section-title {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 8px 12px 14px;
}

.markets {
  padding: 0 12px 24px;
  display: grid;
  gap: 12px;
}

.market {
  background: #fff;
  border: 2px solid #ece7d8;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: 64px 1fr 72px;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.market .side {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.market .side i {
  display: block;
  font-size: 1.2rem;
  color: var(--yellow-dark);
  margin-bottom: 4px;
}

.market .name {
  font-weight: 800;
  font-size: 0.98rem;
}

.market .status {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 2px 0;
}

.market .status.open {
  color: var(--ok);
}

.market .result {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
  color: #444;
  font-size: 0.9rem;
}

.market .play-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto;
  box-shadow: var(--shadow);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
}

.market .play-circle i {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

.download-band {
  margin: 8px 12px 28px;
  background: linear-gradient(160deg, #fff 0%, #fff8dc 100%);
  border: 2px solid var(--yellow);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.download-band .badge {
  display: inline-block;
  background: var(--yellow);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.download-band h2 {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.download-band p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 34rem;
  margin: 0 auto 18px;
}

.download-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--yellow);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.download-cta:hover {
  background: var(--yellow-dark);
}

.features {
  padding: 0 12px 32px;
  display: grid;
  gap: 12px;
}

@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }

  .markets {
    max-width: 760px;
    margin: 0 auto;
  }

  .download-band,
  .starline,
  .banner,
  .hero-actions {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
}

.feature {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.feature i {
  color: var(--yellow-dark);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.feature p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.site-footer {
  text-align: center;
  padding: 20px 16px 100px;
  color: var(--muted);
  font-size: 0.8rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: var(--yellow);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
}

.bottom-nav a,
.bottom-nav button {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  padding: 4px;
}

.bottom-nav i {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.wa-float {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 46;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow);
}

/* Download popup */
.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.popup-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.popup {
  width: min(100%, 380px);
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}

.popup-backdrop.open .popup {
  transform: none;
}

.popup-top {
  background: var(--yellow);
  color: #fff;
  padding: 22px 20px 18px;
  text-align: center;
  position: relative;
}

.popup-top .close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}

.popup-icon {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  margin: 0 auto 12px;
  background: #fff;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.popup-top h2 {
  font-size: 1.2rem;
  font-weight: 900;
}

.popup-top p {
  margin-top: 6px;
  font-size: 0.88rem;
  opacity: 0.95;
}

.popup-body {
  padding: 18px 20px 22px;
  text-align: center;
}

.popup-body p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 16px;
}

.popup-download {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: var(--yellow);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.popup-later {
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

button.action-card,
button.play-circle {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.empty-card,
.auth-card {
  margin: 16px 12px 28px;
  background: #fff;
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card {
  text-align: left;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.empty-card h3,
.auth-card h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-card p,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 12px 0 6px;
}

.auth-card input,
.auth-card select {
  width: 100%;
  border: 1.5px solid #e5dfcd;
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  background: #fffaf0;
}

.auth-card .download-cta {
  width: 100%;
  margin-top: 16px;
  justify-content: center;
}

.auth-card .download-cta.secondary {
  background: #333;
  margin-top: 10px;
}

.auth-card .download-cta:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-error {
  background: #ffe8e8;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 8px 0 4px;
}

.auth-switch {
  margin-top: 14px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-switch button,
.linkish {
  background: none;
  border: none;
  color: var(--yellow-dark);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.linkish {
  margin-bottom: 10px;
  padding: 0;
}

.toast {
  position: sticky;
  top: 56px;
  z-index: 50;
  margin: 8px 12px 0;
  background: #1b8a3a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
}

.balance-big {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  margin: 8px 0 18px;
  color: var(--text);
}

.balance-big small {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.subhead {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.method {
  background: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.bid-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee4c8;
  text-align: left;
}

.bid-right {
  text-align: right;
  font-weight: 800;
}

.bid-right .status {
  font-size: 0.75rem;
  text-transform: uppercase;
}

.bid-right .status.won { color: var(--ok); }
.bid-right .status.lost { color: var(--danger); }
.bid-right .status.pending { color: #b8860b; }

.bottom-nav button {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  padding: 4px;
}

.bottom-nav button i {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 2px;
}
