/* Modos e telas da 1.7 em diante: resumo no resultado, barra do replay e listas (Partidas e as que vêm). */

/* Menu em grupos (1.8): os modos e a coleção em duas colunas, para caber no celular sem rolar muito. */
.home-group {
  align-self: flex-start;
  margin: 4px 0 -4px 4px;
  color: #b9addb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.home-tile {
  min-height: 48px;
  padding: 0 8px;
  font-size: 18px;
  line-height: 1.05;
}

.home-tile--weekly {
  background: linear-gradient(135deg, #7a4fe0, #3a3356 75%);
}

.home-tile--wide {
  grid-column: 1 / -1;
}

.home-howto {
  min-height: 44px;
}

/* A Wiki (public/wiki/) é um link para outra página, com a cara dos botões. */
.home-wiki {
  color: var(--text);
  text-decoration: none;
}

@media (max-height: 760px) {
  .home-card .home-tile {
    min-height: 42px;
    font-size: 16px;
  }
}

/* O cartão do resultado cresce com o resumo: rola se a tela for baixa. */
.result.is-interactive .result-card {
  max-height: calc(100% - 8px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Tela baixa: o cartão encolhe para o resumo e os botões caberem quase sem rolar. */
@media (max-height: 700px) {
  .result.is-interactive .result-card {
    padding: 12px 14px 12px;
  }

  .result.is-interactive .result-title {
    font-size: 34px;
  }

  .result-summary {
    margin-top: 8px;
    padding: 8px 8px 6px;
    font-size: 12px;
  }

  .sum-chart {
    height: 40px;
  }

  .result-actions {
    margin-top: 10px !important;
  }

  .result-actions .big-btn {
    min-height: 46px;
  }
}

.result-row {
  display: flex;
  gap: 10px;
}

.result-row .big-btn[hidden],
.result-actions > .big-btn[hidden] {
  display: none;
}

.result-summary {
  width: 100%;
  margin-top: 12px;
  padding: 10px 10px 8px;
  border: 2px solid var(--outline);
  border-radius: 12px;
  background: rgba(13, 10, 28, 0.6);
  font-size: 13px;
  text-align: left;
}

.result-summary[hidden] {
  display: none;
}

.sum-top {
  margin: 0 0 6px !important;
  color: #ffe08a;
  font-weight: 600;
}

.sum-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.sum-table th,
.sum-table td {
  padding: 2px 4px;
  font-weight: 600;
}

.sum-table th:first-child {
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}

.sum-table td,
.sum-table tr:first-child th {
  text-align: right;
}

.sum-blue {
  color: #a9d4ff;
}

.sum-red {
  color: #ffb3b8;
}

.sum-note {
  margin: 6px 0 0 !important;
  color: #e3d6ff;
}

.sum-chart-box {
  margin-top: 6px;
}

.sum-chart-title {
  margin: 0 0 2px !important;
  color: var(--muted);
  font-size: 12px;
}

.sum-chart {
  display: block;
  width: 100%;
  height: 54px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sum-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sum-line--blue {
  stroke: #5aa8ff;
}

.sum-line--red {
  stroke: #ff6b75;
}

/* Barra do replay, no lugar da mão. */
.replay-bar {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 10px 10px 8px;
}

.replay-bar[hidden] {
  display: none;
}

.replay-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.replay-time {
  flex: 0 0 auto;
  min-width: 34px;
  color: #d8d2f0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.replay-seek {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  accent-color: #a57bff;
}

.replay-buttons {
  display: flex;
  gap: 6px;
}

.replay-buttons .act-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 4px;
}

.replay-toggle {
  flex-grow: 1.4 !important;
}

/* Listas das telas de modo (Partidas, Trilha, Placar, Votos, Amigos): o conteúdo começa no alto (a nota
   das telas de escolha empurra o resto para baixo, perto do polegar; aqui a lista é que importa). */
.screen--list .setup-note {
  margin: 0;
}

.screen--list .online-panel {
  margin: 0;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border: 3px solid var(--outline);
  border-left: 6px solid #8e88a6;
  border-radius: 14px;
  background: rgba(20, 16, 40, 0.92);
}

.list-row--win {
  border-left-color: #ffcf4a;
}

.list-row--loss {
  border-left-color: var(--red);
}

.list-row--draw {
  border-left-color: #c9a8ff;
}

.list-info {
  flex: 1 1 auto;
  min-width: 0;
}

.list-info p {
  margin: 0;
}

.list-title {
  font-family: var(--font-display);
  font-size: 18px;
}

.list-runes {
  color: #d8d2f0;
  font-size: 15px;
}

.list-sub {
  color: #c8c0e6;
  font-size: 13px;
}

.list-warn {
  color: #ffb3b8;
  font-size: 12px;
  font-weight: 600;
}

.list-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
}

.list-actions .act-btn {
  min-width: 76px;
  height: 38px;
}

/* Molduras das cartas da mão (data/cosmetics.js, tipo frame): uma borda e um brilho por cima do retrato. A
   Pedra é a de sempre (sem nada a mais). */
.card-frame--pedra {
  box-shadow: 0 0 0 2px #6f6890, 0 3px 0 #0c0a16;
}

.card-frame--bronze,
#hand[data-frame="bronze"] .card--hand:not(.is-selected) {
  box-shadow: 0 0 0 2px #c8793f, inset 0 0 0 2px rgba(255, 190, 120, 0.45), 0 3px 0 #0c0a16;
}

.card-frame--cristal,
#hand[data-frame="cristal"] .card--hand:not(.is-selected) {
  box-shadow: 0 0 0 2px #8fe3ff, 0 0 10px rgba(143, 227, 255, 0.55), 0 3px 0 #0c0a16;
}

