/* ===============================
   GLASS NAVBAR (UNITY STYLE)
================================ */

html.gamify .apple-nav {
  position: fixed;
  top: 0;
  z-index: 9000;

  /* Glass background */
  background: linear-gradient(
    180deg,
    rgba(52, 52, 53, 0.75),
    rgba(59, 59, 59, 0.55)
  ) !important;

  /* Glass effect */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(10px);


  /* Depth */
  box-shadow:
    0 10px 40px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
html.gamify .apple-nav a {
  color: rgba(226,232,240,0.9);
}

html.gamify .apple-nav a:hover {
  color: #ffffff;
  text-shadow: 
    0 0 6px rgba(255,255,255,0.45),
    0 0 12px rgba(255,255,255,0.25);
}

/* ===============================
   HERO GAME ENTRY
================================ */

html.gamify .game-anchor {
  margin-top: 32px;
}

html.gamify .game-btn {
background: linear-gradient(
  135deg,
  rgba(0,0,0,0.6),
  rgba(0,0,0,0.4)
);

border: 1px solid rgba(255,255,255,0.12);
color: #ffffff;


  padding: 14px 26px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;

  box-shadow:
    0 0 0 1px rgba(167,139,250,0.35),
    0 18px 40px rgba(0,0,0,0.6);
}

html.gamify .game-btn:hover {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.1);
  box-shadow:
    0 0 0 1px rgba(125,211,252,0.9),
    0 28px 70px rgba(0,0,0,0.85);
}

/* ===============================
   SERVICES GAME INDICATOR
================================ */

html.gamify .game-mode-indicator {
  text-align: center;
  margin: 24px 0 36px;

  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: rgba(226,232,240,0.75);

  text-shadow: 0 0 10px rgba(125,211,252,0.25);
}


html.gamify .hero-game-hint {
  margin-top: 14px;
  font-size: 0.9rem;
  color: rgba(226,232,240,0.7);
}

html.gamify .hero-game-hint span {
  color: var(--accent);
  cursor: pointer;
  text-shadow: 0 0 8px rgba(125,211,252,0.6);
}

html.gamify .game-strip {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 40px;
  flex-wrap: wrap;
}

html.gamify .game-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(125,211,252,0.4);
  color: #e5f0ff;

  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;

  cursor: pointer;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html.gamify .game-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(125,211,252,0.5);
}


html.gamify .easter-game {
  margin-top: 24px;
  font-size: 0.85rem;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

html.gamify .easter-game:hover {
  opacity: 1;
  text-shadow: 0 0 10px rgba(167,139,250,0.6);
}


html.gamify .tech-game-toggle {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 24px 0 48px;

  font-size: 0.9rem;
  color: rgba(226,232,240,0.7);
}

html.gamify .tech-game-toggle span {
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

html.gamify .tech-game-toggle span:hover {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(125,211,252,0.6);
}

html.gamify .footer-game-entry {
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
  opacity: 0.7;
  cursor: pointer;
}

html.gamify .footer-game-entry:hover {
  opacity: 1;
  text-shadow: 0 0 10px rgba(167,139,250,0.5);
}


/* ===============================
   GAME OVERLAY
================================ */
.game-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.82);

  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;
}



.game-overlay.hidden {
  display: none;
}

.game-frame {
  position: relative;

  width: min(94vw, 700px);
  height: min(90vh, 720px);
  padding : 13px;


  background: linear-gradient(
    180deg,
    rgba(12,12,12,0.98),
    rgba(4,4,4,0.99)
  );

  border-radius: 22px;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.2),
    0 0 40px rgba(255,255,255,0.08),
    0 10px 30px rgba(0,0,0,0.6);

  display: flex;
  flex-direction: column;
  overflow: visible; /* IMPORTANT */
}



.game-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.game-hud {
  flex-shrink: 0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px 18px;

  background: linear-gradient(
    180deg,
    rgba(20,20,20,0.95),
    rgba(10,10,10,0.85)
  );

  border-bottom: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
}



