@font-face {
  font-family: 'Permanent Marker';
  font-style: normal;
  font-weight: 400;
  src: url('/font/permanent-marker.woff2') format('woff2');
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Two — and only two — yellows are used across the site:
     --tape-yellow      bright primary (leaderboard bars, primary action buttons,
                          voted markers, jury winners warning band)
     --tape-yellow-soft same hue at 33% alpha (confirm button, hover/bump
                          highlights, voting-progress chart fill)
     If you find yourself reaching for a third yellow, reach for one of these
     instead. */
  --tape-yellow: #ffb84a;
  --tape-yellow-soft: rgba(255, 184, 74, 0.33);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  color: #1e1d19;
  font-family: 'Permanent Marker', cursive;
  background: #afaea7 url('/static/background_2.webp') no-repeat center / cover;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

#app:fullscreen {
  background: #000;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fatal-error {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 2rem;
  color: #2b2924;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  text-align: center;
}

#overlay-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#toast-root {
  position: fixed;
  top: 5.5rem;
  right: 1.25rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(24rem, calc(100vw - 2.5rem));
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  border: 2px solid rgba(49, 45, 38, 0.42);
  background: rgba(247, 242, 228, 0.98);
  color: #1e1d19;
  box-shadow: 0 16px 36px rgba(31, 28, 23, 0.24);
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--error {
  border-color: rgba(150, 70, 60, 0.55);
  background: rgba(247, 226, 215, 0.98);
}

.toast--info {
  border-color: rgba(49, 45, 38, 0.32);
}

.toast__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d674d;
  margin: 0 0 0.15rem 0;
  font-weight: 800;
}

.toast__body {
  margin: 0;
  word-break: break-word;
}

.toast__close {
  margin-left: auto;
  background: none;
  border: 0;
  color: #1e1d19;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  font-weight: 800;
  opacity: 0.55;
}

.toast__close:hover {
  opacity: 1;
}

.dialog-overlay,
#google-signin-overlay {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  pointer-events: auto;
  background: rgba(40, 38, 34, 0.54);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease;
}

