/* ===== Fullscreen fixes (drop into assets/css/style.css) ===== */

/* CSS khizer start*/

/* ===============================
   GLOBAL STYLES
=============================== */
/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600&family=Poppins:wght@400;500;600&display=swap');

:root {
  --primary: #42a5f5;
  --secondary: #ff80ab;
  --accent: #ffd54f;
  --bg-gradient: linear-gradient(135deg, #42a5f5, #7e57c2);
  --card-bg: rgba(255, 255, 255, 0.1);
  --text-dark: #222;
  --text-light: #fff;
}

body {
  background: radial-gradient(circle at top left, #1e1e2f, #111);
  font-family: "Poppins", sans-serif;
  color: var(--text-light);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: "Baloo 2", cursive;
  color: var(--accent);
}

a {
  text-decoration: none;
  transition: 0.3s;
}

/* Navbar / Header */
.navbar {
  background: var(--bg-gradient);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.navbar-brand {
  font-family: "Baloo 2", cursive;
  font-size: 1.8rem;
  color: #fff !important;
}

.nav-link {
  color: #fff !important;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--accent) !important;
}

/* Hero Section */
section {
  background: var(--bg-gradient);
  border-radius: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  padding: 4rem 2rem;
}

section h1 {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

section p {
  font-size: 1.1rem;
  opacity: 0.9;
}

section .btn {
  background: #fff;
  color: #1e88e5;
  font-weight: 600;
  transition: all 0.3s ease;
}
section .btn:hover {
  background: var(--accent);
  color: #222;
  transform: scale(1.05);
}

/* Game Cards */
.game-card {
  background: var(--card-bg);
  border: none;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s, box-shadow 0.3s;
  color: #fff;
}

.game-card img {
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  height: 160px;
  object-fit: cover;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(66, 165, 245, 0.3);
}

.game-card .card-title {
  color: var(--accent);
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
}

.game-card .card-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.btn-outline-primary {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  border-radius: 50px;
}
.btn-outline-primary:hover {
  background: var(--accent);
  color: #222;
}

/* Theme-Matched Footer */
footer {
  background: var(--bg-gradient); /* match theme gradient */
  color: var(--text-light);
  text-align: center;
  padding: 2rem 1rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.1); /* subtle separator */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: 0.3s;
}

footer a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

footer small {
  opacity: 0.8;
  font-size: 0.85rem;
}


/* Parent Center Button */
.btn-primary {
  background: var(--secondary);
  border: none;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 128, 171, 0.4);
}
.btn-primary:hover {
  background: #ffb6c1;
  transform: scale(1.05);
}

/* Responsive tweaks */
@media (max-width: 576px) {
  footer {
    padding: 1.5rem 0.5rem;
  }
  footer .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  section {
    padding: 2.5rem 1rem;
  }
  .display-6 {
    font-size: 1.8rem;
  }
  .game-card img {
    height: 140px;
  }
}

/* Css khizer End */


/* Ensure the element we fullscreen (e.g., #game-stage or its wrapper) fills viewport */
:fullscreen, /* standard */
:-webkit-full-screen, /* Safari/WebKit */
:-moz-full-screen, /* Firefox */
:-ms-fullscreen /* IE/Edge old */ {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483647 !important; /* very top */
  display: block !important;
  background: #000; /* prevents white gaps */
  overflow: hidden !important;
}

/* If you target a specific element like #game-stage when fullscreen */
#game-stage:fullscreen,
#game-stage:-webkit-full-screen,
#game-stage:-moz-full-screen {
  width: 100vw !important;
  height: 100vh !important;
}

.fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #000 !important;
}


#game-stage:fullscreen, #game-stage:-webkit-full-screen {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh; z-index: 2147483647;
}

.game-canvas-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* prevents canvas from creating page scroll */
}

/* Make sure canvas visually fills its container */
#game-stage canvas,
.game-canvas-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain;
  margin: 0;
  padding: 0;
}


/* Prevent body scroll when fullscreened */
:fullscreen body,
:-webkit-full-screen body {
  overflow: hidden !important;
}

/* Minor: ensure parent wrappers don't add spacing that breaks fullscreen */
.container, .container-fluid, .row, .col, .card {
  /* do not override global layout — only matters if you accidentally fullscreen them */
}

/* Remove any transform on parent elements — transforms can create stacking contexts that break fullscreen layout */
#game-stage, .game-canvas-wrapper {
  transform: none !important;
}



/* ===============================
   HAPPY GLASS GAME STYLES
   =============================== */
.happy-glass-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9; /* keeps proportions on resize */
  background: radial-gradient(circle at top, #0d47a1 10%, #1e1e2f 90%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(66, 165, 245, 0.3);
}

.happy-glass-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  flex-direction: column;
  z-index: 1000;
}

/* .hg-start-card,
.hg-result-card {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 20px 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 10px #000;
} */

.hg-buttons {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.hg-map-overlay button {
  margin: 5px;
  padding: 10px 20px;
  font-size: 18px;
}
.hg-star {
  position: absolute;
  font-size: 28px;
  color: gold;
  text-shadow: 0 0 10px rgba(255, 255, 150, 0.8);
  transform: scale(0);
  /* animation: star-fly 1s ease-out forwards; */
}

/* @keyframes star-fly {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.2;
  }
  60% {
    transform: translate(-20%, -60%) scale(1.5);
    opacity: 1;
  }
  100% {
    transform: translate(80vw, -80vh) scale(0.5);
    opacity: 0;
  }
} */
.hg-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
/* Back button (now right-aligned) */
.hg-map-back {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.hg-map-back:hover {
  background: rgba(255, 255, 255, 0.4);
}
.hg-map-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 4000;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hg-map-modal > div {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 80%;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px 16px 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Scrollbar styling (optional aesthetic) */
.hg-map-modal > div::-webkit-scrollbar {
  width: 6px;
}
.hg-map-modal > div::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.hg-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  justify-items: center;
  padding-bottom: 10px;
}

.hg-map-node {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.hg-map-node:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.hg-map-node.current {
  background: var(--accent, #00bfff);
  border-color: #fff;
  color: #000;
  font-weight: bold;
}

.hg-node-id {
  font-size: 0.85rem;
}
.hg-node-stars {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* Back button (icon style) */
.hg-back-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.hg-back-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Responsive padding for side panel layout (same structure as other games) */
@media (max-width: 768px) {
  .happy-glass-wrapper {
    max-width: 100%;
    aspect-ratio: 4 / 3;
  }
}

