/* The rage meter on Today's brief (pages/rage.js): a speedometer of how heated his posting is today, a strip of the
   last 30 days, and a back side with the five measures and the posts that pushed it up. The turn is the shared flip in
   credits.css; the needle, the segments and the glow move on transform and opacity only. The full-frame version for a
   chart video is at the bottom. */

.flipcard.rage { --rg-hot: var(--red); }
.rage-face { padding-bottom: 16px; overflow: hidden; }
/* A low heat haze behind the dial, in the score's color. */
.rage-face.flip-front::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(90% 60% at 50% 34%, color-mix(in srgb, var(--lvl) 12%, transparent), transparent 70%);
}

.rg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.rg-head .w-title { flex: 1; min-width: 0; margin: 0; }
.rg-head .w-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-head .flip-btn[disabled] { opacity: .45; cursor: default; filter: none; transform: none; }
.rg-live {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font: 700 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--red-ink);
}
.rg-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); --lvl: var(--red); animation: cr-beat 1.8s ease-out infinite; }
.rg-today {
  appearance: none; flex: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer;
  font: 650 11.5px/1 var(--mono); padding: 7px 10px; border-radius: 999px; transition: border-color .2s, transform .15s var(--ease);
}
.rg-today:hover { border-color: var(--red); transform: translateY(-1px); }

/* ---- The dial ---- */
.rg-gauge { position: relative; width: 100%; max-width: 360px; margin: 2px auto 0; isolation: isolate; }
.rg-dial { display: block; width: 100%; height: auto; overflow: visible; }
.rg-glow {
  position: absolute; left: 50%; top: 58%; width: 78%; aspect-ratio: 1; z-index: -1; pointer-events: none; border-radius: 50%;
  translate: -50% -50%; background: radial-gradient(circle, color-mix(in srgb, var(--rg) 46%, transparent), transparent 66%);
  animation: rg-breathe 3.6s ease-in-out infinite;
}
.rg-hot .rg-glow { animation-duration: 1.6s; }
@keyframes rg-breathe { 0%, 100% { scale: .9; } 50% { scale: 1.06; } }
.rg-seg { fill: var(--c); opacity: .16; transform-box: fill-box; transform-origin: center; }
.rg-seg.on { opacity: 1; }
.rg-tick { stroke: var(--muted); stroke-width: 1; stroke-linecap: round; opacity: .55; }
.rg-tick.major { stroke-width: 1.8; opacity: .85; }
.rg-num-tick { font: 600 8.5px var(--mono); fill: var(--muted); text-anchor: middle; }
.rg-end { font: 700 7.5px var(--mono); letter-spacing: .14em; fill: var(--muted); }
.rg-end:first-of-type { text-anchor: start; }
.rg-end.hot { text-anchor: end; fill: var(--red-ink); }
.rg-needle, .rg-shake { transform-box: view-box; transform-origin: 120px 118px; }
.rg-hand { fill: var(--ink); }
.rg-hub { fill: var(--rg, var(--ink)); stroke: var(--panel); stroke-width: 3.5; }
.rg-hub-dot { fill: var(--panel); }
.rg-score { font: 800 46px/1 var(--display); font-stretch: 80%; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
/* Pinned near the top, the needle can't keep still. */
.rg-hot .rg-shake { animation: rg-shake .11s linear infinite alternate; }
@keyframes rg-shake { from { rotate: -.9deg; } to { rotate: .9deg; } }
.rg-word {
  margin: -4px 0 0; text-align: center; font: 850 21px/1.1 var(--display); font-stretch: 85%; letter-spacing: .05em; text-transform: uppercase;
}
.rg-line { margin: 8px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); text-wrap: balance; }
.rg-line b { color: var(--ink); font-weight: 700; }

