/* Locaweb Cloud Rush — estilos da página, HUD e telas (menu, ranking, fim de jogo). */

:root {
  color-scheme: dark;
  --red: #F00843;
  --navy: #213D54;
  --muted: #9fb0c0;
}
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  min-height: 100%;
  background: #0a1118;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Ubuntu, sans-serif;
}
body {
  background: radial-gradient(ellipse at 60% 10%, #1d3550 0%, #0a1118 62%);
  overflow-x: hidden;
}
button, input {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible, input:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.shell {
  max-width: 1180px;
  margin: auto;
  padding: 14px 16px 22px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img {
  height: 38px;
  max-width: 62vw;
  display: block;
}
.brand .small {
  border-left: 1px solid #ffffff30;
  padding-left: 14px;
  margin: 0;
}
.small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-top: 3px;
}
.utility {
  background: #16232f;
  color: #fff;
  border: 1px solid #33506a;
  border-radius: 12px;
  padding: 9px 13px;
  font-weight: 800;
}
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 340px;
  overflow: hidden;
  border: 2px solid #2b4760;
  border-radius: 20px;
  background: #0d1620;
  box-shadow: 0 18px 60px #000a, 0 0 0 1px #F0084355;
  isolation: isolate;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hud {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.hudbox {
  background: #0b1620cc;
  border: 1px solid #ffffff26;
  border-radius: 12px;
  padding: 6px 11px;
  min-width: 88px;
  backdrop-filter: blur(6px);
}
.hudbox small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1px;
}
.hudbox strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.hudright {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.lives {
  font-size: 22px;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px #000;
}
.powers {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.chip {
  display: flex;
  white-space: nowrap;
  align-items: center;
  gap: 6px;
  background: #0b1620dd;
  border: 1px solid #F0084388;
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  font-weight: 900;
}
.chip i {
  display: block;
  width: 34px;
  height: 4px;
  border-radius: 3px;
  background: #ffffff22;
  overflow: hidden;
}
.chip i b {
  display: block;
  height: 100%;
  background: var(--red);
}
.pausebtn {
  pointer-events: auto;
  background: #0b1620cc;
  border: 1px solid #ffffff33;
  color: #fff;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 15px;
  font-weight: 900;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(125deg, #08111aee, #14202dde);
  overflow-y: auto;
}
.screen[hidden], .hud[hidden], .touch[hidden], .pause-label[hidden] {
  display: none!important;
}
.panel {
  width: min(540px, 100%);
  max-height: 100%;
  overflow: auto;
  text-align: center;
  padding: 16px 22px;
  border: 1px solid #2f4d68;
  border-top: 4px solid var(--red);
  border-radius: 22px;
  background: linear-gradient(160deg, #172736, #0d1620);
  box-shadow: 0 13px 0 #050a0f, 0 24px 65px #0009;
}
.panel .logo {
  height: 40px;
  max-width: 100%;
  margin: 2px auto 6px;
  display: block;
}
.panel h1.title {
  margin: 6px 0 4px;
}
.panel .logo.big {
  height: auto;
  width: min(230px, 72%);
  margin: 0 auto 4px;
}
.eyebrow {
  font-size: 11px;
  color: #ff7d9b;
  letter-spacing: 3px;
  font-weight: 900;
}
.panel h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
  margin: 4px 0 6px;
  letter-spacing: -2px;
}
.panel h1 b {
  color: var(--red);
}
.panel h2 {
  font-size: clamp(22px, 3.4vw, 32px);
  margin: 4px 0 6px;
}
.panel p {
  color: #c3d0dc;
  line-height: 1.45;
  margin: 6px 0 8px;
  font-size: 14px;
}
.heroes {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  height: 92px;
}
.heroes img {
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 5px #0006);
}
.heroes img.sm {
  height: 44px;
  margin-bottom: 6px;
}
.field {
  text-align: left;
  margin: 8px 0 4px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 900;
  color: #d5dee6;
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.field input {
  width: 100%;
  background: #08111a;
  border: 1px solid #3c5a75;
  border-radius: 12px;
  padding: 11px 13px;
  color: #fff;
  font-weight: 700;
}
.field input::placeholder {
  color: #6b7f90;
}
.error {
  color: #ff9eb4;
  font-size: 12px;
  min-height: 18px;
  text-align: left;
}
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 11px 16px;
  font-weight: 900;
  letter-spacing: .4px;
  color: #fff;
  background: #24394c;
  margin: 6px 0;
  box-shadow: 0 4px 0 #0c1720;
  transition: transform .12s;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0c1720;
}
.primary {
  background: linear-gradient(#ff2b62, #d6003a);
  box-shadow: 0 4px 0 #7a0021;
}
.btn.subtle {
  background: transparent;
  border: 1px solid #3c5a75;
  box-shadow: none;
}
.howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
  font-size: 11px;
  color: #c3d0dc;
}
.howto div {
  background: #0b1620;
  border: 1px solid #24394c;
  border-radius: 10px;
  padding: 7px 4px;
}
.howto b {
  display: block;
  color: #fff;
  font-size: 12px;
}
.hint {
  font-size: 11.5px;
  color: #8ea2b3;
  margin: 12px 0 0;
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.rank-table th {
  color: #93a7b8;
  font-size: 11px;
}
.rank-table td, .rank-table th {
  padding: 8px 5px;
  border-bottom: 1px solid #ffffff1a;
}
.rank-table tr.mine {
  background: #F0084333;
}
.rank-wrap {
  max-height: 245px;
  overflow: auto;
}
.score-big {
  font-size: 50px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stats span {
  background: #0b1620;
  border: 1px solid #24394c;
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 13px;
}
.pause-label {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background: #08111ab8;
  text-align: center;
  font-weight: 900;
  font-size: 32px;
  pointer-events: none;
}
.pause-label small {
  font-size: 13px;
  color: #c3d0dc;
}
.touch {
  display: none;
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  z-index: 3;
  justify-content: space-between;
  pointer-events: none;
}
.touch button {
  pointer-events: auto;
  border: 2px solid #ffffff44;
  background: #0b1620c8;
  border-radius: 18px;
  color: white;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 900;
  user-select: none;
  -webkit-user-select: none;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8ea2b3;
  font-size: 12px;
  padding: 12px 3px;
  flex-wrap: wrap;
}
.foot em {
  color: var(--red);
  font-style: normal;
}
.foot b {
  color: #fff;
}
.confetti {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}
.confetti i {
  position: absolute;
  top: -30px;
  width: 9px;
  height: 18px;
  animation: fall 2.6s ease-in forwards;
  transform: rotate(20deg);
}
@keyframes fall {
  to {
    top: 115%;
    transform: translateX(100px) rotate(900deg);
    opacity: 0;
  }
}
.heroes.over-hero {
  height: 72px;
}
.over-name {
  font-weight: 800;
  color: #d5dee6;
}
.stats.over-stats {
  margin-bottom: 8px;
}

/* ======== telas pequenas ======== */
@media(max-width:680px) {
  .shell {
    padding: 10px 8px;
  }
  .brand {
    gap: 10px;
  }
  .brand img {
    height: 30px;
  }
  .brand .small {
    display: none;
  }
  .utility {
    font-size: 12px;
    white-space: nowrap;
  }
  .stage {
    aspect-ratio: 1.25;
    min-height: 0;
    border-radius: 14px;
  }
  .hud {
    left: 7px;
    right: 7px;
    top: 6px;
    gap: 5px;
  }
  .hudbox {
    padding: 4px 7px;
    min-width: 58px;
    border-radius: 8px;
  }
  .hudbox strong {
    font-size: 14px;
  }
  .hudbox small {
    font-size: 8px;
  }
  .hudbox.opt {
    display: none;
  }
  .lives {
    font-size: 15px;
  }
  .screen {
    padding: 8px;
  }
  .panel {
    padding: 12px 14px;
    border-radius: 15px;
  }
  .panel h1 {
    font-size: 30px;
  }
  .panel p {
    font-size: 12px;
    margin: 5px 0 8px;
  }
  .heroes {
    height: 80px;
  }
  .heroes img.sm {
    height: 36px;
  }
  .field {
    margin: 8px 0;
  }
  .field input {
    padding: 10px;
  }
  .btn {
    padding: 9px;
    margin: 6px 0;
    font-size: 13px;
  }
  .howto {
    font-size: 10px;
  }
  .touch {
    display: flex;
  }
  .touch button {
    padding: 10px 16px;
    font-size: 13px;
  }
  .rank-wrap {
    max-height: 180px;
  }
  .score-big {
    font-size: 40px;
  }
  .foot {
    font-size: 10px;
  }
  .utility {
    padding: 7px;
  }
}
@media(hover:none) {
  .touch {
    display: flex;
  }
}
@media(max-height:650px) and (min-width:681px) {
  .stage {
    max-height: 74vh;
    width: auto;
    margin: auto;
    aspect-ratio: 16/9;
  }
  .panel {
    padding: 14px;
  }
  .heroes {
    height: 84px;
  }
}

/* ======== celular / tablet: jogo ocupa a tela inteira ======== */
.tools {
  display: flex;
  gap: 8px;
}
.mobonly, .hint.tch {
  display: none;
}
.hudrow {
  display: flex;
  gap: 8px;
  align-items: center;
}
.stage {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
@media (pointer:coarse) {
  .hint.kb {
    display: none;
  }
  .hint.tch {
    display: block;
  }
}
@media (max-width:820px), (max-height:540px), (pointer:coarse) and (max-width:1100px) {
  html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
  }
  body {
    position: fixed;
    inset: 0;
  }
  .shell {
    height: 100vh;
    height: 100dvh;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: calc(env(safe-area-inset-top) + 6px) calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 8px);
  }
  .topbar {
    margin: 0;
    flex: 0 0 auto;
  }
  .brand img {
    height: 32px;
  }
  .brand .small {
    display: none;
  }
  .utility {
    padding: 7px 11px;
    font-size: 13px;
  }
  .stage {
    flex: 1 1 auto;
    aspect-ratio: auto!important;
    min-height: 0;
    max-height: none!important;
    width: 100%!important;
    border-radius: 14px;
    border-width: 1px;
  }
  .foot {
    display: none;
  }
  .touch {
    display: flex;
    bottom: calc(10px + env(safe-area-inset-bottom)*0);
    left: 10px;
    right: 10px;
  }
  .touch button {
    padding: 16px 24px;
    font-size: 16px;
    border-radius: 20px;
    min-width: 128px;
    background: #0b1620b0;
  }
  .field input {
    font-size: 16px;
  }
  .panel {
    padding: 14px 16px;
  }
}

/* celular em pé */
@media (orientation:portrait) and (max-width:820px) {
  .touch {
    bottom: 14px;
  }
  .touch button {
    padding: 20px 22px;
    min-width: 140px;
    font-size: 17px;
  }
}

/* celular deitado: sem cabeçalho, painéis em 2 colunas */
@media (orientation:landscape) and (max-height:540px) {
  .topbar {
    display: none;
  }
  .shell {
    gap: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .stage {
    border-radius: 0;
    border: 0;
  }
  .mobonly {
    display: inline-block;
  }
  .mobonly[hidden] {
    display: none;
  }
  .hud {
    top: 8px;
    left: 12px;
    right: 12px;
  }
  .hudbox {
    padding: 4px 9px;
  }
  .hudbox strong {
    font-size: 16px;
  }
  .pausebtn {
    width: 34px;
    height: 34px;
  }
  .touch {
    bottom: 10px;
  }
  .touch button {
    padding: 12px 20px;
    min-width: 118px;
    font-size: 14px;
  }
  .screen {
    padding: 10px;
  }
  #menu .panel {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "logo form" "hero form" "text form" "how form";
    column-gap: 20px;
    align-items: center;
    padding: 12px 18px;
  }
  .a-logo {
    grid-area: logo;
  }
  .a-hero {
    grid-area: hero;
  }
  .a-text {
    grid-area: text;
  }
  .a-how {
    grid-area: how;
  }
  .a-form {
    grid-area: form;
    align-self: center;
  }
  #menu .heroes {
    height: 70px;
  }
  #menu .panel p {
    font-size: 12px;
    margin: 4px 0;
  }
  #menu .logo.big {
    width: min(190px, 90%);
  }
  .howto {
    margin: 6px 0 0;
  }
  .ovp {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    align-items: center;
    padding: 10px 18px;
  }
  .ovp .heroes {
    height: 54px!important;
  }
  .ovp h2 {
    font-size: 22px;
    margin: 2px 0;
  }
  .ovp .score-big {
    font-size: 38px;
  }
  .ovp .logo {
    height: 30px;
  }
  .rank-wrap {
    max-height: calc(100vh - 170px);
  }
  .panel h2 {
    font-size: 22px;
    margin: 2px 0 6px;
  }
}
@media (orientation:portrait) and (max-height:620px) {
  #menu .a-text {
    display: none;
  }
  #menu .heroes {
    height: 64px;
  }
  .howto {
    margin-top: 6px;
  }
  .howto div {
    padding: 5px 3px;
  }
  .ovp .heroes {
    height: 52px!important;
  }
  .ovp #joke {
    display: none;
  }
  .score-big {
    font-size: 40px;
  }
  .btn {
    margin: 5px 0;
    padding: 10px;
  }
}
@media (max-width:360px) {
  .hudbox {
    min-width: 52px;
    padding: 4px 6px;
  }
  .hudbox strong {
    font-size: 13px;
  }
  .lives {
    font-size: 13px;
    letter-spacing: 0;
  }
  .touch button {
    min-width: 118px;
    padding: 16px 14px;
  }
  .heroes {
    height: 70px;
  }
}
