.rating-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 0, 0, 0.76);
  backdrop-filter: blur(18px);
}

.rating-backdrop.visible {
  display: flex;
}

.rating-modal {
  width: min(100%, 430px);
  max-height: calc(100dvh - 34px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 122, 38, 0.58);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 4%, rgba(255, 123, 38, 0.34), transparent 38%),
    radial-gradient(circle at 18% 100%, rgba(180, 92, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(43, 10, 7, 0.98), rgba(7, 1, 1, 0.98));
  box-shadow:
    0 -18px 72px rgba(0, 0, 0, 0.74),
    0 0 54px rgba(255, 72, 26, 0.3),
    inset 0 0 0 1px rgba(255, 210, 170, 0.06);
  animation: ratingRise 0.24s ease both;
}

@keyframes ratingRise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rating-head h3 {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.rating-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.rating-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.rating-choice {
  min-height: 58px;
  border: 1px solid rgba(255, 122, 54, 0.28);
  border-radius: 18px;
  background: rgba(16, 4, 4, 0.76);
  color: #ffd7c6;
  font-weight: 900;
  box-shadow: inset 0 0 18px rgba(255, 70, 26, 0.05);
}

.rating-choice.active {
  border-color: rgba(255, 151, 66, 0.9);
  background: linear-gradient(180deg, rgba(255, 112, 48, 0.34), rgba(136, 20, 12, 0.7));
  color: #fff7f0;
  box-shadow: 0 0 28px rgba(255, 78, 26, 0.24), inset 0 1px 0 rgba(255,255,255,.14);
}

.rating-negative {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  border: 1px solid rgba(255, 82, 82, 0.42);
  border-radius: 18px;
  background: rgba(120, 16, 16, 0.5);
  color: #ffd4d4;
  font-weight: 900;
}

.rating-negative.active {
  background: linear-gradient(180deg, #ff5959, #c71d1d 72%, #7a1010);
  color: #fff8f8;
  box-shadow: 0 0 28px rgba(255, 60, 60, 0.24);
}

.rating-field {
  margin-top: 16px;
}

.rating-field label {
  display: block;
  margin-bottom: 8px;
  color: #ffd7c6;
  font-size: 13px;
  font-weight: 900;
}

.rating-textarea {
  width: 100%;
  min-height: 108px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 122, 54, 0.32);
  border-radius: 18px;
  outline: none;
  resize: vertical;
  background: rgba(9, 2, 2, 0.7);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 0 20px rgba(255, 70, 26, 0.06);
}

.rating-textarea:focus {
  border-color: rgba(255, 139, 54, 0.9);
  box-shadow: 0 0 26px rgba(255, 68, 26, 0.18), inset 0 0 20px rgba(255, 70, 26, 0.08);
}

.rating-error {
  display: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 60, 60, 0.42);
  border-radius: 16px;
  background: rgba(255, 35, 35, 0.12);
  color: #ffd0d0;
  font-size: 13px;
  line-height: 1.4;
}

.rating-error.visible {
  display: block;
}

.rating-actions {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 10px;
  margin-top: 16px;
}

.rating-actions button {
  min-height: 52px;
  border-radius: 18px;
  font-weight: 900;
}

.rating-cancel {
  border: 1px solid rgba(255, 122, 54, 0.32);
  background: rgba(18, 5, 5, 0.84);
  color: #ffd5c5;
}

.rating-submit,
.rating-open-button {
  background: linear-gradient(180deg, #ff7238, #d91e12 72%, #83100b);
  color: #fff8f2;
  box-shadow: 0 0 34px rgba(255, 62, 26, 0.34), inset 0 1px 0 rgba(255,255,255,.16);
}

.rating-submit:disabled {
  cursor: wait;
  opacity: 0.66;
}

.rating-open-button {
  margin-top: 8px;
}
