:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #edf5f4;
  background: #092c34;
  font-synthesis: none;
  --accent: #c7eb89;
  --ink: #122f35;
  --muted: #b3c8c8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
#game {
  display: block;
  width: 100vw;
  height: 100vh;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ffffff35;
  border-radius: 8px;
  background: #143e46;
  color: #edf5f4;
  padding: 10px 15px;
}
button:hover {
  filter: brightness(1.15);
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #c7eb89;
  outline-offset: 3px;
}
a {
  color: #d5efab;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 82px;
  background: linear-gradient(#0a262fe8, #0a262f55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  gap: 15px;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.08em;
  font-size: 16px;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--ink);
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 16px;
  letter-spacing: 0;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.14em;
  margin-top: 6px;
  color: #c2d4d4;
}
.header-right {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
#validation {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  background: #e4c987;
  color: #332e20;
  text-align: center;
  font-size: 11px;
  padding: 7px 14px;
  letter-spacing: 0.02em;
}
#validation button {
  padding: 3px 10px;
  margin-left: 12px;
  background: transparent;
  border-color: #78673e;
  color: #332e20;
  font-size: 10px;
}
#mission-panel {
  position: fixed;
  left: 30px;
  top: 142px;
  width: 310px;
  background: #10343aed;
  border: 1px solid #bfddce28;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 40px #09212622;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.19em;
  font-weight: 800;
  color: var(--accent);
}
h1 {
  font-size: 27px;
  font-weight: 650;
  line-height: 1.14;
  margin: 15px 0;
}
p {
  line-height: 1.65;
  font-size: 14px;
  color: #c6d9d7;
}
#instruction {
  font-size: 13px;
}
#status {
  font-size: 12px;
  color: #e0efb5;
  line-height: 1.55;
  min-height: 40px;
  margin-top: 18px;
}
.meter {
  height: 3px;
  background: #ffffff20;
  margin: 20px 0 10px;
  border-radius: 4px;
  overflow: hidden;
}
.meter span {
  display: block;
  background: var(--accent);
  height: 100%;
  width: 0;
  transition: width 0.3s;
}
small,
#detail {
  font-size: 10px;
  color: #abc6c6;
  line-height: 1.5;
}
#steps {
  position: fixed;
  right: 25px;
  top: 149px;
  display: grid;
  gap: 8px;
}
#steps span {
  font-size: 11px;
  color: #d6e1da;
  background: #143a40d9;
  padding: 10px 13px;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
#steps b {
  font-weight: 500;
  min-width: 57px;
}
#steps .current {
  background: var(--accent);
  color: #173c35;
}
#steps .done {
  color: #a7c5b4;
}
#reticle {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #fff9;
  pointer-events: none;
}
#subtitle {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #0c252ded;
  max-width: 660px;
  width: max-content;
  max-width: min(660px, 90vw);
  padding: 13px 22px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  pointer-events: none;
}
#subtitle:empty {
  display: none;
}
#hint {
  position: fixed;
  bottom: 67px;
  left: 50%;
  transform: translateX(-50%);
  background: #12373cd9;
  border-radius: 6px;
  padding: 8px 15px;
  font-size: 10px;
  max-width: 90vw;
  text-align: center;
}
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55px;
  padding: 8px 25px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #0c2b32ed;
  font-size: 10px;
  color: #bdcecc;
}
footer span {
  flex: 1;
}
footer button {
  font-size: 11px;
  padding: 7px 12px;
}
kbd {
  font-family: inherit;
  color: white;
  padding: 2px 4px;
  background: #ffffff12;
  border: 1px solid #ffffff22;
  border-radius: 4px;
  margin-left: 8px;
}
#quake {
  position: fixed;
  left: 50%;
  top: 130px;
  transform: translateX(-50%);
  background: #95513ded;
  color: #fff1da;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
