:root {
  --teal: #06b49f;
  --teal-deep: #087f7d;
  --yellow: #f8b916;
  --white: #ffffff;
  --ink: #071414;
  --glass: rgba(0, 12, 15, 0.82);
  --line: rgba(4, 189, 170, 0.76);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--white);
  background: #020807;
  font-family: Bahnschrift, "Trebuchet MS", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.58;
}

[hidden] {
  display: none !important;
}

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

.app-shell,
.screen {
  width: 100%;
  min-height: 100svh;
}

.screen {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.image-button,
.touch-start-button {
  appearance: none;
  border: 0;
  color: transparent;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  text-indent: -9999px;
  transition: filter 160ms ease, transform 160ms ease;
}

.image-button:not(:disabled):hover,
.touch-start-button:hover {
  filter: brightness(1.08) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.3));
  transform: translateY(-2px) scale(1.015);
}

.image-button:focus-visible,
.difficulty-option input:focus-visible + span,
.difficulty-option.controller-focus span,
button.controller-focus:not(.touch-start-button) {
  outline: 4px solid var(--white);
  outline-offset: 5px;
  filter: drop-shadow(0 0 16px rgba(248, 185, 22, 0.95));
}

/* Intro and difficulty selection */

.intro-screen {
  background: #07100d url("assetsOficiais/bg-woman.png") center / cover no-repeat;
}

.intro-screen::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 8, 7, 0.26), transparent 32%, transparent 72%, rgba(0, 8, 7, 0.12)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.24));
}

.intro-stage {
  position: absolute;
  inset: 0;
}

.intro-summit-logo {
  position: absolute;
top: 25%;
    left: 50%;
    width: min(50vw, 1050px);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.34));
  animation: brand-in 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.touch-start-button {
  position: absolute;
  bottom: 7%;
  left: 50%;
  width: min(34vw, 570px);
  padding: 0;
  transform: translateX(-50%);
  animation: prompt-in 650ms 180ms ease both, prompt-pulse 1.8s 900ms ease-in-out infinite;
}

.touch-start-button:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.015);
}

.touch-start-button:focus-visible,
.touch-start-button.controller-focus {
  outline: none;
  filter: brightness(1.08) drop-shadow(0 0 16px rgba(248, 185, 22, 0.95));
}

.touch-start-button img {
  display: block;
  width: 100%;
  height: auto;
}

.intro-menu {
  position: absolute;
  bottom: 7%;
  left: 50%;
  width: min(59vw, 980px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(150px, 12vw, 220px);
  gap: clamp(24px, 3vw, 58px);
  align-items: end;
  transform: translateX(-50%);
  animation: prompt-in 400ms ease both;
}

.difficulty-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: clamp(10px, 1.2vw, 20px);
}

.difficulty-selector > span {
  grid-column: 1 / -1;
  color: var(--white);
  font-size: clamp(1rem, 1.2vw, 1.35rem);
  font-style: italic;
  font-weight: 900;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
}

.difficulty-option {
  position: relative;
}

.difficulty-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.difficulty-option span {
  display: grid;
  min-height: clamp(42px, 3.4vw, 58px);
  place-items: center;
  padding: 0 18px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  color: var(--white);
  background: var(--teal);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  font-size: clamp(0.9rem, 1.05vw, 1.15rem);
  font-style: italic;
  font-weight: 900;
  transition: background 140ms ease, transform 140ms ease;
}

.difficulty-option input:checked + span {
  color: var(--white);
  background: var(--yellow);
  transform: scale(1.045);
}

.difficulty-option:hover span {
  transform: translateY(-2px);
}

.play-button {
  width: 100%;
  aspect-ratio: 536 / 198;
  background-image: url("assetsOficiais/btn_jogar.png");
}

/* Gameplay */

.gameplay-screen {
  --progress-top: clamp(34px, 4.4vw, 72px);
  background: #06100e url("assetsOficiais/bg_band.png") center / cover no-repeat;
}

