/* Community vote page.
 *
 * Shares the site's teal-on-near-black palette: #5eead4 / #33c9b7 for accents,
 * #0e3732 panels over a dark base, #fbbf24 kept exclusively for the winner so
 * gold on this page always means "this one is ahead".
 *
 * Everything is prefixed vt- so none of it can reach another page's markup.
 */

:root {
  --vt-bg: #07100f;
  --vt-bg-soft: #0a1a18;
  --vt-panel: rgba(14, 55, 50, 0.72);
  --vt-panel-solid: #0d2b28;
  --vt-line: rgba(94, 234, 212, 0.18);
  --vt-line-strong: rgba(94, 234, 212, 0.38);
  --vt-accent: #5eead4;
  --vt-accent-deep: #33c9b7;
  --vt-text: #e5f1ef;
  --vt-muted: #9cc9c4;
  --vt-dim: #6e8f8a;
  --vt-gold: #fbbf24;
  --vt-gold-soft: rgba(251, 191, 36, 0.16);
}

/* No background here on purpose.
 *
 * style.css already paints <body> with the site photo (bg1.webp) under a teal
 * gradient, fixed and covering. Setting a background on .vt-body overrode it
 * and this page ended up the only one on the site without the backdrop. The
 * teal glow this page wants is added as an overlay instead, so the photo still
 * shows through. */
.vt-body {
  color: var(--vt-text);
  min-height: 100vh;
  position: relative;
}

/* Columns grow to hold every voter.
 *
 * They were capped to the height of the screen with each list scrolling inside
 * its own card, which meant hovering a column and scrolling it just to read
 * eight names. A column is now exactly as tall as its voters need, and the
 * page scrolls once, normally, like every other page on the site.
 *
 * .vt-board already sets align-items:start, so each column ends at its own
 * last voter rather than being padded out to match the longest one. */

.vt-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(51, 201, 183, 0.18), transparent 70%),
    radial-gradient(900px 500px at 10% 20%, rgba(94, 234, 212, 0.08), transparent 65%);
}

/* Everything real sits above the overlay. */
.vt-body > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- header */

.vt-head-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.vt-fetch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--vt-line);
  border-radius: 999px;
  background: var(--vt-panel);
  backdrop-filter: blur(6px);
}

.vt-fetch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vt-accent);
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.6);
  flex-shrink: 0;
}

/* Pulses only while a request is in flight, so the header doubles as the
   loading indicator and the page needs no spinner. */
.vt-fetch-dot.is-busy {
  animation: vt-pulse 1.1s ease-out infinite;
}

.vt-fetch-dot.is-stale {
  background: var(--vt-gold);
}

.vt-fetch-dot.is-error {
  background: #f87171;
}

@keyframes vt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(94, 234, 212, 0); }
}

.vt-fetch-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.vt-fetch-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vt-dim);
}

.vt-fetch-value {
  font-size: 0.86rem;
  color: var(--vt-text);
  font-weight: 600;
}

.vt-refresh {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--vt-line);
  background: var(--vt-panel);
  color: var(--vt-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.vt-refresh:hover:not(:disabled) {
  color: var(--vt-accent);
  border-color: var(--vt-line-strong);
  transform: rotate(-35deg);
}

.vt-refresh:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ hero */

.vt-main {
  padding-bottom: 4rem;
}

/* Compact now that the page is one screen: the options are the content, and
   the hero only has to say what is being decided. */
.vt-hero {
  display: grid;
  place-items: center;
  padding: 1.8rem 1rem 1.2rem;
  text-align: center;
}

.vt-hero-inner {
  max-width: 880px;
  width: 100%;
}

.vt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--vt-line);
  background: var(--vt-panel);
  color: var(--vt-muted);
}

.vt-chip-open {
  color: #bbf7d0;
  border-color: rgba(134, 239, 172, 0.45);
  background: rgba(22, 101, 52, 0.28);
}

.vt-chip-closed {
  color: var(--vt-gold);
  border-color: rgba(251, 191, 36, 0.42);
  background: var(--vt-gold-soft);
}

.vt-chip-hidden {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(71, 85, 105, 0.26);
}