#quake strong {
  margin-left: 18px;
}
dialog {
  color: #edf5f4;
  border: 1px solid #8ab0a266;
  background: #10353d;
  border-radius: 20px;
  padding: 38px;
  width: min(610px, calc(100vw - 30px));
  max-height: 90vh;
  box-shadow: 0 20px 100px #001c27aa;
}
dialog::backdrop {
  background: #041d27bd;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font-size: clamp(25px, 3.4vw, 39px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin: 16px 0 22px;
}
dialog .lead {
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 0;
}
dialog p {
  font-size: 13px;
}
dialog small {
  display: block;
  margin-top: 15px;
}
.warning {
  font-size: 11px;
  line-height: 1.6;
  background: #e9d19214;
  border-left: 2px solid #dcc17b;
  padding: 12px 16px;
  color: #e9dcae;
  margin: 22px 0;
}
.intro-stats {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #ffffff18;
  margin: 22px 0;
  padding: 20px 0 0;
  font-size: 10px;
  color: #b6cccc;
}
.intro-stats b {
  display: block;
  font-size: 20px;
  color: #f1f6ed;
  margin-bottom: 6px;
}
.primary {
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  margin-top: 15px;
}
dialog label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: #dce9e5;
  font-size: 13px;
}
input {
  accent-color: #a5d875;
}
#answers {
  display: grid;
  gap: 8px;
}
#answers button {
  text-align: left;
  font-size: 13px;
}
#explanation {
  color: #e1ecb4;
}
#load-error {
  position: fixed;
  inset: 20%;
  padding: 30px;
  background: #782e28;
  color: white;
  z-index: 99;
}
.high-contrast #mission-panel,
.high-contrast footer,
.high-contrast #subtitle {
  background: #001a21;
}
.high-contrast p,
.high-contrast small {
  color: white;
}
#pause-dialog > button:not(.primary) {
  width: 100%;
  margin-top: 12px;
}
@media (max-width: 850px) {
  header {
    padding: 0 14px;
    height: 68px;
  }
  .brand small {
    max-width: 200px;
    font-size: 7px;
  }
  .brand {
    font-size: 13px;
  }
  .header-right {
    gap: 8px;
  }
  #validation {
    top: 68px;
    font-size: 9px;
  }
  #mission-panel {
    top: 126px;
    left: 14px;
    width: 250px;
    padding: 17px;
  }
  h1 {
    font-size: 23px;
  }
  #steps {
    right: 12px;
    gap: 5px;
  }
  #steps b {
    display: none;
  }
  footer span {
    display: none;
  }
  footer {
    justify-content: flex-end;
  }
  #subtitle {
    bottom: 108px;
  }
  dialog {
    padding: 27px;
  }
}
@media (max-height: 650px) {
  #mission-panel {
    padding: 14px;
    top: 123px;
  }
  h1 {
    font-size: 21px;
    margin: 10px 0;
  }
  #instruction {
    font-size: 11px;
  }
  #status {
    margin-top: 8px;
  }
  .meter {
    margin-top: 10px;
  }
  #steps {
    top: 126px;
    gap: 4px;
  }
  #steps span {
    padding: 7px 10px;
  }
  dialog {
    padding: 24px;
  }
  dialog h2 {
    font-size: 29px;
  }
  .warning {
    margin: 14px 0;
  }
  .intro-stats {
    margin: 14px 0;
  }
}
#teacher-dialog{max-width:680px}#mission-picker{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0;max-height:38vh;overflow:auto}#mission-picker button{text-align:left;font-size:12px}#teacher-dialog>button{margin:6px 4px 0 0;font-size:12px}#teacher-dialog .primary{width:100%;margin-top:14px}@media(max-width:560px){#mission-picker{grid-template-columns:1fr}}

/* V4.0.3: acesso simples à proteção para alunos do 5.º ano */
#protect-now {display:block;width:100%;margin:14px 0 10px;padding:12px 8px;background:#c7eb89;color:#122f35;font-size:13px;font-weight:800;border:2px solid #e6ffc1;}
#protect-now[hidden]{display:none}
#protect-now:disabled{background:#2b5854;color:#e8fff1;opacity:1;cursor:default}
#release-tag {color:#c7eb89;white-space:nowrap;font-size:12px;font-weight:800;}
@media(max-width:700px){#release-tag{font-size:9px}#protect-now{font-size:11px}}
