#app, #app *, #app *::before, #app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#app {
  position: relative;
  width: 100%;
  max-width: 940px;
  aspect-ratio: 940 / 560;
  margin: 0 auto;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.j7e-screen {
  position: absolute;
  inset: 0;
  display: none;
}

.j7e-screen.j7e-active {
  display: block;
}

.j7e-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

#app .j7e-btn-primary,
#app .j7e-btn-secondary {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0.62em 2.1em 0.68em;
  font-family: inherit;
  font-size: clamp(0.85rem, 1.9vw, 1.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-style: solid;
  border-width: 3px;
  border-radius: 999px;
  cursor: pointer;

  transition: translate 0.07s ease-out, box-shadow 0.07s ease-out, filter 0.15s ease-out;
}

#app .j7e-btn-primary {
  color: #4a2c00;
  border-color: #8a5200;
  background: linear-gradient(#ffe589, #ffb703 52%, #ef8f00);
  box-shadow: 0 5px 0 #a35f00, 0 9px 16px rgba(0, 0, 0, 0.35),
              inset 0 2px 0 rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

#app .j7e-btn-secondary {
  color: #0b3d61;
  border-color: #0a5480;
  background: linear-gradient(#ffffff, #d4ebff 52%, #a2d4fb);
  box-shadow: 0 5px 0 #0a5480, 0 9px 16px rgba(0, 0, 0, 0.3),
              inset 0 2px 0 rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

#app .j7e-btn-primary:hover,
#app .j7e-btn-secondary:hover {
  filter: brightness(1.07);
}

#app .j7e-btn-primary:active,
#app .j7e-btn-secondary:active {
  translate: 0 5px;
}

#app .j7e-btn-primary:active {
  box-shadow: 0 0 0 #a35f00, 0 3px 6px rgba(0, 0, 0, 0.3),
              inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

#app .j7e-btn-secondary:active {
  box-shadow: 0 0 0 #0a5480, 0 3px 6px rgba(0, 0, 0, 0.25),
              inset 0 2px 0 rgba(255, 255, 255, 0.85);
}

#app .j7e-btn-primary:focus-visible,
#app .j7e-btn-secondary:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

#screen-menu .j7e-btn-primary {
  position: absolute;
  bottom: 11%;
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
}

.j7e-hud {
  position: absolute;
  top: 8%;
  left: 0;
  right: 0;
  z-index: 1;
  color: #ffe066;
  font-weight: bold;
  font-size: clamp(0.7rem, 1.6vw, 1.1rem);
}

.j7e-hud-item {
  position: absolute;
  transform: translateX(-50%);
}

.j7e-pontos-pulsa {
  animation: j7e-pontos-pulso 0.35s ease-out;
}

@keyframes j7e-pontos-pulso {
  0%   { transform: translateX(-50%) scale(1); }
  40%  { transform: translateX(-50%) scale(1.35); }
  100% { transform: translateX(-50%) scale(1); }
}

.j7e-delta {
  position: absolute;
  font-weight: bold;
  font-size: clamp(0.9rem, 2.2vw, 1.5rem);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.j7e-delta-mais {
  color: #2f6fd0;
  animation: j7e-delta-sobe 1.1s ease-out forwards;
}

.j7e-delta-menos {
  color: #d92b2b;
  animation: j7e-delta-desce 1.1s ease-out forwards;
}

@keyframes j7e-delta-sobe {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  15%  { opacity: 1; transform: translate(-50%, -50%) translateY(-4px) scale(1.15); }
  60%  { opacity: 1; transform: translate(-50%, -50%) translateY(-16px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-34px) scale(1); }
}

@keyframes j7e-delta-desce {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  15%  { opacity: 1; transform: translate(-50%, -50%) translateY(4px) scale(1.15); }
  60%  { opacity: 1; transform: translate(-50%, -50%) translateY(16px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(34px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .j7e-pontos-pulsa,
  .j7e-delta-mais,
  .j7e-delta-menos {
    animation: none;
  }

  .j7e-delta-mais,
  .j7e-delta-menos {
    display: none;
  }
}

#hud-tempo {
  left: 34.5%;
}

#hud-pontos {
  left: 53.1%;
}

#hud-fase {
  left: 79.9%;
}

#app .j7e-btn-som {
  position: absolute;
  left: 92%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6.5%;
  aspect-ratio: 1;
  padding: 1.1%;
  display: grid;
  place-items: center;
  color: #4a2c00;
  border: 2px solid #8a5200;
  border-radius: 50%;
  background: linear-gradient(#ffe589, #ffb703 52%, #ef8f00);
  box-shadow: 0 3px 0 #a35f00, 0 5px 10px rgba(0, 0, 0, 0.3),
              inset 0 2px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: translate 0.07s ease-out, box-shadow 0.07s ease-out, filter 0.15s ease-out;
}

#app .j7e-btn-som:hover {
  filter: brightness(1.07);
}

