.scr {
  position: absolute;
  inset: 0;
  z-index: var(--layer-screen);
  display: flex;
  flex-direction: column;
}
#s-home,
#s-chat,
#s-games {
  padding-top: var(--hud-top);
}
#topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}
.topbar {
  position: relative;
  z-index: var(--layer-hud);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: calc(10px + env(safe-area-inset-top, 0px)) 12px 0;
  padding: 5px 0;
}
.topbar > .rowb {
  display: contents;
}
.topbar .chipc,
.topbar .iconbtn,
.topbar .chestc.on {
  flex: none;
  box-sizing: border-box;
  height: 40px;
  animation: none;
}
.topbar .iconbtn {
  width: 40px;
}
.me {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar > .me {
  flex: none;
  display: grid;
  grid-template-columns: 40px auto;
  grid-template-rows: 18px 18px;
  gap: 4px 0;
  height: 40px;
}
.me .h {
  position: relative;
  grid-row: 1 / 3;
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 3px;
  cursor: pointer;
  background: conic-gradient(
    var(--gold) calc(var(--hud-level-progress, 0) * 1%),
    rgba(255, 255, 255, 0.22) 0
  );
}
.me .h[data-rank-tier] {
  box-shadow: 0 0 0 2px var(--rank-color);
}
.me .h .rank-badge {
  right: auto;
  left: -5px;
  bottom: -5px;
  width: 17px;
  height: 17px;
}
.hud-avatar-picture {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #2a1b3a;
}
.hud-avatar-picture svg {
  display: block;
  width: 100%;
  height: 100%;
}
.me .streak,
.me .lv {
  position: relative;
  justify-self: start;
  margin-left: -10px;
  box-sizing: border-box;
  height: 18px;
  font-size: 12px;
  line-height: 16px;
  padding: 0 7px 0 4px;
  background: #1c1226;
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}
.me .streak {
  cursor: pointer;
}
.topbar .me .h::after {
  content: "";
  position: absolute;
  inset: -6px 0 -6px -12px;
}
.topbar .me .streak::after {
  content: "";
  position: absolute;
  inset: -7px -3px -29px 10px;
}
.topbar .me .lv {
  pointer-events: none;
}
.me .h:active,
.me .streak:active {
  transform: scale(0.92);
  filter: brightness(1.3);
}
.me .streak svg {
  width: 12px;
  height: 12px;
}
.me .lv {
  padding-left: 7px;
}
.streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 900;
  font-size: 13px;
  color: #ff8a3d;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 99px;
  padding: 3px 8px 3px 5px;
}
.streak svg {
  width: 15px;
  height: 15px;
}
.lv {
  flex: none;
  font-weight: 900;
  font-size: 12px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 99px;
  padding: 3px 8px;
  white-space: nowrap;
}
.chipc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(245, 180, 0, 0.35);
  border-radius: 99px;
  padding: 6px 10px 6px 6px;
  font-weight: 900;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.45);
}
.chipc svg {
  width: 20px;
  height: 20px;
}
.chipc > svg {
  color: var(--gold);
}
.chipc .plus {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}
.iconbtn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
}
/* área de toque maior que o desenho do botão */
.iconbtn::after,
.close::after {
  content: "";
  position: absolute;
  inset: -7px;
}
.close::after {
  inset: -8px;
}
.iconbtn svg {
  width: 20px;
  height: 20px;
}
.dash {
  position: relative;
  z-index: var(--layer-hud);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  margin: 18px 12px 0;
}
#meters {
  display: contents;
}
.meter {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
  width: 68px;
}
.meter .lb {
  display: flex;
  justify-content: center;
  font-weight: 900;
  line-height: 16px;
}
.meter .lb > svg,
#nIc {
  position: absolute;
  top: 13px;
  left: 50%;
  z-index: 1;
  width: 20px;
  height: 20px;
  transform: translateX(-50%);
  color: #ffffff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}
#nIc svg {
  width: 20px;
  height: 20px;
}
.meter .lb .nm {
  display: none;
}
.meter .lb b {
  max-width: 78px;
  font-size: 12px;
  line-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(20, 12, 26, 0.88);
  border-radius: 10px;
  padding: 1px 7px;
}
.meter .lb b.bad {
  color: #ff8a96;
}
.bar {
  height: 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 7px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 9px;
  transition: width 0.4s;
}
.meter .bar {
  position: relative;
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(20, 12, 26, 0.6);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}
.meter .bar i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--meter-level, 0) * 1%);
  border-radius: 0;
  background: hsl(calc(var(--meter-level, 0) * 1.2) 85% 44%);
  transition: height 0.4s;
}
.stage {
  position: relative;
  flex: 1 1 0;
  min-height: 110px;
  max-height: 338px;
  width: 270px;
  max-width: 78%;
  margin: auto auto calc(168px + var(--sab));
  z-index: var(--layer-stage);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(224, 36, 58, 0.35));
}
.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx > * {
  z-index: var(--layer-effects);
}
/* faca: o dedo risca a tela toda sem rolar a página */
.app.knife #s-home,
.app.knife #s-home * {
  touch-action: none;
}
.app.knife .stage {
  cursor: crosshair;
}
.heart {
  position: absolute;
  width: 26px;
  height: 26px;
  color: var(--red);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
  animation: rise 1.1s ease-out forwards;
}
@keyframes rise {
  from {
    transform: translateY(0) scale(0.5);
    opacity: 1;
  }
  to {
    transform: translateY(-110px) scale(1.2);
    opacity: 0;
  }
}
/* creme: um canvas do tamanho do #app, por cima de toda a interface (é o "vidro" da tela do jogador) */
.crm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: calc(var(--layer-particles) + 8);
  pointer-events: none;
}
.say {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 78%;
  background: #f2e9ee;
  color: #1a1220;
  border-radius: 18px;
  padding: 9px 14px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  text-align: center;
  z-index: calc(var(--layer-hud) + 1);
  animation: pop 0.25s ease-out;
}
.say::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top-color: #f2e9ee;
  border-bottom: 0;
}
@keyframes pop {
  from {
    transform: translateX(-50%) scale(0.7);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}
.fight {
  position: relative;
  z-index: var(--layer-hud);
  margin: 8px 12px 0;
}
.weps {
  display: flex;
  gap: 6px;
}
.wep {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 900;
  font-size: 9.5px;
  line-height: 1.05;
  background: rgba(20, 10, 14, 0.78);
  color: #d9ccc0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
}
.wep::after {
  content: "";
  position: absolute;
  inset: -3.5px -4.5px;
}
.wep:active {
  transform: scale(0.92);
  filter: brightness(1.3);
}
.wep svg {
  width: 30px;
  height: 30px;
  flex: none;
}
.wep.sac {
  letter-spacing: -0.4px;
}
.wep.on {
  border-color: #ff2a44;
  background: #3a0508;
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 42, 68, 0.55);
}
.stage.atk {
  cursor: crosshair;
}