.card-frame--ouro,
#hand[data-frame="ouro"] .card--hand:not(.is-selected) {
  box-shadow: 0 0 0 2px #ffd36b, 0 0 12px rgba(255, 211, 107, 0.7), inset 0 0 0 1px #fff3c4, 0 3px 0 #0c0a16;
}

.card-frame--raizes,
#hand[data-frame="raizes"] .card--hand:not(.is-selected) {
  box-shadow: 0 0 0 2px #4f9a4a, 0 0 0 4px #2b5a2a, 0 3px 0 #0c0a16;
}

.card-frame--abismo,
#hand[data-frame="abismo"] .card--hand:not(.is-selected) {
  box-shadow: 0 0 0 2px #6b3fb8, 0 0 14px rgba(60, 20, 120, 0.9), 0 3px 0 #0c0a16;
}

/* Amigos (ui/friends-view.js) e a faixa de quem assiste. */
.friend-add {
  display: flex;
  gap: 8px;
}

.friend-add[hidden] {
  display: none;
}

.friend-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.friend-add .act-btn {
  flex: 0 0 auto;
  height: auto;
  min-height: 44px;
}

.friend-invite {
  border-left-color: #ffcf4a;
  background: linear-gradient(90deg, rgba(255, 207, 74, 0.2), rgba(20, 16, 40, 0.92) 60%);
}

.friend-row.is-online {
  border-left-color: #4ade80;
}

.friend-row.is-playing {
  border-left-color: #a57bff;
}

.friend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: #5b5672;
  vertical-align: 2px;
}

.friend-dot.is-on {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
}

.spectate-bar[hidden],
.spectate-bar [hidden] {
  display: none;
}

/* Campeonato (ui/tourney-view.js). */
.tourney-open {
  margin-top: 18px;
}

.tourney-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tourney-body .online-panel {
  margin: 0;
}

.tourney-body .list {
  margin: 0;
}

.tourney-intro {
  margin: 0;
}

.tourney-player.is-you {
  border-left-color: #a57bff;
}

.tourney-status {
  align-items: stretch;
  text-align: center;
}

.tourney-status p {
  margin: 0;
}

.tourney-status.is-called {
  border-color: #ffcf4a;
  box-shadow: 0 0 18px rgba(255, 207, 74, 0.45);
}

.tourney-status.is-over {
  border-color: #c9a8ff;
}

.tourney-headline {
  font-family: var(--font-display);
  font-size: 28px;
}

.tourney-line {
  color: #e2dcf8;
  font-size: 16px;
}

.tourney-out {
  color: #ffb3b8;
}

.tourney-countdown {
  color: #ffcf4a;
  font-weight: 700;
}