.gameplay-topbar {
  position: absolute;
  top: clamp(24px, 3vw, 58px);
  left: clamp(28px, 4.4vw, 84px);
  right: clamp(28px, 4.4vw, 84px);
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.gameplay-summit-logo {
  width: clamp(155px, 14vw, 270px);
  height: auto;
}

.vale-logo {
  width: clamp(92px, 8.5vw, 165px);
  height: auto;
}

.top-progress {
  position: absolute;
  top: var(--progress-top);
  left: 50%;
  z-index: 5;
  width: min(28vw, 520px);
  min-width: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.progress-track {
  height: clamp(14px, 1.25vw, 22px);
  overflow: hidden;
  padding: 4px;
  border: 2px solid var(--teal-deep);
  border-radius: 999px;
  background: rgba(0, 35, 37, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #bce1d8);
}

.top-progress strong {
  color: var(--white);
  font-size: clamp(0.72rem, 0.9vw, 1rem);
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.gameplay-layout,
.stage-panel {
  position: absolute;
  inset: 0;
}

.gameplay-layout {
  z-index: 2;
  pointer-events: none;
}

.stage-panel {
  z-index: 0;
  overflow: hidden;
  pointer-events: auto;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  touch-action: none;
}

.combo-message {
  position: absolute;
  top: calc(var(--progress-top) + clamp(40px, 3.4vw, 58px));
  left: 50%;
  z-index: 3;
  width: clamp(220px, 16vw, 300px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.28));
  transform: translate(-50%, -10px) scale(0.96);
  transition:
    visibility 0s linear 280ms,
    opacity 280ms ease,
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.combo-message.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0s;
}

.combo-message img {
  display: block;
  width: 100%;
  height: auto;
}

.combo-message img.is-changing {
  animation: combo-message-in 360ms cubic-bezier(0.18, 0.9, 0.28, 1.18) both;
}

.info-panel {
  position: absolute;
  top: 29%;
  right: clamp(26px, 4.2vw, 80px);
  z-index: 4;
  width: clamp(210px, 13.2vw, 285px);
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 0.7vw, 12px);
  pointer-events: auto;
}

.hud-card,
.hud-details {
  border: 2px solid var(--line);
  border-radius: 5px;
  background: var(--glass);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.hud-card {
  min-height: clamp(64px, 5.2vw, 94px);
  padding: clamp(8px, 0.8vw, 14px);
  display: grid;
  grid-template-columns: clamp(42px, 3.2vw, 58px) minmax(0, 1fr);
  gap: clamp(8px, 0.8vw, 14px);
  align-items: center;
}

.hud-card img {
  display: block;
  width: 100%;
  height: auto;
}

.hud-card span,
.hud-mini span {
  color: var(--teal);
  font-size: clamp(0.66rem, 0.72vw, 0.83rem);
  font-style: italic;
  font-weight: 900;
}

.hud-card strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--yellow);
  font-size: clamp(1.55rem, 2vw, 2.5rem);
  font-style: italic;
  font-weight: 950;
  line-height: 0.92;
  text-overflow: ellipsis;
}

.hud-details {
  overflow: hidden;
}

.hud-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hud-mini div {
  padding: clamp(8px, 0.75vw, 13px);
}

.hud-mini div + div {
  border-left: 1px solid rgba(4, 189, 170, 0.42);
}

.hud-mini strong {
  display: block;
  margin-top: 3px;
  color: var(--white);
  font-size: clamp(0.78rem, 0.88vw, 1rem);
}

.status-stack {
  padding: 0 clamp(8px, 0.75vw, 13px) clamp(8px, 0.75vw, 13px);
  display: grid;
  gap: 3px;
}

.status-stack span,
.status-stack strong {
  overflow: hidden;
  font-size: clamp(0.58rem, 0.63vw, 0.72rem);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-stack span {
  color: var(--white);
}

.status-stack strong {
  color: var(--teal);
  text-transform: uppercase;
}

.side-controls {
  display: grid;
  gap: clamp(7px, 0.7vw, 12px);
}

.pause-button {
  width: 100%;
  aspect-ratio: 785 / 144;
  background-image: url("assetsOficiais/btn_pause%5D.png");
}

/* Countdown and pause/result overlays */

.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: rgba(0, 17, 15, 0.62);
  backdrop-filter: blur(4px);
}

.countdown-overlay span {
  color: var(--white);
  font-size: clamp(1rem, 1.8vw, 2rem);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

.countdown-overlay strong {
  color: var(--yellow);
  font-size: clamp(7rem, 18vw, 17rem);
  font-style: italic;
  line-height: 0.82;
  text-shadow: 0 0 32px rgba(248, 185, 22, 0.55);
}

.countdown-overlay strong.is-ready {
  font-size: clamp(3rem, 8vw, 7.5rem);
}

.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  overflow: hidden;
  background: #07100d url("assetsOficiais/bg-woman.png") center / cover no-repeat;
}

.stage-overlay::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgba(0, 7, 6, 0.34), transparent 62%, rgba(0, 0, 0, 0.1));
}

