/* =====================================================================================
   Interface: telas, HUD, frascos e barra de dica.
   Carrega depois do style.css e sobrepõe o visual das telas, HUD, frascos e barra de dica.
   ===================================================================================== */
:root {
  --iris: conic-gradient(from 200deg, #ff9fe3, #ffe49c, #9af0ff, #c9a4ff, #ffb3e6, #ff9fe3);
}

/* painel de vidro com borda furta-cor */
.panel {
  position: relative;
  width: min(94vw, 440px);
  padding: 26px 20px 20px;
  border-radius: 64px;
  gap: 14px;
  border: 10px solid transparent;
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -12px;
  background:
    radial-gradient(110% 60% at 30% 0%, rgba(255, 255, 255, 0.55), transparent 60%) padding-box,
    linear-gradient(180deg, rgba(255, 240, 255, 0.74), rgba(235, 215, 255, 0.8)) padding-box,
    var(--iris) border-box;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.75),
    0 0 24px rgba(255, 200, 255, 0.8),
    0 14px 40px rgba(70, 40, 120, 0.38),
    inset 0 -10px 22px rgba(190, 150, 255, 0.3),
    inset 0 6px 14px rgba(255, 255, 255, 0.9);
}
.panel::before,
.panel::after {
  /* bolhinhas de sabão grudadas na borda do painel */
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at 32% 30%,
    #fff 0 14%,
    rgba(255, 255, 255, 0.2) 38%,
    rgba(200, 170, 255, 0.35) 100%
  );
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.panel::before {
  width: 34px;
  height: 34px;
  left: -20px;
  bottom: 30px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.9),
    16px 18px 0 -8px rgba(255, 255, 255, 0.75);
}
.panel::after {
  width: 26px;
  height: 26px;
  right: -16px;
  top: 34%;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.9),
    -4px 26px 0 -6px rgba(255, 255, 255, 0.75);
}

/* faixa de título */
.ribbon {
  position: relative;
  align-self: center;
  width: min(86%, 300px);
  aspect-ratio: 4.064;
  container-type: inline-size;
  margin: -8px 0 2px;
  display: grid;
  place-items: center;
  background: url(assets/ui/faixa.webp) center / 100% auto no-repeat; /* fita reta (5,6:1) centrada na caixa: o layout das telas não muda */
}
.ribbon span {
  transform: translateY(-4%); /* fita reta centrada na altura (desconta a sombra do texto) */
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
}
.panel h2.title-ink {
  margin: 0;
  font-size: 38px;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}
