/* static/css/tournament/vote.css
   The group vote page's own styles, moved out of the page unchanged. */

.vote-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: 'Roboto', sans-serif;
}

.vote-theme {
  text-align: center;
  margin-bottom: 28px;
}

.vote-theme-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}

.vote-theme-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.vote-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.vote-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
}

.vote-card-number {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  background: rgba(15,23,42,0.75);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

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

.vote-card-body {
  padding: 10px 12px;
}

.vote-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 8px;
  line-height: 1.3;
  min-height: 1.3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vote-btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.vote-btn:hover {
  background: #2563eb;
}

.vote-own {
  display: block;
  width: 100%;
  padding: 8px 0;
  background: #f1f5f9;
  color: #94a3b8;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

/* The four judgements on a card: the name on the left, its number on the
   right. Under the Rating bar, "Your rating" keeps a gap from it. */
.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.875rem;
}

.rate-row input {
  width: 5em;
  padding: 4px 6px;
}

.vote-bar-wrap + .vote-own {
  margin-top: 8px;
}

/* Results state */
.vote-card.voted {
  border-color: #e2e8f0;
}

.vote-card.voted:hover {
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.vote-card.winner {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
}

.vote-bar-wrap {
  background: #f1f5f9;
  border-radius: 4px;
  height: 24px;
  overflow: hidden;
  position: relative;
}

.vote-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 0;
}

.vote-bar.top {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.vote-bar-count {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
}

.vote-thanks {
  text-align: center;
  padding: 12px;
  background: #f0fdf4;
  border-radius: 8px;
  color: #166534;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* AI reason box */
.ai-reason-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.ai-reason-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 6px;
}

.ai-reason-text {
  font-size: 0.88rem;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
}

/* Staff AI input */
.ai-input-wrap {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.ai-input-wrap label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 6px;
}

.ai-input-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  /* Eight lines before a word is typed, and after that the box grows with the
     verdict instead of scrolling it three lines at a time. field-sizing does
     this on its own where it exists; the script below covers the rest. */
  min-height: 10.5rem;
  overflow-y: hidden;
  field-sizing: content;
  resize: vertical;
}

.vote-group-label {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .vote-page {
    padding: 16px 4px;
  }
  .vote-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .vote-card-body {
    padding: 8px 8px;
  }
  .vote-theme-name {
    font-size: 1.3rem;
  }
  .ai-input-wrap {
    padding: 8px 4px;
  }
}

/* no images yet, the sign-in line, the AI reason button */
.vote-empty { grid-column: 1 / -1; text-align: center; color: #94a3b8; }
.vote-login { text-align: center; margin: 12px 0; font-size: 0.9rem; }
.vote-login-link { color: #3b82f6; font-weight: 600; }
.vote-btn.vote-btn--gap { margin-top: 8px; }
