/* Next-game vote — event page on top of new-UI tokens. */
.vote-page {
  min-width: 0;
}

.vote-hero {
  margin-bottom: 1.75rem;
}

.vote-hero__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.vote-hero__title {
  margin-bottom: 0.75rem;
}

.vote-hero__lead {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text);
  overflow-wrap: break-word;
}

.vote-countdown,
.vote-status {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.vote-status--done {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.vote-status__winner {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.35rem 0;
}

.vote-how {
  margin: 1.5rem 0 0;
}

.vote-how__title {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}

.vote-how p {
  margin: 0 0 0.7rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.vote-how__note {
  color: var(--muted);
  font-size: 0.92rem;
}

.vote-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1.5rem;
  min-width: 0;
}

/* Desktop: three equal cards in one row. Must match --new-break-wide. */
@media (min-width: 920px) {
  .vote-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

.vote-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.15rem 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
}

.vote-card--redactle {
  box-shadow: inset 3px 0 0 color-mix(in srgb, #3b6ea5 65%, var(--border));
}

.vote-card--cryptic {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--warning) 80%, var(--border));
}

.vote-card--logic {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 70%, var(--border));
}

.vote-card.is-leader,
.vote-card.is-tied {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.vote-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem 0.6rem;
  min-width: 0;
}

.vote-card__name {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: break-word;
}

.vote-card__badge {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.vote-card__badge--winner {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.vote-card__tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.vote-card__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.vote-preview {
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--tile) 45%, var(--surface));
  padding: 0.7rem 0.75rem;
  min-width: 0;
}

.vote-preview--redactle p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
}

.vote-mask {
  display: inline-block;
  width: calc(var(--ch, 4) * 0.52em + 0.12em);
  height: 0.78em;
  margin: 0 0.04em;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: var(--text);
  opacity: 0.72;
}