.label {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

/* botões de bala: lilás e verde, com brilho em cima e sombra grossa embaixo */
.btn {
  position: relative;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  font-size: 25px;
  padding: 15px 18px;
  white-space: nowrap;
  -webkit-text-stroke: 3px #3d1f6e;
  paint-order: stroke fill;
  text-shadow: 0 2px 0 rgba(60, 30, 110, 0.55);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.18),
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    0 5px 0 rgba(70, 40, 120, 0.35),
    0 8px 16px rgba(70, 40, 120, 0.25);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.btn::before {
  content: '';
  position: absolute;
  left: 16%;
  right: 30%;
  top: 5px;
  height: 26%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.05));
  opacity: 0.6;
  pointer-events: none;
}
.btn:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.18),
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    0 1px 0 rgba(70, 40, 120, 0.35);
}
.btn.lilac {
  background: linear-gradient(180deg, #d9b6ff, #a46ff0 70%, #8d58df);
}
.btn.green {
  background: linear-gradient(180deg, #a8f56b, #4fcf33 70%, #36a91f);
  -webkit-text-stroke-color: #1f6a10;
  text-shadow: 0 2px 0 rgba(20, 90, 10, 0.5);
}
.btn.xl {
  font-size: 32px;
  padding: 18px 26px;
}
.row .btn {
  font-size: 24px;
  padding: 14px 10px;
}
.row .btn.wide {
  flex: 1.3;
}
#btn-start {
  width: min(84vw, 420px);
}

/* linhas de configuração com ícone e chave */
.setting {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 2px rgba(200, 170, 255, 0.45);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.setting span {
  flex: 1;
  text-align: left;
  color: #fff;
  -webkit-text-stroke: 3px #3d1f6e;
  paint-order: stroke fill;
  font-size: 21px;
  text-shadow: 0 2px 0 #3d1f6e;
}
.setting .ico {
  width: 50px;
  height: 50px;
  outline: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 35% 28%, #fff 0 10%, #e7d4ff 36%, #a97cf2 80%, #8a5ad8);
  box-shadow:
    inset 0 -3px 0 rgba(60, 30, 110, 0.25),
    inset 0 0 0 2px rgba(255, 255, 255, 0.75),
    0 0 0 2px rgba(255, 190, 240, 0.7);
}
.setting .ico svg {
  width: 26px;
  height: 26px;
}
.setting {
  font-size: 21px;
}
.setting input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #cfc4e2;
  box-shadow: inset 0 2px 4px rgba(60, 30, 110, 0.3);
  transition: background 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #eee 60%, #d8d0e8);
  box-shadow: 0 2px 4px rgba(60, 30, 110, 0.35);
  transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.setting input:checked + .switch {
  background: linear-gradient(180deg, #8ef05a, #45c22c);
}
.setting input:checked + .switch::after {
  transform: translateX(26px);
}

/* vitória: estrelas em arco por cima do painel */
.panel.win {
  padding-top: 40px;
  margin-top: 120px;
}
.panel.win .stars {
  position: absolute;
  left: 0;
  right: 0;
  top: -124px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  pointer-events: none;
}
.panel.win .stars i {
  display: block;
  width: 66px;
  height: 66px;
  opacity: 1;
  filter: none;
  clip-path: none;
  margin: 0 3px;
  background: url(assets/ui/estrela-vazia.webp) center / contain no-repeat;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px));
}
.panel.win .stars i:nth-child(1) {
  --r: -14deg;
  --y: 12px;
}
.panel.win .stars i:nth-child(2) {
  width: 84px;
  height: 84px;
  z-index: 1;
}
.panel.win .stars i:nth-child(3) {
  --r: 14deg;
  --y: 12px;
}
.panel.win .stars i.on {
  background-image: url(assets/ui/estrela-ouro.webp);
  animation: starIn2 0.55s cubic-bezier(0.3, 1.8, 0.5, 1) both;
  filter: drop-shadow(0 0 10px rgba(255, 220, 120, 0.8));
}
@keyframes starIn2 {
  0% {
    transform: rotate(calc(var(--r, 0deg) - 40deg)) translateY(var(--y, 0px)) scale(2.4);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)) scale(1);
  }
}
.panel.win .ribbon,
#s-pause .ribbon {
  margin-top: -72px;
  width: min(96%, 360px);
}
#s-pause .panel {
  margin-top: 40px;
  padding-top: 36px;
}
.ribbon span {
  font-size: min(34px, 9.5cqw);
  -webkit-text-stroke-width: min(3px, 1cqw);
} /* encolhe com a faixa: o texto fica dentro da fita do meio */
#win-themes {
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
}
.soap {
  position: relative;
  flex: 0 1 112px;
  min-width: 0;
  aspect-ratio: 0.73;
  background: var(--img) center bottom / contain no-repeat;
}
.soap b {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 57%;
  height: 20%;
  display: grid;
  place-items: center;
  font-size: var(--lfs, 12px);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

/* derrota */
.panel.lose {
  padding-top: 56px;
  margin-top: 60px;
}
.lose-ico {
  position: absolute;
  left: 50%;
  top: -66px;
  width: 124px;
  transform: translateX(-50%);
  pointer-events: none;
}
#lose-msg {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 21px;
  color: var(--ink);
}
.pill {
  position: relative;
  padding: 6px 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--c);
  -webkit-text-stroke: 2px rgba(60, 30, 110, 0.7);
  paint-order: stroke fill;
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.15),
    inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  font-size: 19px;
}

/* abertura */
#s-title {
  align-content: start;
  justify-items: center;
  gap: 2.4vh;
  padding-top: 6vh;
}
.title-space {
  height: 30vh;
}
.logo-img {
  width: min(84vw, 460px);
  filter: drop-shadow(0 8px 16px rgba(70, 40, 120, 0.3));
  animation: bob 3s ease-in-out infinite;
}
.sub {
  font-size: 23px;
  font-weight: 700;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.gear {
  width: 54px;
  height: 54px;
  color: #fff;
}
.round svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 0 rgba(60, 30, 110, 0.6));
}

/* HUD: pausa de vidro, faixa da fase e sopros num estojo */
.round {
  background: radial-gradient(circle at 35% 28%, #fff 0 10%, #e7d4ff 36%, #a97cf2 80%, #8a5ad8);
  box-shadow:
    inset 0 -4px 0 rgba(60, 30, 110, 0.25),
    inset 0 0 0 2px rgba(255, 255, 255, 0.7),
    0 4px 0 rgba(70, 40, 120, 0.3);
}
#level-title {
  font-size: 22px;
  padding: 5px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d9b6ff, #a46ff0);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 255, 255, 0.8),
    0 3px 0 rgba(70, 40, 120, 0.3);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
}
#breaths {
  background: linear-gradient(180deg, rgba(90, 55, 150, 0.65), rgba(60, 30, 110, 0.65));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    0 3px 0 rgba(40, 20, 80, 0.3);
}

