:root {
  color-scheme: dark;
  --cream: #fff7c7;
  --aqua: #6ef2d3;
  --ink: #090b35;
  --pixel: 'Press Start 2P', monospace;
  --mono: 'JetBrains Mono', monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #06062b;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  color: inherit;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #fff69b;
  outline-offset: 5px;
}
button {
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
[hidden] {
  display: none !important;
}
.screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}
.title-screen {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #07076a url('assets/title.webp') center center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.title-screen:after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 80%, #02032699);
}
.catalog-link {
  position: absolute;
  left: 3vw;
  top: 28px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  z-index: 2;
}
.catalog-link span {
  opacity: 0.55;
  font-size: 12px;
}
.edition {
  position: absolute;
  right: 3vw;
  top: 28px;
  color: #a8b9e6;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.title-content {
  width: 650px;
  text-align: center;
  z-index: 1;
  margin-top: -3vh;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--aqua);
  font-weight: 800;
}
.title-content h1 {
  font-family: Impact, 'Arial Black', sans-serif;
  font-style: italic;
  transform: rotate(-7deg);
  margin: 0 auto 24px;
  position: relative;
  width: 540px;
  line-height: 0.81;
  filter: drop-shadow(7px 9px 0 #030b23);
  letter-spacing: -5px;
}
.super {
  display: block;
  font-size: 42px;
  letter-spacing: 5px;
  color: #b7dcff;
  -webkit-text-stroke: 2px #091434;
  text-shadow: 2px 3px 0 white;
  margin-left: -150px;
  margin-bottom: 4px;
}
.logo-line {
  display: block;
  font-size: 112px;
  color: #ffbc26;
  -webkit-text-stroke: 3px #181820;
  paint-order: stroke fill;
  text-shadow:
    3px 5px 0 #f56a23,
    6px 8px 0 #fffbea,
    -4px -4px 0 #fffbea,
    9px 10px 0 #0b1734;
}
.logo-line.second {
  font-size: 108px;
}
.logo-bomb {
  display: inline-block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 28%,
    #e5faff 0 7%,
    #739bda 9% 15%,
    #2b60a6 24%,
    #142c73 49%,
    #07123b 75%
  );
  border: 4px solid #081535;
  box-shadow: 0 0 0 4px #ffce28;
  position: relative;
  margin: 0 4px;
}
.logo-bomb:before {
  content: '';
  width: 12px;
  height: 21px;
  background: #dec377;
  position: absolute;
  top: -19px;
  left: 38px;
  transform: rotate(24deg);
}
.spark {
  font-size: 60px;
  color: #fff58a;
  position: absolute;
  right: 45px;
  bottom: 15px;
  -webkit-text-stroke: 1px #ffa52b;
}
.subtitle {
  font-size: 11px;
  letter-spacing: 0.17em;
  color: #b5c6fa;
  margin: 0 0 28px;
}
.main-options {
  width: 330px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.menu-choice {
  background: #070d57c9;
  border: 1px solid #6786d47a;
  box-shadow: 0 4px 0 #030a2b;
  padding: 16px 8px;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.menu-choice span {
  display: block;
  font-family: var(--pixel);
  font-size: 17px;
  color: #8affda;
  text-shadow: 2px 2px #123c62;
}
.menu-choice small {
  display: block;
  font-size: 12px;
  color: #c4c9e7;
  margin-top: 11px;
}
.menu-choice:hover,
.menu-choice:focus-visible {
  border-color: #96ffe1;
  background: #123475;
  transform: translateY(-2px);
}
.quiet {
  background: transparent;
  color: #d5def7;
  padding: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.main-options > .quiet {
  font-size: 12px;
  margin-top: 3px;
}
.title-footer {
  position: absolute;
  bottom: 18px;
  left: 3vw;
  right: 3vw;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #c4c9ec;
}
.title-footer b {
  font-size: 11px;
  color: #7de9d6;
}
.title-footer i {
  margin: 0 12px;
}
.select-screen {
  padding: 24px max(5vw, 24px);
  background-color: #e4c47d;
  background-image:
    linear-gradient(90deg, #9b71351c 2px, transparent 2px),
    linear-gradient(#9b71351c 2px, transparent 2px);
  background-size: 48px 48px;
  color: #333051;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.select-top {
  position: absolute;
  left: 4vw;
  right: 4vw;
  top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
}
.select-top button {
  color: #363254;
}
.selection-kicker {
  font-size: 12px;
  letter-spacing: 0.2em;
  margin: 16px 0;
}
.select-screen h2 {
  font: clamp(16px, 2.2vw, 27px)/1.4 var(--pixel);
  color: #202c75;
  text-shadow: 2px 2px #fff5c5;
  margin: 0 0 28px;
  text-align: center;
}
.roster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(760px, 80vw);
  padding: 22px;
  gap: 16px;
  border: 10px ridge #41a847;
  background: #a4823880;
  box-shadow:
    0 5px 0 #63592d,
    0 0 0 4px #ede0a8;
}
.character {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f5dfa04d;
  border: 2px solid #b59b51;
  padding: 12px 8px;
  color: #292740;
  min-height: 125px;
}
.character canvas {
  width: 96px;
  height: 80px;
  image-rendering: pixelated;
}
.character strong {
  font-size: 14px;
  white-space: nowrap;
}
.character[aria-pressed='true'] {
  border-color: #fff9c9;
  background: #fff1a5;
  box-shadow: 0 0 0 3px #213d7b;
}
.character[aria-pressed='true']:before {
  content: '1P';
  position: absolute;
  left: 7px;
  top: 8px;
  font: 12px var(--pixel);
  color: #20488e;
}
.select-bottom {
  width: min(760px, 80vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  gap: 20px;
}
.select-bottom p {
  font-size: 14px;
  line-height: 1.7;
}
.select-bottom p span {
  font-size: 12px;
  color: #615832;
}
.primary {
  background: #ffcf49;
  color: #20254a;
  border: 3px solid #fff4a9;
  box-shadow: 0 5px 0 #ac6c29;
  font: 16px var(--pixel);
  padding: 19px 26px;
}
.primary:hover {
  background: #ffe780;
}
.select-bottom .primary {
  background: #2e7653;
  color: #fff7bd;
  box-shadow: 0 5px 0 #244335;
}
.play-screen {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 40%, #254d56, #102832);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
  overflow: hidden;
}
.hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-shrink: 0;
  height: 55px;
  background: #0e2031;
  border-bottom: 3px solid #52776a;
  font: 14px var(--pixel);
}
#timer {
  color: #ffe192;
  font-size: 22px;
}
#score {
  color: #7ff3c2;
}
.hud button {
  background: #213b50;
  padding: 10px 12px;
  font: 12px var(--mono);
  border: 1px solid #4b6f77;
}
.play-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px;
}
#arena {
  width: 480px;
  height: 416px;
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 22px #0005;
}
.game-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 20px;
  background: #0e2031;
  font-size: 12px;
  flex-shrink: 0;
  color: #dcdfce;
}
.touch-direction,
.touch-bomb {
  display: none;
}
.play-mode {
  overflow: hidden;
}
.play-mode .gamepad-settings {
  display: none;
}
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: #050b2dc9;
  display: grid;
  place-items: center;
  z-index: 5;
  padding: 20px;
}
.dialog-card {
  width: min(530px, 90vw);
  max-height: 90dvh;
  overflow: auto;
  background: #111a53;
  border: 3px solid #b7d1ff;
  padding: 35px;
  text-align: center;
  box-shadow: 8px 8px 0 #04072e;
}
.dialog-card h2 {
  font: 24px/1.5 var(--pixel);
  color: #ffe074;
  margin: 22px 0;
}
.dialog-card p:not(.eyebrow) {
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-line;
  color: #d4dcf6;
}
.dialog-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 25px;
}
.dialog-buttons > button:not(.primary) {
  padding: 12px;
  background: #223369;
  border: 1px solid #4f6695;
}
.dialog-buttons > .quiet {
  background: transparent !important;
  border: 0 !important;
}
#orientation {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #090e39;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 25px;
}
#orientation h2 {
  font: 21px/1.6 var(--pixel);
  color: #ffe385;
}
#orientation p {
  line-height: 1.8;
}
#orientation a {
  display: inline-block;
  margin-top: 20px;
}
.rotate-icon {
  display: block;
  font-size: 90px;
  color: var(--aqua);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (pointer: coarse) {
  .touch-direction {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 3px;
    flex-shrink: 0;
  }
  .touch-direction button,
  .touch-bomb button {
    background: #263e59;
    border: 2px solid #7593a3;
    color: #e8f7ed;
    touch-action: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  .touch-direction button {
    font-size: 22px;
    border-radius: 8px;
  }
  .touch-direction button:first-child {
    grid-column: 2;
  }
  .touch-direction button:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  .touch-direction span {
    grid-row: 2;
    grid-column: 2;
  }
  .touch-direction button:nth-child(4) {
    grid-row: 2;
    grid-column: 3;
  }
  .touch-direction button:last-child {
    grid-row: 3;
    grid-column: 2;
  }
  .touch-bomb {
    display: block;
    width: 112px;
    text-align: center;
    flex-shrink: 0;
  }
  .touch-bomb button {
    border-radius: 50%;
    width: 88px;
    height: 88px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #ad356c;
    border-color: #f596bf;
    box-shadow: 0 5px 0 #632343;
  }
  .bomb-icon {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #b6c7ee, #202940 45%);
    border: 2px solid #172333;
    position: relative;
  }
  .bomb-icon:before {
    content: '';
    position: absolute;
    top: -6px;
    left: 14px;
    background: #ffdf6f;
    width: 4px;
    height: 7px;
  }
  .game-footer {
    font-size: 11px;
  }
  .hud {
    height: 44px;
    gap: 12px;
  }
  .hud button {
    padding: 8px;
  }
  .hud > span {
    font-size: 12px;
  }
  #timer {
    font-size: 18px;
  }
}
@media (max-height: 650px) and (orientation: landscape) {
  .title-content {
    margin: 10px 0 0;
  }
  .title-content h1 {
    width: 380px;
    margin-bottom: 12px;
  }
  .super {
    font-size: 26px;
    margin-left: -90px;
  }
  .logo-line {
    font-size: 77px;
  }
  .logo-line.second {
    font-size: 74px;
  }
  .logo-bomb {
    width: 53px;
    height: 53px;
  }
  .logo-bomb:before {
    height: 14px;
    top: -13px;
    left: 24px;
    width: 8px;
  }
  .spark {
    font-size: 40px;
    right: 35px;
  }
  .title-content .eyebrow {
    display: none;
  }
  .subtitle {
    font-size: 9px;
    margin-bottom: 16px;
  }
  .main-options {
    width: 290px;
    gap: 8px;
  }
  .menu-choice {
    padding: 11px 6px;
  }
  .menu-choice span {
    font-size: 14px;
  }
  .menu-choice small {
    margin-top: 7px;
    font-size: 11px;
  }
  .catalog-link,
  .edition {
    top: 14px;
    font-size: 11px;
  }
  .catalog-link span {
    display: none;
  }
  .title-footer {
    bottom: 8px;
    font-size: 10px;
  }
  .title-footer b {
    font-size: 9px;
  }
  .select-screen {
    padding: 42px 22px 12px;
  }
  .selection-kicker {
    display: none;
  }
  .select-screen h2 {
    font-size: 17px;
    margin-bottom: 15px;
  }
  .roster {
    width: min(680px, 86vw);
    gap: 9px;
    padding: 12px;
    border-width: 6px;
  }
  .character {
    min-height: 80px;
    padding: 4px;
  }
  .character canvas {
    width: 72px;
    height: 60px;
  }
  .character strong {
    font-size: 11px;
  }
  .select-bottom {
    margin-top: 12px;
    width: min(680px, 86vw);
  }
  .select-bottom p {
    margin: 0;
    font-size: 12px;
  }
  .select-bottom p span {
    font-size: 10px;
  }
  .primary {
    padding: 14px 22px;
    font-size: 14px;
  }
  .dialog-card {
    padding: 18px 28px;
  }
  .dialog-card h2 {
    margin: 12px 0;
    font-size: 20px;
  }
  .dialog-card p:not(.eyebrow) {
    font-size: 14px;
  }
  .dialog-buttons {
    margin-top: 15px;
    gap: 10px;
  }
  .game-footer {
    padding: 5px 12px;
  }
  .game-footer #powers {
    font-size: 10px;
  }
  .hud {
    height: 43px;
    gap: 12px;
  }
}
@media (max-height: 360px) and (orientation: landscape) {
  .select-screen {
    padding: 38px 22px 8px;
  }
  .select-screen .character {
    gap: 3px;
    padding: 2px;
  }
  .select-screen .select-bottom .primary {
    padding: 10px 20px;
  }
  .title-content h1 {
    margin-bottom: 9px;
  }
  .super {
    font-size: 20px;
  }
  .logo-line {
    font-size: 60px;
  }
  .logo-line.second {
    font-size: 58px;
  }
  .logo-bomb {
    height: 42px;
    width: 42px;
  }
  .subtitle {
    display: none;
  }
  .menu-choice {
    padding: 9px;
  }
  .menu-choice small {
    display: none;
  }
  .main-options {
    gap: 8px;
  }
  .title-footer > span {
    display: none;
  }
  .title-footer {
    justify-content: flex-end;
  }
  .select-screen h2 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  .roster {
    padding: 8px;
    gap: 6px;
  }
  .character {
    min-height: 65px;
  }
  .character canvas {
    width: 60px;
    height: 50px;
  }
  .character strong {
    font-size: 10px;
  }
  .select-bottom {
    margin-top: 7px;
  }
  .select-bottom p span {
    display: none;
  }
  .touch-direction {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
  }
  .touch-bomb {
    width: 88px;
  }
  .touch-bomb button {
    width: 76px;
    height: 76px;
  }
  .hud {
    gap: 8px;
  }
  .hud > span {
    font-size: 10px;
  }
  .hud button {
    font-size: 11px;
    padding: 7px;
  }
  .game-footer {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.title-footer #sound {
  margin-right: 140px;
}
.catalog-link,
.edition {
  background: #050b4da6;
  padding: 9px 12px;
  border-radius: 3px;
}

.select-mode .gamepad-settings {
  display: none;
}
.hud {
  background: linear-gradient(#294578, #152a54);
  border-bottom-color: #85a6ca;
}
.sr-only {
  top: 0;
  left: 0;
}
.select-screen {
  background-image: url('assets/puzzle.svg');
  background-size: 128px 128px;
}

/* Ilustrações HD: densidade maior no backing canvas, filtragem própria desta família. */
#arena,
.character canvas {
  image-rendering: auto;
}
.play-screen {
  background: #142f28;
}
.hud {
  background: linear-gradient(#087a19, #00590e);
  border: 2px solid #e7bb52;
  box-shadow:
    inset 0 0 0 2px #143515,
    0 3px 0 #152615;
}
.hud #score {
  background: #090f09;
  border: 2px solid #d2aa4f;
  padding: 3px 9px;
  color: #fff9e4;
}
.hud .lives {
  color: #ffeff0;
  text-shadow: 2px 2px #852829;
  white-space: nowrap;
}
.hud button {
  background: #123d21;
  border-color: #81a251;
  color: #fff8d5;
}
#arena {
  border-color: #c3b76b;
  box-shadow: 0 8px 28px #06181070;
}
.game-footer {
  background: #112c20;
  color: #f8f3d0;
}
.roster {
  border-color: #278729;
  box-shadow:
    inset 0 0 0 2px #a8dc68,
    0 3px 0 #817024;
}
@media (max-width: 740px) {
  .hud {
    gap: 7px;
  }
  .hud #score {
    padding: 2px 4px;
  }
  .hud .lives {
    font-size: 10px;
  }
}