.rest-topline {
  position: absolute;
  top: clamp(28px, 4vw, 70px);
  left: clamp(30px, 5vw, 96px);
  right: clamp(30px, 5vw, 96px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.rest-copy {
  position: absolute;
  top: 25%;
  left: clamp(34px, 5vw, 98px);
  width: min(42vw, 720px);
}

.rest-copy h2 {
  margin: 0;
  color: var(--yellow);
  font-size: clamp(5rem, 10.5vw, 12rem);
  font-style: italic;
  font-weight: 950;
  line-height: 0.78;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.rest-copy p {
  margin: clamp(14px, 1.5vw, 26px) 0 clamp(14px, 1.8vw, 30px);
  color: var(--white);
  font-size: clamp(1rem, 1.4vw, 1.7rem);
  font-style: italic;
  font-weight: 900;
}

.rest-actions {
  width: clamp(260px, 24vw, 460px);
  display: grid;
  gap: clamp(10px, 1vw, 18px);
}

.continue-button,
.reset-button {
  width: 100%;
  aspect-ratio: 785 / 144;
}

.continue-button {
  background-image: url("assetsOficiais/btn_continuar.png");
}

.reset-button {
  background-image: url("assetsOficiais/btn_reiniciar.png");
}

.result-copy {
  display: none;
}

.stage-overlay[data-mode="confirm-exit"] .rest-copy h2 {
  font-size: clamp(4.5rem, 8vw, 9rem);
}

.stage-overlay[data-mode="confirm-exit"] .rest-actions {
  width: min(56vw, 840px);
}

.stage-overlay[data-mode="confirm-exit"] .continue-button {
  width: clamp(340px, 25vw, 480px);
  background-image: url("assetsOficiais/btn_continuar.png");
}

.stage-overlay[data-mode="confirm-exit"] .reset-button {
  width: clamp(600px, 43vw, 825px);
  aspect-ratio: 1465 / 144;
  background-image: url("assetsOficiais/btn_voltarAoMenu.png");
}

.stage-overlay[data-mode="end"] {
  background-image: url("assetsOficiais/bg_drum.png");
}

.stage-overlay[data-mode="end"]::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 62%);
}

.stage-overlay[data-mode="end"] .rest-topline,
.stage-overlay[data-mode="end"] .rest-copy {
  display: none;
}

.stage-overlay[data-mode="end"] .result-copy {
  position: absolute;
  inset: 0;
  display: block;
}

.result-summit-logo {
  position: absolute;
  top: clamp(32px, 5vw, 90px);
  left: clamp(38px, 6vw, 116px);
  width: clamp(180px, 22vw, 420px);
  height: auto;
}

.result-card {
  position: absolute;
  top: 31%;
  left: clamp(80px, 12vw, 230px);
  width: clamp(360px, 31vw, 590px);
  aspect-ratio: 1602 / 1521;
}

.result-card-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.result-content {
  position: absolute;
  inset: 7% 9% 8% 13%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--white);
}

.result-content > span {
  font-size: clamp(1rem, 1.35vw, 1.6rem);
  font-style: italic;
  font-weight: 900;
}

