.tp-recinto {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

@media (max-width: 900px) {
  .tp-recinto {
    grid-template-columns: 1fr;
  }
}

.tp-palco {
  display: grid;
  gap: 10px;
}

.tp-arena {
  position: relative;
  width: 100%;
  max-width: min(100%, calc(100svh - 170px));
  aspect-ratio: 1 / 1;
  min-height: 300px;
  justify-self: center;
  overflow: hidden;
  isolation: isolate;
  background: #3b2a7a;
  box-shadow: 0 0 0 3px #2b2350, 10px 10px 0 #ffd24d;
  outline: none;
}

.tp-arena:focus-visible {
  outline: 3px solid var(--tp-tinta);
  outline-offset: 6px;
}

.tp-arena__ceu {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: crosshair;
}

.tp-arena__sem {
  position: absolute;
  inset: auto 16px 16px;
  z-index: 5;
  margin: 0;
  padding: 14px;
  background: #ffffff;
}

.tp-arena--viva .tp-arena__sem {
  display: none;
}

.tp-arena:not(.tp-arena--viva) .tp-sobreposto,
.tp-arena:not(.tp-arena--viva) .tp-painel {
  display: none;
}

.tp-painel {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 3;
  pointer-events: none;
  color: #ffffff;
}

.tp-ferramentas {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  max-width: min(100%, calc(100svh - 170px));
  justify-self: center;
}

.tp-painel[data-tp-ativo='nao'] .tp-painel__luta {
  visibility: hidden;
}

.tp-painel__luta {
  display: grid;
  gap: 4px;
  padding: 6px 10px 8px;
  background: rgba(43, 35, 80, 0.8);
}

.tp-painel__linha {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tp-barra {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.tp-barra__enche {
  position: absolute;
  inset: 0;
  background: #ffd24d;
  transform-origin: left center;
  transition: transform 0.15s ease-out;
}

.tp-barra[data-tp-fase='2'] .tp-barra__enche {
  background: #ff8a6b;
}

.tp-vigor {
  display: flex;
  gap: 4px;
}

.tp-pip {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.25);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.tp-pip--cheio {
  background: #6ee0b4;
}

.tp-faixa {
  position: absolute;
  top: 40%;
  left: 50%;
  z-index: 3;
  max-width: 90%;
  margin: 0;
  padding: 10px 20px;
  background: #6b4bbf;
  box-shadow: 5px 5px 0 #ffd24d;
  color: #ffffff;
  font-family: var(--tp-titulo);
  font-size: clamp(1.1rem, 3.6vw, 1.7rem);
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.tp-faixa[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .tp-faixa:not([hidden]) {
    animation: tp-faixa-entra 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  }
}

@keyframes tp-faixa-entra {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.6) rotate(-4deg);
  }
}

.tp-sobreposto {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow-y: auto;
  background: rgba(43, 35, 80, 0.55);
}

.tp-sobreposto[hidden] {
  display: none;
}

.tp-sobreposto__caixa {
  width: 100%;
  max-width: 27em;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 0 0 3px #2b2350, 8px 8px 0 #ffd24d;
  text-align: center;
}

.tp-sobreposto__caixa h3 {
  margin-bottom: 6px;
}

.tp-sobreposto__caixa > p {
  color: var(--tp-ardosia);
  font-size: 0.95rem;
}

.tp-rush {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 60px;
  margin-bottom: 12px;
}

.tp-rush span:last-child {
  font-size: 0.85rem;
  font-weight: 500;
}

.tp-duelos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tp-duelo {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 0.5em 0.8em;
  text-align: left;
}

.tp-duelo__nome {
  font-size: 0.98rem;
}

.tp-duelo__nota {
  font-size: 0.78rem;
  font-weight: 500;
}

.tp-duelo:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.tp-opcoes {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tp-melhoria {
  display: grid;
  gap: 4px;
  min-height: 64px;
  text-align: left;
}

.tp-melhoria__texto {
  font-size: 0.88rem;
  font-weight: 500;
}

.tp-resultado {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
  text-align: left;
}

.tp-resultado div {
  padding: 6px 10px;
  background: #f3efff;
}

.tp-resultado dt {
  font-size: 0.8rem;
  color: var(--tp-ardosia);
}

.tp-resultado dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tp-constelacoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.tp-constelacoes li {
  padding: 3px 10px;
  background: #eeeaf8;
  color: #5d5873;
}

.tp-constelacoes li::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  background: #c8c2dc;
  clip-path: polygon(50% 0, 62% 38%, 100% 38%, 69% 60%, 80% 100%, 50% 75%, 20% 100%, 31% 60%, 0 38%, 38% 38%);
}

.tp-constelacoes li.tp-estrela--acesa {
  background: #2b2350;
  color: #ffffff;
}

.tp-constelacoes li.tp-estrela--acesa::before {
  background: #ffd24d;
}

.tp-novo {
  margin: 0 0 8px;
  padding: 6px 10px;
  background: #6ee0b4;
  color: #0f3d31;
  font-weight: 600;
  font-size: 0.9rem;
}

.tp-novo[hidden] {
  display: none;
}

.tp-sobreposto__acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tp-poderes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: min(100%, calc(100svh - 170px));
  justify-self: center;
}

.tp-poder {
  --tp-carga: 0;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 72px;
  padding: 8px 6px;
  border: 3px solid #2b2350;
  background: #ffffff;
  color: var(--tp-tinta);
  font: 600 0.95rem/1.2 var(--tp-letra);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform 0.12s ease, background 0.2s ease;
}

.tp-poder::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(43, 35, 80, 0.2);
  transform-origin: bottom;
  transform: scaleY(var(--tp-carga));
}

.tp-poder--pronto {
  background: #fff4c2;
}

.tp-poder:active {
  transform: translateY(2px);
}

.tp-poder svg {
  width: 26px;
  height: 26px;
}

.tp-poder kbd {
  margin: 0;
  font-size: 0.72rem;
}

@media (max-width: 560px) {
  .tp-painel__luta {
    padding: 4px 8px 6px;
  }

  .tp-ferramentas .tp-lanco {
    padding: 0.4em 0.7em;
    font-size: 0.85rem;
  }

  .tp-duelo {
    min-height: 48px;
    padding: 0.35em 0.6em;
  }

  .tp-sobreposto__caixa {
    padding: 14px;
  }
}

.tp-selo {
  margin: 0 0 8px;
  padding: 6px 10px;
  background: #ffd24d;
  color: #2b2350;
  font-weight: 700;
}
