@font-face {
  font-family: 'NRT';
  src: url('../fonts/NRT-Reg.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NRT';
  src: url('../fonts/NRT-Bd.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --gl-bg-1: #030612;
  --gl-bg-2: #07152e;
  --gl-glow: #00b4ff;
  --gl-accent: #22d3ee;
  --gl-gold: #fbbf24;
  --gl-card: rgba(10, 22, 48, 0.74);
  --gl-border: rgba(56, 189, 248, 0.24);
  --gl-text: #f1f5f9;
  --gl-muted: #94a3b8;
  --gl-logo-d: 110px;
  --gl-logo-m: 78px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(1200px 680px at 50% -10%, rgba(0, 180, 255, 0.24), transparent 60%),
              radial-gradient(900px 520px at 85% 35%, rgba(34, 211, 238, 0.14), transparent 65%),
              linear-gradient(160deg, var(--gl-bg-1) 0%, var(--gl-bg-2) 55%, #02040b 100%);
  color: var(--gl-text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

html[lang="ckb"] body, html[lang="ar"] body {
  font-family: 'NRT', 'Segoe UI', Tahoma, sans-serif;
}

h1, h2, h3, h4, .gl-btn, .gl-nav-lang { font-weight: 700; }

/* Decorative rising bubbles (non-blocking) */
.gl-bg-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gl-bg-bubble {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 28%, rgba(255,255,255,0.5), rgba(34,211,238,0.18) 45%, rgba(168,85,247,0.08) 70%, transparent);
  border: 1px solid rgba(186, 230, 253, 0.28);
  box-shadow: inset 0 0 18px rgba(255,255,255,0.2), 0 0 24px rgba(0,180,255,0.14);
  animation: gl-rise linear infinite;
}

@keyframes gl-rise {
  0% { transform: translateY(0) translateX(0) scale(0.9); opacity: 0; }
  12% { opacity: 0.52; }
  85% { opacity: 0.36; }
  100% { transform: translateY(-115vh) translateX(22px) scale(1.08); opacity: 0; }
}

.gl-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 56px;
  display: grid;
  gap: 22px;
}

/* 1. Topbar */
.gl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.gl-logo-img {
  height: var(--gl-logo-d);
  width: auto;
  filter: drop-shadow(0 0 22px rgba(0, 180, 255, 0.45));
  animation: gl-logo-float 4.6s ease-in-out infinite;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.gl-logo-img:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 32px rgba(34, 211, 238, 0.72));
}

@keyframes gl-logo-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

.gl-lang-switch {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--gl-border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  backdrop-filter: blur(10px);
}

.gl-nav-lang {
  color: var(--gl-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.gl-nav-lang.is-active, .gl-nav-lang:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--gl-glow), #0284c7);
  box-shadow: 0 4px 16px rgba(0, 180, 255, 0.35);
}

/* Cards */
.gl-card {
  background: var(--gl-card);
  border: 1px solid var(--gl-border);
  border-radius: 22px;
  padding: 26px;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 2. Hero & Prominent Countdown with Side Logos */
.gl-hero {
  text-align: center;
  padding: 36px 24px 30px;
}

.gl-hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  margin: 0 0 10px;
  background: linear-gradient(180deg, #ffffff 12%, #bae6fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gl-hero p.gl-sub {
  max-width: 700px;
  margin: 0 auto 24px;
  color: #cbd5e1;
  font-size: 1.06rem;
}

.gl-cd-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gl-cd-side-logo {
  height: 56px;
  width: auto;
  opacity: 0.92;
  filter: drop-shadow(0 0 18px rgba(0, 180, 255, 0.55));
  animation: gl-logo-float 3.8s ease-in-out infinite;
}

.gl-cd-side-logo.is-right {
  animation-delay: -1.9s;
}

.gl-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 146px));
  justify-content: center;
  gap: 14px;
}

.gl-cd-box {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  padding: 18px 10px;
  box-shadow: 0 12px 32px rgba(0, 180, 255, 0.18), inset 0 1px 0 rgba(255,255,255,0.12);
}

.gl-cd-num {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.55rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 0 22px rgba(0, 180, 255, 0.45);
}

.gl-cd-lbl {
  display: block;
  font-size: 0.88rem;
  color: var(--gl-accent);
  margin-top: 6px;
}

.gl-launch-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #cbd5e1;
  font-size: 0.9rem;
}

/* 3. Primary Visitor Stats */
.gl-stats-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gl-stat-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--gl-border);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
}

.gl-stat-val {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

.gl-stat-lbl {
  font-size: 0.88rem;
  color: var(--gl-muted);
}

/* 4. Large Electric Heater Prize Showcase */
.gl-prize-card {
  background: radial-gradient(620px 360px at 50% 18%, rgba(251, 191, 36, 0.14), transparent 65%),
              radial-gradient(680px 420px at 50% 80%, rgba(0, 180, 255, 0.18), transparent 70%),
              var(--gl-card);
  border-color: rgba(251, 191, 36, 0.35);
}

.gl-prize-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 26px;
  align-items: center;
}

.gl-prize-img-wrap {
  border-radius: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(251, 191, 36, 0.12), rgba(2, 6, 23, 0.82) 72%);
  border: 1px solid rgba(251, 191, 36, 0.28);
  padding: 20px;
  text-align: center;
}

.gl-prize-img-wrap img {
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.5));
}

.gl-prize-size-medium img { max-height: 220px; }
.gl-prize-size-large img { max-height: 310px; }
.gl-prize-size-xlarge img { max-height: 390px; }

