/* FineNights rating sheet (dialog) — shared by the venue page, Home and the map.
 * Markup: templates/venues/includes/fn_rating_sheet.html · JS: venues/js/venue_rating_sheet.js */

.fn-vd-rate-sheet [hidden] {
  display: none !important;
}

.fn-vd-rate-error {
  display: none;
  margin: 0;
  color: #fca5a5;
  font-size: 0.9rem;
}

.fn-vd-rate-sheet.is-error .fn-vd-rate-error {
  display: block;
}

.fn-vd-rate-sheet.is-error .fn-vd-rate-summary,
.fn-vd-rate-sheet.is-error .fn-vd-rate-breakdown,
.fn-vd-rate-sheet.is-error .fn-vd-rate-mine {
  display: none;
}

.fn-rating-badge.is-loading {
  opacity: 0.6;
  cursor: progress;
}

.fn-vd-rate-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: rgba(22, 22, 26, 0.72);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  flex: 0 0 auto;
}

.fn-vd-rate-close:hover,
.fn-vd-rate-close:focus-visible {
  background: rgba(40, 40, 48, 0.9);
  outline: 2px solid var(--fn-vd-orange, #ff8a00);
  outline-offset: 2px;
}

.fn-vd-rate-close [data-fn-icon],
.fn-vd-rate-close .fn-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.fn-vd-rate-btn {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--fn-vd-orange, #ff8a00);
  background: var(--fn-vd-orange, #ff8a00);
  color: #1a1005;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fn-vd-rate-btn:hover {
  filter: brightness(1.06);
  color: #120b03;
}

.fn-vd-rate-btn:focus-visible {
  outline: 2px solid var(--fn-vd-orange, #ff8a00);
  outline-offset: 2px;
}

.fn-vd-rate-subhead {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.fn-vd-rate-muted {
  margin: 0;
  color: var(--fn-text-secondary, #a1a1aa);
  font-size: 0.88rem;
  line-height: 1.5;
}

.fn-vd-rate-scale {
  color: var(--fn-text-secondary, #a1a1aa);
  font-size: 0.85rem;
}

/* Rating sheet: full-height panel on phones, centered dialog on wider screens */
html.is-fn-vd-rate-open {
  overflow: hidden;
}

.fn-vd-rate-sheet {
  width: 100%;
  max-width: 100%;
  height: calc(100dvh - 0.75rem);
  max-height: calc(100dvh - 0.75rem);
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
}

.fn-vd-rate-sheet::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

.fn-vd-rate-sheet-inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 0.55rem var(--fn-vd-pad, 16px) calc(0.65rem + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--fn-vd-border, rgba(255, 255, 255, 0.1));
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--fn-vd-surface, #16161a);
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.45);
}

.fn-vd-rate-sheet[open] .fn-vd-rate-sheet-inner {
  animation: fn-vd-rate-in 0.24s ease-out;
}

@keyframes fn-vd-rate-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-vd-rate-sheet[open] .fn-vd-rate-sheet-inner {
    animation: none;
  }
}

@media (min-width: 720px) {
  .fn-vd-rate-sheet {
    width: min(560px, calc(100vw - 2rem));
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    margin: auto;
  }

  .fn-vd-rate-sheet-inner {
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    padding: 0.85rem 1.1rem 0.95rem;
    border-bottom: 1px solid var(--fn-vd-border, rgba(255, 255, 255, 0.1));
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  }
}

.fn-vd-rate-head,
.fn-vd-rate-summary,
.fn-vd-rate-mine,
.fn-vd-rate-error {
  flex: 0 0 auto;
}

.fn-vd-rate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.fn-vd-rate-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.fn-vd-rate-venue {
  margin: 0.15rem 0 0;
  color: var(--fn-text-secondary, #a1a1aa);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.fn-vd-rate-summary {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 0.15rem;
}

.fn-vd-rate-meta {
  display: flex;
  align-items: center;
  min-height: 1.6rem;
  gap: 0.1rem;
}

.fn-vd-rate-meta .fn-vd-rate-muted {
  font-size: 0.8rem;
  line-height: 1.3;
}

.fn-vd-rate-info {
  position: static;
  flex: 0 0 auto;
}

.fn-vd-rate-info-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -10px -6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fn-text-secondary, #a1a1aa);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fn-vd-rate-info-btn svg {
  width: 18px;
  height: 18px;
}

.fn-vd-rate-info-btn:hover,
.fn-vd-rate-info-btn:focus-visible {
  color: #fff;
  outline: none;
}

.fn-vd-rate-info-btn:focus-visible svg {
  outline: 2px solid var(--fn-vd-orange, #ff8a00);
  outline-offset: 3px;
  border-radius: 999px;
}

.fn-vd-rate-info-tip {
  display: none;
  position: absolute;
  z-index: 4;
  left: 0;
  right: auto;
  width: min(17.5rem, calc(100% - 8.75rem));
  top: calc(100% - 4px);
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #24242a;
  color: #e4e4e7;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.fn-vd-rate-info.is-open .fn-vd-rate-info-tip {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .fn-vd-rate-info:hover .fn-vd-rate-info-tip,
  .fn-vd-rate-info-btn:focus-visible ~ .fn-vd-rate-info-tip {
    display: block;
  }
}

.fn-vd-rate-score {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* View mode toggle (Chart | Bars) */
.fn-vd-rate-breakdown {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  gap: 0.15rem;
}

.fn-vd-rate-breakdown-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
}

.fn-vd-rate-breakdown-head .fn-vd-rate-subhead {
  margin: 0;
}

.fn-vd-rate-modes {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--fn-vd-border, rgba(255, 255, 255, 0.1));
}

.fn-vd-rate-mode {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 28px;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fn-text-secondary, #a1a1aa);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.fn-vd-rate-mode::after {
  content: "";
  position: absolute;
  inset: -8px -2px;
}

.fn-vd-rate-mode svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.fn-vd-rate-mode:hover {
  color: #fff;
}

.fn-vd-rate-mode.is-active {
  background: rgba(255, 138, 0, 0.16);
  color: var(--fn-vd-orange, #ff8a00);
}

.fn-vd-rate-mode:focus-visible {
  outline: 2px solid var(--fn-vd-orange, #ff8a00);
  outline-offset: 1px;
}

.fn-vd-rate-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.fn-vd-rate-view[hidden] {
  display: none !important;
}

.fn-vd-rate-view.is-entering {
  animation: fn-vd-rate-view-in 0.36s ease-out;
}

@keyframes fn-vd-rate-view-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fn-vd-rate-readout {
  flex: 0 0 auto;
  min-height: 1.15em;
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  text-align: center;
  color: var(--fn-text-secondary, #a1a1aa);
}

/* Chart (radar) view */
.fn-vd-rate-view.is-chart,
.fn-vd-rate-view.is-bars {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.fn-vd-rate-view.is-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.fn-vd-rate-radar-svg {
  width: min(100%, 290px, calc(100dvh - 17.5rem));
  height: auto;
  flex: 0 0 auto;
  overflow: visible;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}

.fn-vd-rate-radar-svg text,
.fn-vd-rate-radar-svg polygon,
.fn-vd-rate-radar-svg line,
.fn-vd-rate-radar-svg circle,
.fn-vd-rate-radar-svg g {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.fn-vd-rate-radar-svg.is-editable {
  touch-action: none;
}

.fn-vd-rate-radar-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  pointer-events: none;
}

.fn-vd-rate-radar-axis {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
  pointer-events: none;
  transition: stroke 0.2s ease;
}

.fn-vd-rate-radar-axis.is-active {
  stroke: rgba(255, 255, 255, 0.2);
}

.fn-vd-rate-radar-hit {
  stroke: transparent;
  stroke-width: 22;
  stroke-linecap: round;
  cursor: pointer;
}

.fn-vd-rate-radar-label {
  fill: var(--fn-text-secondary, #a1a1aa);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: fill 0.2s ease;
}

.fn-vd-rate-radar-label.is-active {
  fill: #fff;
}

.fn-vd-rate-radar-venue {
  fill: rgba(255, 138, 0, 0.22);
  stroke: var(--fn-vd-orange, #ff8a00);
  stroke-width: 1.6;
  stroke-linejoin: round;
  pointer-events: none;
}

.fn-vd-rate-radar-draft {
  fill: rgba(167, 139, 250, 0.07);
  stroke: rgba(184, 170, 214, 0.58);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  stroke-linejoin: round;
  pointer-events: none;
}

.fn-vd-rate-radar-dot {
  fill: var(--fn-vd-orange, #ff8a00);
  pointer-events: none;
}

.fn-vd-rate-radar-core {
  fill: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.fn-vd-rate-handle {
  cursor: grab;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.fn-vd-rate-handle:focus {
  outline: none;
}

.is-dragging .fn-vd-rate-handle {
  cursor: grabbing;
}

.fn-vd-rate-handle-hit {
  fill: transparent;
}

.fn-vd-rate-handle-dot {
  fill: rgba(22, 22, 26, 0.85);
  stroke: rgba(167, 139, 250, 0.46);
  stroke-width: 0.9;
  stroke-dasharray: 1.4 1.6;
  transition: r 0.15s ease, fill 0.15s ease, stroke 0.15s ease;
}

.fn-vd-rate-handle.is-set .fn-vd-rate-handle-dot {
  fill: rgba(158, 144, 198, 0.62);
  stroke: rgba(186, 174, 214, 0.5);
  stroke-width: 0.8;
  stroke-dasharray: none;
  r: 2.7;
}

.fn-vd-rate-handle:hover .fn-vd-rate-handle-dot,
.fn-vd-rate-handle:focus-visible .fn-vd-rate-handle-dot {
  r: 3.7;
}

.fn-vd-rate-handle.is-set:hover .fn-vd-rate-handle-dot,
.fn-vd-rate-handle.is-set:focus-visible .fn-vd-rate-handle-dot {
  r: 3.15;
}

.fn-vd-rate-handle:focus-visible .fn-vd-rate-handle-hit {
  fill: rgba(167, 139, 250, 0.08);
}

.fn-vd-rate-legend {
  display: flex;
  flex: 0 0 auto;
  gap: 1rem;
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--fn-text-secondary, #a1a1aa);
}

.fn-vd-rate-legend-item::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.35rem;
  border-radius: 3px;
  vertical-align: -0.05rem;
}

.fn-vd-rate-legend-item.is-venue::before {
  background: var(--fn-vd-orange, #ff8a00);
}

.fn-vd-rate-legend-item.is-draft::before {
  background: #a78bfa;
}

/* Bars view */
.fn-vd-rate-view.is-bars {
  display: flex;
  flex-direction: column;
}

.fn-vd-rate-rows {
  display: grid;
  flex: 1 1 auto;
  grid-auto-rows: minmax(1.65rem, 2.15rem);
  gap: 0;
  width: 100%;
  min-height: 0;
  align-content: start;
}

.fn-vd-rate-row {
  display: grid;
  grid-template-columns: 5.9rem minmax(0, 1fr) 3.4rem;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  font-size: 0.84rem;
  transition: background 0.18s ease;
}

.fn-vd-rate-rows.is-editable .fn-vd-rate-row {
  grid-template-columns: 5.9rem minmax(0, 1fr) 3.4rem 1.5rem;
  min-height: 1.65rem;
}

.fn-vd-rate-row.is-active {
  background: rgba(255, 255, 255, 0.04);
}

.fn-vd-rate-view.is-entering .fn-vd-rate-row {
  animation: fn-vd-rate-row-in 0.42s ease-out both;
  animation-delay: calc(var(--i, 0) * 32ms);
}

@keyframes fn-vd-rate-row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fn-vd-rate-row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fn-vd-rate-row-track {
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  height: 100%;
  min-height: 22px;
  padding: 0 8px;
}

.fn-vd-rate-row-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 13px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.fn-vd-rate-row-guest,
.fn-vd-rate-row-mine {
  position: relative;
  display: block;
  height: 5px;
  max-width: 100%;
  border-radius: 999px;
}

.fn-vd-rate-row-guest {
  background: var(--fn-vd-orange, #ff8a00);
}

.fn-vd-rate-row-mine {
  height: 4px;
  background: #a78bfa;
}

.fn-vd-rate-rows:not(.is-editable) .fn-vd-rate-row-mine {
  display: none;
}

.fn-vd-rate-row-input {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 100%;
  max-height: 36px;
  margin: 0;
  transform: translateY(-50%);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}

.fn-vd-rate-row-input::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
}

.fn-vd-rate-row-input::-moz-range-track {
  height: 100%;
  background: transparent;
  border: 0;
}

.fn-vd-rate-row-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 28px;
  height: 100%;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  opacity: 0;
  cursor: ew-resize;
}

.fn-vd-rate-row-input::-moz-range-thumb {
  box-sizing: border-box;
  width: 28px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  opacity: 0;
  cursor: ew-resize;
}

.fn-vd-rate-row.is-set .fn-vd-rate-row-input::-webkit-slider-thumb,
.fn-vd-rate-row.is-set .fn-vd-rate-row-input::-moz-range-thumb {
  border: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  opacity: 0;
}

.fn-vd-rate-row-input:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
  border-radius: 6px;
}

.fn-vd-rate-row-values {
  display: inline-flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.fn-vd-rate-row-values b {
  font-weight: 700;
}

.fn-vd-rate-row-values i {
  font-style: normal;
  font-weight: 700;
  color: #a78bfa;
}

.fn-vd-rate-row-clear {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fn-text-secondary, #a1a1aa);
  cursor: pointer;
}

.fn-vd-rate-row-clear::after {
  content: "";
  position: absolute;
  inset: -10px -6px;
}

.fn-vd-rate-row-clear[hidden] {
  display: inline-grid !important;
  visibility: hidden;
}

.fn-vd-rate-row-clear svg {
  width: 10px;
  height: 10px;
}

.fn-vd-rate-row-clear:hover,
.fn-vd-rate-row-clear:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.fn-rating-badge.is-pulse {
  animation: fn-vd-badge-pulse 0.6s ease-out;
}

@keyframes fn-vd-badge-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-vd-rate-view.is-entering,
  .fn-vd-rate-view.is-entering .fn-vd-rate-row,
  .fn-rating-badge.is-pulse {
    animation: none;
  }
}

.fn-vd-rate-mine {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--fn-vd-border, rgba(255, 255, 255, 0.1));
}

.fn-vd-rate-form {
  display: grid;
  gap: 0.25rem;
}

.fn-vd-rate-submit-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.fn-vd-rate-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fn-vd-rate-preview {
  display: grid;
  margin: 0;
  font-size: 0.78rem;
  color: var(--fn-text-secondary, #a1a1aa);
}

.fn-vd-rate-preview strong {
  font-size: 1.35rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.fn-vd-rate-submit-row .fn-vd-rate-btn {
  flex: 0 1 auto;
  min-width: 9rem;
}

.fn-vd-rate-submit-row .fn-vd-rate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.fn-vd-rate-locked {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--fn-text-secondary, #a1a1aa);
}

.fn-vd-rate-locked[hidden],
.fn-vd-rate-form[hidden] {
  display: none;
}

.fn-vd-rate-status {
  margin: 0;
  font-size: 0.8rem;
  color: #86efac;
}

.fn-vd-rate-status.is-error {
  color: #fca5a5;
}

.fn-vd-rate-status:empty {
  display: none;
}

.fn-vd-rate-signin {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}
