/* Compare (Daily Showdown) view */

/* Container and cards */
.cmp-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cmp-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 0.75rem;
}

.cmp-card h3 {
  text-align: center;
  color: var(--main-color-dark);
  margin: 0 0 0.5rem 0;
}

/* VS header */
.cmp-vs-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
}

.cmp-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
}

.cmp-username {
  font-family: "Macondo", cursive;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--main-color-dark);
  text-align: center;
  overflow-wrap: anywhere;
}

.cmp-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

.cmp-vs-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.cmp-vs-date {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--main-color-dark);
  border-radius: 10px;
  padding: 0.1rem 0.4rem;
  margin-top: 0.2rem;
  white-space: nowrap;
}

/* Tavern badge (re-skinned) */
.tavern-badge {
  background: var(--main-color-light);
  color: var(--main-color-dark);
  font-size: 0.7rem;
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
}

.cmp-player-progress { align-self: stretch; margin-top: auto; padding-top: 0.35rem; }
.cmp-player-pct { font-size: 0.8rem; font-weight: bold; color: var(--main-color-dark-hover); }
.cmp-player.winner { background: linear-gradient(rgba(255,181,58,0.35), rgba(255,181,58,0.35)), rgba(255,255,255,0.85); box-shadow: inset 0 0 0 2px var(--highlight-yellow); }
.cmp-player.tie    { background: linear-gradient(rgba(240,200,255,0.4), rgba(240,200,255,0.4)), rgba(255,255,255,0.85); }

/* Overall stats — label-on-top rows */
.cmp-stat {
  margin-bottom: 0.5rem;
}

.cmp-stat:last-child {
  margin-bottom: 0;
}

.cmp-stat-label {
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--main-color-muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}

.cmp-stat-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.cmp-stat-side {
  font-weight: bold;
  color: var(--main-color-dark-hover);
  text-align: center;
  padding: 0.25rem 0.3rem;
  border-radius: 8px;
  background: rgba(230, 230, 230, 0.45);
}

.cmp-stat-side--small {
  font-size: 0.85rem;
  font-weight: normal;
}

/* Progress bars */
.cmp-bar {
  height: 6px;
  background: var(--grey);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.2rem;
}

.cmp-rate-row .cmp-bar {
  flex: 1;
  margin-top: 0;
}

.cmp-bar--mirror {
  display: flex;
  justify-content: flex-end;
}

.cmp-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Habit head-to-head rows */
.cmp-habit {
  border-top: 1px solid var(--grey);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.cmp-habit:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.cmp-habit-name {
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--main-color-dark);
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

.cmp-rank-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--main-color-muted);
  text-align: center;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.cmp-habit-side-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--main-color-dark);
  text-align: center;
  overflow-wrap: anywhere;
}

.cmp-habit-duel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.cmp-habit-side {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.25rem 0.3rem;
  border-radius: 8px;
  background: rgba(230, 230, 230, 0.45);
}

.cmp-streak {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--main-color-dark);
  text-align: center;
}

.cmp-substat {
  font-size: 0.7rem;
  color: var(--main-color-muted);
}

.cmp-rate-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.cmp-rate {
  font-size: 0.75rem;
  color: var(--main-color-muted);
  white-space: nowrap;
}

/* Notes */
.cmp-note {
  font-size: 0.8rem;
  color: var(--main-color-muted);
  text-align: center;
  margin-bottom: 0.5rem;
}

.cmp-note-box {
  background: rgba(240, 200, 255, 0.35);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--main-color-muted);
  margin-top: 0.5rem;
}

/* Winner / tie highlighting */
.cmp-stat-side.winner,
.cmp-habit-side.winner {
  background: rgba(255, 181, 58, 0.35);
  box-shadow: inset 0 0 0 2px var(--highlight-yellow);
}

.cmp-stat-side.winner .cmp-stat-value::after,
.cmp-habit-side.winner .cmp-streak::after,
.cmp-player.winner .cmp-player-pct::after {
  content: " ★";
  color: #ffd700;
}

.cmp-stat-side.tie,
.cmp-habit-side.tie {
  background: rgba(240, 200, 255, 0.4);
}

/* Shared comparison mode */
.shared-comparison-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px;
}

.shared-comparison-mode {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.shared-comparison-wrapper .shared-comparison-mode {
  background: linear-gradient(135deg, var(--main-color-dark) 0%, var(--main-color-vibrant) 100%);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.shared-comparison-mode h2 {
  color: white;
}

.shared-comparison-mode #leaderboard-headline {
  padding-top: 10px;
}

.shared-comparison-mode #magic-link-container {
  display: none !important;
}

.shared-comparison-mode #spinner-leaderboard {
  text-align: center;
}