.gl-free-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.gl-prize-title {
  font-size: clamp(1.45rem, 2.8vw, 2.15rem);
  margin: 0 0 10px;
  color: #fff;
}

/* Forms & Buttons */
.gl-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.gl-field { display: flex; flex-direction: column; gap: 6px; }
.gl-field-full { grid-column: 1 / -1; }
.gl-field label { font-size: 0.92rem; color: #e2e8f0; font-weight: 700; }

.gl-input, .gl-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(2, 6, 23, 0.78);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
}

.gl-input:focus, .gl-textarea:focus {
  outline: none;
  border-color: var(--gl-accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.gl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gl-glow), #0284c7);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 180, 255, 0.35);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.gl-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 180, 255, 0.48); }
.gl-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.gl-btn-ghost {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--gl-border);
  box-shadow: none;
}

.gl-msg {
  padding: 11px 14px;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 0.94rem;
  display: none;
}
.gl-msg.is-err { display: block; background: rgba(220, 38, 38, 0.22); border: 1px solid rgba(248, 113, 113, 0.48); color: #fecaca; }
.gl-msg.is-ok  { display: block; background: rgba(16, 185, 129, 0.22); border: 1px solid rgba(52, 211, 153, 0.48); color: #a7f3d0; }

/* 5. Notices & 6. Gameplay Arena */
.gl-notice-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.92rem;
  color: #cbd5e1;
}

.gl-comp-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.gl-arena-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gl-hud { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.gl-hud-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid var(--gl-border);
  font-weight: 700;
}

.gl-hud-big {
  font-size: 1.35rem;
  border-color: rgba(34, 211, 238, 0.45);
}

.gl-arena {
  position: relative;
  width: 100%;
  height: 460px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 25%, rgba(0, 180, 255, 0.18), rgba(2, 6, 23, 0.94) 72%);
  border: 1px solid rgba(56, 189, 248, 0.38);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.gl-arena.is-expanded {
  position: fixed;
  inset: 10px;
  height: calc(100dvh - 20px);
  z-index: 90;
}

.gl-arena-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(5px);
  z-index: 4;
  overflow-y: auto;
}

.gl-game-bubble {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  touch-action: none;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.88), rgba(34, 211, 238, 0.44) 45%, rgba(0, 180, 255, 0.28) 75%, rgba(255,255,255,0.12));
  border: 1.5px solid rgba(186, 230, 253, 0.78);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.55), 0 0 22px rgba(0, 180, 255, 0.42);
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Pooled Official BUBBLE Logo Pop Effect (pointer-events: none) */
.gl-pop-fx {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0;
  will-change: transform, opacity;
}

.gl-pop-fx.is-active {
  animation: gl-logo-pop 360ms ease-out forwards;
}

.gl-pop-fx img {
  display: block;
  width: var(--pop-logo-size, 30px);
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 180, 255, 0.75));
}

.gl-pop-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(186, 230, 253, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

@keyframes gl-logo-pop {
  0%   { opacity: 0.95; transform: translate(-50%, -50%) scale(0.75); }
  55%  { opacity: 1;    transform: translate(-50%, -72%) scale(1.08); }
  100% { opacity: 0;    transform: translate(-50%, -105%) scale(1.16); }
}

/* Mandatory Instructions Modal */
.gl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(8px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

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

.gl-modal {
  width: 100%;
  max-width: 680px;
  max-height: 92dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, #07142b, #030714);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.gl-rule-card {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 0.96rem;
}
.gl-rule-white { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16); color: #f8fafc; }
.gl-rule-gold  { background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.45); color: #fef3c7; }
.gl-rule-red   { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(248, 113, 113, 0.5); color: #fee2e2; }
.gl-rule-green { background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(52, 211, 153, 0.48); color: #d1fae5; }

/* End-of-game Results Card */
.gl-results-panel {
  margin-top: 16px;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(10, 28, 62, 0.9), rgba(2, 6, 23, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.45);
  display: none;
}

.gl-results-panel.is-open { display: block; }

.gl-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

/* 7. Leaderboard */
.gl-lb-table { width: 100%; border-collapse: collapse; }
.gl-lb-table th, .gl-lb-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: start;
}
.gl-lb-table th { color: var(--gl-accent); font-size: 0.9rem; }
.gl-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 180, 255, 0.18);
  font-weight: 700;
}
.gl-rank-1 .gl-rank-badge { background: linear-gradient(135deg, #fbbf24, #d97706); color: #0b1120; }
.gl-rank-2 .gl-rank-badge { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #0b1120; }
.gl-rank-3 .gl-rank-badge { background: linear-gradient(135deg, #fb923c, #b45309); color: #fff; }

/* 8 & 9. Socials & Developer Credit */
.gl-social-row { display: flex; flex-wrap: wrap; gap: 10px; }
.gl-social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--gl-border);
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.92rem;
}

.gl-dev-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 180, 255, 0.65);
  margin: 6px 0 10px;
}

@media (max-width: 860px) {
  .gl-prize-layout { grid-template-columns: 1fr; }
  .gl-cd-side-logo { height: 42px; }
}

@media (max-width: 600px) {
  .gl-logo-img { height: var(--gl-logo-m); }
  .gl-countdown { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .gl-cd-side-logo { display: none; }
  .gl-stats-3 { grid-template-columns: 1fr; }
  .gl-form-grid { grid-template-columns: 1fr; }
  .gl-arena { height: 400px; }
  .gl-card { padding: 18px; }
}
