:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7fff9;
  background: #061c14;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(34,124,78,.35), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(115,185,92,.22), transparent 26%),
    linear-gradient(180deg, #103a29 0%, #08281d 40%, #04140f 100%);
}
body { min-height: 100dvh; }
button { font: inherit; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(106px + env(safe-area-inset-bottom));
}
.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
}
.brand { font-weight: 900; letter-spacing: .08em; font-size: 14px; }
.creator {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  font-size: 12px;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.08);
}

.creator-link {
  color: #fff;
  cursor: pointer;
}
.creator-link:hover { background: rgba(255,255,255,.16); }
.creator-card {
  max-width: none;
  white-space: normal;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(230px, 60vw);
  padding: 8px 10px 8px 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
  box-shadow: 0 10px 26px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.12);
}
.creator-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.12);
}
.creator-copy-wrap {
  display: grid;
  min-width: 0;
  text-align: left;
  line-height: 1.1;
}
.creator-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
}
.creator-sub {
  font-size: 11px;
  opacity: .7;
  margin-top: 4px;
}

.partner-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.partner-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}
.partner-body { min-width: 0; }
.partner-copy { max-width: none; }

.offer-modal.hidden { display: none; }
.offer-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}
.offer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 8, .72);
  backdrop-filter: blur(4px);
}
.offer-modal-card {
  position: relative;
  width: min(100%, 420px);
  background: linear-gradient(180deg, rgba(15,50,36,.96), rgba(5,20,15,.96));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  box-shadow: 0 26px 60px rgba(0,0,0,.45);
  padding: 16px;
  text-align: center;
}
.offer-modal-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 14px;
}
.offer-modal-label {
  font-size: 11px;
  letter-spacing: .15em;
  font-weight: 900;
  opacity: .72;
}
.offer-modal-title {
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.1;
}
.offer-modal-copy {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  opacity: .82;
}
.offer-modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.screen { display: none; }
.screen.active { display: block; }

.social-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  width: min(calc(100% - 24px), 560px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background: rgba(8, 29, 22, .88);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 26px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
}
.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  flex: 0 0 auto;
}
.social-telegram .social-icon {
  background: linear-gradient(180deg, #44c4ff, #188cd9);
}
.social-whatsapp .social-icon {
  background: linear-gradient(180deg, #54d98c, #1ea95e);
}
.social-text-wrap {
  display: grid;
  line-height: 1.1;
}
.social-name {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
}
.social-sub {
  font-size: 11px;
  opacity: .74;
  margin-top: 3px;
}

.hero-card, .result-card { padding: 14px 4px 18px; }
.hero-card {
  min-height: calc(100dvh - 92px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ball-mark {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  font-size: 56px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  box-shadow: 0 18px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.16);
  margin-bottom: 18px;
}
.eyebrow { font-size: 12px; font-weight: 900; letter-spacing: .18em; opacity: .76; }
h1 {
  font-size: clamp(38px, 10vw, 62px);
  line-height: .96;
  margin: 10px 0 16px;
  max-width: 520px;
}
.subcopy {
  font-size: 17px;
  line-height: 1.55;
  opacity: .84;
  margin: 0 0 26px;
  max-width: 460px;
}
.primary, .secondary, .partner-button, .hit-button {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.primary:hover, .secondary:hover, .partner-button:hover, .hit-button:hover { transform: translateY(-1px); }
.primary:active, .secondary:active, .partner-button:active, .hit-button:active { transform: translateY(1px) scale(.99); }
.primary {
  min-width: 190px;
  padding: 17px 22px;
  background: linear-gradient(180deg, #f4ff7f, #ddeb4d);
  color: #102014;
  box-shadow: 0 12px 24px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.48);
}
.secondary {
  padding: 15px 18px;
  background: rgba(255,255,255,.12);
  color: white;
  border: 1px solid rgba(255,255,255,.08);
}
.micro { font-size: 12px; opacity: .62; text-align: center; }

.hud {
  display: flex;
  justify-content: space-between;
  padding: 8px 6px 12px;
  font-size: 14px;
}
.hud strong { font-size: 18px; }
.game-wrap {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(#86c8ff 0 38%, #5ea94b 38% 100%);
  box-shadow: 0 18px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.08);
}
#gameCanvas { display: block; width: 100%; aspect-ratio: 9/13; touch-action: manipulation; }
.game-message {
  position: absolute;
  inset: 15% 0 auto;
  text-align: center;
  font-size: 30px;
  font-weight: 1000;
  letter-spacing: .06em;
  text-shadow: 0 3px 14px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0;
  transform: scale(.9);
  transition: .16s ease;
}
.game-message.show { opacity: 1; transform: scale(1); }
.hit-button {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #f4ff7f, #ddeb4d);
  color: #102014;
  font-size: 22px;
  box-shadow: 0 10px 22px rgba(0,0,0,.24);
}

.result-card { text-align: center; }
.big-score {
  font-size: clamp(72px, 22vw, 124px);
  font-weight: 1000;
  line-height: .9;
  margin: 6px 0 10px;
}
.rank-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255,255,255,.1);
  font-size: 13px;
  margin-bottom: 16px;
}
.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.leaderboard-card, .partner-card {
  text-align: left;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(4,20,15,.68);
  backdrop-filter: blur(14px);
  border-radius: 20px;
}
.partner-label { font-size: 10px; letter-spacing: .13em; font-weight: 900; opacity: .58; }
.partner-title { font-size: 17px; font-weight: 900; margin-top: 6px; }
.partner-copy { font-size: 12px; opacity: .7; margin-top: 4px; max-width: none; }
.partner-button {
  flex: 0 0 auto;
  padding: 12px 14px;
  background: white;
  color: #102014;
  font-size: 12px;
  white-space: nowrap;
}

.leaderboard-card { padding: 16px 18px; }
.section-title { font-size: 12px; letter-spacing: .16em; font-weight: 900; opacity: .72; }
#leaderboard {
  padding-left: 28px;
  margin: 12px 0 0;
}
#leaderboard li {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#leaderboard li:last-child { border-bottom: 0; }

@media (max-width: 420px) {
  .social-bar { width: min(calc(100% - 20px), 420px); gap: 8px; }
  .social-link { padding: 9px 10px; border-radius: 14px; }
  .social-icon { width: 32px; height: 32px; font-size: 16px; }
  .social-name { font-size: 12px; }
  .social-sub { font-size: 10px; }
  .topbar { min-height: 80px; }
  .brand { font-size: 13px; }
  .creator-card { width: min(190px, 56vw); padding: 7px; gap: 8px; }
  .creator-thumb { width: 48px; height: 48px; border-radius: 12px; }
  .creator-title { font-size: 11px; }
  .creator-sub { font-size: 10px; }
  .hero-card { min-height: calc(100dvh - 86px); }
  h1 { font-size: clamp(34px, 11vw, 50px); }
  .subcopy { font-size: 15px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .primary, .secondary { min-width: 0; width: 100%; }
  .partner-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .partner-thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .partner-button { width: 100%; text-align: center; }
  .big-score { font-size: 88px; }
}

@media (min-width: 780px) {
  .social-bar { width: min(calc(94vw - 24px), 760px); }
  .app-shell { width: min(94vw, 760px); }
  #gameCanvas { aspect-ratio: 4/3; }
  .game-wrap { max-height: 70vh; }
  .result-card { max-width: 760px; margin: 0 auto; }
}