#google-signin-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.dialog-card,
.signin-card {
  width: min(34rem, 100%);
  padding: 1.2rem;
  border: 2px solid rgba(49, 45, 38, 0.34);
  border-radius: 1.25rem;
  background: rgba(247, 242, 228, 0.96);
  box-shadow: 0 32px 70px rgba(31, 28, 23, 0.26);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-kicker,
.signin-kicker {
  margin: 0;
  color: #6d674d;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-card h2,
.signin-card h2 {
  margin: 1rem 0 1rem 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.05;
}

.signin-copy {
  margin: 0.9rem 0 1.25rem;
  color: #575246;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
}

.signin-button-host {
  display: grid;
  justify-items: center;
  width: 100%;
  min-height: 44px;
  margin: 2.5rem auto 0 auto;
}

.signin-error,
.dialog-status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0;
  color: #5a5346;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.dialog-close,
.dialog-save {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  color: #1e1d19;
  font: inherit;
  background: var(--tape-yellow-soft);
  cursor: pointer;
}

.dialog-close {
  background: rgba(30, 29, 25, 0.08);
}

.dialog-form {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.1rem;
}

.dialog-field {
  display: grid;
  gap: 0.45rem;
}

.dialog-field span {
  font-size: 0.82rem;
  color: #6a634e;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-field input,
.dialog-field textarea,
.dialog-field select {
  width: 100%;
  border: 1px solid rgba(49, 45, 38, 0.18);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  color: #1e1d19;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.68);
}

.dialog-field textarea {
  resize: vertical;
  min-height: 7rem;
}

.dialog-field select {
  appearance: none;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .dialog-card,
  .signin-card {
    padding: 1rem;
  }

  .dialog-header,
  .dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== Voting + Leaderboard ===== */

body.is-voting-page,
body.is-voting-page html {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
}

.voting-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: auto !important;
  background: #efeae0;
  color: #1e1d19;
  padding: 0;
  --voting-header-height: 5rem;
}

@media (max-width: 720px) {
  .voting-page {
    --voting-header-height: 3.25rem;
  }
}

.voting-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 3px solid #1e1d19;
  background: #f7f2e4;
  position: sticky;
  top: 0;
  z-index: 5;
}

.voting-header h1 {
  margin: 0;
  font-size: 1.8rem;
  flex: 1;
  text-align: center;
}

.voting-home {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #1e1d19;
  border: 2px solid #1e1d19;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.voting-home__arrow {
  font-size: 1rem;
  line-height: 1;
}

.voting-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.voting-user__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid #1e1d19;
  object-fit: cover;
  background: #f7f2e4;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  color: #1e1d19;
  text-transform: uppercase;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.voting-user__avatar--placeholder {
  background: var(--tape-yellow-soft);
}

.voting-user__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.voting-user__signout {
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  background: none;
  border: 2px solid #1e1d19;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: #1e1d19;
  cursor: pointer;
}

.voting-user__signout:hover {
  background: var(--tape-yellow-soft);
}

@media (max-width: 720px) {
  .voting-header {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }

  .voting-header h1 {
    font-size: clamp(1rem, 4.2vw, 1.3rem);
  }

  .voting-home {
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
  }

  /* Hide the "Home" word — the arrow alone reads as a back button. */
  .voting-home__label {
    display: none;
  }

  .voting-user {
    gap: 0.35rem;
  }

  /* Hide the username on mobile; the avatar identifies the user. */
  .voting-user__name {
    display: none;
  }

  .voting-user__avatar {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.85rem;
  }

  .voting-user__signout {
    padding: 0.15rem 0.45rem;
    font-size: 0.95rem;
  }
}

.voting-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.voting-main--admin {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 1300px;
}

.voting-main--leaderboard {
  position: relative;
  max-width: none;
  width: 100%;
  margin: 0;
  /* Fill the rest of the viewport below the sticky .voting-header. The
     header height is exposed as --voting-header-height so the math stays
     correct on mobile (where the header is shorter). dvh keeps mobile
     browser chrome from cutting the bottom tape off. */
  height: calc(100dvh - var(--voting-header-height));
  min-height: calc(100dvh - var(--voting-header-height));
  /* Reserve a band at the top and bottom for the tape overlays so flow
     content (cup, polaroid, lists) sits in the paper area between them. */
  padding: var(--lb-tape-band) 0;
  overflow: hidden;
  background: url('/static/cup_background_paper.webp') no-repeat center / cover;
  --lb-tape-band: clamp(72px, 12vh, 130px);
}

/* Tape overlays — top and bottom strips that visually replace the baked-in
   tape that used to live in cup_background.webp. The tape art lives on a
   ::before pseudo-element so that the bottom variant can rotate the image
   180deg without flipping the content (tabs / members) inside it. */
.lb-tape {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--lb-tape-band);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  padding-bottom: 2rem;
  z-index: 2;
  pointer-events: none;
}

.lb-tape::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/static/cup_background_tape.png') no-repeat center / 100% 100%;
  z-index: -1;
}

.lb-tape--top {
  top: 0;
  /* Inherits align-items: center from .lb-tape so the tabs row sits
     vertically centered in the tape band whether it wraps to one line
     or two. */
}

.lb-tape--bottom {
  bottom: 0;
  align-items: flex-start;
  padding-top: 3rem;
  padding-bottom: 0.5rem;
}

.lb-tape--bottom::before {
  transform: rotate(180deg);
}

.lb-tape > * {
  pointer-events: auto;
}

.lb-tape__members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  font-family: 'Permanent Marker', cursive;
  max-width: min(900px, 92%);
}

.lb-tape__members:empty {
  display: none;
}

