/* Moober — Reviews screen (reviews.html). Builds on the tokens in styles.css. */

body.reviews-body {
  background: var(--surface);
  padding: 0;
}

/* Dark mode uses the high-contrast treatment: surfaces, borders, and muted
   text lift toward the ink, derived from the base tokens — never hard-coded.
   In dark, --text ≈ ink and --bg ≈ paper, mirroring the design system. */
@media (prefers-color-scheme: dark) {
  body.reviews-body {
    --surface: color-mix(in srgb, var(--text) 11%, var(--bg));
    --border: color-mix(in srgb, var(--text) 25%, var(--bg));
    --text-muted: color-mix(in srgb, var(--text) 82%, var(--bg));
  }

  /* chips sit one step lighter than the card they're on */
  body.reviews-body .chip {
    background: color-mix(in srgb, var(--text) 17%, var(--bg));
  }

  body.reviews-body .chip[aria-pressed="true"],
  body.reviews-body .chip[aria-checked="true"] {
    background: var(--text);
  }
}

.phone {
  width: 100%;
  max-width: 460px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---- top bar ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 10px;
}

.topbar .status {
  margin: 0;
}

.topbar-sp {
  flex: 1 1 auto;
}

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

.iconbtn:hover {
  background: var(--surface);
}

.brand-sm {
  gap: 8px;
  margin-bottom: 0;
}

.brand-sm .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
}

.brand-sm .brand-name {
  font-size: 20px;
}

/* ---- scroll column ---- */

.scroll {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 0 22px 30px;
}

/* ---- offline banner ---- */

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: 0 0 auto;
}

/* ---- summary ---- */

.summary {
  display: flex;
  align-items: center;
  gap: 18px;
}

.summary-num {
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.summary-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-count {
  color: var(--text-muted);
  font-size: 15px;
}

.summary-credo {
  font-style: italic;
}

/* ---- stars ---- */

.stars {
  display: inline-flex;
  gap: 3px;
}

.stars svg {
  display: block;
}

.star.is-fill {
  color: var(--text);
}

.star.is-empty {
  color: var(--border);
}

.starbtn {
  background: none;
  border: none;
  padding: 4px;
  margin: -4px;
  cursor: pointer;
  color: var(--border);
  line-height: 0;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.starbtn.is-on {
  color: var(--text);
}

/* ---- the one card: gate / composer / thanks ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}

.gate-lockrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gate-title {
  margin: 10px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.gate-sub {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.3;
}

.gate-note {
  margin: 12px 0 0;
  font-size: 13px;
}

.gate-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 22px 0 6px;
}

.dot {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s, box-shadow 0.12s, border-color 0.12s,
    color 0.12s, transform 0.06s;
}

.dot:not(:disabled) {
  cursor: pointer;
}

.dot.is-lit {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.gate-progress {
  color: var(--text-muted);
  font-size: 13px;
}

.gate-alt {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.gate-alt--riddle {
  margin-top: 14px;
}

.altlink {
  background: none;
  border: none;
  padding: 6px 2px;
  margin: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.altlink:hover {
  color: var(--text);
}

/* ---- chips ---- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips--column {
  flex-direction: column;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.06s ease;
}

.chip:hover {
  border-color: var(--text);
}

.chip:active {
  transform: scale(0.97);
}

.chip[aria-pressed="true"],
.chip[aria-checked="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.chip-tick {
  width: 15px;
  height: 15px;
  opacity: 0;
  margin-left: -2px;
  flex: 0 0 auto;
  transition: opacity 0.15s ease;
}

.chip[aria-pressed="true"] .chip-tick,
.chip[aria-checked="true"] .chip-tick {
  opacity: 1;
}

.chip--option {
  justify-content: flex-start;
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.chip--static {
  cursor: default;
  min-height: 0;
  padding: 5px 11px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
}

.chip--static:hover {
  border-color: var(--border);
}

/* ---- composer ---- */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flabel {
  font-size: 15px;
  font-weight: 600;
}

.flabel-hint {
  color: var(--text-muted);
  font-weight: 400;
}

.solved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

.solved-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--bg);
  box-shadow: 0 0 0 5px var(--accent-soft);
  animation: pop 0.4s ease;
}

.post-error {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.3;
}

/* honeypot — visually gone, still in the form for bots that fill everything */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

button.btn {
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  min-height: 44px;
  font-size: 15px;
  padding: 0 16px;
  gap: 8px;
}

/* ---- thanks ---- */

.thanks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.thanks .gate-sub {
  margin-top: 0;
}

.thanks-check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--bg);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: pop 0.45s ease;
}

.thanks-detail {
  align-self: stretch;
  margin-top: 4px;
}

.thanks-detail .chips {
  margin-top: 10px;
}

/* ---- reviews list ---- */

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

.sectlabel {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sortrow {
  display: flex;
  gap: 6px;
}

.sortchip {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.sortchip:hover {
  border-color: var(--text);
}

.sortchip[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.review {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.review:last-child {
  border-bottom: 0;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.review-name {
  font-weight: 600;
  font-size: 16px;
}

.review-when {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  flex: 0 0 auto;
}

.review .chips {
  margin-top: 3px;
}

.review.is-new {
  animation: slidein 0.4s ease;
}

.list-note {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.3;
}

.more {
  margin-top: 12px;
}

/* skeleton rows — static, no shimmer (no looping motion) */
.skel {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.skel b {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: var(--border);
  opacity: 0.55;
}

.skel b:nth-child(1) {
  width: 38%;
}

.skel b:nth-child(2) {
  width: 24%;
}

.skel b:nth-child(3) {
  width: 66%;
}

/* ---- footer ---- */

.screen-foot {
  margin-top: 0;
  padding: 4px 0 calc(8px + env(safe-area-inset-bottom));
}

/* ---- motion ---- */

.reveal {
  animation: slidein 0.32s ease;
}

.shake {
  animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes slidein {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-5px);
  }
  40%,
  60% {
    transform: translateX(5px);
  }
}