.tourney-bracket {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tourney-round h3 {
  margin: 0 0 6px;
}

.tourney-match.is-current {
  border-left-color: #ffcf4a;
}

.tourney-match.is-done {
  border-left-color: #6b6385;
}

.tourney-name.is-winner {
  color: #ffcf4a;
}

.tourney-name.is-loser {
  color: #8e88a6;
  text-decoration: line-through;
}

.tourney-name.is-you {
  text-decoration-line: underline;
}

.tourney-name.is-loser.is-you {
  text-decoration-line: underline line-through;
}

.tourney-name.is-empty {
  color: #8e88a6;
  font-style: italic;
}

.tourney-vs {
  color: #8e88a6;
}

.tourney-foot {
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
}

.tourney-leave.is-confirm {
  border-color: var(--red);
  color: #ffb3b8;
}

/* Tela Visual (ui/cosmetics-view.js). */
.looks-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.look-section .setup-note {
  margin: 2px 0 8px;
  text-align: left;
}

.look-head {
  --domain: #c9a8ff;
}

.look-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.look-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 118px;
  padding: 8px 4px 6px;
  border: 3px solid var(--outline);
  border-radius: 14px;
  background: rgba(20, 16, 40, 0.92);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.look-tile:disabled {
  cursor: default;
}

.look-tile.is-locked {
  opacity: 0.5;
}

.look-tile.is-equipped {
  border-color: #ffcf4a;
  box-shadow: 0 0 0 2px #ffcf4a, 0 0 14px rgba(255, 207, 74, 0.45);
}

.look-art {
  display: block;
}

.look-name {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.1;
}

.look-source {
  color: #c8c0e6;
  font-size: 11px;
  line-height: 1.2;
}

.look-tile.is-equipped .look-source {
  color: #ffe08a;
  font-weight: 700;
}

.look-frame {
  position: relative;
  display: block;
  width: 42px;
  height: 56px;
  border-radius: 6px;
  background: linear-gradient(#5a5280, #2a2540);
  /* A sombra e a borda vêm da moldura (.card-frame--<id>, acima). */
}

.look-frame-cost {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7c3aed;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 20px;
}

/* Partida guiada (ui/coach.js): o balão no alto da arena e o anel que aponta. */
.coach {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.coach[hidden] {
  display: none;
}

.coach-bubble {
  position: absolute;
  top: calc(var(--top-bar-bottom, 44px) + 30px);
  left: calc(var(--column-x, 0px) + var(--column-w, 100vw) / 2);
  width: min(340px, calc(var(--column-w, 100vw) - 24px));
  padding: 10px 12px 4px;
  border: 3px solid var(--outline);
  border-radius: 16px;
  background: linear-gradient(#4a3a7a, #2a2148);
  box-shadow: 0 6px 0 #0c0a16, 0 0 24px rgba(154, 102, 255, 0.55);
  transform: translateX(-50%);
  pointer-events: auto;
  animation: pop-in 0.25s ease-out;
}

.coach-bubble.is-done {
  border-color: #2fb866;
  box-shadow: 0 6px 0 #0c0a16, 0 0 24px rgba(74, 222, 128, 0.6);
}

.coach-bubble.is-done .coach-head b::after {
  content: " ✓";
  color: #4ade80;
}

.coach-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 3px;
}

.coach-head b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: #ffe08a;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.coach-head span {
  color: #c8c0e6;
  font-size: 12px;
  font-weight: 700;
}

.coach-text {
  margin: 0;
  color: #f5f3ff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.coach-skip {
  min-height: 32px;
  padding: 0;
  font-size: 12px;
}

.coach-ring {
  position: absolute;
  border: 4px solid #ffe08a;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 224, 138, 0.8), inset 0 0 14px rgba(255, 224, 138, 0.5);
  animation: coach-pulse 1.1s ease-in-out infinite;
}

.coach-ring[hidden] {
  display: none;
}

.coach-ring.is-box {
  border-radius: 16px;
  animation-name: coach-pulse-box;
}

@keyframes coach-pulse-box {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-height: 700px) {
  .coach-bubble {
    top: calc(var(--top-bar-bottom, 44px) + 8px);
    padding: 6px 10px 2px;
  }

  .coach-head b {
    font-size: 16px;
  }

  .coach-text {
    font-size: 12.5px;
  }
}

@keyframes coach-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* O convite da partida guiada no menu e o botão no Como jogar. */
.home-invite {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 8px 8px 12px;
  border: 3px solid var(--outline);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.55), rgba(20, 16, 40, 0.9));
}

.home-invite[hidden] {
  display: none;
}

.home-invite p {
  flex: 1 1 auto;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.home-invite .act-btn {
  flex: 0 0 auto;
}

.home-invite-close {
  min-width: 36px !important;
}

.guide-cta {
  padding-bottom: 0;
}

.guide-cta .setup-note {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .coach-ring {
    animation: none;
  }
}

/* Regra da semana, no alto da tela da fila. */
.weekly-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 3px solid var(--outline);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(20, 16, 40, 0.92) 70%);
  box-shadow: 0 0 22px rgba(154, 102, 255, 0.35);
}

.weekly-card[hidden] {
  display: none;
}

.weekly-card p {
  margin: 0;
}

.weekly-name {
  font-family: var(--font-display);
  font-size: 26px;
  color: #ffe08a;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.weekly-text {
  color: #f0eaff;
  font-weight: 600;
}

.weekly-card .setup-note {
  text-align: left;
}

