/* ===== Reset + premenné ===== */
:root {
  --color-primary: #2c3e50;
  --color-accent: #27ae60;
  --color-gold: #f39c12;
  --color-silver: #95a5a6;
  --color-bronze: #cd6133;
  --color-bg: #fafafa;
  --color-card-bg: #ffffff;
  --color-text-muted: #7f8c8d;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.18);
  --radius: 12px;
  --transition: 0.18s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--color-bg);
  color: var(--color-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.site-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
}

.site-header h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.03em;
  color: var(--color-primary);
}

.subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
  font-style: italic;
}

/* ===== Progress bar ===== */
.progress-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.progress-bar {
  width: min(260px, 55vw);
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-family: sans-serif;
  white-space: nowrap;
}

/* ===== Battle arena ===== */
.battle-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  flex: 1;
}

@media (min-width: 640px) {
  .battle-arena {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }
}

/* ===== VS divider ===== */
.vs-divider {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-text-muted);
  font-family: sans-serif;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ===== Artwork card ===== */
.artwork-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  border: 3px solid transparent;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  outline: none;
}

@media (min-width: 640px) {
  .artwork-card {
    flex: 1;
    max-width: 420px;
  }
}

.artwork-card:hover,
.artwork-card:focus-visible {
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0f0f0;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artwork-info {
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.artwork-title {
  font-size: 0.95rem;
  font-weight: bold;
  line-height: 1.3;
}

.artwork-artist {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
  font-style: italic;
}

/* ===== Winner flash animácia ===== */
@keyframes winner-flash {
  0%   { border-color: transparent; }
  30%  { border-color: var(--color-accent); transform: scale(1.05); }
  100% { border-color: var(--color-accent); }
}

.artwork-card.winner-flash {
  animation: winner-flash 220ms ease forwards;
  border-color: var(--color-accent);
}

/* ===== Battle footer ===== */
.battle-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1rem 2rem;
  background: #fff;
  border-top: 1px solid #e8e8e8;
}

/* ===== Tlačidlá ===== */
.btn-primary,
.btn-secondary {
  padding: 0.55rem 1.4rem;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  font-family: Georgia, serif;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-secondary {
  background: #ecf0f1;
  color: var(--color-primary);
}

.btn-secondary:hover {
  background: #dde4e6;
}

/* ===== Rankings screen ===== */
#rankings-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.rankings-main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.rankings-footer {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 2rem;
  background: #fff;
  border-top: 1px solid #e8e8e8;
}

/* ===== Ranking card ===== */
.ranking-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 3px solid transparent;
}

.ranking-card.rank-1 { border-color: var(--color-gold); }
.ranking-card.rank-2 { border-color: var(--color-silver); }
.ranking-card.rank-3 { border-color: var(--color-bronze); }

/* ===== Rank badge ===== */
.rank-badge {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: #ecf0f1;
  color: var(--color-primary);
}

.ranking-card.rank-1 .rank-badge { background: var(--color-gold); color: #fff; }
.ranking-card.rank-2 .rank-badge { background: var(--color-silver); color: #fff; }
.ranking-card.rank-3 .rank-badge { background: var(--color-bronze); color: #fff; }

/* ===== Ranking thumbnail ===== */
.ranking-card img {
  width: 70px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ===== Ranking info ===== */
.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-title {
  font-size: 0.9rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-artist {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

.ranking-stats {
  font-size: 0.78rem;
  font-family: sans-serif;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.ranking-stats strong {
  color: var(--color-primary);
}

.low-data {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-style: italic;
  font-weight: normal;
}
