/* =========================================================
   OTPbaba – Pro Gaming UI v2.1 (FINAL)
   Neon • Depth • Motion • Mobile First • AdSense Safe
========================================================= */

/* =========================
   RESET & BASE
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body.site-body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(circle at top, #312e81, #020617 60%);
  color: #e5e7eb;
  line-height: 1.6;
}

/* =========================
   GLOBAL ELEMENTS
========================= */
a {
  text-decoration: none;
  color: inherit;
}

button {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

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

/* =========================
   LAYOUT
========================= */
.main-container {
  max-width: 1280px;
  margin: auto;
  padding: 24px 16px;
}

/* =========================
   HEADER (GLASS GAMING BAR)
========================= */
.top-header {
  background: rgba(2,6,23,.55);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.header-inner {
  max-width: 1280px;
  margin: auto;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .5px;
  color: #e0f2fe;
  text-shadow: 0 0 12px rgba(59,130,246,.6);
}

.site-nav a {
  margin-left: 18px;
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  opacity: 0.85;
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #22c55e;
  transition: width .2s ease;
}

.site-nav a:hover::after {
  width: 100%;
}

.site-nav a:hover {
  opacity: 1;
  color: #fde047;
}

/* =========================
   HERO (ESPORTS STYLE)
========================= */
.hero {
  text-align: center;
  padding: 42px 22px;
  background: linear-gradient(145deg,#1e3a8a,#2563eb);
  border-radius: 22px;
  margin-bottom: 26px;
  box-shadow:
    0 20px 50px rgba(0,0,0,.45),
    inset 0 0 40px rgba(255,255,255,.06);
}

/* =========================
   GAMES HUB
========================= */
.games-hero {
  background:
    radial-gradient(1200px 400px at 20% 0%, rgba(56,189,248,.35), transparent 55%),
    radial-gradient(900px 380px at 80% 0%, rgba(34,197,94,.28), transparent 52%),
    linear-gradient(145deg,#0b1220,#1d4ed8);
  position: relative;
  overflow: hidden;
}

.games-hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(500px 260px at 15% 25%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(520px 280px at 85% 30%, rgba(255,255,255,.06), transparent 60%);
  pointer-events: none;
}

.games-card a {
  position: relative;
  overflow: hidden;
}

.games-card a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-120%);
  transition: transform .5s ease;
  pointer-events: none;
}

.games-card a:hover::after {
  transform: translateX(120%);
}

.games-card a:focus-visible {
  outline: 3px solid rgba(56,189,248,.55);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .games-card a::after {
    transition: none;
  }
}

html.game-modal-open,
html.game-modal-open body {
  overflow: hidden;
}

.game-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.game-modal.is-open {
  display: block;
}

.game-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 15% 10%, rgba(56,189,248,.22), transparent 60%),
    radial-gradient(900px 420px at 85% 15%, rgba(34,197,94,.16), transparent 60%),
    rgba(2,6,23,.82);
  backdrop-filter: blur(10px);
}

.game-modal-panel {
  position: relative;
  margin: 10px auto;
  width: min(1280px, calc(100vw - 20px));
  height: min(92vh, 860px);
  background:
    radial-gradient(900px 380px at 25% 0%, rgba(56,189,248,.12), transparent 60%),
    radial-gradient(780px 320px at 78% 0%, rgba(34,197,94,.10), transparent 60%),
    linear-gradient(180deg, rgba(2,6,23,.96), rgba(2,6,23,.86));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  box-shadow:
    0 26px 70px rgba(0,0,0,.68),
    0 0 0 1px rgba(56,189,248,.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 720px) {
  .game-modal-panel {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    margin: 6px auto;
    border-radius: 20px;
  }
}

:fullscreen .game-modal-panel {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
}

.game-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(2,6,23,.55);
}

.game-modal-title {
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 14px;
  text-transform: uppercase;
  color: rgba(226,232,240,.92);
}

.game-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(15,23,42,.65);
  color: rgba(226,232,240,.95);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.game-modal-close:hover {
  transform: translateY(-1px);
  background: rgba(30,41,59,.75);
  box-shadow: 0 10px 24px rgba(0,0,0,.55);
}

.game-modal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
}

.game-btn {
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.10);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-btn:focus-visible {
  outline: 3px solid rgba(56,189,248,.55);
  outline-offset: 3px;
}

.game-btn-primary {
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #022c22;
  box-shadow: 0 0 18px rgba(34,197,94,.26);
}

.game-btn-secondary {
  background: linear-gradient(135deg,#38bdf8,#0ea5e9);
  color: #082f49;
  box-shadow: 0 0 18px rgba(56,189,248,.22);
}

.game-btn-ghost {
  background: rgba(15,23,42,.65);
  color: rgba(226,232,240,.92);
}

.game-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.55);
  filter: saturate(1.05);
}

