/* Shared game-shell standardization for PT/EN modes */
#entry-screen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(5, 8, 18, 0.42) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  padding: 24px 16px !important;
}

#entry-screen .entry-panel {
  width: min(100%, 760px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  align-items: center !important;
  text-align: center !important;
  padding: 20px 18px !important;
}

#entry-screen .entry-panel h2 {
  margin: 0 !important;
  text-align: center !important;
}

#entry-screen .entry-panel p {
  max-width: 560px !important;
  margin: 0 !important;
}

#entry-screen .entry-panel .mode-button-group {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 14px !important;
}

#entry-screen .entry-panel .btn {
  min-width: 150px !important;
}

#entry-screen .entry-ads {
  width: min(100%, 760px) !important;
  gap: 12px !important;
}

#entry-screen .ad-banner-middle,
#entry-screen .ad-mobile-banner {
  border-radius: 14px !important;
}

#back-button,
.back-button {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 10000 !important;
  min-width: 124px !important;
  padding: 12px 24px !important;
  border-radius: 10px !important;
}

#back-button:hover,
.back-button:hover {
  transform: scale(1.04) !important;
}

#particle-canvas,
#experienceCanvas,
#dynamic-bg,
#canvas,
#entry-particle-canvas {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 5 !important;
}

#entry-particle-canvas {
  z-index: 9998 !important;
  pointer-events: none !important;
}

#lumnix-magic-bg {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

body.entry-active #back-button,
body.entry-active .back-button {
  display: block !important;
}

/* Entry particles rendered inside the welcome overlay */
#entry-screen.lumnix-entry-particles-ready {
  isolation: isolate !important;
  overflow: hidden !important;
}

#entry-screen #lumnix-entry-particle-layer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

#entry-screen #lumnix-entry-particle-layer[hidden] {
  display: none !important;
}

#entry-screen > :not(#lumnix-entry-particle-layer),
#entry-screen .entry-panel {
  z-index: 1 !important;
}

/* Shared magic background layer. */
:root {
  --lumnix-magic-bg: #0d0614;
  --lumnix-magic-bg-center: #1b0c30;
}

#lumnix-magic-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#lumnix-cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
  z-index: 2;
}

.lumnix-magic-layer {
  position: relative;
  z-index: 3;
}

/* Shared keyboard and motion accessibility safeguards. */
:where(
  button,
  [href],
  input,
  select,
  textarea,
  [role="button"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px !important;
}

.lumnix-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.lumnix-scan-active,
.scan-active,
.scan-focus {
  outline: 4px solid #fff !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 7px rgba(0, 212, 255, 0.72) !important;
  transform: scale(1.04);
}

[data-lumnix-dwell] { position: relative; }
[data-lumnix-dwell]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 4px solid transparent;
  border-top-color: #fff;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: rotate(0deg);
}
[data-lumnix-dwell].lumnix-dwell-active::after {
  opacity: 1;
  animation: lumnix-dwell-progress var(--lumnix-dwell-time, 1500ms) linear forwards;
}
@keyframes lumnix-dwell-progress { to { transform: rotate(360deg); } }

.learning-access-controls {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(92vw, 720px);
  transform: translateX(-50%);
}

.learning-access-controls button,
.learning-access-settings button {
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  color: #fff;
  background: rgba(15, 23, 42, 0.86);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.learning-access-settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

body.entry-active .learning-access-controls { display: none; }

@media (pointer: coarse) {
  :where(button, [role="button"], input[type="button"], input[type="submit"]) {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .lumnix-scan-active,
  .scan-active,
  .scan-focus { transform: none; }
}



.lumnix-home-instruction {
  width: min(100%, 620px);
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(15, 23, 42, 0.48);
  font: 600 0.92rem/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

@media (max-width: 520px) {
  .lumnix-home-instruction {
    font-size: 0.84rem;
    line-height: 1.35;
    padding: 8px 10px;
  }
}
/* The first screen stays intentionally simple: title, visual context, START/COMEÇAR. */
#entry-screen [data-lumnix-entry-access-control],
#entry-screen .learning-access-settings,
#entry-screen [id*="access-controls"],
#entry-screen [id*="access-settings"] {
  display: none !important;
}

[data-lumnix-adaptive-target] {
  touch-action: manipulation;
}

.lumnix-input-hint {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1400;
  width: min(92vw, 560px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  font: 700 0.92rem/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  pointer-events: none;
}

.lumnix-input-hint[hidden],
body.entry-active .lumnix-input-hint {
  display: none !important;
}

.lumnix-dwell-ready {
  outline: 4px solid #fff !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.58) !important;
}

button[data-lumnix-adaptive-target],
[role="button"][data-lumnix-adaptive-target],
a[href][data-lumnix-adaptive-target] {
  min-width: 44px;
  min-height: 44px;
}

.lumnix-reduced-motion #lumnix-cursor-glow {
  transition: none !important;
}

/* Keep game-home ads visually centered inside the entry container. */
#entry-screen .entry-ads {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

#entry-screen .entry-ads > *,
#entry-screen .ad-desktop-only,
#entry-screen .ad-mobile-only,
#entry-screen .ad-banner-middle,
#entry-screen .ad-mobile-banner {
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

#entry-screen .adsterra-unit,
#entry-screen ins.adsterra-unit,
#entry-screen .adsterra-unit iframe {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Universal accessibility hardening for all game experiences. */
:root {
  --lumnix-focus-ring: #ffffff;
  --lumnix-focus-halo: rgba(0, 212, 255, 0.78);
  --lumnix-target-min: 44px;
}

#entry-screen,
#entry-screen .entry-panel,
#entry-screen .mode-button-group,
#entry-screen .entry-ads {
  max-width: 100vw !important;
}

:where(button, [role="button"], a[href], input[type="button"], input[type="submit"], .cell, .choice, .option, .card) {
  min-width: var(--lumnix-target-min) !important;
  min-height: var(--lumnix-target-min) !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.22) !important;
}

:where(canvas, #experienceCanvas, #experience-canvas, #canvas) {
  touch-action: none !important;
  outline-offset: 5px !important;
}

:where(button, [role="button"], a[href], input, select, textarea, canvas, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 4px solid var(--lumnix-focus-ring) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 8px var(--lumnix-focus-halo) !important;
}

@media (forced-colors: active) {
  :where(button, [role="button"], a[href], input, select, textarea, canvas, .cell) {
    forced-color-adjust: auto !important;
    border: 2px solid ButtonText !important;
  }

  :where(button, [role="button"], a[href], input, select, textarea, canvas, .cell):focus-visible {
    outline: 3px solid Highlight !important;
    box-shadow: none !important;
  }
}

@media (prefers-contrast: more) {
  :where(button, [role="button"], a[href], input[type="button"], input[type="submit"], .cell, .choice, .option) {
    border-width: 2px !important;
    text-decoration-thickness: 0.14em !important;
  }

  #entry-screen .entry-panel {
    background-color: rgba(0, 0, 0, 0.72) !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  #entry-screen,
  #entry-screen .entry-panel,
  #entry-screen .ad-desktop-only,
  #entry-screen .ad-mobile-only {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(5, 8, 18, 0.92) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto !important;
  }

  #entry-screen *,
  .lumnix-magic-layer *,
  canvas {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