.voting-status {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.voting-status:empty {
  display: none;
}

.voting-chip {
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
}

.voting-chip--error {
  background: #ffe2c4;
  border-color: #c2401d;
}

.voting-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* When tabs sit inside the top leaderboard tape they don't need a bottom
   margin — the tape band already provides spacing below the buttons. */
.lb-tape .voting-tabs {
  margin-bottom: 0;
}

.voting-tabs button {
  font-family: inherit;
  border: 2px solid #1e1d19;
  background: #fff8e6;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
}

.voting-tabs button.is-active {
  background: #1e1d19;
  color: #f7f2e4;
}

@media (max-width: 720px) {
  .voting-tabs {
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    padding: 0 0.4rem;
  }

  .voting-tabs button {
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    border-width: 1.5px;
    line-height: 1.05;
  }
}

.voting-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* PC live-tally list: cap to the paper area between the top and bottom
   tape bands so rows scroll inside the visible paper instead of slipping
   under the bottom tape. */
.voting-main--leaderboard [data-pc-list].lb-list {
  max-height: calc(100dvh - var(--voting-header-height) - 2 * var(--lb-tape-band));
  overflow-y: auto;
  padding-right: 0.4rem;
  scrollbar-gutter: stable;
}

.voting-main--leaderboard [data-pc-list].lb-list::-webkit-scrollbar {
  width: 8px;
}

.voting-main--leaderboard [data-pc-list].lb-list::-webkit-scrollbar-thumb {
  background: rgba(31, 28, 23, 0.32);
  border-radius: 999px;
}

.voting-main--leaderboard [data-pc-list].lb-list::-webkit-scrollbar-track {
  background: transparent;
}

.lb-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 2fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.55rem 1rem;
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 0.6rem;
  transition: transform 0.4s ease, background 0.4s ease;
}

.lb-row--bump {
  transform: scale(1.02);
  background: var(--tape-yellow-soft);
}

.lb-row__name {
  font-size: 1.1rem;
  min-width: 0;
}

.lb-row__name-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .lb-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem 0.6rem;
    padding: 0.55rem 0.85rem;
  }

  .lb-row__bar {
    grid-column: 1 / -1;
  }
}

.lb-row__bar {
  height: 12px;
  background: #e3dccc;
  border-radius: 999px;
  overflow: hidden;
}

.lb-row__bar span {
  display: block;
  height: 100%;
  background: rgba(255, 184, 74, 0.45);
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}

.lb-row__count {
  font-size: 1.4rem;
  min-width: 2.5rem;
  text-align: right;
}

.lb-row--jury {
  grid-template-columns: 1.5fr auto auto;
}

.lb-row--jury.is-winner {
  background: #d8e7c7;
}

.lb-row__avg {
  font-size: 1.1rem;
  opacity: 0.85;
}

.lb-row__dist {
  display: flex;
  gap: 0.35rem;
}

.lb-pip {
  font-size: 0.7rem;
  background: #efeae0;
  border: 1px solid #1e1d19;
  border-radius: 0.4rem;
  padding: 0.15rem 0.4rem;
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.lb-pip b {
  font-size: 0.85rem;
}

.lb-row__crown {
  font-size: 0.85rem;
  background: var(--tape-yellow);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
}

/* admin view */
.admin-card {
  background: #f7f2e4;
  border: 2px solid #1e1d19;
  border-radius: 0.8rem;
  padding: 1rem 1.25rem;
}

.admin-card--wide {
  grid-column: 1 / -1;
}

.admin-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.3rem;
}