/* barra de dica com borda furta-cor */
#hint {
  border: 3px solid transparent;
  background:
    linear-gradient(180deg, #f8efff, #e3cfff) padding-box,
    var(--iris) border-box;
  box-shadow:
    0 6px 16px rgba(70, 40, 120, 0.28),
    inset 0 3px 8px rgba(255, 255, 255, 0.9);
}

/* frascos: garrafas de sabão sobre o parapeito */
.flask {
  background: none;
  box-shadow: none;
  padding: 0;
  gap: 0;
}
.flask .bottle {
  position: relative;
  width: 100%;
  max-width: 112px;
  aspect-ratio: 0.73;
  border-radius: 0;
  overflow: visible;
  background: var(--img) center bottom / contain no-repeat;
  box-shadow: none;
}
.flask .bottle::before {
  display: none;
}
.flask .liquid {
  display: none;
}
.flask {
  position: relative;
}
.flask .side {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 0;
  bottom: 0;
  display: block;
}
.flask .dots {
  position: absolute;
  left: 0;
  right: 0;
  top: 49%;
  justify-content: center;
}
.flask .name {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 60%;
  height: 15%;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.flask .dots {
  gap: 3px;
}
.flask .dots i {
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, var(--ink));
}
.flask .dots i.on {
  background: color-mix(in srgb, var(--c) 70%, var(--ink));
  box-shadow: 0 0 0 1.5px #fff;
}
.flask .name b {
  border-bottom: 2.5px solid rgba(91, 59, 140, 0.8);
  margin: 0 0.5px;
}
.flask .name b.gap {
  border: 0;
}
.flask.done .bottle {
  filter: drop-shadow(0 0 10px var(--c)) drop-shadow(0 0 4px #fff);
}
.flask .name {
  background: none;
  box-shadow: none;
  padding: 0;
  justify-content: center;
}

.flask.done .name {
  background: none;
}
.flask.done .name b.on {
  color: var(--ink);
  text-shadow: none;
}
body.land #flasks {
  justify-items: center;
}
body.land .flask {
  flex-direction: column;
  width: auto;
}
body.land .flask .side {
  align-items: center;
}
body.land .flask .name {
  justify-content: center;
}
body.land .flask .bottle {
  width: auto;
  height: var(--bh, 120px);
  max-width: none;
}

/* janelas: o jogo atrás fica desfocado e escuro */
.modal {
  background: rgba(60, 30, 110, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
body.land .panel.win {
  width: min(94vw, 640px);
}
body.land #hint {
  width: min(100% - 40px, 62vw, 900px);
  max-width: 900px;
  margin: 0 auto;
}
@media (max-height: 450px) {
  body.land #hint {
    min-height: 40px;
  }
}
/* janelas no desktop: escala própria (menor que a do HUD) para caber na altura */
.panel {
  zoom: var(--pk, 1);
}
body.land .panel.win {
  width: min(94vw, 520px);
}
.setting {
  font-size: 19px;
}
.pill {
  padding: 5px 12px;
  font-size: 17px;
}

/* ajustes finos de medidas */
.label {
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 #fff;
  font-size: 22px;
}
.modal {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  background: rgba(60, 30, 110, 0.4);
}
.hint-text {
  color: #fff;
}
.hint-text b.on {
  color: #fff;
  -webkit-text-stroke: 3px #3d1f6e;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #3d1f6e;
}
.hint-text b {
  margin: 0 0.06em;
}
body.land #hud > * {
  zoom: calc(var(--k, 1) * 1.2);
}
/* celular deitado: janelas compactas, sem ficar ilegível */
@media (max-height: 450px) {
  .panel.win {
    margin-top: 64px;
    padding-top: 22px;
    gap: 6px;
  }
  .panel.win .stars {
    top: -70px;
    height: 60px;
    z-index: 2;
  }
  .panel.win .label {
    display: none;
  }
  .screen.modal {
    align-items: end;
    padding-bottom: 8px;
  }
  .panel.win .stars i {
    width: 50px;
    height: 50px;
  }
  .panel.win .stars i:nth-child(2) {
    width: 62px;
    height: 62px;
  }
  .panel.win .ribbon {
    margin-top: -26px;
    width: min(64%, 240px);
  }
  .soap {
    flex-basis: 74px;
  }
  .panel {
    padding: 16px 16px 14px;
    gap: 8px;
  }
  .setting .ico {
    width: 40px;
    height: 40px;
  }
  .lose-ico {
    width: 90px;
    top: -48px;
  }
  .panel.lose {
    margin-top: 40px;
    padding-top: 40px;
  }
}

.setting span {
  white-space: nowrap;
  font-size: 19px;
}

/* End of ui.css */