.game-modal-body {
  padding: 0 16px 16px;
  flex: 1;
  min-height: 0;
}

.game-modal-framewrap {
  position: relative;
  height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  overflow: hidden;
  background:
    radial-gradient(800px 340px at 30% 10%, rgba(56,189,248,.10), transparent 60%),
    radial-gradient(700px 320px at 80% 10%, rgba(34,197,94,.08), transparent 60%),
    #020617;
}

.game-modal-framewrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.game-modal-paused {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(2,6,23,.60);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.game-modal-paused-card {
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 16px 18px;
  text-align: center;
  box-shadow: 0 26px 70px rgba(0,0,0,.70);
}

.game-modal-paused-title {
  font-size: 18px;
  font-weight: 900;
  color: rgba(226,232,240,.96);
}

.game-modal-paused-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(148,163,184,.92);
}

.game-frame-body {
  padding: 0;
}

.game-frame-main {
  padding: 14px;
}

.game-frame-body .card {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(900px 380px at 20% 0%, rgba(56,189,248,.10), transparent 60%),
    radial-gradient(800px 320px at 80% 0%, rgba(34,197,94,.08), transparent 60%),
    rgba(2,6,23,.88);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 22px 60px rgba(0,0,0,.60);
}

.game-frame-body .card > .flex {
  display: none;
}

.game-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(700px 220px at 20% 0%, rgba(56,189,248,.14), transparent 60%),
    radial-gradient(650px 220px at 80% 0%, rgba(34,197,94,.10), transparent 60%),
    rgba(15,23,42,.62);
  backdrop-filter: blur(10px);
}

.game-controls-left,
.game-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gc-btn {
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.10);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, opacity .15s ease;
  background: rgba(2,6,23,.45);
  color: rgba(226,232,240,.92);
}

.gc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.55);
  filter: saturate(1.05);
}

.gc-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.gc-start {
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #022c22;
  box-shadow: 0 0 18px rgba(34,197,94,.22);
}

.gc-pause {
  background: linear-gradient(135deg,#38bdf8,#0ea5e9);
  color: #082f49;
  box-shadow: 0 0 18px rgba(56,189,248,.18);
}

.gc-stop {
  background: linear-gradient(135deg,#f97316,#ef4444);
  color: #2b0b0b;
  box-shadow: 0 0 18px rgba(239,68,68,.16);
}

.gc-restart {
  background: rgba(15,23,42,.78);
}

.game-controls-state {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(226,232,240,.86);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.35);
}

.gc-link {
  font-size: 12px;
  font-weight: 900;
  color: rgba(226,232,240,.86);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(2,6,23,.28);
}

.gc-link:hover {
  filter: brightness(1.08);
}

.game-frame-body canvas {
  width: min(860px, 100%);
  height: auto;
  display: block;
  margin-inline: auto;
  border-radius: 16px;
}

.game-frame-body #arena {
  height: min(520px, calc(100vh - 180px));
}

@media (min-width: 900px) {
  .game-frame-main {
    padding: 18px;
  }
  .game-frame-body .card {
    padding: 18px;
  }
}

.game-frame-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(2,6,23,.55);
  backdrop-filter: blur(8px);
  z-index: 10;
  pointer-events: none;
}

html[data-game-paused="1"] .game-frame-overlay {
  display: grid;
}

.game-frame-overlay-card {
  background: rgba(15,23,42,.78);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 26px 70px rgba(0,0,0,.70);
}

.game-frame-overlay-title {
  font-size: 18px;
  font-weight: 900;
  color: rgba(226,232,240,.96);
}

.game-frame-overlay-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(148,163,184,.92);
}

.hero h1 {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 900;
  margin-bottom: 8px;
  text-shadow: 0 0 16px rgba(96,165,250,.8);
}

.hero p {
  font-size: 14px;
  opacity: 0.9;
}

/* =========================
   HUD (GAME STATUS)
========================= */
.hud {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 10px;
  background: #020617;
  padding: 14px;
  border-radius: 16px;
  font-size: 14px;
  margin: 18px 0 24px;
  border: 1px solid rgba(255,255,255,.06);
}

.hud span {
  text-align: center;
  font-weight: 800;
}

/* =========================
   CARD SYSTEM
========================= */
.card {
  background: #020617;
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow:
    0 18px 45px rgba(0,0,0,.55),
    inset 0 0 0 1px rgba(255,255,255,.04);
}

/* =========================
   BUTTONS
========================= */
.btn-primary,
.btn-success {
  width: 100%;
  padding: 16px 20px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .3px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary {
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #022c22;
  box-shadow: 0 0 24px rgba(34,197,94,.4);
}

.btn-success {
  background: linear-gradient(135deg,#38bdf8,#0ea5e9);
  color: #082f49;
  box-shadow: 0 0 24px rgba(56,189,248,.4);
}

.btn-primary:hover,
.btn-success:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
}

/* =========================
   TYPING GAME
========================= */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}

