:root {
  --arcade-wall: #0c1130;
  --arcade-board: #141339;
  --arcade-border: #57428b;
  --arcade-gold: #ffdf59;
}

body[data-page="programacao"] main, body[data-page="ferramentas"] main {
  background: radial-gradient(ellipse at 64% 0, #26204b 0, transparent 55%), var(--arcade-wall);
}
.navlinks a, .footer .filter { font-size: .875rem; }
.arcade-title { padding: clamp(28px, 5vw, 60px) 0 22px; }
.arcade-title h1 { font-size: clamp(2.8rem, 7vw, 5.5rem); margin: 5px 0 9px; }
.arcade-title p { margin: 0; color: var(--muted); }
.arcade-map { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: start; gap: clamp(14px, 4vw, 44px); }

.map-art {
  position: relative;
  aspect-ratio: 1;
  isolation: isolate;
  background: #101035;
  box-shadow: 0 0 0 2px #854dc1, 0 7px 0 #030719, 0 16px 45px #020517b0;
}
.map-art img { display: block; width: 100%; height: auto; }
.map-hotspot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: var(--h);
  border: 2px solid transparent;
  border-radius: 5px;
  transition: background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.map-hotspot:hover, .map-hotspot:focus-visible {
  border-color: var(--cyan);
  background: #61f3ff25;
  box-shadow: 0 0 18px #47e9ffd0, inset 0 0 24px #47e9ff60;
  outline: none;
}
.map-hotspot.is-completed { border-color: #91edc5; }
.map-hotspot.is-completed::after {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 0 6px;
  background: #0e4137;
  color: #c2ffdf;
  font-weight: 800;
}
.level-menu {
  border: 1px solid var(--arcade-border);
  box-shadow: 4px 5px 0 #070819;
  padding: clamp(12px, 3vw, 21px);
  background: linear-gradient(145deg, #24204c, #11142e);
}
.level-menu-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  margin-bottom: 12px;
}
.level-menu-top h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); margin: 0; }
.level-menu-top span { color: var(--muted); font-size: .875rem; text-align: right; }
.level-menu-top progress { grid-column: 1 / -1; width: 100%; height: .55rem; margin-top: 6px; accent-color: var(--arcade-gold); }
.level-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.level-item {
  display: grid;
  grid-template-columns: 2.75rem 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--arcade-board);
  border: 1px solid #504477;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.level-item:hover, .level-item:focus-visible { transform: translateX(3px); border-color: var(--arcade-gold); background: #302153; }
