/* ==========================================================
   GameZone stylesheet (public site)
   1. Variables: colour themes + dark/light mode
   2. Base / layout
   3. Components (buttons, cards, forms, chat ...)
   4. Home page sections
   5. Animation + button-shape switches (controlled from Admin)
   6. Responsive rules
   ========================================================== */

/* ---------- 1. VARIABLES ---------- */
:root {
  --ac: #7c4dff;            /* main accent colour   */
  --ac2: #00e5ff;           /* second accent colour */
  --bg: #0d0f1a; --card: #171a2b; --tx: #e8eaf6; --mu: #8b90b0; --bd: #272b45;
  --radius-btn: 9px;
  --ticker-speed: 32s;
}
html[data-mode="light"] { --bg: #f1f2fa; --card: #ffffff; --tx: #14162b; --mu: #5d617f; --bd: #dcdff0; }

/* Colour themes: change the accent colours only. */
html[data-theme="fire"]   { --ac: #ff5722; --ac2: #ffc107; }
html[data-theme="ocean"]  { --ac: #0091ea; --ac2: #1de9b6; }
html[data-theme="toxic"]  { --ac: #5fd400; --ac2: #00e676; }
html[data-theme="sakura"] { --ac: #ec407a; --ac2: #ff9ec7; }
html[data-theme="gold"]   { --ac: #d4a017; --ac2: #fff1a8; }

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 70px); }
body {
  margin: 0; background: var(--bg) center / cover fixed; color: var(--tx);
  font: 16px/1.5 "Segoe UI", Roboto, system-ui, sans-serif;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
main { width: 95%; max-width: 1500px; margin: 0 auto; padding: 20px 0 60px; }
h1, h2 { margin: 24px 0 12px; }
h2 { font-size: 20px; border-left: 4px solid var(--ac); padding-left: 10px; }
.mu { color: var(--mu); }
.error { color: #ff5252; }
.ok { color: #00c853; }
.em { text-align: center; color: var(--mu); padding: 30px; }

/* Animated grid background behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 420px at 12% 8%, color-mix(in srgb, var(--ac) 38%, transparent), transparent),
    radial-gradient(540px 420px at 88% 28%, color-mix(in srgb, var(--ac2) 26%, transparent), transparent),
    linear-gradient(color-mix(in srgb, var(--bd) 60%, transparent) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, color-mix(in srgb, var(--bd) 60%, transparent) 1px, transparent 1px) 0 0 / 48px 48px;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { to { background-position: 40px 30px, -40px 20px, 0 0, 0 0; } }

/* ---------- HEADER ---------- */
header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--bd);
}
.bar { width: 95%; max-width: 1500px; margin: 0 auto; padding: 10px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo {
  font: 800 22px Impact, "Arial Black", sans-serif; letter-spacing: 1px;
  display: flex; align-items: center; gap: 8px;
}
.logo span { background: linear-gradient(90deg, var(--ac), var(--ac2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo img { height: 32px; border-radius: 6px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { padding: 6px 12px; border-radius: 8px; color: var(--mu); font-weight: 600; font-size: 14px; text-transform: uppercase; }
nav a:hover, nav a.on { color: var(--tx); background: var(--card); }
.sb input { width: 150px; }
.tools, .auth { display: flex; gap: 6px; align-items: center; }
.tools select { width: auto; padding: 7px; }
.auth form { display: inline; }
.burger { display: none; }
.badge { background: #ff1744; color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 6px; margin-left: 4px; display: none; }
.badge.on { display: inline-block; }

/* Avatar */
.av { display: inline-grid; place-items: center; border-radius: 50%; flex: none; vertical-align: middle;
      background: linear-gradient(135deg, var(--ac), var(--ac2)) center / cover; color: #fff; font-weight: 800; }

/* ---------- 3. COMPONENTS ---------- */
.btn, button {
  background: linear-gradient(90deg, var(--ac), color-mix(in srgb, var(--ac) 55%, #000));
  color: #fff; border: 0; padding: 9px 16px; border-radius: var(--radius-btn);
  font: 700 14px inherit; cursor: pointer; display: inline-block; text-align: center;
}
.btn:hover, button:hover { filter: brightness(1.15); }
.btn.alt, button.alt { background: var(--bd); color: var(--tx); }
.btn.red, button.red { background: #c62828; color: #fff; }
.btn.cy { background: linear-gradient(90deg, #00b8d4, #0091ea); }
.btn.gr { background: linear-gradient(90deg, #00c853, #009624); }
.btn.or { background: linear-gradient(90deg, #ff9100, #ef6c00); }

input, select, textarea {
  width: 100%; background: var(--bg); color: var(--tx); border: 1px solid var(--bd);
  border-radius: 8px; padding: 9px; font: inherit;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
label { display: block; font-size: 13px; color: var(--mu); margin: 10px 0 3px; }
.narrow { max-width: 420px; }

.box { background: var(--card); border: 1px solid var(--bd); border-radius: 12px; padding: 16px; margin: 12px 0; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px; border-bottom: 1px solid var(--bd); text-align: left; font-size: 14px; }
.tw { overflow-x: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { background: var(--card); border: 1px solid var(--bd); padding: 8px 14px; border-radius: 99px; }
.chips a:hover, .chips a.on { border-color: var(--ac); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pill { background: var(--bd); padding: 4px 11px; border-radius: 99px; font-size: 13px; }

/* Game cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.g { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; overflow: hidden; transition: .2s; display: flex; flex-direction: column; }
.g:hover { transform: translateY(-4px); border-color: var(--ac); box-shadow: 0 10px 30px color-mix(in srgb, var(--ac) 45%, transparent); }
.g .im { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--ac), var(--ac2)) center / cover; display: grid; place-items: center; font-size: 40px; transition: transform .5s; }
.g:hover .im { transform: scale(1.07); }
.g .b { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; background: var(--card); position: relative; }
.g p { margin: 0; color: var(--mu); font-size: 13px; flex: 1; }
.tag { font-size: 11px; background: var(--bd); padding: 2px 8px; border-radius: 99px; width: fit-content; color: var(--ac2); }

/* Game details */
.det { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.det .big { width: 100%; aspect-ratio: 16/10; border-radius: 14px; background: linear-gradient(135deg, var(--ac), var(--ac2)) center / cover; }
.acts { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

/* Chat / messages */
.live .lb { height: 320px; overflow: auto; margin: 8px 0; }
.msg { padding: 6px 0; border-bottom: 1px solid var(--bd); font-size: 14px; }
.msg b { color: var(--ac2); }
.msg small { color: var(--mu); }
.msg.me b { color: var(--ac); }
.conv { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; margin-top: 6px; }
.conv:hover, .conv.on { background: var(--bd); }
.conv span:nth-child(2) { flex: 1; }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.page-body img { max-width: 100%; }

/* Footer, WhatsApp button */
footer { text-align: center; color: var(--mu); padding: 24px 16px; border-top: 1px solid var(--bd); font-size: 14px; }
.social { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.social a { background: var(--card); border: 1px solid var(--bd); padding: 6px 12px; border-radius: 99px; color: var(--tx); }
.social a:hover { border-color: var(--ac); }
.wa {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: #25d366; color: #fff; font-weight: 700; padding: 12px 18px; border-radius: 99px;
  box-shadow: 0 6px 20px #0006; display: flex; align-items: center; gap: 6px;
}
.wa:hover { filter: brightness(1.1); }

/* ---------- 4. HOME SECTIONS ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 120px 4vw; min-height: 60vh; margin-bottom: 14px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px;
  background: linear-gradient(120deg, var(--ac), color-mix(in srgb, var(--ac2) 55%, #10102a), var(--ac));
  background-size: 240% 240%; animation: gradshift 10s ease infinite; color: #fff;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--ac) 40%, transparent);
}
@keyframes gradshift { 50% { background-position: 100% 50%; } }
.hero h1 { font: 900 clamp(34px, 7vw, 66px) Impact, "Arial Black", sans-serif; margin: 0; letter-spacing: 2px; text-shadow: 0 4px 24px #0006; }
.hero p { max-width: 520px; font-size: 18px; opacity: .92; margin: 0 0 8px; }
.fl { position: absolute; font-size: 48px; opacity: .35; animation: float 6s ease-in-out infinite; pointer-events: none; }
@keyframes float { 50% { transform: translateY(-22px) rotate(12deg); } }

.tick { display: flex; background: var(--card); border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; margin: 12px 0; }
.tt { background: var(--ac); color: #fff; font-weight: 800; padding: 9px 14px; white-space: nowrap; }
.tm { overflow: hidden; flex: 1; display: flex; align-items: center; }
.tm div { display: flex; gap: 48px; white-space: nowrap; padding-left: 24px; animation: marquee var(--ticker-speed) linear infinite; }
.tm:hover div { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

.slider { position: relative; border-radius: 14px; overflow: hidden; height: clamp(220px, 45vw, 560px); margin: 12px 0; }
.sl { position: absolute; inset: 0; background: center / cover; opacity: 0; transition: opacity .8s; display: flex; align-items: flex-end; }
.sl.on { opacity: 1; }
.sl span { background: linear-gradient(transparent, #000b); width: 100%; padding: 26px 16px 12px; color: #fff; font-weight: 800; font-size: 18px; }
.dots { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #fff6; cursor: pointer; }
.dots i.on { background: #fff; }

.stats4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.stats4 div { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; padding: 18px; text-align: center; color: var(--mu); }
.stats4 b { display: block; font-size: 34px; color: var(--ac2); }

.ct { position: relative; aspect-ratio: 16/9; border-radius: 14px; background: linear-gradient(135deg, var(--ac), var(--ac2)) center / cover; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; color: #fff; transition: .3s; }
.ct::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, #000c); }
.ct * { position: relative; z-index: 1; }
.ct:hover { transform: scale(1.04); }
.ct b { font-size: 20px; }

.ft { text-align: center; }
.ft span { font-size: 42px; display: block; animation: float 5s ease-in-out infinite; }
.cta { text-align: center; padding: 50px 20px; border-radius: 20px; margin-top: 30px; background: linear-gradient(120deg, var(--ac), var(--ac2)); color: #fff; }
.cta h2 { border: 0; font-size: 30px; padding: 0; }

/* Scroll reveal (only hidden when JavaScript is running) */
.js .rv { opacity: 0; transform: translateY(30px); transition: .8s; }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- 5. SWITCHES FROM ADMIN (body classes) ---------- */
body.btn-pill   { --radius-btn: 99px; }
body.btn-square { --radius-btn: 2px; }
body.no-hero  .hero { animation: none; }
body.no-float .fl, body.no-float .ft span { animation: none; }
body.no-reveal .rv { opacity: 1 !important; transform: none !important; transition: none; }
body.no-cards .g, body.no-cards .g .im, body.no-cards .ct { transition: none; }
body.no-cards .g:hover, body.no-cards .g:hover .im, body.no-cards .ct:hover { transform: none; }
body.no-bg::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 6. RESPONSIVE ---------- */
@media (max-width: 1000px) {
  .burger { display: inline-block; margin-left: auto; }
  nav { display: none; flex: none; width: 100%; order: 5; flex-direction: column; }
  nav.open { display: flex; }
  .sb { order: 6; flex: 1; } .sb input { width: 100%; }
  .tools { order: 7; } .auth { order: 8; }
}
@media (max-width: 700px) {
  .det, .row { grid-template-columns: 1fr; }
  .hero { padding: 70px 20px; min-height: 50vh; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .wa { padding: 10px 14px; }
}

/* ---------- ads + cookie notice ---------- */
.adbox { margin: 16px 0; text-align: center; overflow: hidden; max-width: 100%; }
.adbox.adtest { border: 2px dashed var(--ac); color: var(--mu); padding: 24px; border-radius: 10px; }
.cookiebar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  max-width: 720px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--ac); border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: 0 8px 30px #0008;
}
.cookiebar[hidden] { display: none; }

/* ---------- floating contact buttons ---------- */
.fab { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; flex-direction: column; gap: 10px; }
.fab-right { right: 16px; align-items: flex-end; }
.fab-left { left: 16px; align-items: flex-start; }
.fab-list { display: flex; flex-direction: column; gap: 10px; }
.fab-right .fab-list { align-items: flex-end; }
.fab-left .fab-list { align-items: flex-start; }
.fab-btn { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; padding: 11px 16px; border-radius: 99px; box-shadow: 0 6px 20px #0006; transition: transform .2s; }
.fab-btn:hover { transform: scale(1.06); }
.fab-btn span { font-size: 18px; line-height: 1; }
.fab-main { width: 56px; height: 56px; border-radius: 50%; padding: 0; font-size: 24px; box-shadow: 0 6px 20px #0006; }
.fab-menu { flex-direction: column-reverse; }
.fab-menu .fab-list { display: none; }
.fab-menu.open .fab-list { display: flex; }
@media (max-width: 700px) { .fab-btn { padding: 12px; border-radius: 50%; } .fab-btn b { display: none; } }

/* ---------- right-to-left languages (Urdu, Arabic ...) ---------- */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] h2 { border-left: 0; border-right: 4px solid var(--ac); padding-left: 0; padding-right: 10px; }
html[dir="rtl"] td, html[dir="rtl"] th { text-align: right; }
html[dir="rtl"] .hero { align-items: flex-end; text-align: right; }
html[dir="rtl"] .burger { margin-left: 0; margin-right: auto; }

/* ---------- reviews ---------- */
.stars { color: #ffc107; letter-spacing: 2px; }
.review { padding: 10px 0; border-bottom: 1px solid var(--bd); }
.review small { color: var(--mu); }
.nf { text-align: center; padding: 60px 16px; }
.nf .big404 { font: 900 clamp(70px, 18vw, 150px) Impact, "Arial Black", sans-serif; background: linear-gradient(90deg, var(--ac), var(--ac2)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