.admin-status {
  margin-bottom: 0.75rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-btn {
  font-family: inherit;
  border: 2px solid #1e1d19;
  background: #fff8e6;
  padding: 0.4rem 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-btn:hover { background: var(--tape-yellow-soft); }
.admin-btn.is-active { background: #1e1d19; color: #f7f2e4; }
.admin-btn--primary { background: var(--tape-yellow); }
.admin-btn--danger { background: #f3c0b8; margin-left: 0.5rem; }
.admin-btn--danger:hover { background: #eda99f; }

.admin-winners {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.admin-winners__lock {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.75rem;
  background: var(--tape-yellow-soft);
  border: 2px solid #1e1d19;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.admin-info {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--tape-yellow-soft);
  border: 2px solid #1e1d19;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #1e1d19;
}

.admin-info[hidden] {
  display: none;
}

.admin-btn[disabled],
.admin-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-winner select[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-winner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.admin-winner select {
  font-family: inherit;
  padding: 0.3rem;
  border: 2px solid #1e1d19;
  border-radius: 0.4rem;
  background: #fff8e6;
}

.admin-lb {
  margin-bottom: 1.25rem;
}

.vote-progress {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.vote-progress__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.vote-progress__chart {
  width: 100%;
  height: auto;
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 0.5rem;
}

.vote-progress__empty {
  margin: 0;
  padding: 1rem;
  background: #efe7d5;
  border: 2px dashed rgba(30, 29, 25, 0.4);
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.95rem;
}

.vote-progress__non-voters {
  margin-top: 0.4rem;
  padding: 0.6rem 0.85rem;
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.vote-progress__non-voters-title {
  margin: 0 0 0.3rem;
  font-weight: bold;
}

.vote-progress__non-voters-list {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
}

.vote-progress__non-voters-list li {
  margin-bottom: 0.15rem;
}

.vote-progress__voter-meta {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-left: 0.4rem;
}

.admin-lb h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.admin-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.admin-toolbar select {
  font-family: inherit;
  padding: 0.25rem 0.5rem;
  border: 2px solid #1e1d19;
  border-radius: 0.4rem;
  background: #fff8e6;
  margin-left: 0.4rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 2px solid #1e1d19;
  border-radius: 0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff8e6;
}

.admin-table th,
.admin-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(30,29,25,0.18);
  text-align: left;
  vertical-align: top;
}

.admin-table thead th {
  background: #1e1d19;
  color: #f7f2e4;
  position: sticky;
  top: 0;
}

.admin-count {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-left: 0.5rem;
}

.voting-empty {
  display: grid;
  place-items: center;
  height: 100vh;
  font-size: 1.5rem;
}

/* product page voting overlay */
.vote-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: min(22rem, calc(100vw - 2rem));
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 0.8rem;
  padding: 1rem;
  z-index: 20;
  font-size: 0.95rem;
  box-shadow: 0 12px 28px rgba(31,28,23,0.25);
  pointer-events: auto;
}

#app:fullscreen .vote-panel {
  display: none;
}

.vote-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.vote-panel__header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.vote-panel__link {
  font-size: 0.85rem;
  color: #1e1d19;
}

.vote-panel__status {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.vote-panel__status span {
  background: #efeae0;
  border: 1px solid #1e1d19;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.vote-panel__note {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.vote-btn {
  font-family: inherit;
  width: 100%;
  border: 2px solid #1e1d19;
  background: var(--tape-yellow);
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.vote-btn.is-active {
  background: #1e1d19;
  color: #f7f2e4;
}

.vote-panel__jury {
  margin-top: 0.5rem;
  border-top: 1px dashed #1e1d19;
  padding-top: 0.5rem;
}

.vote-panel__jury-title {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: bold;
}

.vote-panel__jury-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.vote-panel__jury-label {
  font-size: 0.85rem;
}

.vote-panel__scores {
  display: inline-flex;
  gap: 0.2rem;
}

.score-btn {
  font-family: inherit;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid #1e1d19;
  background: #efeae0;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.score-btn.is-active {
  background: #1e1d19;
  color: #f7f2e4;
}

.vote-panel__error {
  color: #8b3414;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  min-height: 1em;
}

@media (max-width: 720px) {
  .voting-main--admin {
    grid-template-columns: 1fr;
  }

  /* On mobile, dock the project page's vote panel as a bottom sheet so it
     never covers the project title at the top of the page. Cap the height
     and let it scroll internally if a long jury form needs more room. */
  .vote-panel {
    top: auto;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.75rem;
  }
}

.confirm-overlay {
  pointer-events: auto;
  z-index: 50;
}

.confirm-card {
  max-width: 28rem;
}

.confirm-intro {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.confirm-details {
  margin: 0 0 0.6rem;
}

.confirm-details summary {
  cursor: pointer;
  list-style: none;
}

.confirm-details summary::-webkit-details-marker {
  display: none;
}

.confirm-details summary::after {
  content: ' ▾';
  display: inline-block;
  transition: transform 120ms ease;
}

.confirm-details[open] summary::after {
  transform: rotate(180deg);
}

.confirm-kicker {
  margin: 0.4rem 0 0.3rem;
  opacity: 0.75;
  font-size: 0.9rem;
}

.confirm-list {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.confirm-list li {
  margin-bottom: 0.3rem;
}

@media (max-width: 720px) {
  .confirm-card {
    max-width: calc(100vw - 1.5rem);
    padding: 0.85rem 0.9rem;
    border-radius: 1rem;
  }

  .confirm-card h2 {
    margin: 0.2rem 0 0.5rem;
    font-size: clamp(1.15rem, 5vw, 1.45rem);
    line-height: 1.1;
  }

  .confirm-intro {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
  }

  .confirm-kicker {
    font-size: 0.8rem;
    margin: 0.2rem 0;
  }

  .confirm-list {
    font-size: 0.85rem;
    padding-left: 1rem;
  }

  .confirm-list li {
    margin-bottom: 0.2rem;
  }

  /* Override dialog-actions column-stack for the confirm dialog so the
     two buttons sit side-by-side and don't push content off screen. */
  .confirm-card .dialog-actions {
    flex-direction: row;
    gap: 0.5rem;
    margin-top: 0.6rem;
  }

  .confirm-card .dialog-close,
  .confirm-card .dialog-save {
    flex: 1;
    padding: 0.55rem 0.6rem;
    font-size: 0.92rem;
  }
}

.home-admin-link {
  position: fixed;
  left: 3rem;
  top: 3rem;
  z-index: 30;
  text-decoration: none;
  color: #1e1d19;
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-family: 'Permanent Marker', cursive;
  font-size: 0.95rem;
  box-shadow: 0 6px 14px rgba(31, 28, 23, 0.18);
  pointer-events: auto;
}

.home-admin-link:hover {
  background: var(--tape-yellow);
}

@media (max-width: 720px) {
  .home-admin-link {
    left: 14px;
    top: 14px;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
  }
}

.project-manager {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 22rem;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 26px rgba(31, 28, 23, 0.22);
  z-index: 25;
  font-size: 0.9rem;
}

.pm-team {
  margin-bottom: 0.7rem;
}

.pm-team h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.pm-btn {
  font-family: inherit;
  border: 2px solid #1e1d19;
  background: var(--tape-yellow, #ffd966);
  border-radius: 0.35rem;
  padding: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pm-btn:hover {
  filter: brightness(1.05);
}

.pm-error {
  color: #8b3414;
  font-size: 0.8rem;
  margin: 0.4rem 0 0;
}

.pm-error:empty {
  display: none;
}

/* ===== Leaderboard row enter/move animation ===== */

.lb-list .lb-row {
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.lb-row--enter {
  animation: lb-row-enter 420ms ease both;
}

@keyframes lb-row-enter {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== People's Choice champion card ===== */

.pc-champion {
  /* Now a transparent wrapper around .jury-stage__board (the same layout
     the jury panels use). The old flex/padding shrunk the board to its
     content width, so the tape rendered narrower than on jury panels. */
  display: block;
  padding: 0;
}

.pc-champion[hidden] {
  display: none;
}

.pc-champion__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

@media (min-width: 720px) {
  .pc-champion__hero {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }
}

.pc-champion__loading,
.pc-champion__error {
  color: #5a5346;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  padding: 2rem 1rem;
}

.pc-champion__cup {
  width: min(58vw, 320px);
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(31, 28, 23, 0.32));
  animation: pc-champion-cup-in 600ms ease both;
}

@media (min-width: 720px) {
  .pc-champion__cup {
    width: min(36vw, 360px);
  }
}

@keyframes pc-champion-cup-in {
  from {
    opacity: 0;
    transform: scale(0.85) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.pc-champion__selfies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0.4rem 0 0.2rem;
}

.pc-champion__selfie {
  border-radius: 0.85rem;
  border: 3px solid #1e1d19;
  object-fit: cover;
  background: #f7f2e4;
  box-shadow: 0 10px 22px rgba(31, 28, 23, 0.32);
  transform: rotate(-2deg);
}

.pc-champion__selfie:nth-child(2n) {
  transform: rotate(2deg);
}

.pc-champion__selfies--solo .pc-champion__selfie {
  width: clamp(8rem, 32vw, 13rem);
  height: clamp(8rem, 32vw, 13rem);
}

.pc-champion__selfies--duo .pc-champion__selfie {
  width: clamp(7rem, 22vw, 10.5rem);
  height: clamp(7rem, 22vw, 10.5rem);
}

.pc-champion__selfies--many .pc-champion__selfie {
  width: clamp(5.5rem, 16vw, 8.5rem);
  height: clamp(5.5rem, 16vw, 8.5rem);
}

.pc-champion__selfie--placeholder {
  display: grid;
  place-items: center;
  background: var(--tape-yellow);
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(3rem, 9vw, 6rem);
  color: #1e1d19;
  line-height: 1;
}

.pc-champion__kicker {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6d674d;
  margin-top: 0.2rem;
}

.pc-champion__project {
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  margin: 0.05rem 0 0.15rem;
}

.pc-champion__team {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pc-champion__members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.85rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #4f493d;
  max-width: 32rem;
}

.pc-champion__member {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pc-champion__avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 2px solid #1e1d19;
  object-fit: cover;
  background: #f7f2e4;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: #1e1d19;
  text-transform: uppercase;
}

.pc-champion__avatar--placeholder {
  background: #efeae0;
}

.pc-champion__votes {
  margin-top: 0.4rem;
  display: inline-block;
  background: var(--tape-yellow);
  border: 2px solid #1e1d19;
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 800;
}

/* ===== Jury winner stage ===== */

.voting-panel.jury-stage {
  padding: 0;
}

.jury-stage__title {
  /* Sits on the cup's top banner area inside .jury-stage__cup-wrap. */
  position: absolute;
  left: 50%;
  top: 13%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 42%;
  margin: 0;
  text-align: center;
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(0.85rem, 1.6vw, 1.5rem);
  line-height: 1.05;
  color: #1e1d19;
  pointer-events: none;
  word-break: break-word;
}

.jury-stage__hint {
  text-align: center;
  margin: 0 0 0.6rem;
  color: #6d674d;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.jury-stage__board {
  /* The torn-paper band sits on .voting-main--leaderboard; the board is a
     transparent overlay that hosts the cup + polaroid/tape over it.

     Cup + tape are flow children stacked via flex (they never overlap).
     Polaroid and members are intentionally NOT positioned against the
     board — they escape it (since the board is `position: static`) and
     anchor to .voting-main--leaderboard so the polaroid pins to the
     leaderboard's right edge and the members list pins to its bottom. */
  position: static;
  color: #f7f2e4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 0 2rem;
}

.jury-stage__cup-wrap {
  position: relative;
  /* Sized to fit cup + tape + bottom-pinned members within a single
     viewport-tall leaderboard area without overflow. */
  height: clamp(200px, 42vh, 420px);
  /* cup.webp is 1662 × 1458 — lock aspect so the title can be placed at
     a fixed percentage offset that always lands on the cup's top banner. */
  aspect-ratio: 1662 / 1458;
  flex: 0 0 auto;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.55));
}

.jury-stage__cup {
  display: block;
  width: 100%;
  height: 100%;
}

.jury-stage__board--empty .jury-stage__cup-wrap {
  opacity: 0.45;
}

.jury-stage__board--empty {
  filter: grayscale(0.2) opacity(0.7);
}

.jury-stage__member {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  color: #1e1d19;
}

.jury-stage__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid #f7f2e4;
  object-fit: cover;
  background: #f7f2e4;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: #1e1d19;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.jury-stage__avatar--placeholder {
  background: #efeae0;
}

.jury-stage__member-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

/* Polaroid — pinned to the right, vertically centered on the cup band.
   The photo sits behind a ::after layer that paints the frame on top, so
   the placeholder/photo can never bleed over the polaroid's paper edges. */
.jury-stage__polaroid {
  position: absolute;
  right: clamp(1rem, 2vw, 2rem);
  top: 72%;
  transform: translateY(-50%) rotate(3deg);
  width: clamp(150px, 22vw, 260px);
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
  z-index: 3;
}

.jury-stage__polaroid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/static/polaroid.webp') no-repeat center / 100% 100%;
  pointer-events: none;
  z-index: 2;
}

.jury-stage__polaroid:empty {
  display: none;
}

.jury-stage__polaroid-photo {
  position: absolute;
  left: 10.8%;
  top: 12.2%;
  width: calc(100% - 21.6%);
  height: calc(100% - 34.2%);
  object-fit: cover;
  background: #f7f2e4;
  z-index: 1;
}

.jury-stage__polaroid-photo--placeholder {
  display: grid;
  place-items: center;
  color: #1e1d19;
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  background: var(--tape-yellow);
}

/* Tape banner — flex child below the cup, can never overlap. Uses
   tape_l_left.webp (2065 × 530) as its background. */
.jury-stage__tape {
  position: relative;
  width: min(640px, 70%);
  aspect-ratio: 2065 / 530;
  background: url('/static/tape_l_left.webp') no-repeat center / 100% 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #1e1d19;
  font-family: 'Permanent Marker', cursive;
  line-height: 1.05;
  padding: 0.4rem 1.2rem;
  flex: 0 0 auto;
  z-index: 2;
}

.jury-stage__tape-team {
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  letter-spacing: 0.05em;
}

.jury-stage__tape-project {
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  margin-top: 0.1rem;
  word-break: break-word;
}

.jury-stage__board--empty .jury-stage__tape,
.jury-stage__board--empty .jury-stage__polaroid {
  display: none;
}

@media (max-width: 720px) {
  .jury-stage__board {
    min-height: calc(100vh - 9rem);
    padding: 1rem 0 6rem;
    gap: 0.6rem;
    justify-content: center;
  }

  .jury-stage__cup-wrap {
    height: clamp(180px, 38vh, 320px);
  }

  .jury-stage__title {
    font-size: clamp(0.75rem, 3.4vw, 1.05rem);
  }

  /* Polaroid pinned to the top-right corner so it doesn't fight the cup
     for vertical space; smaller so it doesn't dominate the layout. */
  .jury-stage__polaroid {
    top: clamp(4rem, 10vh, 7rem);
    right: 0.75rem;
    transform: rotate(4deg);
    width: clamp(90px, 26vw, 140px);
  }

  .jury-stage__tape {
    width: 90%;
  }

  .jury-stage__tape-team {
    font-size: clamp(0.95rem, 3.6vw, 1.2rem);
  }

  .jury-stage__tape-project {
    font-size: clamp(1rem, 4vw, 1.4rem);
  }

  .lb-tape__members {
    gap: 0.25rem 0.7rem;
    max-width: 96%;
  }

  .jury-stage__member-name {
    max-width: 9rem;
    font-size: 0.9rem;
  }

  .jury-stage__avatar {
    width: 1.6rem;
    height: 1.6rem;
  }
}

.tape-name-input::selection {
  color: transparent;
  background: rgba(31, 28, 23, 0.18);
}

.tape-name-input::-moz-selection {
  color: transparent;
  background: rgba(31, 28, 23, 0.18);
}

.lb-row__team {
  display: block;
  font-size: 0.7em;
  opacity: 0.6;
  font-weight: 400;
  margin-top: 0.1em;
}

/* ===== Team progress card ===== */

.team-progress {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 720px) {
  .team-progress {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 0.75rem;
  }
}

.team-progress__empty {
  color: #6d674d;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  margin: 0;
}

.team-progress-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.45rem 0.85rem;
  background: #fff8e6;
  border: 2px solid #1e1d19;
  border-radius: 0.55rem;
}

.team-progress-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.team-progress-row__name {
  font-size: 1rem;
}

.team-progress-row__meta {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #4f493d;
  white-space: nowrap;
}

.team-progress-row__bar {
  height: 10px;
  background: #e3dccc;
  border-radius: 999px;
  overflow: hidden;
}

.team-progress-row__bar span {
  display: block;
  height: 100%;
  background: var(--tape-yellow);
  transition: width 0.5s cubic-bezier(.2, .8, .2, 1);
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.admin-pagination:empty {
  display: none;
}

.admin-pagination .admin-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-pagination__label {
  font-weight: 700;
  color: #4f493d;
  font-size: 0.92rem;
}

.admin-pagination__range {
  margin-left: 0.4rem;
  font-weight: 500;
  opacity: 0.7;
}
