/* prelander.css — left-side info overlay for the "live game as landing page"
   attract mode. Owns the LANDING look: a AAA-menu style glass card pinned to
   the left edge with the live 3D scene showing through on the right.
   Reuses style.css design tokens (--bg, --surface, --border, --accent,
   --accent2, --danger, --text, --text-dim, --radius, --font).

   Structural note: #screen-lobby stays a fixed, full-viewport element (its
   base rules live in style.css), repurposed here as a transparent stage that
   pins its child card LEFT (index.html adds class="prelander"). */

/* ── Stage: transparent full-bleed wrapper, card pinned left ────────────── */
#screen-lobby.prelander {
  background: transparent;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
}

/* ── The card: layered glass, gold hairline ring, entrance slide ────────── */
#screen-lobby.prelander .lobby-card {
  position: relative;
  margin-left: 4vw;
  max-width: 512px;
  width: min(94vw, 512px);
  max-height: 94vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 32px 24px;
  gap: 18px;
  border: 1px solid rgba(240, 192, 64, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(240, 192, 64, 0.07) 0%, transparent 55%),
    linear-gradient(168deg, rgba(26, 29, 38, 0.92) 0%, rgba(13, 15, 20, 0.94) 60%, rgba(10, 11, 15, 0.96) 100%);
  backdrop-filter: blur(10px);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    0 4px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: prelanderCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  /* Fades out (not away) during the PLAY sweep. */
  transition: opacity 0.5s ease, transform 0.6s ease;
}
@keyframes prelanderCardIn {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0); }
}

#screen-lobby.prelander.sweeping .lobby-card {
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
  /* Kill the entrance animation (fill:both pins opacity:1 and would block the
     fade), then snap out fast — the card shouldn't linger during the sweep. */
  animation: none;
  transition: opacity 0.18s ease, transform 0.22s ease;
}

/* The card is a flex column with overflow-y:auto — children must NOT
   flex-shrink, or tall content crushes the info panels flat instead of
   letting the card scroll. */
#screen-lobby.prelander .lobby-card > * { flex-shrink: 0; }

/* Slim gold scrollbar for the card overflow. */
#screen-lobby.prelander .lobby-card::-webkit-scrollbar { width: 5px; }
#screen-lobby.prelander .lobby-card::-webkit-scrollbar-thumb {
  background: rgba(240, 192, 64, 0.35);
  border-radius: 3px;
}
#screen-lobby.prelander .lobby-card::-webkit-scrollbar-track { background: transparent; }

/* ── Branding block ─────────────────────────────────────────────────────── */
#screen-lobby.prelander .lobby-brand {
  text-align: left;
  padding-bottom: 14px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(240, 192, 64, 0.5), rgba(240, 192, 64, 0.06) 70%, transparent) 1;
  border-bottom-width: 1px;
  border-bottom-style: solid;
}
/* Eyebrow kicker above the title. */
#screen-lobby.prelander .lobby-brand::before {
  content: "PLAY & EARN · ON SOLANA";
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--accent2);
  margin-bottom: 8px;
}
#screen-lobby.prelander .lobby-brand h1 {
  font-size: 2.9rem;
  line-height: 1.02;
  letter-spacing: 0.1em;
}
#screen-lobby.prelander .lobby-tag {
  font-size: 1rem;
  margin-top: 9px;
  color: #c6cad6;
  line-height: 1.5;
}

/* ── Info panels (how-to / economy): glass slats with accent spine ──────── */
.prelander-howto,
.prelander-economy {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 15px 18px 15px 20px;
  font-size: 0.92rem;
  color: #c6cad6;
  line-height: 1.6;
  overflow: hidden;
}
.prelander-howto::before,
.prelander-economy::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.prelander-howto::before  { background: linear-gradient(180deg, var(--accent), rgba(240, 192, 64, 0.15)); }
.prelander-economy::before { background: linear-gradient(180deg, var(--accent2), rgba(61, 224, 160, 0.15)); }

.prelander-howto { display: flex; flex-direction: column; gap: 7px; }
.prelander-howto b {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.74rem;
  margin-right: 2px;
}
.prelander-howto-title,
.prelander-economy-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
  margin-bottom: 6px;
}
.prelander-howto-title  { color: var(--accent); }
.prelander-economy-title { color: var(--accent2); }
.prelander-economy b { color: var(--accent); font-weight: 700; }
.prelander-economy ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}
.prelander-economy li { padding-left: 14px; position: relative; }
.prelander-economy li::before {
  content: "▸";
  position: absolute; left: 0;
  color: var(--accent2);
}