.game-hud span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #ffffff;

  text-shadow:
    0 0 6px rgba(255,255,255,0.35),
    0 6px 18px rgba(0,0,0,0.9);
}


.game-hud-actions {
  display: flex;
  gap: 8px;
}

.game-hud-btn {
  background: rgba(255,255,255,0.06);
  color: #ffffff;

  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 8px;

  font-size: 0.8rem;

  background: rgba(0,0,0,0.88) !important;

  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.game-hud-btn:hover {
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
}


.game-hud-btn:hover {
  background: rgba(255,255,255,0.2);
}

.hidden {
  display: none;
}

#gameMount {
  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 36px 36px 30px;

  overflow: visible;

  background: radial-gradient(
    circle at center,
    rgba(255,255,255,0.025),
    rgba(0,0,0,0.92)
  );
}
#gameMount canvas {
  width: min(520px, 90%);
  height: auto;

  aspect-ratio: 1 / 1;

  background: #050505;
  border-radius: 16px;

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.18),
    0 25px 80px rgba(0,0,0,0.9);

  image-rendering: pixelated;
}



.breakout-hint,
.snake-hint {
  margin-top: 14px;
  font-size: 0.85rem;
  color: rgba(226,232,240,0.65);
  text-align: center;
}

/* ===============================
   GAMIFY BUTTON — GLASS ANIMATION
================================ */

.gamify-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 5px 16px;
  border-radius: 12px;

  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;

  color: #343435;
  cursor: pointer;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.25),
      rgba(255, 255, 255, 0.25)
    );

  border: 1px solid rgba(125,211,252,0.05);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow:
    0 0 0 1px rgba(167,139,250,0.25),
    0 1px 1px rgba(0,0,0,0.45);
}

/* 🔁 SOFT BREATHING GLOW */
.gamify-btn::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;

  background: linear-gradient(
    120deg,
    rgba(125,211,252,0.6),
    rgba(167,139,250,0.6),
    rgba(125,211,252,0.6)
  );

  opacity: 0.35;
  filter: blur(8px);
  z-index: -1;

  animation: gamifyPulse 3.5s ease-in-out infinite;
}

/* ✨ LIGHT SWEEP (Unity-style) */
.gamify-btn::after {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(241, 103, 103, 0.35),
    transparent 80%
  );

  opacity: 0;
  transform: translateX(-120%);
  transition: transform 2.5s ease, opacity 0.3s ease;
  pointer-events: none;
}

/* HOVER */
.gamify-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(125,211,252,0.9);

  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 20px 50px rgba(0,0,0,0.6);
}

.gamify-btn:hover::after {
  opacity: 1;
  transform: translateX(120%);
}

/* ACTIVE / CLICK */
.gamify-btn:active {
  transform: translateY(0) scale(0.98);
}

/* 🔁 KEYFRAMES */
@keyframes gamifyPulse {
  0%, 100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.6;
  }
}

/* ======================================================
   GAMIFY — FINAL STABLE VISUAL SYSTEM (AUTHORITATIVE)
   zero pop · zero flicker · scroll-safe
====================================================== */

/* ---------- GLOBAL BASE ---------- */
html.gamify {
  background: #000;
  --purple: rgba(167,139,250,1);
  --purple-soft: rgba(167,139,250,0.35);
  --purple-dim: rgba(167,139,250,0.18);
}

/* ---------- SECTIONS ---------- */
html.gamify section {
  position: relative;
  background: #000 !important;
  overflow: visible;
}

/* Section glow (single source of truth) */
html.gamify section::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 36px var(--purple-dim);
}

/* Scroll = dim, never remove */
html.gamify.gamify-scrolling section::after {
  box-shadow: 0 0 18px rgba(167,139,250,0.08);
}

