.thermometer { container-type: inline-size; min-width: 0 }
.thermo-empty { padding-block: 8px; margin: 0 }
.thermometer[hidden] * { animation-play-state: paused !important }
.thermo-particles { position: absolute; left: 0; top: 7px }
.thermo-particles b { position: absolute; width: 3px; height: 3px; background: #df933d; border-radius: 50%; opacity: 0 }
.thermo-improved .thermo-particles b { animation: thermo-burst .9s ease-out both; animation-delay: calc(var(--i) * 35ms) }
.display-settings summary { color: var(--muted); cursor: pointer; padding-block: 5px; font-size: .875rem }
.thermo-scales { display: grid; gap: 24px; color: var(--muted); font-size: .6875rem; margin-bottom: 12px }
.thermo-scales > div { display: flex; justify-content: space-between }
.thermo-scales > div + div { display: none }
.thermo-players { display: grid; gap: 18px 24px; padding: 0; margin: 0; list-style: none }
.thermo-player { min-width: 0 }
.thermo-player-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: .8125rem; margin-bottom: 6px }
.thermo-name { flex: 1; min-width: 0; overflow-wrap: anywhere }
.thermo-self .thermo-name { font-weight: 600 }
.thermo-current { color: var(--muted); font-size: .75rem; white-space: nowrap }
.thermo-value { font-weight: 500; white-space: nowrap }
.thermo-track { height: 26px; position: relative; margin-inline: 5px }
.thermo-glass { position: absolute; inset: 0 0 10px; overflow: hidden; border: 1px solid var(--control); border-radius: 5px; background: var(--surface) }
.thermo-fill { position: absolute; inset: 0; background: linear-gradient(90deg,#719ead,#a3b59c 35%,#eab566 70%,#ff9a52); opacity: .65; transition: clip-path .65s cubic-bezier(.2,.75,.25,1) }
.thermo-best,.thermo-latest { position: absolute; top: 7px; transition: left .65s cubic-bezier(.2,.75,.25,1) }
.thermo-best > i { display: block; position: absolute; width: 8px; height: 8px; left: -4px; top: -4px; background: var(--player-color); border: 1px solid #514538; border-radius: 1px; transform: rotate(45deg); box-shadow: 0 0 9px #edb66b66 }
.thermo-latest { top: 22px }
.thermo-latest > i { display: block; position: absolute; width: 7px; height: 7px; left: -4px; top: -4px; background: var(--page); border: 2px solid var(--player-color); border-radius: 50% }
.thermo-best .thermo-particles { top: 0 }
.thermo-shimmer { position: absolute; inset: 0; opacity: 0; background: linear-gradient(110deg,transparent 30%,#fff6,transparent 70%); pointer-events: none }
.thermo-improved .thermo-shimmer { animation: thermo-shimmer 1.2s ease-out }
.thermo-snapshot * { transition: none !important }
.thermo-single .thermo-track { height: 34px }
.thermo-single .thermo-glass { bottom: 12px }
.thermo-single .thermo-best { top: 10px }
.thermo-single .thermo-latest { top: 28px }
.visuals { min-width: 0; display: grid; gap: 16px; container: progress / inline-size }
.visuals > .map-replay { margin: 0 }
.thermo-shared { padding-top: 2px }
/* A compact temperature comparison, independent of the surrounding room grid. */
.thermo-shared,.thermo-compact { min-width: 0 }
.temperature-scale { padding: 0 6px; margin-bottom: 4px }
.temperature-ruler { display: flex; justify-content: space-between; font-size: .625rem; color: var(--muted); line-height: 1.2 }
.temperature-rail { height: 30px; position: relative; margin-top: 3px; isolation: isolate }
.temperature-rail::before,.temperature-mercury { content: ''; position: absolute; top: 5px; left: 0; right: 0; height: 6px; border-radius: 5px }
.temperature-rail::before { background: var(--line) }
.temperature-mercury { background: linear-gradient(90deg,#719ead,#a3b59c 35%,#eab566 70%,#ff9a52); transition: clip-path .4s ease }
.temperature-marks { position: absolute; inset: 0 }
.temperature-mark { position: absolute; top: 8px; width: 7px; height: 7px; background: var(--player-color); border: 1px solid var(--text); border-radius: 1px; transform: translate(-50%,-50%) rotate(45deg); transition: left .4s ease }
.temperature-mark[data-field=latest] { top: 22px; background: var(--page); border: 2px solid var(--player-color); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 .5px var(--muted) }
.temperature-mark[data-self=true] { z-index: 1; width: 9px; height: 9px }
.temperature-values { display: grid; grid-template-columns: minmax(0,1fr) minmax(6ch,max-content) minmax(6ch,max-content); column-gap: 8px; font-size: .75rem }
.temperature-labels,.temperature-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; gap: 4px 8px; align-items: baseline }
.temperature-labels { padding: 3px 0 6px; font-size: .625rem; line-height: 1.3 }
.temperature-labels > span { min-width: 0; contain: inline-size; overflow-wrap: anywhere }
.temperature-labels > :not(:first-child),.temperature-row > :not(:first-child) { text-align: right }
.temperature-roster { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; list-style: none; padding: 0; margin: 0 }
.temperature-row { padding: 7px 0; font-size: .75rem; line-height: 1.3 }
.temperature-name { min-width: 0; overflow-wrap: anywhere }
.temperature-name::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--player-color); vertical-align: .12em }
.temperature-row[data-self=true] .temperature-name { font-weight: 600 }
.temperature-best { font-weight: 600 }
.temperature-latest { color: var(--muted) }
.temperature-best,.temperature-latest { white-space: nowrap; font-variant-numeric: tabular-nums }
.temperature-best-only .temperature-values { grid-template-columns: minmax(0,1fr) minmax(6ch,max-content) }
.temperature-best-only .temperature-rail { height: 18px }
/* Large text must not squeeze a player's name between two complete °C values. */
@container (max-width: 14rem) {
  .thermo-name { flex-basis: 100%; }
  .temperature-values { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .temperature-labels > :first-child { display: none; }
  .temperature-name { grid-column: 1 / -1; }
  .temperature-labels > :nth-child(2), .temperature-row > .temperature-best { text-align: left; }
}
.temperature-still * { transition: none !important }
.temperature-personal { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; font-size: .75rem; font-variant-numeric: tabular-nums }
.temperature-personal > span { color: var(--muted) }
.temperature-disclosure > summary { padding-block: 8px; color: var(--muted); cursor: pointer; font-size: .6875rem }
.temperature-disclosure > summary:focus-visible { outline-offset: 2px }
.temperature-mark.thermo-improved { animation: temperature-improvement .65s ease-out }
/* Map-side results scale: a fixed narrow column with full values on demand. */
.thermo-vertical { min-width: 0 }
.thermo-vertical .temperature-scale { position: relative; height: var(--temperature-height, clamp(220px, 36dvh, 360px)); padding: 0; margin: 0 0 8px }
.thermo-vertical .temperature-ruler { position: absolute; inset: 0; display: block; text-align: center; line-height: 1.2 }
.thermo-vertical .temperature-ruler > span { position: absolute; left: 0; right: 0 }
.thermo-vertical .temperature-ruler > span:first-child { bottom: 0 }
.thermo-vertical .temperature-ruler > span:nth-child(2) { display: none }
.thermo-vertical .temperature-ruler > span:last-child { top: 0 }
.thermo-vertical .temperature-rail { position: absolute; inset: 1.3rem 8px; height: auto; margin: 0 }
.thermo-vertical .temperature-rail::before, .thermo-vertical .temperature-mercury { top: 0; bottom: 0; left: calc(50% - 3px); right: auto; width: 6px; height: auto }
.thermo-vertical .temperature-mercury { background: linear-gradient(0deg,#719ead,#a3b59c 35%,#eab566 70%,#ff9a52) }
.thermo-vertical .temperature-mark { transition: top .4s ease; z-index: 1 }
.thermo-vertical .temperature-mark[data-self=true] { z-index: 2 }
.thermo-vertical .temperature-personal { display: none }
.thermo-vertical .temperature-disclosure { position: relative; min-width: 0 }
.thermo-vertical .temperature-disclosure > summary { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 5px 2px; border: 1px solid var(--control); border-radius: 6px; list-style: none; font-size: .75rem; line-height: 1.2; font-variant-numeric: tabular-nums }
.thermo-vertical .temperature-disclosure > summary::-webkit-details-marker { display: none }
.thermo-vertical .temperature-disclosure > summary::after { content: ''; width: 5px; height: 5px; margin-left: 1px; flex: none; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) }
.thermo-vertical .temperature-disclosure[open] > summary::after { transform: rotate(225deg) }
.thermo-vertical .temperature-disclosure > summary:hover { background: var(--hover) }
.thermo-vertical .temperature-disclosure svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round }
.temperature-vertical-panel { position: absolute; z-index: 12; right: 0; top: calc(100% + 6px); width: min(23rem, calc(100vw - 32px)); max-height: min(60dvh, 30rem); overflow: auto; overscroll-behavior: contain; padding: 12px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 28px #0002 }
.temperature-vertical-panel .temperature-row { padding-block: 8px }
@container (min-width: 600px) {
  .thermo-dense .thermo-players,.thermo-dense .thermo-scales { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .thermo-dense .thermo-scales > div + div { display: flex }
}
@keyframes temperature-improvement { 50% { box-shadow: 0 0 0 5px color-mix(in srgb,var(--player-color) 30%,transparent) } }
@keyframes thermo-shimmer { 0% { opacity: 0; transform: translateX(-100%) } 25% { opacity: .7 } 100% { opacity: 0; transform: translateX(100%) } }
@keyframes thermo-burst { 0% { opacity: .9; transform: translate(0,0) } 100% { opacity: 0; transform: translate(calc((var(--i) - 2) * 8px),calc(-18px - var(--i) * 4px)) scale(.25) } }
@media (prefers-reduced-motion: reduce) {
  .thermometer * { animation: none !important; transition: none !important }
  .thermo-particles { display: none }
}
@media (forced-colors: active) {
  .temperature-mark,.thermo-best > i,.thermo-latest > i { background: Highlight; border-color: CanvasText }
  .temperature-mark[data-field=latest] { background: Canvas }
}