.result-content > strong {
  margin-top: 1%;
  font-size: clamp(3.5rem, 5.6vw, 6.7rem);
  font-style: italic;
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.result-content > p {
  margin: 4% 0 1%;
  font-size: clamp(0.68rem, 0.82vw, 1rem);
  font-style: italic;
  font-weight: 900;
}

.result-stars {
  width: 96%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5%;
}

.result-stars img {
  display: block;
  width: 100%;
  height: auto;
}

.result-stats {
  width: 66%;
  margin: 4% 0 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12%;
}

.result-stats div,
.result-stats dt,
.result-stats dd {
  margin: 0;
}

.result-stats dt {
  font-size: clamp(0.72rem, 0.88vw, 1.05rem);
  font-weight: 900;
}

.result-stats dd {
  margin-top: 2px;
  font-size: clamp(1rem, 1.2vw, 1.45rem);
}

.replay-button {
  width: min(86%, 360px);
  aspect-ratio: 814 / 164;
  background-image: url("assetsOficiais/btn_jogarnovamente.png");
}

.result-phrase {
  position: absolute;
  right: clamp(48px, 8vw, 150px);
  bottom: clamp(38px, 7vw, 130px);
  width: clamp(280px, 33vw, 630px);
  height: auto;
  filter: drop-shadow(0 7px 16px rgba(0, 0, 0, 0.42));
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes prompt-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes prompt-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(248, 185, 22, 0));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(248, 185, 22, 0.5));
  }
}

@keyframes combo-message-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .gameplay-screen {
    --progress-top: 92px;
  }

  .intro-summit-logo {
    top: 22%;
    width: min(76vw, 840px);
  }

  .touch-start-button {
    width: min(52vw, 520px);
  }

  .intro-menu {
    width: min(78vw, 800px);
  }

  .gameplay-topbar {
    left: 24px;
    right: 24px;
  }

  .top-progress {
    top: var(--progress-top);
    width: min(54vw, 470px);
  }

  .info-panel {
    right: 16px;
    width: 210px;
  }

  .combo-message {
    width: clamp(210px, 30vw, 280px);
  }
}

@media (max-width: 700px) {
  .gameplay-screen {
    --progress-top: 105px;
  }

  body {
    overflow-y: auto;
  }

  .intro-screen {
    background-position: 55% center;
  }

  .intro-summit-logo {
    top: 21%;
    width: 88vw;
  }

  .touch-start-button {
    top: 69%;
    width: 78vw;
  }

  .intro-menu {
    top: 66%;
    width: 88vw;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .difficulty-selector {
    gap: 8px;
  }

  .difficulty-option span {
    min-height: 42px;
    padding: 0 8px;
  }

  .play-button {
    justify-self: end;
    width: 170px;
  }

  .gameplay-summit-logo {
    width: 145px;
  }

  .gameplay-topbar .vale-logo {
    width: 85px;
  }

  .top-progress {
    top: var(--progress-top);
    width: calc(100vw - 28px);
    min-width: 0;
  }

  .info-panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hud-card {
    min-height: 66px;
    padding: 7px;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 5px;
  }

  .hud-card strong {
    font-size: 1.1rem;
  }

  .hud-details {
    display: none;
  }

  .combo-message {
    width: min(52vw, 220px);
  }

  .side-controls {
    grid-column: 1 / -1;
  }

  .pause-button,
  .side-controls .reset-button {
    justify-self: end;
    width: 180px;
  }

  .rest-topline {
    top: 20px;
    left: 20px;
    right: 20px;
  }

  .rest-topline .vale-logo {
    width: 90px;
  }

  .rest-copy {
    top: 32%;
    left: 22px;
    width: calc(100vw - 44px);
  }

  .rest-copy h2 {
    font-size: clamp(4.2rem, 18vw, 7rem);
  }

  .rest-actions {
    width: min(82vw, 340px);
  }

  .stage-overlay[data-mode="confirm-exit"] .rest-actions {
    width: calc(100vw - 44px);
  }

  .stage-overlay[data-mode="confirm-exit"] .continue-button,
  .stage-overlay[data-mode="confirm-exit"] .reset-button {
    width: 100%;
  }

  .result-summit-logo {
    top: 24px;
    left: 24px;
    width: 190px;
  }

  .result-card {
    top: 25%;
    left: 50%;
    width: min(88vw, 430px);
    transform: translateX(-50%);
  }

  .result-phrase {
    right: 22px;
    bottom: 24px;
    width: min(62vw, 370px);
  }
}

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