/* Interactive Remote shared tokens and results components.
   Palette sampled from the logo: sky, signal blue, aqua, violet on a cool paper white with navy ink. */
:root {
  --paper: #F5F8FD;
  --card: #FFFFFF;
  --ink: #132237;
  --muted: #5B6B82;
  --faint: #8C9AB0;
  --line: #E2E8F2;
  --sky: #01B0FD;
  --blue: #1446F8;
  --aqua: #03E7CA;
  --violet: #8948FC;
  --danger: #E0355B;
  --grad: linear-gradient(135deg, #01B0FD 0%, #1446F8 58%, #8948FC 100%);
  --grad-r: linear-gradient(90deg, #01B0FD 0%, #1446F8 60%, #8948FC 100%);
  --grad-aqua: linear-gradient(135deg, #03E7CA 0%, #01B0FD 100%);
  --tint: #EEF4FF;
  --font: 'Outfit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* hidden always wins over layout rules */
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(20, 70, 248, .45); outline-offset: 2px; }

.shimmer {
  background: linear-gradient(90deg, var(--faint) 0%, var(--blue) 40%, var(--violet) 55%, var(--faint) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ---------- Results (sized in em so each surface scales them) ---------- */
.r-track { display: block; height: .55em; border-radius: 99px; background: var(--line); overflow: hidden; }
.r-fill { display: block; height: 100%; border-radius: 99px; background: var(--grad-r); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.r-count { margin: 1em 0 0; color: var(--muted); font-size: .85em; }
.r-empty { color: var(--muted); list-style: none; }
.r-summary { margin: 1.1em 0 0; padding: .9em 1.1em; border-radius: 1em; background: var(--tint); line-height: 1.45; }

.r-slider .r-avg { display: flex; align-items: baseline; gap: .5em; margin-bottom: .8em; }
.r-avg-n { font-size: 3.2em; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r-avg-l { color: var(--muted); }
.r-hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: .45em; height: 9em; align-items: end; }
.r-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .25em; }
.r-bar { width: 100%; border-radius: .5em .5em .2em .2em; background: linear-gradient(180deg, #01B0FD, #1446F8); transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.r-col.is-mine .r-bar { background: linear-gradient(180deg, #8948FC, #1446F8); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--violet); }
.r-colc { font-size: .75em; color: var(--muted); min-height: 1.2em; }
.r-coln { font-size: .85em; font-weight: 600; }
.r-ends { display: flex; justify-content: space-between; margin-top: .4em; color: var(--muted); font-size: .85em; }

.r-tf { display: grid; gap: .9em; }
.r-tf-row { display: grid; grid-template-columns: 4em 1fr 3.2em; align-items: center; gap: .8em; }
.r-tf-row .r-track { height: 1.6em; }
.r-tf-l { font-weight: 700; }
.r-tf-p { font-weight: 700; text-align: right; }
.r-tf-row.is-mine .r-tf-l::after { content: ' (you)'; font-weight: 400; color: var(--muted); font-size: .8em; }

.r-emote { display: grid; gap: .7em; }
.r-emo { display: grid; grid-template-columns: 1.8em 6.5em 1fr 3em; align-items: center; gap: .6em; }
.r-emo-e { font-size: 1.5em; line-height: 1; }
.r-emo-l { font-weight: 600; }
.r-emo-c { text-align: right; font-weight: 700; }
.r-emo.is-mine .r-emo-l { color: var(--violet); }

.r-cloud { position: relative; width: 100%; height: 14em; }
.r-cloud .cw { position: absolute; white-space: nowrap; line-height: 1; letter-spacing: -.01em; animation: cw-in .5s ease both; }
.r-cloud .cw.is-mine { text-decoration: underline; text-decoration-color: var(--violet); text-decoration-thickness: .08em; text-underline-offset: .12em; }
@keyframes cw-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

.r-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: .75em; }
.r-rank li { display: grid; grid-template-columns: 1.9em 1fr auto; align-items: center; gap: .7em; }
.r-rank-i { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--tint); color: var(--blue); font-weight: 800; font-size: .9em; }
.r-rank li:first-child .r-rank-i { background: var(--grad); color: #fff; }
.r-rank-t { display: grid; gap: .35em; font-weight: 600; line-height: 1.25; }
.r-rank-t .r-track { height: .4em; }
.r-rank-v { color: var(--muted); font-size: .85em; white-space: nowrap; }

.r-reflect { position: relative; padding: 1.2em 1.3em 1.1em 1.5em; border-radius: 1.1em; background: var(--card); box-shadow: inset 4px 0 0 var(--violet); }
.r-reflect p { margin: 0 0 .7em; font-size: 1.08em; line-height: 1.55; }
.r-reflect-by { color: var(--muted); font-size: .8em; }
.r-reflect.is-pending { padding: 1.4em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
