/* KinoWatch Vote v2.3 — poster bar below year/IMDb, action below titles. */
/* Scoped to .poster-card; does not modify global style.css */
.poster-card .mkv-vote[hidden],
.poster-card .mkv-vote-action[hidden] { display: none !important; }

/* On voting posts only: an overlay INSIDE the image at its lower edge. */
.poster-card .mkv-poster-bottom {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 27px 10px 9px;
  color: #fff;
  background: linear-gradient(0deg, rgba(4,6,10,.98) 0%, rgba(4,6,10,.76) 60%, transparent 100%);
  pointer-events: none;
  font-family: "Helvetica Neue LT GEO",Verdana,sans-serif;
}
.poster-card .mkv-poster-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
}
.poster-card .mkv-poster-meta-row .card-poster-year,
.poster-card .mkv-poster-meta-row .card-poster-rating { font-size: 12px; line-height: 1.3; }
.poster-card .mkv-poster-meta-row .card-poster-rating::before { font-size: 12px; }

.poster-card .mkv-poster-bottom .mkv-vote {
  display: block;
  min-width: 0;
  margin: 7px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.poster-card .mkv-poster-bottom .mkv-vote-track {
  display: block;
  height: 4px;
  width: 100%;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255,255,255,.26);
}
.poster-card .mkv-poster-bottom .mkv-vote-fill {
  display: block;
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: inherit;
  background: #ff783e;
  transition: width .22s ease;
}
.poster-card .mkv-poster-bottom .mkv-vote-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  color: #eff4f9;
  font-size: 10px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.poster-card .mkv-poster-bottom .mkv-vote-count { color: rgba(255,255,255,.9); white-space: nowrap; }
.poster-card .mkv-poster-bottom .mkv-vote-percent { color: #ff783e; font-weight: 700; white-space: nowrap; }

/* Separate button — no big panel/border around titles. */
.poster-card .mkv-vote-action {
  margin: 7px 1px 0;
  position: relative;
  z-index: 2;
}
.poster-card .mkv-vote-button {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255,120,62,.30);
  background: rgba(255,120,62,.09);
  color: #fff2e5;
  font-family: "Helvetica Neue LT GEO", Verdana,sans-serif;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}
.poster-card .mkv-vote-button:hover:not(:disabled) {
  border-color: rgba(255,120,62,.55);
  background: rgba(255,120,62,.16);
  color: #fff;
}
.poster-card .mkv-vote-button:disabled { cursor: default; opacity: .68; }
.poster-card:has(.mkv-is-complete) .mkv-vote-fill { background: #3bd38b; }
.poster-card:has(.mkv-is-complete) .mkv-vote-percent { color: #66e4a6; }
@media (max-width: 870px) {
  .poster-card .mkv-poster-bottom { padding: 23px 6px 6px; }
  .poster-card .mkv-poster-bottom .mkv-vote { margin-top: 5px; }
  .poster-card .mkv-vote-button { min-height: 27px; font-size: 10px; }
}

/* v2.5 — trailer-style voting button ABOVE titles.
   Poster progress, voting JavaScript and backend remain unchanged. */
.poster-card:has(> .mkv-vote-action) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.poster-card:has(> .mkv-vote-action) > .card-media {
  order: 0;
  flex: 0 0 auto;
}
.poster-card:has(> .mkv-vote-action) > .card-info {
  order: 2;
  display: block;
}
.poster-card:has(> .mkv-vote-action) > .mkv-vote-action {
  order: 1;
  width: calc(100% - 2px);
  margin: 10px 1px 0;
}
.poster-card .mkv-vote-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: #281f1c;
  color: #dfe4ee;
  box-shadow: none;
  font-family: "Myriad GEO Mtavruli Medium", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.poster-card .mkv-vote-button::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid currentColor;
}
.poster-card .mkv-vote-button:hover:not(:disabled) {
  background: #342b28;
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}
.poster-card .mkv-vote-button:disabled {
  background: #281f1c;
  border-color: rgba(255, 255, 255, .18);
  color: #ab988c;
  opacity: 1;
  cursor: default;
}
.poster-card .mkv-vote-button:disabled::before {
  content: "✓";
  width: auto;
  height: auto;
  border: 0;
  font-size: 13px;
}
@media (max-width: 870px) {
  .poster-card .mkv-vote-button {
    height: 38px;
    min-height: 38px;
    font-size: 12px;
  }
  .poster-card:has(> .mkv-vote-action) > .mkv-vote-action {
    margin-top: 8px;
  }
}

/* v2.6 — vote controls ONLY on the home page and /tags/vote/ pages. */
/* Vote markup is hidden everywhere by default. JS enables .mkv-vote-route
   only for permitted URLs; on other pages it sends ZERO voting AJAX requests. */
html:not(.mkv-vote-route) .poster-card .mkv-poster-bottom,
html:not(.mkv-vote-route) .poster-card .mkv-vote-action {
  display: none !important;
}

/* On permitted pages replace the regular year/IMDb overlay with the voting footer.
   Keep the original year/IMDb visible on every other page. */
html.mkv-vote-route .poster-card:has(.mkv-poster-bottom:not([hidden])) .card-poster-meta {
  display: none !important;
}

/* Non-vote routes must retain the original shortstory card layout even if an
   article contains hidden voting elements. This neutralizes the v2.5 flex order. */
html:not(.mkv-vote-route) .poster-card:has(> .mkv-vote-action) {
  display: block;
}

/* v2.7: unlimited voting shows count without progress/percentage. */
.poster-card .mkv-vote-track[hidden], .poster-card .mkv-vote-percent[hidden] { display:none !important; }
.poster-card .mkv-vote-stats.mkv-count-only { justify-content:flex-start; }
.poster-card .mkv-vote-action .mkv-vote-button:disabled { opacity:1; }
.poster-card .mkv-vote-action .mkv-vote-button.mkv-button-voted::before { display:none; }
.mkv-ranking-pages { grid-column:1/-1; display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin:20px 0; }
.mkv-ranking-pages a { padding:7px 12px; border:1px solid rgba(255,255,255,.18); border-radius:6px; }
.mkv-ranking-pages a[aria-current=page] { background:#ff783e; color:#170e0b; }
.mkv-ranking-empty { grid-column:1/-1; padding:20px; color:#b4a195; }

/* v2.8 — Fullstory vote button. The shortstory design above is unchanged. */
.mkv-fullstory-vote[hidden] { display:none !important; }
.mkv-fullstory-vote { display:inline-flex; max-width:100%; align-items:center; }
.mkv-fullstory-vote .mkv-vote-button {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  min-height:38px;
  max-width:100%;
  gap:7px;
  padding:0 13px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:6px;
  background:#281f1c;
  color:#dfe4ee;
  font-family:"Myriad GEO Mtavruli Medium",sans-serif;
  font-size:13px;
  line-height:1.2;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease;
}
.mkv-fullstory-vote .mkv-vote-button:hover:not(:disabled) {
  background:#342b28;
  border-color:rgba(255,255,255,.28);
}
.mkv-fullstory-vote .mkv-vote-button:disabled { opacity:1; cursor:default; }
.mkv-fullstory-vote .mkv-vote-button.mkv-button-voted {
  color:#eff2f8;
  border-color:rgba(255,255,255,.20);
}
@media (max-width:430px) {
  .mkv-fullstory-vote .mkv-vote-button { min-height:38px; padding:0 10px; font-size:12px; }
}