/* ---- The five measures at a glance ---- */
.rg-mini { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rg-mini li {
  position: relative; display: grid; gap: 3px; justify-items: center; padding: 8px 4px 7px; border-radius: 10px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); cursor: help;
}
.rg-mini li::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.rg-mini span { font: 650 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.rg-mini b { display: inline-flex; align-items: baseline; gap: 3px; font: 800 17px/1 var(--display); font-stretch: 85%; font-variant-numeric: tabular-nums; }
.rg-mini i, .rg-m-val i { font-style: normal; font-size: 9px; }
.rg-up { color: var(--red-ink); }
.rg-down { color: var(--blue-ink); }
.rg-same { color: var(--muted); }

/* ---- The last 30 days ---- */
.rg-strip { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; height: 44px; margin: 14px 0 0; align-items: stretch; }
.rg-bar {
  appearance: none; position: relative; display: flex; align-items: flex-end; height: 100%; padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer; border-radius: 3px;
}
.rg-bar i {
  display: block; width: 100%; height: 100%; border-radius: 3px 3px 1px 1px; background: var(--c); opacity: .62; transform-origin: 50% 100%;
  transition: opacity .2s;
}
.rg-bar:hover i, .rg-bar.here i { opacity: 1; }
.rg-bar.here::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink);
}
.rg-bar[disabled] { cursor: default; }
.rg-bar:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rg-strip-key { display: flex; justify-content: space-between; margin-top: 9px; font: 500 10.5px/1 var(--mono); color: var(--muted); letter-spacing: .03em; }
.rg-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; min-height: 44px; }
.rg-video-slot:empty { display: none; }