.time-btn {
  padding: 14px;
  border-radius: 16px;
  background: #1e293b;
  color: #e5e7eb;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.06);
  transition: all .15s ease;
}

.time-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}

.time-btn.active {
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #022c22;
  box-shadow: 0 0 0 3px rgba(34,197,94,.45);
}

/* =========================
   TYPING AREA
========================= */
.typing-header {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  font-size: 14px;
  margin-bottom: 14px;
}

.typing-text {
  background: #020617;
  padding: 18px;
  border-radius: 16px;
  min-height: 140px;
  margin-bottom: 14px;
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.8;
  border: 1px solid rgba(255,255,255,.06);
}

.typing-text span.correct {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34,197,94,.7);
}

.typing-text span.wrong {
  color: #ef4444;
  text-shadow: 0 0 8px rgba(239,68,68,.7);
}

.typing-input {
  width: 100%;
  min-height: 140px;
  padding: 18px;
  border-radius: 16px;
  font-size: clamp(16px, 3.5vw, 20px);
  background: #020617;
  color: #e5e7eb;
  border: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

/* =========================
   RESULT
========================= */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-box {
  border-radius: 18px;
  padding: 16px;
  background: rgba(2,6,23,.70);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}

.stat-box h3 {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(226,232,240,.88);
  margin-bottom: 8px;
}

.stat-box p {
  font-size: 22px;
  font-weight: 900;
  color: rgba(226,232,240,.96);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

@media (max-width: 1024px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1024px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}

.leaderboard-box {
  border-radius: 20px;
  padding: 16px;
  background: rgba(2,6,23,.70);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}

.leaderboard-box h2 {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .2px;
  margin-bottom: 10px;
  color: rgba(226,232,240,.96);
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 10px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.leaderboard-table th {
  text-align: left;
  font-weight: 900;
  color: rgba(226,232,240,.86);
  background: rgba(15,23,42,.58);
}

.leaderboard-table td {
  color: rgba(226,232,240,.92);
  background: rgba(2,6,23,.45);
}

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

.result-actions {
  display: grid;
  gap: 12px;
}

/* =========================
   TRUST & ADS
========================= */
.trust ul {
  list-style: none;
  font-size: 14px;
  opacity: 0.85;
}

.trust li {
  margin-bottom: 8px;
}

.ad-box {
  margin: 24px 0;
  padding: 14px;
  background: #020617;
  border-radius: 18px;
  min-height: 90px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

/* =========================
   FOOTER
========================= */
.site-footer {
  background: #020617;
  border-top: 1px solid rgba(255,255,255,.06);
}

.footer-inner {
  max-width: 1280px;
  margin: auto;
  padding: 40px 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
}

.footer-brand h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 8px;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fde047;
}

.footer-links a {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  opacity: .85;
}

.footer-links a:hover {
  opacity: 1;
  color: #22c55e;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 14px;
  text-align: center;
  font-size: 13px;
  opacity: .8;
}

/* =========================
   UTILITIES
========================= */
.hidden { display: none }

/* =========================
   MOBILE
========================= */
@media (max-width: 900px) {
  .hud,
  .typing-header {
    grid-template-columns: repeat(2,1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
/* =========================================================
   MICRO-ANIMATIONS (SAFE GAMING POLISH)
========================================================= */

/* Card hover lift */
.card {
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 55px rgba(0,0,0,.6);
}

/* Button press feel */
.btn-primary,
.btn-success,
.time-btn {
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:active,
.btn-success:active,
.time-btn:active {
  transform: scale(.97);
}

/* Soft pulse for CTA (hero only) */
.hero .btn-primary {
  animation: ctaPulse 3.5s infinite;
}
@keyframes ctaPulse {
  0%,100% { box-shadow: 0 0 0 rgba(34,197,94,0); }
  50%     { box-shadow: 0 0 22px rgba(34,197,94,.45); }
}

/* Typing correct feedback */
.typing-text span.correct {
  animation: popCorrect .15s ease;
}
@keyframes popCorrect {
  from { transform: scale(.95); }
  to   { transform: scale(1); }
}

/* Page fade-in */
main {
  animation: pageFade .4s ease;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* =========================================================
   AD HEATMAP OPTIMIZATION (SAFE)
========================================================= */

.ad-box {
  margin: 28px auto;
  padding: 16px;
  max-width: 100%;
  background: linear-gradient(145deg,#020617,#020617);
  border-radius: 20px;
  min-height: 90px;
  box-shadow:
    0 10px 30px rgba(0,0,0,.6),
    inset 0 0 0 1px rgba(255,255,255,.04);
}

/* Do NOT animate ads */
.ad-box * {
  animation: none !important;
}