.vt-title {
  margin: 0.7rem 0 0.6rem;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(180deg, #f1fffb 0%, var(--vt-accent) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Plain body text. No max-height and no inner scrollbar: boxing the
   description off was wrong -- it is the first thing a visitor reads, so it
   gets its natural height and the options take whatever is left. */
.vt-desc {
  color: var(--vt-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 820px;
  margin: 0 auto;
  text-align: left;
}

.vt-desc strong {
  color: var(--vt-text);
}

.vt-desc h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--vt-accent);
  margin: 1.4rem 0 0.4rem;
}

.vt-desc p {
  margin: 0 0 0.85rem;
}

.vt-skeleton-line {
  height: 0.95rem;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.08), rgba(94, 234, 212, 0.16), rgba(94, 234, 212, 0.08));
  background-size: 200% 100%;
  animation: vt-shimmer 1.4s linear infinite;
  margin-bottom: 0.7rem;
}

.vt-skeleton-short { width: 62%; }

@keyframes vt-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ------------------------------------------------------------- your vote */

.vt-mine {
  max-width: 1040px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.vt-mine-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--vt-line);
  border-radius: 20px;
  background: var(--vt-panel);
}

.vt-mine-card.is-voted {
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.08);
}

.vt-mine-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--vt-line);
  background: var(--vt-bg-soft);
  flex-shrink: 0;
}

/* The viewer's own profile: picture, Steam name, SteamID, linking out. */
.vt-mine-who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  border: 1px solid var(--vt-line);
  border-radius: 16px;
  background: rgba(7, 16, 15, 0.5);
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.vt-mine-who:hover {
  border-color: var(--vt-line-strong);
  background: rgba(14, 55, 50, 0.75);
}

.vt-mine-who-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.vt-mine-who-name {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--vt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.vt-mine-who-id {
  font-size: 0.72rem;
  color: var(--vt-dim);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.vt-mine-who:hover .vt-mine-who-id { color: var(--vt-accent); }

.vt-mine-body { flex: 1 1 260px; min-width: 0; }

.vt-mine-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--vt-dim);
}

.vt-mine-choice {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--vt-text);
  margin-top: 0.15rem;
}

.vt-mine-note {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: var(--vt-muted);
}

.vt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.vt-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

.vt-btn-discord {
  background: #5865f2;
  color: #fff;
}

.vt-btn-steam {
  background: linear-gradient(135deg, #1b2838, #2a475e);
  color: #e5f1ef;
  border-color: rgba(148, 163, 184, 0.3);
}

.vt-btn-ghost {
  background: transparent;
  color: var(--vt-muted);
  border-color: var(--vt-line);
}

/* --------------------------------------------------------------- notices */

.vt-notice {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  padding: 1.6rem;
  text-align: center;
  border: 1px solid var(--vt-line);
  border-radius: 20px;
  background: var(--vt-panel);
}

.vt-notice i {
  font-size: 1.8rem;
  color: var(--vt-accent);
}

.vt-notice h2 {
  margin: 0.6rem 0 0.4rem;
  font-size: 1.25rem;
  color: var(--vt-text);
}

.vt-notice p {
  margin: 0;
  color: var(--vt-muted);
  font-size: 0.94rem;
}

.vt-notice.is-warn { border-color: rgba(251, 191, 36, 0.4); }
.vt-notice.is-warn i { color: var(--vt-gold); }

/* ----------------------------------------------------------------- board */

/* Every option side by side: one row, one column per option.
 *
 * --vt-cols is set by vote.js from the option count, so six options give six
 * columns and three give three -- rather than six slots with three empty. */
.vt-board {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(var(--vt-cols, 6), minmax(0, 1fr));
  align-items: start;          /* columns keep their own height */
  gap: 0.85rem;
  scroll-margin-top: 90px;
}

/* One option, as a narrow column. */
.vt-card {
  position: relative;
  border: 1px solid var(--vt-line);
  border-radius: 18px;
  background: var(--vt-panel);
  padding: 1.1rem 0.85rem 0.9rem;
  min-width: 0;                /* so long names cannot widen the column */
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.vt-card:hover {
  border-color: var(--vt-line-strong);
  transform: translateY(-2px);
}

.vt-card.is-winner {
  border-color: rgba(251, 191, 36, 0.5);
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.11), transparent 45%),
    var(--vt-panel);
  box-shadow: 0 18px 50px -32px rgba(251, 191, 36, 0.8);
  /* Lifts the whole winning card, crown included, above its neighbours.
     Every card is position:relative, so without this the cards after it in
     the markup paint over the crown where it sticks out of the top. */
  z-index: 3;
}

/* Room for the crown, which sits half outside the top of the winning card.
   It is padding on the row rather than a margin on the cards, so the gap is
   the same above every column whether or not it holds the crown. */
.vt-board { padding-top: 1.5rem; }

.vt-card.is-mine::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  border: 1px solid rgba(94, 234, 212, 0.55);
  pointer-events: none;
  z-index: 1;          /* under the crown, over the card background */
}