/* ---------- CARDS / TILES ---------- */
html.gamify .grid-tile,
html.gamify .service-card,
html.gamify .work-tile {
  position: relative;
  background: #050505 !important;
  border: 1px solid var(--purple-dim);
  box-shadow: 0 0 0 1px rgba(167,139,250,0.12);
  overflow: visible;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Hover = elevate */
html.gamify .grid-tile:hover,
html.gamify .service-card:hover,
html.gamify .work-tile:hover {
  transform: translateY(-6px);
  box-shadow:
    0 0 0 1px var(--purple-soft),
    0 18px 48px rgba(0,0,0,0.7);
}

/* Scroll = static cheap edge */
html.gamify.gamify-scrolling .grid-tile,
html.gamify.gamify-scrolling .service-card,
html.gamify.gamify-scrolling .work-tile {
  transform: none;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.22);
}

/* ---------- NAV ---------- */
html.gamify .apple-nav {
  background: rgba(0,0,0,0.88) !important;
  border-bottom: 1px solid rgba(167,139,250,0.15);
}

/* ---------- TEXT ---------- */
html.gamify h1,
html.gamify h2,
html.gamify h3 {
  color: #e5f3ff;
  text-shadow: 0 0 18px rgba(167,139,250,0.35);
}

html.gamify p,
html.gamify li {
  color: rgba(226,232,240,0.85);
}

html.gamify .apple-nav {
  background: rgba(0,0,0,0.88) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html.gamify section {
  background: #000 !important;
}

html,
body,
html.gamify,
html.gamify body {
  background: #000000 !important;
}

html.gamify footer,
html.gamify .site-footer {
  background: #000000 !important;
  color: rgba(226,232,240,0.85);
}

html.gamify,
html.gamify body {
  overscroll-behavior: none;
}


/* ======================================================
Checkpoint
*/

html.gamify .grid-tile,
html.gamify .service-card,
html.gamify .work-tile {
  transition:
    transform 0.25s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

html.gamify .grid-tile:hover,
html.gamify .service-card:hover,
html.gamify .work-tile:hover {
  border-color: rgba(167,139,250,0.65);
}

html.gamify a,
html.gamify button,
html.gamify .game-chip {
  transition: color 0.2s ease, text-shadow 0.25s ease;
}

html.gamify a:hover,
html.gamify button:hover,
html.gamify .game-chip:hover {
  text-shadow:
    0 0 6px rgba(167,139,250,0.45),
    0 0 14px rgba(124,58,237,0.25);
}

html.gamify h1,
html.gamify h2 {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.gamify h2::after {
  content: "";
  display: block;
  margin-top: 12px;
  width: 60px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(167,139,250,0.8),
    transparent
  );
}

html.gamify button:active,
html.gamify .game-btn:active {
  transform: scale(0.96);
  filter: brightness(1.15);
}

html.gamify body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      rgba(255,255,255,0.02) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255,255,255,0.02) 1px,
      transparent 1px
    );
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.03;
  z-index: 0;
}

/* ======================================================
   A+B — AMBIENT GAME WORLD LIGHTING
====================================================== */

html.gamify body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(
      900px 520px at 25% 8%,
      rgba(167,139,250,0.06),
      transparent 60%
    ),
    radial-gradient(
      700px 460px at 75% 12%,
      rgba(96,165,250,0.045),
      transparent 65%
    );
  pointer-events: none;
  z-index: 0;
}

/* ======================================================
   A+B — SECTION HIERARCHY
====================================================== */

html.gamify section {
  padding-top: clamp(64px, 8vw, 96px);
  padding-bottom: clamp(64px, 8vw, 96px);
}

/* ======================================================
   A+B — TITLE TREATMENT
====================================================== */

html.gamify h1,
html.gamify h2 {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html.gamify h2::after {
  content: "";
  display: block;
  margin-top: 14px;
  width: 72px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(167,139,250,0.9),
    transparent
  );
}

/* ======================================================
   A+B — CARD POWER-ON FEEDBACK
====================================================== */

html.gamify .grid-tile,
html.gamify .service-card,
html.gamify .work-tile {
  transition:
    transform 0.25s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

html.gamify .grid-tile:hover,
html.gamify .service-card:hover,
html.gamify .work-tile:hover {
  border-color: rgba(167,139,250,0.65);
}

/* ======================================================
   A+B — FOCUS STATES
====================================================== */

html.gamify :focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(167,139,250,0.6),
    0 0 20px rgba(167,139,250,0.35);
}

