/* Ratings — compact single box + interactive numbered stars */

.apk-stars {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  gap: 6px;
}

.apk-stars--sm { font-size: 0.82rem; }
.apk-stars--md { font-size: 1rem; }
.apk-stars--lg { font-size: 1.2rem; }

.apk-stars--readonly {
  display: inline-block;
  width: calc(5 * 1em + 4 * 0.12em);
  height: 1em;
  line-height: 1;
  vertical-align: middle;
  position: relative;
}

.apk-stars--readonly::before {
  content: "★★★★★";
  display: block;
  letter-spacing: 0.12em;
  font-size: 1em;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(90deg, #f59e0b 0, #f59e0b var(--apk-fill, 0%), #e2e8f0 var(--apk-fill, 0%), #e2e8f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Number chips 1–5 (primary vote UI) */
.apk-stars--interactive {
  width: 100%;
  justify-content: space-between;
  gap: 6px;
}

.apk-stars--interactive .apk-stars__btn,
.apk-stars--interactive .apk-stars__btn.Play_apk-star-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1 1 0;
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.apk-stars--interactive .apk-stars__btn::before {
  content: "";
  display: block;
  width: 0.95em;
  height: 0.95em;
  background: #cbd5e1;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.5l2.9 6.1 6.6.6-5 4.3 1.5 6.5L12 17.8 5.9 20l1.5-6.5-5-4.3 6.6-.6L12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.5l2.9 6.1 6.6.6-5 4.3 1.5 6.5L12 17.8 5.9 20l1.5-6.5-5-4.3 6.6-.6L12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.apk-stars--interactive .apk-stars__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 15px;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  color: #1e293b;
  background: #e2e8f0;
  border: 0;
  font-variant-numeric: tabular-nums;
}

.apk-stars--interactive .apk-stars__btn.is-hover::before,
.apk-stars--interactive .apk-stars__btn.is-selected::before,
.apk-stars--interactive .apk-stars__btn:hover::before {
  background: #f59e0b;
}

.apk-stars--interactive .apk-stars__btn.is-hover,
.apk-stars--interactive .apk-stars__btn:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: #fffbeb;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.14);
}

.apk-stars--interactive .apk-stars__btn.is-hover .apk-stars__num,
.apk-stars--interactive .apk-stars__btn:hover .apk-stars__num {
  color: #b45309;
  background: #fef3c7;
}

.apk-stars--interactive .apk-stars__btn.is-selected {
  border-color: rgba(245, 158, 11, 0.65);
  background: #fef3c7;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.18);
}

.apk-stars--interactive .apk-stars__btn.is-selected .apk-stars__num {
  color: #fff;
  background: #d97706;
}

.apk-stars--interactive.is-voted .apk-stars__btn {
  cursor: default;
  opacity: 0.75;
}

.apk-stars--icons-only .apk-stars__num {
  display: none;
}

/* Single compact rating box under article */
.apk-rate-box {
  margin: 0;
  padding: 12px 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.apk-rate-box__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.apk-rate-box__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
}

.apk-rate-box__score {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.apk-rate-box__value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #92400e;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.apk-rate-box__max {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
}

.apk-rate-box__count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  margin-inline-start: 4px;
}

.apk-rate-box__hint {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.apk-rate-box__votes {
  margin: 0;
}

.apk-rate-box__chip {
  display: inline-flex;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0d9488;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
}

.apk-rate-box.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

#app-rating {
  scroll-margin-top: 88px;
}

.apk-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.apk-rating-badge__value {
  font-weight: 700;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}

.apk-rating-badge__count {
  font-size: 0.74rem;
  color: #94a3b8;
}

.apk-rating-badge--compact {
  font-size: 0.72rem;
  margin-inline-start: 4px;
}

.apk-rating-badge--inline {
  font-size: 0.88rem;
}

/* Legacy panel variant (non-compact) */
.apk-rating-panel,
.apk-rating-strip {
  margin: 0;
  border-radius: 16px;
  border: 1px solid rgba(127, 29, 29, 0.1);
  background: linear-gradient(145deg, #fffbeb 0, #fff 42%, #f8fafc 100%);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.apk-rating-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(127, 29, 29, 0.08);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.4));
}

.apk-rating-panel__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #92400e;
}