.level-item.feature { border-color: #a46b26; }
.level-item.is-completed { border-color: #64c9a5; }
.level-icon { width: 100%; aspect-ratio: 1; border: 1px solid #665990; }
.level-name { display: grid; gap: 2px; min-width: 0; line-height: 1.14; }
.level-name small, .level-number, .level-clear { font-size: .875rem; }
.level-name small { color: #c6c7e9; }
.level-name strong { font-size: 1.1rem; }
.level-number { color: var(--arcade-gold); font: 700 .875rem 'Space Mono', monospace; }
.level-clear { color: #91edc5; grid-column: 2 / -1; }
.level-clear[hidden] { display: none; }
.arcade-foot { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 26px 0 40px; }
.arcade-foot p { max-width: 68ch; margin: 0; color: var(--muted); }

.arcade-stage { padding-top: clamp(20px, 4vw, 38px); }
.stage-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.stage-top .quest-checkpoints a { min-width: 42px; min-height: 42px; }
.stage-screen {
  position: relative;
  isolation: isolate;
  min-height: clamp(330px, 41vw, 465px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: end;
  overflow: hidden;
  background: radial-gradient(ellipse at right, #2c1d56, #101331 65%);
  border: 2px solid var(--stage-color, var(--arcade-gold));
  box-shadow: 0 0 0 3px #231938, 0 6px 0 #050619;
  animation: stage-reveal .43s ease-out both;
}
.stage-screen::after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(0deg, #06082024 0 1px, transparent 1px 5px);
}
.stage-room { position: absolute; inset: 0 0 0 auto; width: min(55%, 495px); }
.scene-1 { background: #16112f url('assets/trilha/espelho.webp') 84% center / cover no-repeat; }
.scene-2, .scene-3, .scene-4, .scene-5, .scene-6, .scene-7 {
  background-image: url('assets/trilha/cenarios.webp');
  background-size: 300% 200%;
  background-position: var(--scene-x) var(--scene-y);
  background-repeat: no-repeat;
}
.scene-2 { --scene-x: 0%; --scene-y: 0%; }
.scene-3 { --scene-x: 50%; --scene-y: 0%; }
.scene-4 { --scene-x: 100%; --scene-y: 0%; }
.scene-5 { --scene-x: 0%; --scene-y: 100%; }
.scene-6 { --scene-x: 50%; --scene-y: 100%; }
.scene-7 { --scene-x: 100%; --scene-y: 100%; }
.mirror-screen .stage-room { width: 100%; background: #171132; }
.mirror-screen .stage-room img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 76% 45%; }
.stage-room::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #101331, transparent 27%), linear-gradient(0deg, #0f1026a0, transparent 26%);
}
.mirror-screen .stage-room::after {
  background: linear-gradient(90deg, #10102be6, #10102b40 51%, transparent 72%), linear-gradient(0deg, #101026aa, transparent 34%);
}
.stage-title { z-index: 2; padding: clamp(20px, 5vw, 44px); }
.stage-title h1 { margin: 8px 0 10px; font-size: clamp(3.6rem, 9vw, 7.2rem); text-shadow: 4px 4px #101334; }
.stage-title p { margin: 10px 0 16px; font-size: clamp(1rem, 3vw, 1.25rem); }
.stage-date { display: inline-block; font: 700 .875rem 'Space Mono', monospace; color: var(--arcade-gold); border: 1px solid #8c652d; padding: 4px 7px; background: #16132f; }
.stage-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stage-actions .btn, .arcade-foot .btn { min-height: 44px; margin: 0; }
.stage-actions .btn::after, .arcade-foot .btn::after, .stage-pagination .btn::after { display: none; }
.mirror-shimmer {
  display: none;
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 78% 43%, #c15dffa6 0, #8967ff3d 23%, transparent 53%);
  opacity: 0;
}
.mirror-screen .mirror-shimmer { display: block; transition: opacity .35s ease; }
.mirror-awake .mirror-shimmer { opacity: 1; animation: mirror-glow 2.7s ease-in-out infinite alternate; }
.mirror-awake .mirror-trigger { border-color: #eaa7ff; color: #f7d6ff; }
.stage-resources { margin-top: 28px; scroll-margin-top: 92px; }
.stage-pagination { align-items: flex-start; }
.stage-pagination .quest-feedback { margin: 5px 0 0; color: var(--muted); }
.toolkit-grid { padding-bottom: 45px; }
.toolkit-card { padding: 0; overflow: hidden; }
.toolkit-card:target, .toolkit-card.is-selected { border-color: var(--arcade-gold); }
.toolkit-card figure img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: center; }
.toolkit-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 16px; }
.toolkit-search { display: grid; gap: 6px; max-width: 380px; margin-top: 17px; }
.toolkit-search input { min-height: 44px; padding: 7px 12px; color: var(--ink); background: var(--arcade-board); border: 1px solid var(--arcade-border); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes stage-reveal { from { opacity: .45; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mirror-glow { from { opacity: .54; } to { opacity: 1; } }
@media (max-width: 800px) {
  .arcade-map { grid-template-columns: minmax(0, 1fr); }
  .map-art { max-width: 560px; width: 100%; margin-inline: auto; }
}
@media (max-width: 560px) {
  .arcade-stage .quest-checkpoints { width: 100%; justify-content: space-between; gap: 4px; }
  .stage-top .quest-checkpoints a { min-width: 38px; width: 38px; }
  .stage-screen { display: block; min-height: unset; }
  .stage-room, .mirror-screen .stage-room { position: relative; inset: auto; width: 100%; aspect-ratio: 1; }
  .mirror-screen .stage-room { aspect-ratio: 3 / 2; }
  .stage-room::after, .mirror-screen .stage-room::after { background: linear-gradient(0deg, #101331, transparent 23%); }
  .stage-title { position: relative; margin-top: -30px; }
  .stage-title h1 { font-size: clamp(3rem, 13vw, 5.35rem); }
  .stage-resources { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-screen, .mirror-awake .mirror-shimmer { animation: none; }
  .map-hotspot, .level-item, .mirror-screen .mirror-shimmer { transition: none; }
}
.no-motion .stage-screen, .no-motion .mirror-awake .mirror-shimmer { animation: none; }
.no-motion .map-hotspot, .no-motion .level-item, .no-motion .mirror-shimmer { transition: none; }
@media (max-width: 350px) {
  .stage-top .quest-checkpoints a { min-width: 34px; width: 34px; }
}

.map-art .map-character {
  position: absolute;
  width: clamp(30px, 9%, 65px);
  height: auto;
  transform: translate(-50%, -92%);
  z-index: 3;
  image-rendering: pixelated;
  filter: drop-shadow(2px 3px 0 #07071d);
  pointer-events: none;
}
.map-hotspot { z-index: 2; }
.trail-finished {
  margin-block: 26px 0;
  padding: 16px 22px;
  background: #194135;
  border: 1px solid #79d7a7;
}
.trail-finished[hidden] { display: none; }
.trail-finished h2 { margin: 0; font-size: 2rem; }
.trail-finished p { margin: 4px 0 0; }
.level-dialog {
  width: min(800px, calc(100% - 32px));
  max-height: calc(100dvh - 36px);
  border: 2px solid var(--arcade-gold);
  padding: 0;
  background: #141339;
  color: var(--ink);
  box-shadow: 0 0 0 4px #4e3486, 0 12px 50px #08081ce8;
}
.level-dialog::backdrop { background: #060719d6; }
.level-dialog-top { display: flex; justify-content: flex-end; padding: 8px 12px; }
.level-dialog-top .filter { min-height: 44px; }
.level-preview { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: 0 18px 18px; }
.level-preview-art { aspect-ratio: 1; border: 1px solid #8165aa; }
.level-preview-copy h2 { margin: 6px 0; font-size: clamp(2.45rem, 8vw, 4.85rem); line-height: 1; }
.level-preview-copy p { color: var(--muted); }
.level-preview-copy .btn { margin: 0; }
.preview-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: #101632; padding: 15px 18px; }
.preview-links article { padding: 11px; min-width: 0; border: 1px solid #594884; }
.preview-links h3 { font-size: 1.3rem; margin: 0 0 4px; }
.preview-links p { margin: 3px 0 8px; color: var(--muted); }
.registration { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .76fr); align-items: center; gap: clamp(20px, 5vw, 70px); padding-block: 48px; }
.registration h1 { font-size: clamp(3rem, 8vw, 6rem); }
.registration-form { display: grid; gap: 12px; max-width: 490px; margin-top: 20px; }
.registration-form > input:not([hidden]) { min-height: 50px; padding: 10px 13px; color: var(--ink); background: #171839; border: 1px solid #78659e; }
.registration-form label[for] span { color: var(--muted); font-weight: 400; }
.registration-check { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 9px; font-size: .9375rem; color: var(--muted); }
.registration-check input { width: 17px; height: 17px; margin: 4px 0 0; accent-color: var(--arcade-gold); }
.registration-check a { text-decoration: underline; color: var(--cyan); }
.registration-form .btn { justify-self: start; }
.registration-status { min-height: 1.6em; margin: 0; }
.registration-art { display: block; width: 100%; max-width: 500px; height: auto; }
.campaign-card .offer-access { color: var(--arcade-gold); font-weight: 800; margin-bottom: 7px; }
.offer-choice ul { padding-left: 19px; margin: 0 0 16px; }
.offer-details { margin: 0 0 12px; }
.course-topics { padding: 12px 0 36px; }
.coupon-page { padding-bottom: 52px; }
.coupon-card { max-width: 660px; }
.coupon-card > strong { font: 800 clamp(2.3rem, 7vw, 4rem) Barlow Condensed, sans-serif; color: var(--arcade-gold); }
.coupon-card .coupon-disclosure { margin: 10px 0 0; font-size: .875rem; }
.navlinks a { flex-shrink: 0; }
@media (max-width: 690px) {
  .registration { grid-template-columns: minmax(0, 1fr); padding-block: 30px; }
  .registration-art { max-width: 320px; }
}
@media (max-width: 510px) {
  .level-preview { gap: 10px; padding-inline: 12px; }
  .preview-links { grid-template-columns: 1fr; padding-inline: 12px; }
  .level-preview-copy .btn { min-height: 44px; padding-inline: 10px; }
  .navlinks { flex-wrap: wrap; }
}
.toolkit-screens { display: grid; gap: 18px; }
.live-tool { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; }
.live-tool figure { margin: 0; padding: 14px; background: #080c20; }
.live-tool figure a { display: block; }
.live-tool figure a:focus-visible { outline-offset: 3px; }
.live-tool figure img, .live-tool figure video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #080c20; }
.live-tool figcaption { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.live-tool .toolkit-copy { padding: clamp(15px, 4vw, 35px); }
.toolkit-screens > [hidden] { display: none; }
@media (max-width: 620px) { .live-tool { grid-template-columns: minmax(0, 1fr); } }