/* ---- The back: what pushed it up ---- */
.rg-back-lede { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }
.rg-ms { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.rg-m { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.rg-m-name { font: 650 11.5px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.rg-m-val { text-align: right; font-size: 13px; white-space: nowrap; }
.rg-m-val b { font: 700 13px/1 var(--mono); font-variant-numeric: tabular-nums; }
.rg-m-val small { font: 500 11px/1 var(--mono); color: var(--muted); }
.rg-m-bar { grid-column: 1 / -1; position: relative; height: 7px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.rg-m-bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--c); transform-origin: 0 50%; }
.rg-m-bar em { position: absolute; top: -3px; width: 2px; height: 13px; margin-left: -1px; border-radius: 1px; background: var(--ink); opacity: .55; }
.rg-sub { margin: 14px 0 6px; font: 650 11px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.rg-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rg-post { padding: 8px 10px 9px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); transition: border-color .2s; }
.rg-post:hover { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.rg-post-top { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.rg-post-when { font-size: 11px; color: var(--muted); margin-right: 3px; }
.rg-post-link { display: block; text-decoration: none; color: inherit; }
.rg-post-text {
  font-size: 13px; line-height: 1.42; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
}
.rg-post mark { background: none; color: inherit; border-radius: 3px; }
.rg-post .rg-caps { color: var(--red-ink); font-weight: 750; background: color-mix(in srgb, var(--red) 11%, transparent); padding: 0 2px; }
.rg-post .rg-insult {
  color: var(--kind-attack); font-weight: 700; text-decoration: underline wavy color-mix(in srgb, var(--kind-attack) 70%, transparent);
  text-decoration-thickness: 1.3px; text-underline-offset: 3px;
}
.rg-post .rg-bang { color: var(--red-ink); font-weight: 900; }
.rg-tag { font: 600 10px/1 var(--mono); padding: 3px 6px; border-radius: 999px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); }
.rg-out { margin-left: auto; text-decoration: none; color: var(--red-ink); font-weight: 700; padding: 0 4px; }
.rg-out:hover { color: var(--red); }

/* ---- The blowback needle: X's reaction (a slim hand to an X badge past the ring, its own heat color around it) ---- */
.rg-xneedle { transform-box: view-box; transform-origin: 120px 118px; }
.rg-xhand { stroke: color-mix(in srgb, var(--ink) 50%, transparent); stroke-width: 2.2; stroke-linecap: round; }
.rg-xknob { fill: var(--panel); stroke: var(--xc); stroke-width: 2.6; }
.rg-xup { transform-box: view-box; }
.rg-xmark { stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.rg-xb {
  display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px;
  background: var(--ink); color: var(--panel); font: 800 11px/1 var(--display); font-style: normal;
}
.rg-x {
  appearance: none; display: flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; max-width: 100%;
  margin: 8px auto 0; padding: 5px 12px 5px 6px; border-radius: 999px; font: inherit; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--xc, var(--line)) 55%, var(--line));
  background: color-mix(in srgb, var(--xc, var(--panel-2)) 12%, var(--panel-2));
  transition: border-color .2s, transform .15s var(--ease);
}
button.rg-x { cursor: pointer; }
button.rg-x:hover { border-color: var(--xc); transform: translateY(-1px); }
button.rg-x:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rg-x.quiet { --xc: var(--line); color: var(--muted); cursor: help; }
.rg-x-name { font: 650 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.rg-x b { font: 800 18px/1 var(--display); font-stretch: 85%; font-variant-numeric: tabular-nums; }
.rg-x-word { font: 750 12px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-x.quiet .rg-x-word { font: 500 12px/1.2 var(--body); letter-spacing: 0; text-transform: none; }
.rg-x em { font-style: normal; color: var(--muted); }
/* X's reaction on each day of the strip: a dot at its own height. */
.rg-xdot {
  position: absolute; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; pointer-events: none; text-decoration: none;
  background: var(--xc); box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 2.3px color-mix(in srgb, var(--ink) 38%, transparent);
}
/* Under each hot post on the back: the hours after, against the day before (the dotted line). */
.rg-xr { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.rg-xr.quiet { gap: 7px; }
.rg-xr.quiet .rg-xb { margin-right: 0; }
.rg-xr-chart { position: relative; flex: none; display: grid; grid-template-columns: repeat(6, 5px); gap: 2px; align-items: end; height: 22px; }
.rg-xr-chart i { display: block; height: 100%; border-radius: 2px 2px 1px 1px; background: var(--xc); transform-origin: 50% 100%; }
.rg-xr-chart i.later { box-shadow: inset 0 0 0 1px var(--line); background: none; }
.rg-xr-chart em { position: absolute; left: -2px; right: -2px; height: 0; border-top: 1.5px dotted var(--ink); opacity: .65; }
/* One line of words that wraps like a sentence: the X badge and the Loudest tag sit in it, never alone on a line. */
.rg-xr-text { display: block; min-width: 0; line-height: 1.55; }
.rg-xr-text b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.rg-xr .rg-xb { width: 15px; height: 15px; font-size: 9.5px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.rg-xr-top {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  font: 650 9.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 999px; color: var(--ink);
  background: color-mix(in srgb, var(--xc) 22%, transparent);
}
.rg-sub-x { text-transform: none; letter-spacing: .02em; }
.rg-sub-x b { color: var(--ink); }
.rg-tag-x { color: var(--ink); }

/* ---- Phones ---- */
@media (max-width: 560px) {
  .rg-gauge { max-width: 300px; }
  .rg-strip { gap: 2px; }
  .rg-mini { gap: 4px; }
  /* Two posts on a phone, so the back stays about as tall as the front. */
  .rg-posts > li:nth-child(n + 3) { display: none; }
  .rg-post-text { -webkit-line-clamp: 2; line-clamp: 2; }
  .rg-mini b { font-size: 15px; }
}

@media (max-width: 560px) {
  .rg-x { gap: 6px; padding-right: 10px; }
  .rg-x-name { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .rg-glow, .rg-hot .rg-shake, .rg-live i { animation: none; }
}

/* ---- The chart video: the gauge full frame, the measures under it ---- */
.rg-film { display: grid; justify-items: center; gap: 22px; width: 900px; padding: 6px 0 4px; }
.rg-film .rg-gauge { max-width: 520px; }
.rg-film .rg-word { font-size: 40px; margin-top: -6px; }
.rg-film .rg-score { font-size: 48px; }
.rg-chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; width: 100%; }
.rg-chip {
  position: relative; display: grid; gap: 4px; padding: 14px 14px 12px; border-radius: 14px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.rg-chip::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.rg-chip span { font: 650 12px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rg-chip b { font: 800 30px/1 var(--display); font-stretch: 82%; color: var(--ink); font-variant-numeric: tabular-nums; }
.rg-chip small { font: 500 12px/1.2 var(--mono); color: var(--muted); }
.film-clear .rg-film .rg-chip { background: color-mix(in srgb, var(--panel) 92%, transparent); }
html[data-film="rage"] .film-fit { width: auto; }
/* Portuguese: the exclamation marks' "por publicação", on its own line, sits close under its number. */
.rg-chip .rg-unit { margin-top: -2px; color: var(--ink); }
/* "His rage 8.2 · The internet's 9.1": the two needles in words, under the gauge. */
.rg-duo { display: flex; gap: 16px; justify-content: center; margin-top: -6px; }
.rg-duo > span {
  display: inline-flex; align-items: center; gap: 11px; padding: 10px 20px 10px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: inset 5px 0 0 var(--xc), var(--shadow);
}
.rg-duo small { font: 700 14px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rg-duo b { font: 800 36px/1 var(--display); font-stretch: 82%; color: var(--ink); font-variant-numeric: tabular-nums; }
.rg-duo em { font: 800 15px/1 var(--display); font-style: normal; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); opacity: .78; }
.rg-duo .rg-xb { width: 26px; height: 26px; font-size: 15px; border-radius: 7px; }
.film-clear .rg-film .rg-duo > span { background: color-mix(in srgb, var(--panel) 92%, transparent); }