/* ── Stats row: gold numerals on glass tiles ────────────────────────────── */
#screen-lobby.prelander .lobby-stats { gap: 10px; }
#screen-lobby.prelander .stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 8px 10px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
#screen-lobby.prelander .stat:hover { border-color: rgba(240, 192, 64, 0.35); transform: translateY(-1px); }
#screen-lobby.prelander .stat-num {
  font-size: 1.85rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffe9a3 20%, #f0c040 60%, #c8922a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
#screen-lobby.prelander .stat-lbl {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  margin-top: 3px;
}

/* ── Wallet button: Phantom-branded ─────────────────────────────────────── */
#screen-lobby.prelander #btn-wallet {
  width: 100%;
  padding: 15px 16px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  color: #1c1433;
  background: linear-gradient(180deg, #c4b9f7 0%, #ab9ff2 55%, #8f7fe8 100%);
  box-shadow: 0 4px 18px rgba(171, 159, 242, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#screen-lobby.prelander #btn-wallet:not(.wallet-locked):hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 26px rgba(171, 159, 242, 0.38);
}
/* Locked (pre-launch): visible but unpressable — greyed, padlocked. */
#screen-lobby.prelander #btn-wallet.wallet-locked {
  background: linear-gradient(180deg, #3a3d49 0%, #2c2f39 100%);
  color: #9498a6;
  box-shadow: none;
  cursor: not-allowed;
}
#screen-lobby.prelander #btn-wallet.wallet-locked::before { content: "🔒 "; }

/* Alert under the connect button: 1M hold requirement + X follow link. */
.wallet-alert {
  flex-basis: 100%;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #d7c79a;
  background: rgba(240, 192, 64, 0.07);
  border: 1px dashed rgba(240, 192, 64, 0.38);
  border-radius: 10px;
  padding: 11px 13px;
  margin-top: 9px;
}
.wallet-alert b { color: #ffd34d; }
.wallet-alert a {
  color: #66c2ff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(102, 194, 255, 0.4);
}
.wallet-alert a:hover { color: #8fd2ff; }

/* Free-play disclaimer under PLAY FOR FREE. */
.freeplay-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #b9bdca;
  text-align: center;
  padding: 2px 6px;
}
.freeplay-note b { color: #ff7a7a; letter-spacing: 0.02em; }

/* ── Sticky CTA: keeps PLAY FOR FREE pinned to the card bottom, always
   visible without scrolling however tall the info content gets. Bleeds to the
   card edges (negative margins cancel the 32px/24px card padding) and masks
   scrolled content behind it with the card's own background. ─────────────── */
#screen-lobby.prelander .lobby-cta {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 2px -32px -24px;
  padding: 14px 32px 20px;
  background: linear-gradient(to top,
    rgba(11, 13, 18, 0.98) 0%, rgba(11, 13, 18, 0.98) 72%, rgba(11, 13, 18, 0) 100%);
}

/* ── PLAY: the hero button ──────────────────────────────────────────────── */
#screen-lobby.prelander .btn-play {
  width: 100%;
  padding: 19px 16px;
  border: none;
  border-radius: 14px;
  font-size: 1.22rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #241a04;
  background: linear-gradient(180deg, #ffe9a3 0%, #f0c040 55%, #d9a52e 100%);
  box-shadow:
    0 6px 26px rgba(240, 192, 64, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
  animation: playPulse 2.6s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
#screen-lobby.prelander .btn-play:hover {
  transform: translateY(-2px) scale(1.015);
  filter: brightness(1.07);
  box-shadow:
    0 12px 38px rgba(240, 192, 64, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation-play-state: paused;
}
#screen-lobby.prelander .btn-play:active { transform: translateY(0) scale(0.99); }
@keyframes playPulse {
  0%, 100% { box-shadow: 0 6px 26px rgba(240, 192, 64, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
  50%      { box-shadow: 0 6px 34px rgba(240, 192, 64, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
}

/* ── Leaderboard: its own glass panel that opens to the RIGHT of the card ── */
#screen-lobby.prelander #lobby-board {
  position: absolute;
  right: 3vw;
  top: 4vh;
  width: min(90vw, 340px);
  max-height: 60vh;               /* clears the bottom-right results card */
  overflow-y: auto;
  padding: 22px 24px;
  border: 1px solid rgba(240, 192, 64, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(240, 192, 64, 0.07) 0%, transparent 55%),
    linear-gradient(168deg, rgba(26, 29, 38, 0.92) 0%, rgba(13, 15, 20, 0.94) 60%, rgba(10, 11, 15, 0.96) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 4px 18px rgba(0, 0, 0, 0.5);
  /* Slide/open in from the right. */
  animation: boardOpenRight 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: right center;
}
@keyframes boardOpenRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
#screen-lobby.prelander.sweeping #lobby-board {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.18s ease, transform 0.22s ease;
  animation: none;
  pointer-events: none;
}
#screen-lobby.prelander #lobby-board h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 10px;
}
#screen-lobby.prelander #lobby-leaderboard li {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}
#screen-lobby.prelander #lobby-leaderboard li:hover { background: rgba(255, 255, 255, 0.045); }
#screen-lobby.prelander #lobby-leaderboard li + li { border-top: 1px solid rgba(255, 255, 255, 0.05); }
#screen-lobby.prelander #lobby-leaderboard li:nth-child(1) .lb-rank { color: #f0c040; }
#screen-lobby.prelander #lobby-leaderboard li:nth-child(2) .lb-rank { color: #c9ced6; }
#screen-lobby.prelander #lobby-leaderboard li:nth-child(3) .lb-rank { color: #cd8f5a; }
#screen-lobby.prelander .lb-score { font-weight: 800; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
#screen-lobby.prelander .lobby-foot {
  padding-top: 4px;
  font-size: 0.72rem;
  opacity: 0.75;
}

/* ── Responsive: collapse to a bottom sheet on narrow / mobile widths ───── */
@media (max-width: 820px) {
  #screen-lobby.prelander {
    align-items: flex-end;
    justify-content: center;
  }
  #screen-lobby.prelander .lobby-card {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 62vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    animation-name: prelanderSheetIn;
  }
  @keyframes prelanderSheetIn {
    from { opacity: 0; transform: translateY(36px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  #screen-lobby.prelander.sweeping .lobby-card { transform: translateY(24px); }
  #screen-lobby.prelander .lobby-brand h1 { font-size: 2rem; }
  /* No room for the side leaderboard beside a bottom-sheet card. */
  #screen-lobby.prelander #lobby-board { display: none; }
}

@media (max-width: 420px) {
  #screen-lobby.prelander .lobby-card { padding: 20px 18px; gap: 13px; }
  #screen-lobby.prelander .lobby-brand h1 { font-size: 1.5rem; }
  .prelander-howto, .prelander-economy { font-size: 0.73rem; padding: 11px 13px 11px 16px; }
  /* match the smaller card padding so the sticky CTA bleeds to the edges cleanly */
  #screen-lobby.prelander .lobby-cta { margin: 2px -18px -20px; padding: 12px 18px 16px; }
}

/* burner warning under the connect button — always visible */
.wallet-warning {
  flex-basis: 100%;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #e8b04b;
  background: rgba(224, 160, 64, 0.08);
  border: 1px solid rgba(224, 160, 64, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
}
.wallet-warning b { color: #ffd34d; }

/* positive play-to-win notes framing the burner warning */
.wallet-note {
  flex-basis: 100%;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #7fd8ae;
  background: rgba(61, 224, 160, 0.07);
  border: 1px solid rgba(61, 224, 160, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
}
.wallet-note b { color: #3de0a0; }

/* locked "earning unlocks post-launch" notice (shown until walletEnabled) */
.wallet-soon {
  flex-basis: 100%;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #cbb98a;
  background: rgba(240, 192, 64, 0.06);
  border: 1px dashed rgba(240, 192, 64, 0.35);
  border-radius: 8px;
  padding: 9px 11px;
}
.wallet-soon b { color: #ffd34d; }

/* draw the eye to CONNECT WALLET when an action needs it */
#btn-wallet.nudge { animation: walletNudge 0.4s ease-in-out 3; }
@keyframes walletNudge {
  0%, 100% { transform: translateX(0); }
  30%      { transform: translateX(-5px); }
  70%      { transform: translateX(5px); }
}



/* ═══ Heavy card polish: animated gold glow ring on both cards ═══════════ */
#screen-lobby.prelander .lobby-card,
#screen-gameover.beside-lobby .go-card {
  position: relative;
  isolation: isolate;
}
#screen-lobby.prelander .lobby-card::after,
#screen-gameover.beside-lobby .go-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255,224,120,.85), rgba(240,192,64,.15) 30%, transparent 55%, rgba(61,224,160,.35) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: .9;
  animation: ringShimmer 6s ease-in-out infinite;
}
@keyframes ringShimmer { 0%,100%{filter:hue-rotate(0) brightness(1)} 50%{filter:hue-rotate(-12deg) brightness(1.25)} }

/* ═══ LAST RUN scorecard → compact, pinned BOTTOM-RIGHT (bull + ansem stay visible) ═══ */
#screen-gameover.beside-lobby {
  background: transparent;
  backdrop-filter: none;
  justify-content: flex-end;
  align-items: flex-end;               /* bottom-right corner */
  padding: 0 3vw 3vh 0;
  pointer-events: none;                /* empty area clicks fall through to the lobby */
}
#screen-gameover.beside-lobby .go-card {
  pointer-events: auto;
  min-width: 300px; max-width: 340px;
  padding: 18px 22px 16px;
  border-radius: 18px;
  border: 1px solid rgba(240,192,64,.28);
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(240,192,64,.12) 0%, transparent 60%),
    linear-gradient(168deg, rgba(24,27,36,.96) 0%, rgba(11,13,18,.97) 100%);
  box-shadow: 0 24px 70px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  text-align: left;
  animation: scorecardIn .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes scorecardIn { from{opacity:0;transform:translate(24px,24px) scale(.96)} to{opacity:1;transform:none} }
#screen-gameover.beside-lobby .go-kicker { text-align:center; font-size:.66rem; }
#screen-gameover.beside-lobby .go-reason { text-align:center; margin:-2px 0 8px; }
#screen-gameover.beside-lobby .go-newbest { text-align:center; }
#screen-gameover.beside-lobby .go-row { display:flex; justify-content:space-between; align-items:baseline; padding:6px 0; border-bottom:1px solid rgba(255,255,255,.05); }
#screen-gameover.beside-lobby .go-row:last-of-type { border-bottom:none; }
#screen-gameover.beside-lobby .go-hero .go-label { color: var(--text-dim); font-size:.8rem; }
#screen-gameover.beside-lobby .go-hero span:last-child {
  font-size: 1.35rem; font-weight: 900;
  background: linear-gradient(180deg,#ffe9a3 20%,#f0c040 60%,#c8922a 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
#screen-gameover.beside-lobby .go-actions { display:flex; gap:8px; margin-top:14px; }
#screen-gameover.beside-lobby .go-actions button {
  flex:1; padding:11px 6px; border:none; border-radius:11px; font-weight:800;
  font-size:.72rem; letter-spacing:.04em; cursor:pointer;
  transition: transform .15s ease, filter .15s ease;
}
#screen-gameover.beside-lobby .go-actions button:hover { transform:translateY(-1px); filter:brightness(1.08); }
#screen-gameover.beside-lobby #btn-submit { background:linear-gradient(180deg,#ffe9a3,#f0c040 60%,#d9a52e); color:#241a04; }
#screen-gameover.beside-lobby #btn-retry  { background:linear-gradient(180deg,#6ff0c0,#3de0a0 60%,#22b884); color:#08281c; }
#screen-gameover.beside-lobby #btn-lobby  { background:rgba(255,255,255,.09); color:var(--text); border:1px solid rgba(255,255,255,.14); }

@media (max-width: 820px) {
  /* Main card is a bottom sheet on mobile — float the scorecard at the TOP. */
  #screen-gameover.beside-lobby { align-items:flex-start; justify-content:center; padding:12px 0 0; }
  #screen-gameover.beside-lobby .go-card { min-width:0; width:92vw; max-width:92vw; }
}

/* ═══ Heavy beautify pass: flourishes, shimmer, medals, icons ════════════ */

/* Brand flourish: gem-dot rule under the tagline */
#screen-lobby.prelander .lobby-brand { position: relative; }
#screen-lobby.prelander .lobby-brand::after {
  content: "◆";
  position: absolute; left: 50%; bottom: -7px;
  transform: translateX(-50%) rotate(0deg);
  font-size: .55rem; color: var(--accent);
  background: transparent;
  text-shadow: 0 0 8px rgba(240,192,64,.8);
}

/* Section title gems */
.prelander-howto-title::before  { content: "◆ "; font-size: .8em; }
.prelander-economy-title::before { content: "◆ "; font-size: .8em; }

/* Stat tile icons */
#screen-lobby.prelander .stat:nth-child(1) .stat-lbl::before { content: "🏆 "; }
#screen-lobby.prelander .stat:nth-child(2) .stat-lbl::before { content: "🪙 "; }

/* PLAY button: sweeping light sheen */
#screen-lobby.prelander .btn-play {
  position: relative;
  overflow: hidden;
}
#screen-lobby.prelander .btn-play::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 46%;
  left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55) 50%, transparent);
  transform: skewX(-18deg);
  animation: playSheen 3.2s ease-in-out infinite;
}
@keyframes playSheen { 0%,55%{left:-60%} 85%,100%{left:130%} }

/* Leaderboard podium medals */
#screen-lobby.prelander #lobby-leaderboard li:nth-child(1) .lb-rank::before { content: "🥇 "; }
#screen-lobby.prelander #lobby-leaderboard li:nth-child(2) .lb-rank::before { content: "🥈 "; }
#screen-lobby.prelander #lobby-leaderboard li:nth-child(3) .lb-rank::before { content: "🥉 "; }

/* Scorecard corner brackets (top-left + bottom-right gold ticks) */
#screen-gameover.beside-lobby .go-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) top left    / 22px 2px,
    linear-gradient(var(--accent), var(--accent)) top left    / 2px 22px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 22px 2px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 2px 22px;
  background-repeat: no-repeat;
  opacity: .55;
}