/* ======================================================
   STEP 1 — MICRO MOTION POLISH (HOVER ONLY)
   zero scroll · zero flicker
====================================================== */

/* Cards feel "ready" instead of static */
html.gamify .grid-tile,
html.gamify .service-card,
html.gamify .work-tile {
  transform: translateZ(0);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* Hover = subtle lift, not jump */
html.gamify .grid-tile:hover,
html.gamify .service-card:hover,
html.gamify .work-tile:hover {
  transform: translateY(-4px);
}

/* ======================================================
   STEP 2 — BUTTON & CTA MASTERY
   hover-only · click feedback · no scroll work
====================================================== */

/* Primary game buttons */
html.gamify .game-btn,
html.gamify .gamify-btn,
html.gamify button {
  position: relative;
  isolation: isolate;

  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

/* Hover = confidence, not aggression */
html.gamify .game-btn:hover,
html.gamify .gamify-btn:hover,
html.gamify button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Active / Click = physical press */
html.gamify .game-btn:active,
html.gamify .gamify-btn:active,
html.gamify button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    0 0 0 1px rgba(167,139,250,0.25),
    0 6px 18px rgba(0,0,0,0.8);
}

/* Focus = controller navigation friendly */
html.gamify button:focus-visible,
html.gamify .game-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(167,139,250,0.55),
    0 0 24px rgba(167,139,250,0.25);
}

/* ======================================================
   STEP 2 — BUTTON & CTA MASTERY
   hover-only · click feedback · no scroll work
====================================================== */

/* Primary game buttons */
html.gamify .game-btn,
html.gamify .gamify-btn,
html.gamify button {
  position: relative;
  isolation: isolate;

  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

/* Hover = confidence, not aggression */
html.gamify .game-btn:hover,
html.gamify .gamify-btn:hover,
html.gamify button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Active / Click = physical press */
html.gamify .game-btn:active,
html.gamify .gamify-btn:active,
html.gamify button:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    0 0 0 1px rgba(167,139,250,0.25),
    0 6px 18px rgba(0,0,0,0.8);
}

/* Focus = controller navigation friendly */
html.gamify button:focus-visible,
html.gamify .game-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(167,139,250,0.55),
    0 0 24px rgba(167,139,250,0.25);
}

/* ======================================================
   STEP 4 — HIGH-END GAME UI POLISH
   typography · spacing · clarity
====================================================== */

/* Headings feel authored, not default */
html.gamify h1,
html.gamify h2,
html.gamify h3 {
  letter-spacing: -0.015em;
  line-height: 1.1;
}

/* Section rhythm (breathing room) */
html.gamify section {
  padding-top: clamp(64px, 8vh, 120px);
  padding-bottom: clamp(64px, 8vh, 120px);
}

/* Cards feel intentional, not cramped */
html.gamify .grid-tile,
html.gamify .service-card,
html.gamify .work-tile {
  padding: 28px;
}

/* Paragraph readability */
html.gamify p {
  line-height: 1.65;
  max-width: 70ch;
}

/* Lists feel UI-aligned */
html.gamify ul,
html.gamify ol {
  padding-left: 1.2em;
}

html.gamify li {
  margin-bottom: 0.5em;
}

/* Small text = system HUD */
html.gamify .game-mode-indicator,
html.gamify .hero-game-hint,
html.gamify .footer-game-entry {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* ======================================================
   HERO — HARD CENTER LOCK (GAMING SAFE)
====================================================== */

html.gamify .hero,
html.gamify .hero-content,
html.gamify .hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Prevent width drift */
html.gamify .hero-content > * {
  margin-left: auto;
  margin-right: auto;
}

/* Title block stays centered as a unit */
html.gamify .hero h1,
html.gamify .hero h2,
html.gamify .hero p {
  text-align: center;
}

/* Button row centered as a group */
html.gamify .hero .cta-group,
html.gamify .hero .button-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
