
/* =====================================================
   TestYourBrain — Gaming Portal Stylesheet
   Font: Nunito | Responsive: Mobile / Tablet / PC
===================================================== */
:root {
  --bg: #0d0f1a;
  --bg-2: #141828;
  --card: #1a1f33;
  --card-hover: #222945;
  --accent: #7c4dff;
  --accent-2: #00e5ff;
  --text: #eef1ff;
  --muted: #9aa3c0;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- HEADER ---------- */
.site-header {
  /* position: sticky; */
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 26, .9);
  backdrop-filter: blur(12px);
  /* border-bottom: 1px solid rgba(255, 255, 255, .06); */
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 0px;
  box-shadow: 0 0 24px rgba(124, 77, 255, .45);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: .5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- MAIN / HERO ---------- */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.hero { text-align: center; margin-bottom: 40px; }

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 10px;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 34px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i { color: var(--accent-2); }

/* ---------- GAME GRID (3 per row) ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: block;
  border: 1px solid rgba(255, 255, 255, .05);
}

.game-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 14px 40px rgba(124, 77, 255, .35);
}

.game-banner {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background: var(--bg-2);
}

.game-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,15,26,.95) 0%, rgba(13,15,26,.25) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.game-card-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.game-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.play-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(124, 77, 255, .9);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: .5px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--bg-2);
  /* border-top: 1px solid rgba(255, 255, 255, .06); */
  padding: 44px 20px 30px;
  text-align: center;
}

.footer-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 0px;
  margin: 0 auto 14px;
  box-shadow: 0 0 30px rgba(124, 77, 255, .5);
}

.footer-tagline {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 26px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 28px;
  padding-top: 22px;
  /* border-top: 1px solid rgba(255, 255, 255, .07); */
}

.footer-nav a {
  color: var(--muted);
  font-weight: 700;
  font-size: .95rem;
  transition: color .2s;
}

.footer-nav a:hover { color: var(--accent-2); }

.footer-copy { margin-top: 20px; color: #5b6380; font-size: .82rem; }

/* ---------- MODAL (Support Us / Contact) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, .8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.modal-head h3 { font-size: 1.2rem; font-weight: 800; }

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  transition: color .2s;
}

.modal-close:hover { color: #ff5b7f; }

.modal-body { padding: 22px; }

.kofi-frame {
  border: none;
  width: 100%;
  padding: 4px;
  background: #f9f9f9;
  border-radius: 8px;
}

/* ---------- GAME PAGE ---------- */
.game-page { max-width: 1100px; }

.game-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}

.back-btn:hover { background: var(--card-hover); border-color: var(--accent); }

.game-title-block h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; }
.game-title-block .cat { color: var(--accent-2); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }

/* Game frame toolbar */
.game-frame-shell {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.frame-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.frame-toolbar .frame-label {
  font-weight: 800;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.frame-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.frame-btn {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: .82rem;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frame-btn:hover { background: var(--accent); border-color: var(--accent); }

.frame-btn.active { background: var(--accent); border-color: var(--accent); }

.game-iframe {
  width: 100%;
  border: none;
  display: block;
  background: #000;
  transition: height .35s ease;
}

/* How to play */
.howto-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  padding: 26px;
  margin-top: 34px;
}

.howto-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.howto-card h2 i { color: var(--accent-2); }

.howto-card ol { padding-left: 22px; color: var(--muted); }
.howto-card ol li { margin-bottom: 10px; line-height: 1.6; font-size: .98rem; }

/* You may also like */
.like-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ---------- STATIC PAGES (Privacy / Contact) ---------- */
.page-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 50px 20px 70px;
}

.page-content h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 22px;
}

.page-content h2 { font-size: 1.25rem; font-weight: 800; margin: 26px 0 10px; color: var(--accent-2); }
.page-content p { color: var(--muted); line-height: 1.75; margin-bottom: 12px; }
.page-content ul { color: var(--muted); padding-left: 22px; line-height: 1.8; margin-bottom: 12px; }

/* Contact form */
.contact-form {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 26px;
  display: grid;
  gap: 16px;
}

.contact-form label { font-weight: 800; font-size: .9rem; }
.contact-form input, .contact-form textarea {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: .95rem;
  width: 100%;
  margin-top: 6px;
  outline: none;
  transition: border .2s;
}

.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }

.submit-btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  justify-self: start;
}

.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124, 77, 255, .45); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .like-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .game-grid { grid-template-columns: 1fr; }
  .like-grid { grid-template-columns: 1fr; }
  .logo-img { width: 52px; height: 52px; }
  .footer-logo { width: 68px; height: 68px; }
  .frame-toolbar { justify-content: center; }
  .game-topbar { gap: 10px; }
  .main-content { padding: 28px 14px 50px; }
}
