/* === PLATEMASH — Facemash replica UI === */

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

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #ffffff;
  color: #333;
  min-height: 100vh;
}

/* === NAV BAR (below photos like original) === */
.nav-bar {
  text-align: center;
  padding: 14px 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
}

.nav-bar .nav-link {
  color: #8B0000;
  text-decoration: none;
}

.nav-bar .nav-link:hover {
  color: #5a0000;
  text-decoration: underline;
}

/* === HEADER === */
.site-header {
  background: #8B0000;
  text-align: center;
  padding: 18px 0 14px;
  border-bottom: 3px solid #5a0000;
}

.site-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 62px;
  font-weight: normal;
  color: #fff;
  letter-spacing: 8px;
  cursor: pointer;
  margin: 0;
  text-transform: uppercase;
}

/* === MAIN CONTENT === */
.main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* === VIEWS === */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* === VOTE VIEW === */
.tagline {
  text-align: center;
  font-size: 13px;
  color: #555;
  margin-bottom: 2px;
  font-style: italic;
}

.tagline em {
  font-style: italic;
  font-weight: bold;
}

.instruction {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #222;
  margin: 8px 0 20px;
}

.matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.photo-card {
  cursor: pointer;
  transition: transform 0.12s ease;
}

/* Only apply hover effects on devices with a real pointer (not touch) */
@media (hover: hover) and (pointer: fine) {
  .photo-card:hover {
    transform: scale(1.03);
  }

  .photo-card:hover .photo-frame {
    border-color: #8B0000;
    box-shadow: 0 4px 16px rgba(139, 0, 0, 0.3);
  }
}

.photo-frame {
  width: 300px;
  height: 240px;
  background: #fff;
  border: 3px solid #888;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-width: 100%;
}

.or-divider {
  font-size: 15px;
  font-style: italic;
  color: #777;
  padding: 0 4px;
}

.vote-stats {
  text-align: center;
  font-size: 12px;
  color: #777;
  margin-top: 10px;
  font-family: Arial, Helvetica, sans-serif;
}

.vote-stats span {
  font-weight: bold;
  color: #333;
}

/* === WINNER / LOSER ANIMATION === */
.photo-card.winner .photo-frame {
  border-color: #2a7d2a;
  box-shadow: 0 0 16px rgba(42, 125, 42, 0.4);
}

.photo-card.loser {
  opacity: 0.35;
  transform: scale(0.95);
}

/* === LEADERBOARD VIEW === */
.page-title {
  font-family: Arial Black, 'Arial Bold', Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #8B0000;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 12px;
  color: #777;
  margin-bottom: 16px;
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #bbb;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.rankings-table th {
  background: #8B0000;
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rankings-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

.rankings-table tbody tr:hover {
  background: #fff5f5;
}

.rankings-table .rank-cell {
  font-weight: bold;
  width: 50px;
  text-align: center;
}

.rankings-table .plate-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rankings-table .plate-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #ccc;
}

.rankings-table .rating-cell {
  font-weight: bold;
  font-size: 13px;
  color: #333;
}

.rankings-table .wins-cell {
  color: #2a7d2a;
  font-weight: bold;
}

.rankings-table .losses-cell {
  color: #c0392b;
  font-weight: bold;
}

.rank-gold { color: #b8860b; font-size: 15px; }
.rank-silver { color: #808080; font-size: 14px; }
.rank-bronze { color: #8B4513; font-size: 14px; }

.pagination {
  text-align: center;
  padding: 14px 0;
}

.pagination a {
  color: #8B0000;
  text-decoration: none;
  font-weight: bold;
  font-size: 12px;
}

.pagination a:hover {
  text-decoration: underline;
}

/* === ABOUT VIEW === */
.about-text {
  background: #fff;
  border: 1px solid #bbb;
  padding: 18px 22px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
}

.about-text p {
  margin-bottom: 10px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* === ALGORITHM SECTION === */
.algorithm-section {
  margin-bottom: 20px;
}

.algo-title {
  font-family: Arial Black, 'Arial Bold', Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 10px;
  color: #8B0000;
}

.algorithm-window {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  border-radius: 6px;
  padding: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.window-glare {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.formula-block {
  position: relative;
  z-index: 1;
}

.formula-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 22px;
  color: #e0e0e0;
}

.formula-label {
  font-style: italic;
  font-size: 24px;
  min-width: 30px;
}

.formula-equals {
  font-size: 24px;
}

.formula-expr {
  font-style: italic;
  font-size: 20px;
}

.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
}

.frac-top {
  border-bottom: 2px solid #e0e0e0;
  padding: 0 8px 4px;
  font-size: 22px;
}

.frac-bottom {
  padding: 4px 8px 0;
  font-size: 18px;
}

.formula-note {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 13px;
  color: #8899aa;
  font-style: italic;
  margin: 14px 0 6px;
}

/* === ABOUT FOOTER === */
.about-footer {
  text-align: center;
  padding: 14px;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

/* === SITE FOOTER === */
.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 10px;
  color: #999;
  border-top: 1px solid #bbb;
  margin-top: 30px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .site-title {
    font-size: 38px;
    letter-spacing: 4px;
  }

  .matchup {
    flex-direction: column;
    gap: 8px;
  }

  .photo-frame {
    width: 85vw;
    min-width: 280px;
    max-width: 300px;
    height: 200px;
  }

  .or-divider {
    margin: 4px 0;
  }

  .instruction {
    font-size: 15px;
  }

  .rankings-table .plate-thumb {
    width: 60px;
    height: 45px;
  }

  .algorithm-window {
    padding: 20px 14px;
  }

  .formula-line {
    font-size: 16px;
    gap: 8px;
  }

  .formula-label { font-size: 18px; }
  .frac-top { font-size: 16px; }
  .frac-bottom { font-size: 14px; }
}

@media (max-width: 480px) {
  .photo-frame {
    height: 170px;
  }

  .rankings-table {
    font-size: 10px;
  }

  .rankings-table th,
  .rankings-table td {
    padding: 4px 6px;
  }
}