/* Renome e Círculos (data/renown.js): a cor de cada Círculo, no Placar, no menu e no resultado. */
.circle--pedra { --circle: #b3adc8; }
.circle--bronze { --circle: #e0975a; }
.circle--prata { --circle: #d7e3f4; }
.circle--cristal { --circle: #8fe3ff; }
.circle--astral { --circle: #ffd36b; }

.circle-name {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--circle);
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.circle-ladder {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.circle-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 2px;
  border: 2px solid var(--outline);
  border-radius: 10px;
  background: rgba(13, 10, 28, 0.6);
  font-size: 10.5px;
  line-height: 1.1;
  text-align: center;
  opacity: 0.55;
}

.circle-step b {
  color: var(--circle);
}

.circle-step span {
  color: #c8c0e6;
}

.circle-step.is-reached {
  opacity: 1;
}

.circle-step.is-current {
  border-color: var(--circle);
  box-shadow: 0 0 10px var(--circle);
}

.rank-row.is-me {
  border-left-color: #ffcf4a;
  background: linear-gradient(90deg, rgba(255, 207, 74, 0.18), rgba(20, 16, 40, 0.92) 60%);
}

.rank-pos {
  flex: 0 0 auto;
  min-width: 38px;
  font-family: var(--font-display);
  font-size: 20px;
  color: #ffe08a;
  text-align: center;
}

/* Forja (data/forge.js): as ofertas da rodada, o deck que vai saindo e o placar da campanha. */
.forge-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forge-offers {
  margin: 0;
}

.forge-offer {
  padding: 6px 8px 6px 6px;
  border-left-color: var(--rarity);
}

.forge-offer.is-selected {
  border-color: #ffcf4a;
  box-shadow: 0 0 0 2px #ffcf4a, 0 0 16px rgba(255, 207, 74, 0.45);
}

.forge-offer-pick {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.forge-offer-pick .list-info,
.forge-offer-pick .list-info span {
  display: block;
}

.forge-art {
  flex: 0 0 auto;
  width: 64px;
  height: 82px;
  border-radius: 8px;
}

.forge-rules {
  margin-top: 2px;
  color: #e3d6ff !important;
  font-size: 12px !important;
  line-height: 1.3;
}

.forge-more {
  flex: 0 0 auto !important;
  min-width: 48px;
  height: 38px;
}

.forge-record {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 20px;
  line-height: 1;
}

.forge-pip {
  color: rgba(255, 255, 255, 0.2);
}

.forge-pip.is-win {
  color: #ffcf4a;
  text-shadow: 0 0 8px rgba(255, 207, 74, 0.7);
}

.forge-pip--loss.is-loss {
  color: var(--red);
}

.forge-sep {
  width: 8px;
}

.forge-picks .level-title {
  margin: 0 0 6px;
}

.forge-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.forge-pick {
  padding: 0;
  border: 2px solid var(--outline);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.forge-pick canvas {
  display: block;
  width: 34px;
  height: 44px;
}

/* O detalhe da carta (o da partida) por cima da tela da Forja, no meio. */
.game[data-screen="forge"] .card-detail {
  z-index: 12;
  top: 50%;
  bottom: auto;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
}

#forge.is-busy .forge-body {
  opacity: 0.6;
  pointer-events: none;
}

/* Votos diários: a barra de progresso de cada um. */
.vow-row.is-done {
  border-left-color: #4ade80;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.15), rgba(20, 16, 40, 0.92) 60%);
}

.vow-row.is-done .list-title::after {
  content: " ✓";
  color: #4ade80;
}

.vow-bar {
  height: 10px;
  margin: 6px 0 4px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.vow-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8f63f7, #c9a8ff);
}

.vow-row.is-done .vow-fill {
  background: linear-gradient(90deg, #2fb866, #8ff0b0);
}

/* Trilha dos Domínios: um bloco por Domínio, na cor dele. */
.trail-domains {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trail-domain .list {
  margin-top: 6px;
}

.trail-head {
  margin: 0;
  padding-left: 10px;
  border-left: 6px solid var(--domain);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.trail-head small {
  color: #d8d2f0;
  font-size: 15px;
}

.trail-row {
  border-left-color: var(--domain);
}

.trail-row.is-done {
  background: linear-gradient(90deg, rgba(255, 207, 74, 0.16), rgba(20, 16, 40, 0.92) 60%);
}

.trail-row.is-done .list-title::after {
  content: " ✓";
  color: #ffcf4a;
}

.trail-row.is-locked {
  opacity: 0.62;
}

.trail-goal {
  margin-top: 2px !important;
  color: #ffe08a !important;
  font-weight: 600;
}

#trail.is-busy .list-actions .act-btn {
  opacity: 0.5;
}

.list-empty {
  margin: 14px 0 0;
  color: #d8d2f0;
  text-align: center;
}

.list-empty[hidden] {
  display: none;
}