.apk-rating-panel__badge-ico {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: currentColor;
  color: #f59e0b;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.5l2.9 6.1 6.6.6-5 4.3 1.5 6.5L12 17.8 5.9 20l1.5-6.5-5-4.3 6.6-.6L12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2.5l2.9 6.1 6.6.6-5 4.3 1.5 6.5L12 17.8 5.9 20l1.5-6.5-5-4.3 6.6-.6L12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.apk-rating-panel__status {
  font-size: 0.74rem;
  font-weight: 600;
  color: #0d9488;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
}

.apk-rating-panel__body,
.apk-rating-strip__inner {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(140px, 1fr) minmax(200px, 1.1fr);
  align-items: center;
  gap: 16px 22px;
  padding: 16px 18px;
}

.apk-rating-panel__score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.apk-rating-panel__ring {
  --apk-rating-fill: 0%;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(#f59e0b var(--apk-rating-fill), #e2e8f0 0);
  display: grid;
  place-items: center;
  position: relative;
}

.apk-rating-panel__ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(127, 29, 29, 0.06);
}

.apk-rating-panel__ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.apk-rating-panel__score { font-size: 1.55rem; }
.apk-rating-panel__score-max { font-size: 0.72rem; font-weight: 600; color: #94a3b8; }
.apk-rating-panel__count-meta { justify-content: center; }

.apk-rating-panel__bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.apk-rating-panel__bar-row {
  display: grid;
  grid-template-columns: 14px 1fr 36px;
  align-items: center;
  gap: 8px;
}

.apk-rating-panel__bar-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #b45309;
  text-align: center;
}

.apk-rating-panel__bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.apk-rating-panel__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.35s;
}

.apk-rating-panel__bar-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.apk-rating-panel__vote {
  border-inline-start: 1px dashed rgba(127, 29, 29, 0.14);
  padding-inline-start: 18px;
}

.apk-rating-strip__score {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  color: #7f1d1d;
  font-variant-numeric: tabular-nums;
}

.apk-rating-strip__meta {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.82rem;
  color: #64748b;
}

.apk-rating-strip__count { font-weight: 700; color: #334155; }

.apk-rating-strip__vote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 1 1 220px;
  justify-content: flex-end;
  min-width: 0;
}

.apk-rating-strip__label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.apk-rating-strip__stars { display: inline-flex; gap: 6px; }

.apk-rating-strip.is-busy,
.apk-rating-widget.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.apk-rating-panel__badge svg,
.apk-rating-strip__hint[hidden],
.apk-rating-widget__hint[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .apk-rating-panel__body,
  .apk-rating-strip__inner {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }

  .apk-rating-panel__vote {
    border-inline-start: 0;
    padding-inline-start: 0;
    border-top: 1px dashed rgba(127, 29, 29, 0.14);
    padding-top: 14px;
  }
}

@media (max-width: 768px) {
  .apk-rating-strip__vote {
    justify-content: center;
    flex-direction: column;
  }

  .apk-rating-strip__stars {
    width: 100%;
    justify-content: center;
  }
}

html.site-dark .apk-rate-box,
html[data-apk-theme-dark] .apk-rate-box {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.22);
}

html.site-dark .apk-rate-box__title,
html[data-apk-theme-dark] .apk-rate-box__title {
  color: #f8fafc;
}

html.site-dark .apk-rate-box__max,
html.site-dark .apk-rate-box__count,
html.site-dark .apk-rate-box__hint,
html[data-apk-theme-dark] .apk-rate-box__max,
html[data-apk-theme-dark] .apk-rate-box__count,
html[data-apk-theme-dark] .apk-rate-box__hint {
  color: #e2e8f0;
}

html.site-dark .apk-rate-box__value,
html[data-apk-theme-dark] .apk-rate-box__value {
  color: #fbbf24;
}

html.site-dark .apk-stars--interactive .apk-stars__btn,
html[data-apk-theme-dark] .apk-stars--interactive .apk-stars__btn {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.35);
}

html.site-dark .apk-stars--interactive .apk-stars__num,
html[data-apk-theme-dark] .apk-stars--interactive .apk-stars__num {
  color: #f1f5f9;
  background: #334155;
}