#app .j7e-btn-som:active {
  translate: 0 3px;
  box-shadow: 0 0 0 #a35f00, 0 2px 4px rgba(0, 0, 0, 0.3),
              inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

#app .j7e-btn-som:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.j7e-btn-som svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
}

.j7e-btn-som .j7e-icone-som-mudo,
.j7e-btn-som.j7e-som-mudo .j7e-icone-som-ligado {
  display: none;
}

.j7e-btn-som.j7e-som-mudo .j7e-icone-som-mudo {
  display: block;
}

#app .j7e-btn-som.j7e-som-mudo {
  color: #4f4f4f;
  background: linear-gradient(#ececec, #c2c2c2 52%, #9d9d9d);
  border-color: #6f6f6f;
  box-shadow: 0 3px 0 #7a7a7a, 0 5px 10px rgba(0, 0, 0, 0.3),
              inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

#phase-image-wrap {
  position: absolute;
  top: 18%;
  left: 4%;
  right: 4%;
  bottom: 4%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#phase-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

#hotspot-layer {
  position: absolute;
  inset: 0;
  margin: auto;
  aspect-ratio: 912 / 411;
  max-width: 100%;
  max-height: 100%;
  cursor: crosshair;
}

.j7e-found-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 3px solid #2ecc71;
  border-radius: 50%;
  background: rgba(46, 204, 113, 0.25);
  pointer-events: none;
  animation: j7e-marcador-surge 0.6s ease-out;
}

@keyframes j7e-marcador-surge {
  0%   { transform: translate(-50%, -50%) scale(0.5); }
  40%  { transform: translate(-50%, -50%) scale(1.18); }
  60%  { transform: translate(-50%, -50%) scale(0.92); }
  78%  { transform: translate(-50%, -50%) scale(1.06); }
  90%  { transform: translate(-50%, -50%) scale(0.98); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .j7e-found-marker {
    animation: none;
  }
}

.j7e-miss-flash {
  animation: j7e-miss-flash-anim 0.25s ease-out;
}

@keyframes j7e-miss-flash-anim {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.6) saturate(0) sepia(1) hue-rotate(-50deg); }
  100% { filter: brightness(1); }
}

.j7e-results-panel {
  position: absolute;
  z-index: 1;
  top: 13%;
  left: 12%;
  right: 12%;
  bottom: 13%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3%;
  color: white;
  text-align: center;

  overflow-y: auto;
}

.j7e-results-panel h2 {
  font-size: clamp(1.2rem, 3.4vw, 2.1rem);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

#app .j7e-placar {
  border-collapse: collapse;
  font-size: clamp(0.7rem, 1.7vw, 1.05rem);
  font-weight: bold;
}

#app .j7e-placar th,
#app .j7e-placar td {
  padding: 0.22em 0.55em;
  text-align: left;
  white-space: nowrap;
}

.j7e-placar-detalhe {
  opacity: 0.75;
  font-weight: normal;
}

#app .j7e-placar-valor {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#app .j7e-placar tfoot th,
#app .j7e-placar tfoot td {
  padding-top: 0.5em;
  border-top: 2px solid rgba(255, 255, 255, 0.55);
  font-size: 1.35em;
  color: #ffe066;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.j7e-results-acoes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55em;
}

@media (max-width: 600px) {

  #app .j7e-btn-primary,
  #app .j7e-btn-secondary {
    padding-left: 1.5em;
    padding-right: 1.5em;
    border-width: 2px;
  }

  .j7e-results-panel {
    top: 6%;
    bottom: 6%;
    gap: 1.2%;
  }

  .j7e-results-panel h2 {
    font-size: 0.9rem;
  }

  #app .j7e-placar {
    font-size: 0.62rem;
  }

  #app .j7e-placar th,
  #app .j7e-placar td {
    padding: 0.08em 0.4em;
  }

  #app .j7e-placar tfoot th,
  #app .j7e-placar tfoot td {
    padding-top: 0.25em;
  }

  .j7e-results-acoes {
    gap: 0.35em;
  }
}