/* The crown sits on top of the winning card, centred and half outside it.
   Nothing may cross it, so it takes the highest layer on the row. */
.vt-crown {
  position: absolute;
  z-index: 10;
  top: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
  background: linear-gradient(135deg, #fde68a, var(--vt-gold));
  color: #3a2a05;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px -12px rgba(251, 191, 36, 0.9);
}

.vt-crown i { font-size: 0.85rem; }

/* Stacked, not side by side: a sixth of the row is too narrow to put the
   label and the number on one line. */
.vt-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

/* Holds "#1" through "#20", so it sizes to its text rather than a fixed box. */
.vt-rank {
  min-width: 30px;
  height: 26px;
  padding: 0 0.4rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.76rem;
  color: var(--vt-muted);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid var(--vt-line);
  flex-shrink: 0;
}

.vt-card.is-winner .vt-rank {
  color: #3a2a05;
  background: linear-gradient(135deg, #fde68a, var(--vt-gold));
  border-color: transparent;
}

.vt-card-label {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--vt-text);
  line-height: 1.2;
}

.vt-card-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.vt-card-numbers { text-align: center; }

.vt-card-percent {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--vt-accent);
  line-height: 1;
}

.vt-card.is-winner .vt-card-percent { color: var(--vt-gold); }

.vt-card-count {
  font-size: 0.72rem;
  color: var(--vt-dim);
  margin-top: 0.2rem;
}

/* Bar spans the column. */
.vt-bar {
  margin-top: 0.85rem;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--vt-line);
  overflow: hidden;
}

.vt-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--vt-accent-deep), var(--vt-accent));
  width: 0;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.vt-card.is-winner .vt-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #fde68a);
}

/* ---------------------------------------------------------- voter cards */

.vt-voters-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem 0 0.6rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vt-dim);
  white-space: nowrap;
}

.vt-voters-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--vt-line);
}

/* A plain vertical list. No max-height and no inner scroll: the card is as
   tall as its voters, and the page is what scrolls. */
.vt-voters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}


/* Avatar on the left, name above a clickable SteamID. */
.vt-voter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.45rem;
  border: 1px solid var(--vt-line);
  border-radius: 11px;
  background: rgba(7, 16, 15, 0.55);
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.vt-voter:hover {
  border-color: var(--vt-line-strong);
  background: rgba(14, 55, 50, 0.75);
}

.vt-voter-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--vt-bg-soft);
  border: 1px solid var(--vt-line);
  flex-shrink: 0;
}

.vt-voter-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--vt-dim);
  font-size: 1rem;
}

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

.vt-voter-name {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--vt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vt-voter-id {
  font-size: 0.66rem;
  color: var(--vt-dim);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vt-voter:hover .vt-voter-id { color: var(--vt-accent); }

.vt-voter.is-me {
  border-color: rgba(94, 234, 212, 0.55);
  background: rgba(94, 234, 212, 0.08);
}

.vt-voter-you {
  margin-left: auto;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vt-accent);
  flex-shrink: 0;
}

.vt-empty {
  font-size: 0.78rem;
  color: var(--vt-dim);
  padding: 0.5rem 0 0.2rem;
  text-align: center;
}

.vt-sealed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.7rem 0.5rem;
  border: 1px dashed var(--vt-line);
  border-radius: 12px;
  color: var(--vt-muted);
  font-size: 0.74rem;
  text-align: center;
}

.vt-sealed i { color: var(--vt-accent); }

/* ----------------------------------------------------------- responsive */

/* Six columns only survive on a wide screen. Below that they fold, rather
   than squeezing a SteamID into 90 pixels. */
@media (max-width: 1280px) {
  .vt-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .vt-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .vt-fetch-label { display: none; }
  .vt-hero { min-height: auto; padding-top: 2.5rem; }
  .vt-desc { font-size: 0.96rem; }
  .vt-board { grid-template-columns: 1fr; gap: 1.1rem; }
  .vt-card { padding: 1.1rem 1rem 0.9rem; }
  .vt-card-label { font-size: 1.2rem; }
  .vt-card-percent { font-size: 1.4rem; }
}

/* Hover lift is wrong for a grid row: one card rising shifts the eye off the
   comparison. Kept only for the single-column phone layout. */
@media (min-width: 721px) {
  .vt-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vt-bar-fill, .vt-card, .vt-voter, .vt-refresh { transition: none; }
  .vt-fetch-dot.is-busy, .vt-skeleton-line { animation: none; }
}
