/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --yellow: #f5c518;
  --yellow-dark: #d4a80e;
  --black: #1a1a1a;
  --white: #ffffff;
  --bg: #fffef5;
  --surface: #ffffff;
  --border: #e8e2cc;
  --text: #1f1f1f;
  --muted: #6b6560;
  --green: #2d6a2d;
  --green-bg: #d4edda;
  --green-border: #b8dbb8;
  --red: #7c1d1d;
  --red-bg: #fde8e8;
  --red-border: #f5c6c6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0 0 0 / 0.07);
  --shadow-hover: 0 8px 28px rgba(0 0 0 / 0.13);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

main { flex: 1; }

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  background: var(--black);
  color: var(--white);
}

.header-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
}

.bee-icon {
  display: block;
  font-size: 3rem;
  margin-bottom: 0.4rem;
  line-height: 1;
}

header h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

header p {
  margin-top: 0.4rem;
  color: #a8a8a8;
  font-size: 1rem;
}

/* ── Nav ───────────────────────────────────────────────────────────────────── */
nav {
  background: var(--black);
  border-top: 1px solid #2e2e2e;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  max-width: 1100px;
  margin-inline: auto;
  display: flex;
  padding-inline: 0.5rem;
}

nav a {
  color: #b0b0b0;
  text-decoration: none;
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav a:hover { color: var(--yellow); }

nav a.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

/* ── Main container ────────────────────────────────────────────────────────── */
main {
  max-width: 1100px;
  margin-inline: auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

/* ── Form card ─────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 560px;
  margin-inline: auto;
}

.form-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ── Form fields ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fafaf7;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--yellow);
  background: var(--white);
}

/* ── File upload ───────────────────────────────────────────────────────────── */
.file-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 2rem 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafaf7;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.file-upload:hover,
.file-upload:focus-within {
  border-color: var(--yellow);
  background: #fffef0;
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon { font-size: 2rem; line-height: 1; }

.upload-prompt {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.file-chosen {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--yellow-dark);
  word-break: break-all;
  min-height: 1.2em;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  margin-top: 1rem;
  background: var(--yellow);
  color: var(--black);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--yellow-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245 197 24 / 0.45);
}

.btn:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg);
  box-shadow: none;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border-width: 1px;
  border-style: solid;
}

.alert-success {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.alert-error {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

/* ── Entries header ────────────────────────────────────────────────────────── */
.entries-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.entries-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  background: var(--yellow);
  color: var(--black);
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 20px;
  vertical-align: middle;
  line-height: 1.6;
}

/* ── Entry grid ────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
  list-style: none;
}

/* ── Entry card ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-img {
  width: 100%;
  height: auto;
}

.card-body {
  padding: 1.1rem 1.2rem 1.2rem;
}

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.card-mascot {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.empty-state span {
  display: block;
  font-size: 4rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.empty-state p { font-size: 1.05rem; }

/* ── Voting ─────────────────────────────────────────────────────────────────── */
.card-votes {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.vote-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}

.vote-btn:hover  { background: var(--bg); }
.vote-btn:active { background: var(--border); }
.vote-btn.voted  { color: var(--text); }
.vote-btn + .vote-btn { border-left: 1px solid var(--border); }

.heart { font-size: 1.25rem; line-height: 1; transition: transform 0.1s; }
.vote-btn:active .heart { transform: scale(1.3); }

.vote-image .heart { color: var(--yellow); }
.vote-name  .heart { color: var(--black); }

/* ── Results page ────────────────────────────────────────────────────────────── */
.results-section {
  margin-bottom: 4rem;
}

.results-heading {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.results-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  counter-reset: none;
}

.result-card {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

/* highlight the winner (last entry = highest votes) */
.result-card:last-child {
  border-color: var(--yellow);
  box-shadow: 0 4px 24px rgba(245, 197, 24, 0.35);
}

.result-card:last-child::before {
  content: '🏆';
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.result-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.result-body { flex: 1; min-width: 0; }

.result-mascot {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-submitter {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.result-votes {
  font-size: 0.9rem;
  font-weight: 700;
}

/* ── Admin ──────────────────────────────────────────────────────────────────── */
.admin-section { margin-bottom: 3rem; }

.admin-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.admin-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.admin-control-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.control-header h3 { font-size: 0.95rem; font-weight: 600; margin: 0; }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-open    { background: var(--green-bg);  color: var(--green); border: 1px solid var(--green-border); }
.pill-closed  { background: var(--red-bg);    color: var(--red);   border: 1px solid var(--red-border); }
.pill-ended   { background: #e8e8e8; color: #555;    border: 1px solid #ccc; }
.pill-pending { background: #fff3cd; color: #856404; border: 1px solid #ffe08a; }

.action-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-sm {
  width: auto;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.btn-red {
  background: var(--red-bg);
  color: var(--red);
  border: 2px solid var(--red-border);
}
.btn-red:hover { background: #f5c6c6; box-shadow: none; transform: none; }

/* ── Admin entry list ────────────────────────────────────────────────────────── */
.admin-entry-list { display: flex; flex-direction: column; gap: 0.75rem; }

.admin-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.entry-hidden { opacity: 0.45; }

.admin-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.admin-entry-info { flex: 1; min-width: 0; }

.admin-mascot {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-meta {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-vote-counts { margin-top: 0.2rem; }
.avc-image { color: var(--yellow-dark); font-weight: 700; }
.avc-name  { color: var(--black);       font-weight: 700; }

.admin-entry-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.admin-entry-actions form { margin: 0; }
.admin-entry-actions .btn { margin-top: 0; }

@media (max-width: 600px) {
  .admin-entry { flex-wrap: wrap; }
  .admin-entry-actions { width: 100%; }
  .admin-entry-actions .btn { flex: 1; text-align: center; }
}

/* ── Image modal ───────────────────────────────────────────────────────────── */
.img-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0 0 0 / 0.92);
  cursor: zoom-out;
}

.img-modal[hidden] { display: none; }

.img-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0 0 0 / 0.6);
}

.card-img { cursor: zoom-in; }

/* ── Cookie banner ─────────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background: var(--black);
  color: #d0d0d0;
  font-size: 0.875rem;
  border-bottom: 3px solid var(--yellow);
}

.cookie-banner[hidden] { display: none; }

.cookie-banner p { margin: 0; max-width: 640px; }

.cookie-btn {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.cookie-btn:hover { background: var(--yellow-dark); }

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 1.5rem 1rem 1.25rem; }
  main { padding: 1.75rem 1rem 3rem; }
  .form-card { padding: 1.5rem 1.25rem; }
  .grid { grid-template-columns: 1fr; }
  nav a { padding: 0.8rem 1rem; font-size: 0.9rem; }
}

@media (max-width: 400px) {
  .form-card { padding: 1.25rem 1rem; }
}
