/*
 * CityScoreCard — variation 7c (segments only, no numbers).
 * Light is the page default; .dark restores the mockup panel.
 * Meter fill / icon colors do not flip. Scoped under .csc-.
 */

.csc-wrap {
  width: 344px;
  max-width: 100%;
}

.csc-card {
  box-sizing: border-box;
  width: 344px;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.csc-group {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 11px;
}

.csc-group-label {
  font: 600 9px/1.3 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.12em;
  color: #8a8a8a;
  padding-top: 5px;
}

.csc-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.csc-row {
  display: grid;
  grid-template-columns: 15px 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
}

.csc-icon {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  overflow: visible;
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
  line-height: 1;
  letter-spacing: normal;
  white-space: nowrap;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  color: var(--csc-c);
}

.csc-icon svg {
  grid-area: 1 / 1;
  display: block;
  width: 15px;
  height: 15px;
}

.csc-icon .csc-online-light {
  display: block;
}

.csc-icon .csc-online-dark {
  display: none;
}

.dark .csc-icon .csc-online-light,
html[data-theme="dark"] .csc-icon .csc-online-light {
  display: none;
}

.dark .csc-icon .csc-online-dark,
html[data-theme="dark"] .csc-icon .csc-online-dark {
  display: block;
}

.csc-label {
  font: 500 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #2a2a2a;
}

.csc-meter {
  display: flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
  height: 8px;
}

.csc-meter i {
  flex: 1 1 0;
  min-width: 0;
  height: 8px;
  border-radius: 2px;
  background: #eeeeee;
  display: block;
  margin: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.csc-meter[data-v="1"] i:nth-child(-n+1),
.csc-meter[data-v="2"] i:nth-child(-n+2),
.csc-meter[data-v="3"] i:nth-child(-n+3),
.csc-meter[data-v="4"] i:nth-child(-n+4),
.csc-meter[data-v="5"] i:nth-child(-n+5),
.csc-meter[data-v="6"] i:nth-child(-n+6),
.csc-meter[data-v="7"] i:nth-child(-n+7),
.csc-meter[data-v="8"] i:nth-child(-n+8),
.csc-meter[data-v="9"] i:nth-child(-n+9),
.csc-meter[data-v="10"] i:nth-child(-n+10) {
  /* Every value keeps the same specificity (class + attribute + pseudo-class
     + element). A bare `[data-v="10"] i` tied with `.dark .csc-meter i` below
     and lost, so a 10 painted as empty in dark mode. */
  background: var(--csc-c);
}

.csc-row[data-kind="daygame"] { --csc-c: #c9922e; }
.csc-row[data-kind="nightgame"] { --csc-c: #ad7c24; }
.csc-row[data-kind="online"] { --csc-c: #8f651c; }
.csc-row[data-kind="hot"] { --csc-c: #3f9e78; }
.csc-row[data-kind="receptive"] { --csc-c: #2f8a66; }
.csc-row[data-kind="volume"] { --csc-c: #217555; }
.csc-row[data-kind="city"] { --csc-c: #4a76c8; }
.csc-row[data-kind="crime"] { --csc-c: #c5392a; }

.csc-rate {
  appearance: none;
  background: none;
  border: 0;
  color: #8a8a8a;
  font: 500 11px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 2px 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.csc-rate:hover,
.csc-rate:focus-visible {
  color: #2a2a2a;
  outline: none;
}

.csc-check-wrap {
  display: inline-flex;
  align-items: center;
}

.csc-check-wrap[hidden] {
  display: none;
}

.csc-check {
  display: block;
  width: 13px;
  height: 13px;
  flex: none;
}

.csc-rate.is-done,
.csc-rate.is-done:hover,
.csc-rate.is-done:focus-visible {
  color: #1b7f4e;
  font-weight: 700;
}

.csc-thanks {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  font: 500 12px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: #1b7f4e;
  background: #edf8f2;
  border-left: 3px solid #1b7f4e;
}

.csc-thanks[hidden] {
  display: none;
}

.csc-thanks .csc-check {
  margin-top: 0.1rem;
}

.csc-thanks.is-no {
  color: #c5392a;
  background: #fef3f1;
  border-left-color: #c5392a;
}

.csc-thanks.is-no .csc-check {
  display: none;
}

.csc-row.is-just-rated {
  animation: csc-rated 1.2s ease-out;
}

@keyframes csc-rated {
  0% { background: #edf8f2; }
  100% { background: transparent; }
}

.csc-card.is-admin .csc-meter i,
.csc-card.is-rating .csc-meter i {
  cursor: pointer;
}

@media (max-width: 400px) {
  .csc-wrap,
  .csc-card {
    width: 100%;
  }
}

.dark .csc-card {
  background: #131313;
  border-color: #232323;
}

.dark .csc-group-label {
  color: #7d7972;
}

.dark .csc-label {
  color: #ececec;
}

/* :where() keeps this at element-level specificity so it can never outrank
   the fill rules above, whatever value the meter holds. */
:where(.dark) .csc-meter i {
  background: #282828;
}

.dark .csc-row[data-kind="daygame"] { --csc-c: #e8bb77; }
.dark .csc-row[data-kind="nightgame"] { --csc-c: #d9a75f; }
.dark .csc-row[data-kind="online"] { --csc-c: #c79448; }
.dark .csc-row[data-kind="hot"] { --csc-c: #7fd0ae; }
.dark .csc-row[data-kind="receptive"] { --csc-c: #6bbd9b; }
.dark .csc-row[data-kind="volume"] { --csc-c: #58aa88; }
.dark .csc-row[data-kind="city"] { --csc-c: #93b3ee; }
.dark .csc-row[data-kind="crime"] { --csc-c: #e2705f; }

.dark .csc-rate {
  color: #7d7972;
}

.dark .csc-rate:hover,
.dark .csc-rate:focus-visible {
  color: #ececec;
}

.dark .csc-rate.is-done {
  color: #7fd0ae;
}

.dark .csc-thanks {
  color: #7fd0ae;
  background: #14241c;
  border-left-color: #7fd0ae;
}

.dark .csc-thanks.is-no {
  color: #e2705f;
  background: #2a1612;
  border-left-color: #e2705f;
}

.dark .csc-row.is-just-rated {
  animation-name: csc-rated-dark;
}

@keyframes csc-rated-dark {
  0% { background: #14241c; }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .csc-row.is-just-rated {
    animation: none;
    background: #edf8f2;
  }

  .dark .csc-row.is-just-rated {
    background: #14241c;
  }
}
