/* Victory screen: tabs (Result | Match Stats) + the Match Stats panel.
   Palette matches the existing .game-over-content styling in style.css
   (var(--text), var(--surface-border), gold accent #c8960c, translucent
   black panels). */

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.game-over-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: clamp(14px, 2.5vh, 22px);
  flex-shrink: 0;
}

.go-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--surface-border);
  border-radius: 2px;
  color: var(--text);
  opacity: 0.6;
  font-size: clamp(0.8rem, 1.6vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.go-tab i {
  font-size: 0.9em;
}

.go-tab:hover {
  opacity: 0.85;
}

.go-tab.active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.28);
  border-color: #c8960c;
  box-shadow: inset 0 -2px 0 #c8960c;
}

.go-tab-panel[hidden] {
  display: none;
}

.go-tab-panel {
  animation: goTabFade 0.25s ease;
}

@keyframes goTabFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Match Stats panel ───────────────────────────────────────────────────── */
.match-stats-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.5vh, 22px);
}

.match-stats-duration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: clamp(12px, 2vh, 18px);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  border-left: 3px solid #c8960c;
}

.match-stats-duration-icon {
  color: #c8960c;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  margin-bottom: 2px;
}

.match-stats-duration-val {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.match-stats-duration-label {
  font-size: clamp(0.7rem, 1.4vw, 0.85rem);
  color: var(--text);
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-stats-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-stats-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(10px, 1.8vh, 16px);
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--surface-border);
  border-radius: 2px;
  min-width: 0;
}

.match-stats-you {
  border-top: 3px solid #4a90d9;
}

.match-stats-opp {
  border-top: 3px solid #d9534f;
}

.match-stats-col-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.match-stats-side-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.7;
}

.match-stats-you-tag {
  color: #4a90d9;
}

.match-stats-opp-tag {
  color: #d9534f;
}

.match-stats-name {
  font-size: clamp(0.85rem, 1.7vw, 1.05rem);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-stats-highlight {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.match-stats-highlight-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  opacity: 0.55;
}

.match-stats-highlight-val {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.82rem, 1.6vw, 1rem);
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.match-stats-highlight-val > span:not(.match-stats-count) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-stats-empty {
  opacity: 0.5;
}

.match-stats-type-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.match-stats-card-star {
  color: #c8960c;
  flex-shrink: 0;
}

.match-stats-count {
  margin-left: auto;
  color: #c8960c;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.match-stats-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: clamp(0.72rem, 1.4vw, 0.88rem);
  color: var(--text);
  opacity: 0.85;
}

.match-stats-total i {
  opacity: 0.6;
  margin-right: 3px;
}

.match-stats-total strong {
  color: var(--text);
  font-weight: 700;
}

.match-stats-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.match-stats-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.68rem, 1.3vw, 0.82rem);
  color: var(--text);
}

.match-stats-bar-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.match-stats-bar-label {
  flex: 0 0 4.5em;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-stats-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

.match-stats-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: #c8960c;
  transition: width 0.4s ease;
}

.match-stats-bar-offense { background: #cd5c5c; }
.match-stats-bar-magic { background: #6fa8dc; }
.match-stats-bar-defense { background: #a0522d; }
.match-stats-bar-special { background: #9e9e9e; }
.match-stats-bar-resource { background: #d9b382; }

.match-stats-bar-count {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  min-width: 1.2em;
  text-align: right;
}

/* Stack the two columns on narrow screens */
@media (max-width: 560px) {
  .match-stats-compare {
    grid-template-columns: 1fr;
  }
}