.vote-preview__clue {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.vote-preview__len {
  color: var(--muted);
  font-weight: 700;
}

.vote-preview__boxes {
  display: flex;
  gap: 0.28rem;
  min-width: 0;
}

.vote-preview__boxes span {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
}

.vote-grid-demo {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  width: min(100%, 10.5rem);
}

.vote-grid-demo span {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.vote-grid-demo .is-num {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.vote-card__score {
  margin-top: auto;
  min-width: 0;
}

.vote-card__amount {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vote-card__share {
  margin: 0.15rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.vote-bar {
  display: flex;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--tile);
  overflow: hidden;
}

.vote-bar__fill,
.vote-bar__carry {
  display: block;
  flex: 0 0 auto;
  height: 100%;
  width: 0;
}

.vote-bar__fill {
  background: var(--accent);
}

.vote-bar__carry {
  background: repeating-linear-gradient(
    -45deg,
    #5c4d96,
    #5c4d96 3px,
    #d9d0f2 3px,
    #d9d0f2 6px
  );
}

.vote-card--redactle .vote-bar__fill {
  background: #3b6ea5;
}

.vote-card--cryptic .vote-bar__fill {
  background: var(--warning);
}

.vote-card--logic .vote-bar__fill {
  background: var(--accent);
}

a.new-btn.vote-card__cta,
a.new-btn.vote-card__origin,
button.new-btn.vote-card__cta {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

a.new-btn.vote-card__origin {
  min-height: var(--btn-height-mini);
}

.vote-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.vote-standings {
  max-width: none;
  margin: 0 0 1.25rem;
}

.vote-standings__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.vote-standings__zero {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.vote-standings__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.vote-standings__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "name amount pct"
    "bar bar bar";
  gap: 0.2rem 0.75rem;
  align-items: baseline;
  min-width: 0;
}

.vote-standings__name {
  grid-area: name;
  font-weight: 650;
  min-width: 0;
  overflow-wrap: break-word;
}

.vote-standings__amount {
  grid-area: amount;
  font-variant-numeric: tabular-nums;
}

.vote-standings__pct {
  grid-area: pct;
  color: var(--muted);
  min-width: 2.5rem;
  text-align: right;
}

.vote-bar--row {
  grid-area: bar;
}

.vote-standings__total,
.vote-standings__until {
  margin: 0.7rem 0 0;
}

.vote-standings__until {
  color: var(--muted);
  font-size: 0.92rem;
}

html.new-ui-dark .vote-mask {
  opacity: 0.85;
}

.vote-card--powders {
  box-shadow: inset 3px 0 0 #c4897b;
}

.vote-card--powders .vote-bar__fill {
  background: #c4897b;
}

.vote-card__carry {
  margin: 0.15rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.vote-legend {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.vote-legend__swatch {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 0.7rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: repeating-linear-gradient(
    -45deg,
    #5c4d96,
    #5c4d96 3px,
    #d9d0f2 3px,
    #d9d0f2 6px
  );
}

.vote-poem,
.vote-clue {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.vote-clue__len,
.vote-play__source {
  color: var(--muted);
}

.vote-play__source {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

/* Playable sample, framed so it reads apart from the description. */
.vote-play {
  min-width: 0;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.75rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: color-mix(in srgb, var(--text) 3%, var(--surface));
}

.vote-play__label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.vote-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin: 0.55rem 0 0;
}

.vote-inline__input,
.vote-mask-field__input {
  box-sizing: border-box;
  min-width: 0;
  min-height: var(--btn-height-mini);
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.vote-inline__input {
  flex: 1 1 0;
  width: 0;
  max-width: 11rem;
}

.vote-inline__input:focus,
.vote-mask-field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.vote-inline__msg {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

/* Порошок: the answer is the 4th line, so the field keeps the poem's line height. */
.vote-inline--line {
  margin: 0.15rem 0 0;
  gap: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.vote-inline--line .vote-inline__input {
  flex: 0 0 6.6rem;
  width: 6.6rem;
  height: 1.45em;
  min-height: 0;
  padding: 0 0.35rem;
  line-height: inherit;
}

/* Word-length mask like the Лесенка inputs: one ◼ per letter until typing. */
.vote-mask-field {
  position: relative;
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.vote-mask-field__input {
  width: calc(var(--len, 5) * (1ch + 0.2em) + 1rem + 2px);
  max-width: 100%;
  font-family: var(--new-font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.vote-mask-field__input::placeholder {
  color: transparent;
}

.vote-mask-field__mask {
  position: absolute;
  inset: 0 calc(0.5rem + 1px);
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--new-font-mono);
  line-height: 1;
  pointer-events: none;
}

.vote-mask-field__mask span {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.vote-mask-field__input:not(:placeholder-shown) + .vote-mask-field__mask {
  display: none;
}

.vote-play__next {
  width: 100%;
  justify-content: center;
  white-space: normal;
}

.vote-play__msg,
.vote-play__done {
  margin: 0.45rem 0 0;
  font-weight: 700;
}

.vote-play__msg.is-ok,
.vote-play__done {
  color: var(--accent);
}

.vote-play__msg.is-bad {
  color: var(--muted);
  font-weight: 650;
}

.vote-logic__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.vote-logic__title {
  margin: 0;
  font-size: 1rem;
}

.vote-rules-btn {
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Penpa-style paper board: thin grid, heavy frame, grey shading, green loop. */
.vote-board {
  width: 100%;
  max-width: 15rem;
  margin: 0.45rem 0;
}

.vote-board__svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.vote-board__cell--empty {
  fill: #fff;
}

.vote-board__cell--shade {
  fill: #4a4a4a;
}

.vote-board__cell--number,
.vote-board__cell--white {
  fill: #fff;
}

.vote-board__cell--black {
  fill: #1a1a1a;
}

.vote-board__white {
  fill: none;
  stroke: #1a1a1a;
  stroke-width: 3;
}

.vote-board__grid line {
  stroke: #a9a9a9;
  stroke-width: 1;
}

.vote-board__frame {
  fill: none;
  stroke: #1a1a1a;
  stroke-width: 3;
}

.vote-board__clue {
  font: 700 17px var(--new-font-mono, sans-serif);
  text-anchor: middle;
  dominant-baseline: central;
  fill: #1a1a1a;
  pointer-events: none;
}

.vote-board__clue--black {
  fill: #fff;
  font-size: 14px;
}

.vote-board__clue--white {
  font-size: 14px;
}

.vote-board__dot {
  fill: #6d6d6d;
}

.vote-board__loop line {
  stroke: #2e9b55;
  stroke-width: 7;
  stroke-linecap: round;
}

.vote-logic__controls {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.vote-rules-body p {
  margin: 0 0 0.7rem;
  line-height: 1.5;
}

.vote-rules-body p:last-child {
  margin-bottom: 0;
}
