/* ============================================================
   site.css — The Ladder of All website styles
   (landing page, auth forms, leaderboard, user bar, AD SLOTS)
   Loaded alongside style.css on the game page.
   ============================================================ */

:root {
  --bg-dark: #0a0a1a;
  --bg-panel: #12122a;
  --bg-card: #1a1a3a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --accent-gold: #f0c040;
  --accent-blue: #4080f0;
  --accent-green: #40c080;
  --accent-red: #e04040;
}

.hidden { display: none !important; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(ellipse at center top, #1a1a3a 0%, #0a0a1a 70%);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
}

.landing-container {
  width: 100%;
  max-width: 1000px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.landing-hero { text-align: center; }

.landing-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.landing-tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0;
}

.landing-columns {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-info {
  flex: 1 1 380px;
  background: var(--bg-panel);
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 26px;
}

.landing-info h2 {
  margin: 0 0 14px;
  color: var(--accent-gold);
  font-size: 1.4rem;
}

.landing-features {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.landing-features li {
  padding: 7px 0;
  font-size: 1rem;
  line-height: 1.45;
  border-bottom: 1px solid #22224a;
}
.landing-features li:last-child { border-bottom: none; }

.landing-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.landing-guest-note {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ---- BUTTONS ---- */
.btn-play {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-gold), #e0a020);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 26px;
  border-radius: 10px;
  border: none;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 192, 64, 0.35);
}

.btn-secondary {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid #3a3a6a;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: #24244a; }

.btn-block {
  display: block;
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
}

/* ============================================================
   AUTH PANEL (login / register / google)
   ============================================================ */
.auth-panel { flex: 0 1 360px; }

.auth-box {
  background: var(--bg-panel);
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 24px;
}

.auth-box h2 {
  margin: 0 0 10px;
  color: var(--accent-gold);
  font-size: 1.3rem;
  text-align: center;
}

.welcome-best {
  text-align: center;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.auth-tab.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.auth-form { display: flex; flex-direction: column; }

.auth-form label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 10px 0 4px;
}
.auth-form label .hint { font-size: 0.75rem; opacity: 0.8; }

.auth-form input {
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid #3a3a6a;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
.auth-form input:focus { border-color: var(--accent-blue); }

.form-msg {
  min-height: 20px;
  margin-top: 10px;
  font-size: 0.88rem;
  text-align: center;
}
.form-msg-error { color: var(--accent-red); }
.form-msg-ok { color: var(--accent-green); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2a2a4a;
}

.google-btn-holder {
  display: flex;
  justify-content: center;
  min-height: 0;
}

.guest-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-decoration: none;
}
.guest-link:hover { color: var(--text-primary); text-decoration: underline; }

/* ============================================================
   USER BAR (top of game + leaderboard pages)
   ============================================================ */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-panel);
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.userbar-nick { color: var(--accent-gold); font-weight: 700; }
.userbar-best { color: var(--text-secondary); }
.userbar-guest { color: var(--text-secondary); }

.userbar-link, .userbar-login-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
}
.userbar-link:hover, .userbar-login-link:hover { text-decoration: underline; }

.userbar-logout {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid #3a3a6a;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}
.userbar-logout:hover { color: var(--accent-red); border-color: var(--accent-red); }

/* ============================================================
   LEADERBOARD
   ============================================================ */
.my-best {
  text-align: center;
  background: linear-gradient(135deg, rgba(240,192,64,.12), rgba(64,128,240,.12));
  border: 1px solid rgba(240,192,64,.4);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 1rem;
}

.leaderboard-panel {
  background: var(--bg-panel);
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 10px;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.leaderboard-table th {
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 14px;
  border-bottom: 2px solid #2a2a4a;
}

.leaderboard-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #1e1e3e;
}

.leaderboard-table tr:last-child td { border-bottom: none; }

.col-rank { width: 60px; text-align: center !important; }
.col-score, .col-level, .col-rungs { text-align: right !important; width: 90px; }

.lb-top3 td { background: rgba(240, 192, 64, 0.06); font-weight: 600; }
.lb-me td { background: rgba(64, 128, 240, 0.14); }
.lb-you {
  background: var(--accent-blue);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
.lb-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px !important;
}

/* ============================================================
   AD SLOTS
   ============================================================ */

/* Layout: ad | game | ad */
.game-page-body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at center top, #1a1a3a 0%, #0a0a1a 70%) !important;
  display: block !important;   /* override style.css body flex */
  padding: 0 !important;
}

.page-with-ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  padding: 16px;
}

.ad-rail {
  flex: 0 0 160px;
  min-height: 620px;
}

.ad-sticky {
  position: sticky;
  top: 16px;
}

.game-center {
  flex: 0 1 940px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

/* Placeholder boxes — replace their content with real ad code */
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(
    45deg, #14142e, #14142e 12px, #181838 12px, #181838 24px
  );
  border: 1px dashed #3a3a6a;
  border-radius: 8px;
  color: #55557a;
  font-size: 0.8rem;
  letter-spacing: 1px;
  line-height: 1.6;
}

.ad-160x600 { width: 160px; height: 600px; }

.ad-728x90 {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
}

.ad-banner-bottom {
  display: flex;
  justify-content: center;
  padding: 12px 0 24px;
}

/* Side ads hide on smaller screens so the game never gets squished */
@media (max-width: 1320px) {
  .ad-rail { display: none; }
}

@media (max-width: 780px) {
  .ad-728x90 { max-width: 320px; height: 50px; } /* mobile banner size */
  .landing-title { font-size: 2rem; }
}

/* ============================================================
   SCORE SUBMIT STATUS (in the collapse overlay)
   ============================================================ */
.score-submit-status {
  margin: 14px 0;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.5;
}
.score-submit-status:empty { display: none; }

.score-submit-status.score-newbest {
  background: rgba(64, 192, 128, 0.15);
  border: 1px solid var(--accent-green);
}
.score-submit-status.score-guest {
  background: rgba(64, 128, 240, 0.12);
  border: 1px solid var(--accent-blue);
}
.score-submit-status.score-error {
  background: rgba(224, 64, 64, 0.12);
  border: 1px solid var(--accent-red);
}

.score-login-link {
  color: var(--accent-gold);
  font-weight: 700;
  text-decoration: none;
}
.score-login-link:hover { text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.landing-footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 10px 0 20px;
}
.landing-footer a { color: var(--accent-blue); text-decoration: none; }
.landing-footer a:hover { text-decoration: underline; }
