/* ui.css — screens, modals, and below-the-fold SEO/marketing content */

@font-face {
  /* Fonts are loaded via Google Fonts <link> in index.php with local
     fallbacks declared here so layout never breaks if the CDN is blocked. */
  font-family: 'Orbitron-fallback';
  src: local('Arial');
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* flex-start + top/bottom padding + scroll, NOT justify-content:center —
     a centered flex container clips overflowing content symmetrically off
     BOTH the top and bottom, so scrolling down from a clipped view can
     never reveal what's above (there's nothing "below the fold" to scroll
     to — it was clipped above the visible area). This exact bug hid the
     game-over title on short mobile viewports until fixed. */
  justify-content: flex-start;
  overflow-y: auto;
  gap: 14px;
  text-align: center;
  padding: 28px 20px;
  background: radial-gradient(ellipse at 50% 30%, rgba(30,45,80,0.65), rgba(5,7,15,0.96));
  z-index: 4;
}

/* Menu/pause screens have short, fixed-height content that can never
   trigger the clipping trap above — centering them still looks better. */
#menu-screen, #pause-screen {
  justify-content: center;
}

#menu-screen h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #3ba7ff, #b93bff, #ff7bf5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(59,167,255,0.4));
}

.tagline { color: var(--text-dim); font-size: 15px; letter-spacing: 0.05em; }

.mode-select { display: flex; gap: 10px; margin-top: 6px; }
.mode-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
}
.mode-btn.active {
  color: #05070f;
  background: linear-gradient(135deg, #3ba7ff, #8fd6ff);
  box-shadow: 0 0 20px rgba(59,167,255,0.5);
}

.btn-primary {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 14px 46px;
  border-radius: 999px;
  color: #05070f;
  background: linear-gradient(135deg, #ffd23b, #ff7bf5);
  box-shadow: 0 8px 30px rgba(255,123,245,0.35), 0 0 0 1px rgba(255,255,255,0.15) inset;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 34px rgba(255,123,245,0.5); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.menu-links { display: flex; gap: 16px; margin-top: 4px; }
.menu-links button {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  border-bottom: 1px solid transparent;
}
.menu-links button:hover { color: #fff; border-color: currentColor; }

.best-line { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.best-line span { color: var(--neon-gold); font-weight: 700; }

/* Game over */
#gameover-screen { gap: 6px; }
#go-title { font-family: 'Orbitron', sans-serif; font-size: clamp(20px, 5vw, 28px); color: var(--neon-gold); text-shadow: 0 0 20px rgba(255,210,59,0.6); }
.go-score { font-family: 'Orbitron', sans-serif; font-size: clamp(44px, 12vw, 70px); font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 0 30px rgba(59,167,255,0.6); }
.go-sub { font-size: 11px; letter-spacing: 0.2em; color: var(--text-dim); margin-bottom: 4px; }
.go-stats { display: flex; gap: 14px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; justify-content: center; }
.go-rank { font-family: 'Orbitron', sans-serif; color: var(--neon-cyan); font-weight: 700; font-size: 14px; }

#save-form { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; width: 100%; max-width: 320px; }
#nickname-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.04em;
}
#nickname-input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(59,167,255,0.25); }
.save-status { font-size: 12px; min-height: 16px; }
.save-status.ok { color: #3bff8f; }
.save-status.warn { color: #ff3b5c; }
.save-status.muted { color: var(--text-dim); }

.go-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.go-actions button:not(.btn-primary) {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}
.go-actions button:not(.btn-primary):hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3,4,10,0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-content h2 { font-family: 'Orbitron', sans-serif; font-size: 20px; margin-bottom: 14px; text-align: center; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.howto-list { display: flex; flex-direction: column; gap: 10px; text-align: left; font-size: 14px; color: #dbe6ff; }
.howto-list li { display: flex; gap: 10px; align-items: flex-start; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.legend-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }

.lb-tabs, .lb-period-tabs { display: flex; gap: 8px; margin-bottom: 10px; justify-content: center; }
.lb-tab, .lb-period {
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--panel-border); color: var(--text-dim);
}
.lb-tab.active, .lb-period.active { color: #05070f; background: linear-gradient(135deg, #3ba7ff, #8fd6ff); }

#lb-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
#lb-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.03); font-size: 14px; }
.lb-rank { width: 34px; color: var(--neon-gold); font-weight: 700; }
.lb-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 700; color: #fff; }
.lb-loading, .lb-empty { color: var(--text-dim); text-align: center; padding: 12px; }
#lb-you { text-align: center; font-weight: 700; color: var(--neon-cyan); font-size: 13px; }

/* --- Below-the-fold SEO / marketing content --- */
.site-header, .site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 13px;
}
.site-header .logo { font-family: 'Orbitron', sans-serif; font-weight: 900; color: #fff; letter-spacing: 0.05em; }
.site-header .logo span { color: var(--neon-cyan); }
.site-header nav a { margin-left: 14px; }
.site-header nav a:hover { color: #fff; }

.landing {
  max-width: 760px;
  margin: 6px auto 0;
  padding: 0 16px;
  text-align: center;
}
.landing h1.seo-h1 { font-family: 'Orbitron', sans-serif; font-size: clamp(22px, 5vw, 32px); margin-bottom: 6px; }
.landing p { color: var(--text-dim); font-size: 14px; }

.content-section {
  max-width: 760px;
  margin: 36px auto;
  padding: 0 16px;
}
.content-section h2 { font-family: 'Orbitron', sans-serif; font-size: 20px; margin-bottom: 14px; }
.content-section p { color: #c8d4ee; line-height: 1.7; margin-bottom: 10px; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.howto-card { background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px; font-size: 13px; color: #dbe6ff; }
.howto-card .emoji { font-size: 22px; display: block; margin-bottom: 6px; }

.faq-item { border-bottom: 1px solid rgba(255,255,255,0.08); padding: 12px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: #fff; }
.faq-item p { margin-top: 8px; }

.related-games { display: flex; flex-wrap: wrap; gap: 10px; }
.related-games a {
  padding: 8px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
}
.related-games a:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

.ad-slot {
  max-width: 960px;
  margin: 20px auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.15);
  font-size: 11px;
  letter-spacing: 0.1em;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 10px;
}

.brand-watermark {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  pointer-events: none;
  z-index: 3;
}

@media (max-width: 480px) {
  .hud-block { min-width: 58px; padding: 3px 8px; }
  .hud-block span:last-child { font-size: 14px; }
  .icon-btn { width: 32px; height: 32px; font-size: 14px; }
  .btn-primary { padding: 12px 34px; font-size: 15px; }
  .go-actions button { padding: 9px 16px; font-size: 12px; }
}
