:root {
  --bg: #0a1e22;
  --surface: #11292d;
  --text: #eaf6f6;
  --muted: #93b2b3;
  --border: #1f4347;
  --accent: #3ecbd6;
  --accent-text: #052226;
  --gold: #e8c158;
  --silver: #b9c4c6;
  --bronze: #c58a4a;
  --danger: #ff8a80;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 16px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding-block: 20px 60px;
}

h1, h2, h3 { line-height: 1.2; }

a { color: var(--accent); }

nav.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  padding-top: 16px;
}

nav.site-nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

nav.site-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}

nav.site-nav a.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

nav.site-nav a.hamburger {
  padding: 6px 12px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

input[type="file"] { margin-top: 4px; }

button, .button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.status.success { background: #2fa66b2e; color: #7fe3b4; }
.status.error { background: #ff8a8022; color: var(--danger); }
.status.info { background: #3ecbd622; color: #7fdfe6; }

.muted { color: var(--muted); font-size: 0.9rem; }

/* Swipeable image gallery */
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0;
  border-radius: var(--radius);
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

.gallery img {
  flex: 0 0 100%;
  scroll-snap-align: center;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #00000010;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.gallery-dots span.active {
  background: var(--accent);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-header h3 { margin: 0 0 2px; }

/* 1-5 score toggle */
.score-toggle {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.score-toggle input { display: none; }

.score-toggle label {
  flex: 1;
  margin: 0;
  text-align: center;
  padding: 12px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 700;
  cursor: pointer;
}

.score-toggle input:checked + label {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th { background: var(--bg); font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }

tr:last-child td { border-bottom: none; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--muted);
}

.rank-badge.rank-1 { background: var(--gold); }
.rank-badge.rank-2 { background: var(--silver); }
.rank-badge.rank-3 { background: var(--bronze); }

.result-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.result-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.flag {
  color: var(--danger);
  font-weight: 600;
}

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions button { padding: 6px 10px; font-size: 0.85rem; }

.logo-badge {
  width: fit-content;
  margin: 8px auto 24px;
  padding: 14px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 16px #00000040;
}

.site-logo {
  display: block;
  max-width: 220px;
  width: 100%;
}

.rules-list {
  margin: 0;
  padding-left: 20px;
}

/* --------------------------------------------------------------------- */
/* Battle Vote (phone voter view) */
/* --------------------------------------------------------------------- */

.battle-header {
  text-align: center;
  margin-bottom: 16px;
}

.battle-theme {
  color: var(--gold);
  font-weight: 600;
  margin: 2px 0 10px;
}

.battle-progress {
  font-weight: 700;
  margin: 4px 0;
}

.battle-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.battle-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.battle-pair {
  display: flex;
  flex-direction: column;
}

.battle-card {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border: 2px solid var(--border);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.battle-card:active {
  transform: scale(0.97);
}

.battle-card-chosen {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #3ecbd655;
}

.battle-card-info {
  text-align: center;
  margin-top: 10px;
}

.battle-card-model {
  font-size: 1.2rem;
  font-weight: 800;
}

.battle-vs {
  text-align: center;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin: 6px 0;
}

.battle-complete {
  text-align: center;
  padding: 32px 16px;
}

/* --------------------------------------------------------------------- */
/* Live Results (TV/monitor view) */
/* --------------------------------------------------------------------- */

.live-main {
  max-width: 900px;
}

.live-main h1, .live-main h2 {
  text-align: center;
}

.live-banner {
  text-align: center;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 10px;
  border-radius: 8px;
  background: var(--danger);
  color: #1c1310;
  margin-bottom: 16px;
  animation: live-pulse 1.6s infinite;
}

.live-banner.final {
  background: var(--gold);
  animation: none;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.live-progress-bar {
  height: 16px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin: 10px 0;
}

.live-progress-fill {
  height: 100%;
  background: var(--accent);
}

.live-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.live-rank-row:last-child { border-bottom: none; }

.live-rank-image {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg);
}

.live-rank-image-placeholder {
  border: 1px dashed var(--border);
}

.live-rank-info { flex: 1; }

.live-rank-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.activity-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.podium-place {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  flex: 1;
  min-width: 120px;
  max-width: 180px;
}

.podium-medal { font-size: 2.2rem; }
.podium-name { font-weight: 800; margin-top: 6px; }

.podium-1 { order: 2; padding-top: 28px; border-color: var(--gold); }
.podium-2 { order: 1; }
.podium-3 { order: 3; }

.rules-list li { margin-bottom: 8px; }

.points-table {
  margin-top: 12px;
}
