:root {
    --bg-1: #111827;
    --bg-2: #1f2937;
    --bg-3: #374151;
  
    --text: #ffffff;
    --face-bg: rgba(255, 255, 255, 0.95);
    --face-shadow: rgba(0, 0, 0, 0.24);
    --ink: #111827;
  
    --glow: rgba(255, 255, 255, 0.28);
    --cheek: rgba(244, 114, 182, 0.24);
  }
  
  * {
    box-sizing: border-box;
  }
  
  html,
  body {
    margin: 0;
    min-height: 100%;
  }
  
  body {
    color: var(--text);
    font-family:
      Inter,
      ui-sans-serif,
      system-ui,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      sans-serif;
  
    background:
      radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.26), transparent 25rem),
      radial-gradient(circle at 18% 82%, rgba(255, 255, 255, 0.13), transparent 19rem),
      linear-gradient(145deg, var(--bg-1), var(--bg-2), var(--bg-3));
  
    background-size: 145% 145%;
    animation: backgroundFloat 13s ease-in-out infinite;
  
    transition:
      background 700ms ease,
      color 300ms ease;
  }
  
  .screen {
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    max-width: 100vw;
    display: grid;
    grid-template-columns:
      minmax(7rem, 1.2fr)
      minmax(0, 22rem)
      minmax(7rem, 1.2fr);
    align-items: center;
    justify-items: stretch;
    column-gap: clamp(1.25rem, 5vw, 3.5rem);
    padding: clamp(1rem, 2.5vh, 1.75rem) clamp(0.5rem, 2.5vw, 2.75rem);
    overflow: hidden;
  }

  .temperature-card {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    display: grid;
    justify-items: center;
    gap: clamp(1.4rem, 3.5vw, 2.4rem);
    text-align: center;
    transform: translateY(-1.1rem);
  }
  
  .face-stage {
    position: relative;
    width: min(88vw, 22rem);
    display: grid;
    justify-items: center;
    gap: clamp(0.55rem, 1.4svh, 0.85rem);
  }

  .face-core {
    position: relative;
    width: clamp(6.5rem, 17vw, 11rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
  }

  .face-bubble {
    --bubble-glow: rgba(255, 255, 255, 0.42);
    --bubble-tint: rgba(255, 255, 255, 0.14);
    --bubble-shimmer: rgba(255, 255, 255, 0.22);

    position: relative;
    z-index: 2;
    width: 100%;
    padding: clamp(0.78rem, 1.6svh, 1rem) clamp(0.88rem, 2.3vw, 1.1rem);
    border-radius: 1.65rem;

    text-align: center;
    isolation: isolate;

    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 0.12rem 0.55rem rgba(15, 23, 42, 0.28);

    background:
      linear-gradient(
        155deg,
        rgba(255, 255, 255, 0.34) 0%,
        rgba(255, 255, 255, 0.14) 48%,
        rgba(255, 255, 255, 0.08) 100%
      );

    border: 1px solid rgba(255, 255, 255, 0.36);

    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);

    box-shadow:
      0 0 2.8rem var(--bubble-glow),
      0 1.2rem 2.8rem rgba(0, 0, 0, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      inset 0 -0.6rem 1.4rem rgba(255, 255, 255, 0.06);

    animation: bubbleDream 7s ease-in-out infinite;

    transition:
      box-shadow 600ms ease,
      border-color 600ms ease;
  }

  .face-bubble::before {
    content: "";
    position: absolute;
    inset: -0.35rem;
    border-radius: inherit;
    z-index: -1;
    pointer-events: none;

    background:
      radial-gradient(circle at 18% 12%, var(--bubble-shimmer), transparent 42%),
      radial-gradient(circle at 82% 88%, var(--bubble-tint), transparent 48%),
      radial-gradient(circle at 50% 110%, var(--bubble-glow), transparent 62%);

    opacity: 0.9;
    filter: blur(10px);
  }

  .face-bubble.is-pop {
    animation: bubblePop 720ms ease, bubbleDream 7s ease-in-out 720ms infinite;
  }

  .face-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.48rem;
    width: 0.95rem;
    height: 0.95rem;
    transform: translateX(-50%) rotate(45deg);

    background: rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.34);
    border-bottom: 1px solid rgba(255, 255, 255, 0.34);

    backdrop-filter: blur(14px);
    box-shadow: 0 0 1.1rem var(--bubble-glow);
  }

  .face-bubble-text {
    margin: 0;
    font-size: clamp(0.88rem, 2.8vw, 1.02rem);
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: 0.01em;
    text-wrap: balance;
  }

  .face-bubble-addon {
    margin: 0.38rem 0 0;
    font-size: clamp(0.78rem, 2.4vw, 0.88rem);
    font-weight: 650;
    font-style: italic;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
    text-wrap: balance;
  }

  .face-bubble-addon[hidden] {
    display: none;
  }

  .face-bubble-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    margin: 0.48rem 0 0;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;

    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 1.2rem rgba(255, 255, 255, 0.12);
  }

  .face-bubble-icon {
    font-size: 0.92rem;
    line-height: 1;
    filter: drop-shadow(0 0 0.45rem rgba(255, 255, 255, 0.35));
  }

  .night-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.45rem, 1.1svh, 0.65rem);
    width: min(100%, 13rem);
    margin-top: clamp(0.5rem, 1.4svh, 0.9rem);
    text-align: center;
    filter: drop-shadow(0 0 1.8rem rgba(255, 255, 255, 0.12));
    animation: historyStatFloat 8.5s ease-in-out infinite;
    animation-delay: 0.5s;
  }

  .night-tip.is-empty .night-tip-range {
    opacity: 0.45;
  }

  .night-tip-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
  }

  .night-tip-label {
    font-size: clamp(0.62rem, 1.6vw, 0.72rem);
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
  }

  .night-tip-label::before {
    content: "";
    display: block;
    width: clamp(0.42rem, 1.2vw, 0.52rem);
    height: clamp(0.42rem, 1.2vw, 0.52rem);
    margin: 0 auto 0.32rem;
    border-radius: 999px;
    background: rgba(196, 181, 253, 0.95);
    box-shadow: 0 0 0.85rem rgba(167, 139, 250, 0.55);
  }

  .night-tip[data-tone="ventilate"] .night-tip-label::before {
    background: rgba(254, 240, 138, 0.95);
    box-shadow: 0 0 0.75rem rgba(251, 191, 36, 0.5);
  }

  .night-tip[data-tone="cozy"] .night-tip-label::before {
    background: rgba(254, 202, 202, 0.95);
    box-shadow: 0 0 0.75rem rgba(251, 146, 60, 0.48);
  }

  .night-tip[data-tone="cool"] .night-tip-label::before {
    background: rgba(191, 219, 254, 0.95);
    box-shadow: 0 0 0.75rem rgba(147, 197, 253, 0.6);
  }

  .night-tip[data-tone="great"] .night-tip-label::before {
    background: rgba(187, 247, 208, 0.95);
    box-shadow: 0 0 0.75rem rgba(134, 239, 172, 0.5);
  }

  .night-tip-range {
    font-size: clamp(1.05rem, 3.4vw, 1.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.055em;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 0 1.4rem rgba(255, 255, 255, 0.32);
  }

  .night-tip-text {
    margin: 0;
    max-width: 12.5rem;
    font-size: clamp(0.66rem, 1.6vw, 0.74rem);
    font-weight: 650;
    line-height: 1.38;
    color: rgba(255, 255, 255, 0.55);
    text-wrap: balance;
  }

  .night-tip-detail {
    margin: 0;
    font-size: clamp(0.62rem, 1.5vw, 0.72rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 0.9rem rgba(255, 255, 255, 0.2);
  }

  .night-tip-detail[hidden] {
    display: none;
  }

  .face-bubble[data-tone="ventilate"] {
    --bubble-glow: rgba(253, 224, 138, 0.5);
    --bubble-tint: rgba(251, 191, 36, 0.22);
    --bubble-shimmer: rgba(254, 243, 199, 0.35);
  }

  .face-bubble[data-tone="cozy"] {
    --bubble-glow: rgba(251, 182, 206, 0.52);
    --bubble-tint: rgba(244, 114, 182, 0.24);
    --bubble-shimmer: rgba(252, 231, 243, 0.34);
  }

  .face-bubble[data-tone="cool"] {
    --bubble-glow: rgba(147, 197, 253, 0.55);
    --bubble-tint: rgba(96, 165, 250, 0.22);
    --bubble-shimmer: rgba(219, 234, 254, 0.34);
  }

  .face-bubble[data-tone="great"] {
    --bubble-glow: rgba(134, 239, 172, 0.5);
    --bubble-tint: rgba(74, 222, 128, 0.2);
    --bubble-shimmer: rgba(220, 252, 231, 0.34);
  }

  @keyframes bubbleDream {
    0%,
    100% {
      transform: translateY(0);
      filter: brightness(1);
    }

    50% {
      transform: translateY(-0.22rem);
      filter: brightness(1.06);
    }
  }

  @keyframes bubblePop {
    0% {
      transform: translateY(0.15rem) scale(0.96);
      opacity: 0.55;
      filter: brightness(0.92);
    }

    55% {
      transform: translateY(-0.1rem) scale(1.015);
      opacity: 1;
      filter: brightness(1.1);
    }

    100% {
      transform: translateY(0) scale(1);
      opacity: 1;
      filter: brightness(1);
    }
  }
  
  .glow-ring {
    position: absolute;
    width: 116%;
    aspect-ratio: 1;
    border-radius: 999px;
    background: var(--glow);
    filter: blur(18px);
    opacity: 0.75;
    animation: glowPulse 5s ease-in-out infinite;
  }
  
  .face {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
  
    background:
      radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.95), transparent 16%),
      var(--face-bg);
  
    box-shadow:
      inset 0 -0.7rem 1.6rem rgba(0, 0, 0, 0.12),
      0 1.4rem 3.5rem var(--face-shadow);
  
    transform-origin: 50% 70%;
    animation: faceIdle 5s ease-in-out infinite;
  
    transition:
      background 300ms ease,
      box-shadow 300ms ease;
  }
  
  /* Eyes */
  
  .eyes {
    position: absolute;
    left: 24%;
    top: 34%;
    width: 52%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .eye {
    position: relative;
    width: clamp(0.72rem, 1.8vw, 1rem);
    height: clamp(0.72rem, 1.8vw, 1rem);
    border-radius: 999px;
    background: var(--ink);
    transform-origin: center;
    animation: blink 5.4s ease-in-out infinite;
  
    transition:
      width 250ms ease,
      height 250ms ease,
      border-radius 250ms ease,
      transform 250ms ease;
  }
  
  .eye::after {
    content: "";
    position: absolute;
    width: 28%;
    height: 28%;
    left: 22%;
    top: 18%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
  }
  
  /* Brows */
  
  .brows {
    position: absolute;
    left: 21%;
    top: 25%;
    width: 58%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
  }
  
  .brow {
    width: 1.35rem;
    height: 0.28rem;
    border-radius: 999px;
    background: var(--ink);
    opacity: 0;
  
    transition:
      opacity 250ms ease,
      transform 250ms ease;
  }
  
  /* Cheeks */
  
  .cheeks {
    position: absolute;
    left: 20%;
    top: 51%;
    width: 60%;
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 250ms ease;
  }
  
  .cheeks span {
    width: 1rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--cheek);
    filter: blur(0.5px);
  }
  
  /* Mouth */
  
  .mouth {
    position: absolute;
    left: 50%;
    top: 62%;
    width: 2.5rem;
    height: 1.2rem;
  
    border: 0.3rem solid var(--ink);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  
    border-radius: 50% 50% 0 0;
    transform: translateX(-50%);
  
    transition:
      top 250ms ease,
      width 250ms ease,
      height 250ms ease,
      border 250ms ease,
      border-radius 250ms ease,
      transform 250ms ease;
  }
  
  /*
    Zweetdruppel:
    Deze staat nu bewust OP het rechtervoorhoofd.
    Niet links, niet als oorbel buiten het hoofd, en niet naast het oog.
  */
  
  .sweat-drop {
    position: absolute;
  
    right: 18%;
    top: 16%;
  
    width: clamp(0.48rem, 1.2vw, 0.72rem);
    height: clamp(0.75rem, 1.85vw, 1.05rem);
  
    border-radius: 70% 70% 70% 18%;
  
    background:
      radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92), transparent 22%),
      linear-gradient(145deg, #dff6ff, #7dd3fc);
  
    transform: rotate(28deg);
    transform-origin: center;
  
    opacity: 0;
    z-index: 5;
    pointer-events: none;
  
    filter:
      drop-shadow(0 0.16rem 0.22rem rgba(15, 23, 42, 0.16))
      drop-shadow(0 0 0.35rem rgba(186, 230, 253, 0.34));
  }
  
  /* Cold breath */
  
  .steam {
    position: absolute;
    bottom: -0.75rem;
    width: 0.55rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    filter: blur(1px);
    pointer-events: none;
  }
  
  .steam-one {
    left: 38%;
  }
  
  .steam-two {
    left: 50%;
  }
  
  .steam-three {
    left: 62%;
  }
  
  /* Temperature */
  
  .temperature {
    font-size: clamp(5.4rem, 18vw, 14rem);
    line-height: 0.86;
    font-weight: 900;
    letter-spacing: -0.085em;
    text-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.24);
    font-variant-numeric: tabular-nums;
  
    transition:
      transform 250ms ease,
      filter 250ms ease,
      opacity 250ms ease;
  }
  
  .temperature.bump {
    animation: tempPop 420ms ease;
  }
  
  .screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  
  /* Loading */
  
  body.loading {
    --bg-1: #111827;
    --bg-2: #1f2937;
    --bg-3: #374151;
    --glow: rgba(255, 255, 255, 0.22);
  }
  
  body.loading .face {
    animation: faceLoading 3.6s ease-in-out infinite;
  }
  
  body.loading .mouth {
    width: 1.8rem;
    height: 0;
    border: 0;
    border-top: 0.28rem solid var(--ink);
    border-radius: 999px;
  }
  
  /* Veel te koud */
  
  body.freezing {
    --bg-1: #172554;
    --bg-2: #1d4ed8;
    --bg-3: #38bdf8;
    --glow: rgba(186, 230, 253, 0.55);
  }
  
  body.freezing .face {
    animation: faceFreezing 150ms linear infinite;
  }
  
  body.freezing .brow {
    opacity: 1;
  }
  
  body.freezing .brow-left {
    transform: rotate(13deg);
  }
  
  body.freezing .brow-right {
    transform: rotate(-13deg);
  }
  
  body.freezing .mouth {
    top: 61%;
    width: 1.2rem;
    height: 1.2rem;
    border: 0.3rem solid var(--ink);
    border-radius: 999px;
  }
  
  body.freezing .steam {
    animation: coldBreath 2s ease-in-out infinite;
  }
  
  body.freezing .steam-two {
    animation-delay: 0.25s;
  }
  
  body.freezing .steam-three {
    animation-delay: 0.5s;
  }
  
  /* Koud */
  
  body.cold {
    --bg-1: #1e3a8a;
    --bg-2: #2563eb;
    --bg-3: #7dd3fc;
    --glow: rgba(125, 211, 252, 0.48);
  }
  
  body.cold .face {
    animation: faceCold 900ms ease-in-out infinite;
  }
  
  body.cold .mouth {
    top: 61%;
    width: 2.1rem;
    height: 1rem;
  }
  
  body.cold .steam {
    animation: coldBreath 2.4s ease-in-out infinite;
  }
  
  body.cold .steam-two {
    animation-delay: 0.35s;
  }
  
  /* Fris */
  
  body.cool {
    --bg-1: #0f766e;
    --bg-2: #14b8a6;
    --bg-3: #5eead4;
    --glow: rgba(94, 234, 212, 0.45);
  }
  
  body.cool .face {
    animation: faceIdle 4.8s ease-in-out infinite;
  }
  
  body.cool .mouth {
    top: 62%;
    width: 2rem;
    height: 0;
    border: 0;
    border-top: 0.28rem solid var(--ink);
    border-radius: 999px;
  }
  
  /* Perfect */
  
  body.perfect {
    --bg-1: #166534;
    --bg-2: #22c55e;
    --bg-3: #86efac;
    --glow: rgba(134, 239, 172, 0.58);
    --cheek: rgba(244, 114, 182, 0.34);
  }
  
  body.perfect .face {
    animation: faceHappy 4.8s ease-in-out infinite;
  }
  
  body.perfect .mouth {
    top: 56%;
    width: 2.7rem;
    height: 1.4rem;
    border: 0.3rem solid var(--ink);
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-radius: 0 0 50% 50%;
  }
  
  body.perfect .cheeks {
    opacity: 1;
  }
  
  /* Warm */
  
  body.warm {
    --bg-1: #b45309;
    --bg-2: #f59e0b;
    --bg-3: #fde68a;
    --glow: rgba(253, 230, 138, 0.52);
  }
  
  body.warm .face {
    animation: faceWarm 3.4s ease-in-out infinite;
  }
  
  body.warm .mouth {
    top: 61%;
    width: 2.2rem;
    height: 1rem;
  }
  
  body.warm .brow {
    opacity: 0.55;
  }
  
  body.warm .brow-left {
    transform: rotate(-8deg);
  }
  
  body.warm .brow-right {
    transform: rotate(8deg);
  }
  
  body.warm .sweat-drop {
    opacity: 0.45;
    animation: sweatWarm 3.2s ease-in-out infinite;
  }
  
  /* Te warm */
  
  body.hot {
    --bg-1: #9a3412;
    --bg-2: #ea580c;
    --bg-3: #fb923c;
    --glow: rgba(251, 146, 60, 0.6);
  }
  
  body.hot .face {
    animation: faceHot 1.9s ease-in-out infinite;
  }
  
  body.hot .eye {
    height: 0.55rem;
    border-radius: 999px;
  }
  
  body.hot .brow {
    opacity: 1;
  }
  
  body.hot .brow-left {
    transform: rotate(-18deg) translateY(0.08rem);
  }
  
  body.hot .brow-right {
    transform: rotate(18deg) translateY(0.08rem);
  }
  
  body.hot .mouth {
    top: 62%;
    width: 2.7rem;
    height: 1.15rem;
    border: 0.3rem solid var(--ink);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
  }
  
  body.hot .sweat-drop {
    opacity: 1;
    animation: sweatHot 2.1s ease-in-out infinite;
  }
  
  /* Veel te warm */
  
  body.too-hot {
    --bg-1: #7f1d1d;
    --bg-2: #dc2626;
    --bg-3: #fb7185;
    --glow: rgba(248, 113, 113, 0.68);
  }
  
  body.too-hot .face {
    animation: faceTooHot 1.1s ease-in-out infinite;
  }
  
  body.too-hot .eye {
    height: 0.48rem;
    border-radius: 999px;
  }
  
  body.too-hot .brow {
    opacity: 1;
  }
  
  body.too-hot .brow-left {
    transform: rotate(-24deg) translateY(0.08rem);
  }
  
  body.too-hot .brow-right {
    transform: rotate(24deg) translateY(0.08rem);
  }
  
  body.too-hot .mouth {
    top: 64%;
    width: 2.85rem;
    height: 1.25rem;
    border: 0.32rem solid var(--ink);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
  }
  
  body.too-hot .sweat-drop {
    opacity: 1;
    animation: sweatPanic 1.25s ease-in-out infinite;
  }
  
  /* Error */
  
  body.error {
    --bg-1: #18181b;
    --bg-2: #3f3f46;
    --bg-3: #71717a;
    --glow: rgba(255, 255, 255, 0.2);
  }
  
  body.error .face {
    animation: faceError 2.2s ease-in-out infinite;
  }
  
  body.error .eye {
    height: 0.25rem;
    border-radius: 999px;
  }
  
  body.error .mouth {
    top: 62%;
    width: 1.8rem;
    height: 0;
    border: 0;
    border-top: 0.3rem solid var(--ink);
    border-radius: 999px;
    transform: translateX(-50%) rotate(-5deg);
  }
  
  /* Animations */
  
  @keyframes backgroundFloat {
    0% {
      background-position: 0% 50%;
    }
  
    50% {
      background-position: 100% 50%;
    }
  
    100% {
      background-position: 0% 50%;
    }
  }
  
  @keyframes glowPulse {
    0%,
    100% {
      transform: scale(0.94);
      opacity: 0.5;
    }
  
    50% {
      transform: scale(1.08);
      opacity: 0.9;
    }
  }
  
  @keyframes faceIdle {
    0%,
    100% {
      transform: translateY(0) rotate(0deg) scale(1);
    }
  
    50% {
      transform: translateY(-0.45rem) rotate(1deg) scale(1.01);
    }
  }
  
  @keyframes faceLoading {
    0%,
    100% {
      transform: translateY(0) rotate(-1deg);
    }
  
    50% {
      transform: translateY(-0.35rem) rotate(1deg);
    }
  }
  
  @keyframes faceHappy {
    0%,
    100% {
      transform: translateY(0) rotate(-1deg) scale(1);
    }
  
    50% {
      transform: translateY(-0.65rem) rotate(1.2deg) scale(1.025);
    }
  }
  
  @keyframes faceWarm {
    0%,
    100% {
      transform: translateY(0) rotate(-1.5deg) scale(1);
    }
  
    50% {
      transform: translateY(-0.28rem) rotate(2deg) scale(1.01);
    }
  }
  
  @keyframes faceHot {
    0%,
    100% {
      transform: translateY(0) rotate(-2.2deg) scale(1);
    }
  
    50% {
      transform: translateY(-0.22rem) rotate(2.2deg) scale(1.025);
    }
  }
  
  @keyframes faceTooHot {
    0%,
    100% {
      transform: translateX(0) rotate(-2deg) scale(1.02);
    }
  
    25% {
      transform: translateX(-0.12rem) rotate(2deg) scale(1.035);
    }
  
    50% {
      transform: translateX(0.12rem) rotate(-2deg) scale(1.045);
    }
  
    75% {
      transform: translateX(-0.08rem) rotate(1deg) scale(1.03);
    }
  }
  
  @keyframes faceCold {
    0%,
    100% {
      transform: translateX(0) translateY(0) rotate(0deg);
    }
  
    50% {
      transform: translateX(0.06rem) translateY(-0.18rem) rotate(0.5deg);
    }
  }
  
  @keyframes faceFreezing {
    0% {
      transform: translateX(-0.08rem) rotate(-1deg);
    }
  
    50% {
      transform: translateX(0.08rem) rotate(1deg);
    }
  
    100% {
      transform: translateX(-0.08rem) rotate(-1deg);
    }
  }
  
  @keyframes faceError {
    0%,
    100% {
      transform: rotate(-3deg);
    }
  
    50% {
      transform: rotate(3deg);
    }
  }
  
  @keyframes blink {
    0%,
    92%,
    100% {
      transform: scaleY(1);
    }
  
    95% {
      transform: scaleY(0.12);
    }
  }
  
  @keyframes sweatWarm {
    0%,
    100% {
      transform: translate(0, 0) rotate(28deg) scale(0.9);
      opacity: 0.25;
    }
  
    50% {
      transform: translate(0.03rem, 0.12rem) rotate(28deg) scale(1);
      opacity: 0.45;
    }
  }
  
  @keyframes sweatHot {
    0% {
      transform: translate(0, -0.08rem) rotate(28deg) scale(0.92);
      opacity: 0;
    }
  
    20% {
      opacity: 1;
    }
  
    58% {
      transform: translate(0.04rem, 0.28rem) rotate(28deg) scale(1);
      opacity: 1;
    }
  
    100% {
      transform: translate(0.08rem, 0.42rem) rotate(28deg) scale(0.95);
      opacity: 0;
    }
  }
  
  @keyframes sweatPanic {
    0% {
      transform: translate(0, -0.08rem) rotate(28deg) scale(0.9);
      opacity: 0;
    }
  
    18% {
      opacity: 1;
    }
  
    52% {
      transform: translate(0.05rem, 0.26rem) rotate(28deg) scale(1.08);
      opacity: 1;
    }
  
    100% {
      transform: translate(0.1rem, 0.42rem) rotate(28deg) scale(0.95);
      opacity: 0;
    }
  }
  
  @keyframes coldBreath {
    0% {
      transform: translate(-50%, 0) scale(0.55);
      opacity: 0;
    }
  
    35% {
      opacity: 0.45;
    }
  
    100% {
      transform: translate(-50%, 1.2rem) scale(1.35);
      opacity: 0;
    }
  }
  
  @keyframes tempPop {
    0% {
      transform: scale(1);
      filter: brightness(1);
    }
  
    45% {
      transform: scale(1.035);
      filter: brightness(1.12);
    }
  
    100% {
      transform: scale(1);
      filter: brightness(1);
    }
  }
  
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 0.001ms !important;
    }
  }



/* Loading temperature text */

.temperature-loader {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.08em;
  
    font-size: clamp(4.2rem, 13vw, 9rem);
    letter-spacing: -0.055em;
    text-transform: lowercase;
  
    animation: loaderPulse 1.8s ease-in-out infinite;
  }
  
  .loading-word {
    display: inline-block;
  }
  
  .loading-dots {
    display: inline-flex;
    width: 0.72em;
    justify-content: flex-start;
    letter-spacing: -0.08em;
  }
  
  .loading-dots span {
    display: inline-block;
    animation: dotBounce 1.2s ease-in-out infinite;
  }
  
  .loading-dots span:nth-child(1) {
    animation-delay: 0s;
  }
  
  .loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
  }
  
  .loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
  }
  
  @keyframes loaderPulse {
    0%,
    100% {
      transform: scale(1);
      opacity: 0.72;
      filter: brightness(1);
    }
  
    50% {
      transform: scale(1.025);
      opacity: 1;
      filter: brightness(1.08);
    }
  }
  
  @keyframes dotBounce {
    0%,
    80%,
    100% {
      transform: translateY(0);
      opacity: 0.35;
    }
  
    40% {
      transform: translateY(-0.16em);
      opacity: 1;
    }
  }

/* Loading temperature text */

.temperature-loader {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.08em;
  
    font-size: clamp(4.2rem, 13vw, 9rem);
    letter-spacing: -0.055em;
    text-transform: lowercase;
  
    animation: loaderPulse 1.8s ease-in-out infinite;
  }
  
  .loading-word {
    display: inline-block;
  }
  
  .loading-dots {
    display: inline-flex;
    width: 0.72em;
    justify-content: flex-start;
    letter-spacing: -0.08em;
  }
  
  .loading-dots span {
    display: inline-block;
    animation: dotBounce 1.2s ease-in-out infinite;
  }
  
  .loading-dots span:nth-child(1) {
    animation-delay: 0s;
  }
  
  .loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
  }
  
  .loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
  }
  
  /* History wings (left & right of the stage) */

  .history-wing {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.75rem, 2svh, 1.15rem);
    width: min(100%, 12.5rem);
    max-height: min(82svh, 38rem);
    text-align: center;
    pointer-events: auto;
    filter: drop-shadow(0 0 1.8rem rgba(255, 255, 255, 0.12));
  }

  .room-glimpse {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    margin-left: clamp(0rem, 1.5vw, 0.75rem);
    width: min(100%, 11rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.65rem, 1.5svh, 0.95rem);
    text-align: center;
    animation: historyWingDriftLeft 9.5s ease-in-out infinite;
    filter: drop-shadow(0 0 1.6rem rgba(255, 255, 255, 0.1));
  }

  .room-glimpse.is-empty .room-breath {
    opacity: 0.4;
  }

  .room-glimpse-label {
    margin: 0;
    font-size: clamp(0.62rem, 1.5vw, 0.72rem);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.46);
  }

  .room-spread {
    margin: 0;
    font-size: clamp(1rem, 3vw, 1.28rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 1.2rem rgba(255, 255, 255, 0.22);
  }

  .room-breath {
    position: relative;
    width: 1.15rem;
    height: clamp(5.5rem, 18svh, 8.5rem);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    box-shadow: inset 0 0 1.2rem rgba(255, 255, 255, 0.08);
  }

  .room-breath-glow {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    border-radius: 999px;
    background: linear-gradient(
      180deg,
      rgba(196, 181, 253, 0.15),
      rgba(196, 181, 253, 0.75)
    );
    box-shadow: 0 0 1.4rem rgba(196, 181, 253, 0.45);
    animation: roomBreathPulse 5.5s ease-in-out infinite;
  }

  .room-breath-glow.freezing,
  .room-breath-glow.cold {
    background: linear-gradient(180deg, rgba(147, 197, 253, 0.15), rgba(191, 219, 254, 0.8));
    box-shadow: 0 0 1.4rem rgba(147, 197, 253, 0.45);
  }

  .room-breath-glow.cool {
    background: linear-gradient(180deg, rgba(94, 234, 212, 0.15), rgba(153, 246, 228, 0.8));
    box-shadow: 0 0 1.4rem rgba(94, 234, 212, 0.4);
  }

  .room-breath-glow.perfect {
    background: linear-gradient(180deg, rgba(134, 239, 172, 0.15), rgba(187, 247, 208, 0.85));
    box-shadow: 0 0 1.4rem rgba(134, 239, 172, 0.45);
  }

  .room-breath-glow.warm {
    background: linear-gradient(180deg, rgba(253, 224, 71, 0.15), rgba(254, 240, 138, 0.85));
    box-shadow: 0 0 1.4rem rgba(253, 224, 71, 0.4);
  }

  .room-breath-glow.hot,
  .room-breath-glow.too-hot {
    background: linear-gradient(180deg, rgba(251, 146, 60, 0.15), rgba(254, 202, 202, 0.85));
    box-shadow: 0 0 1.4rem rgba(251, 146, 60, 0.42);
  }

  .room-trend {
    margin: 0;
    font-size: clamp(0.72rem, 1.8vw, 0.82rem);
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
  }

  .room-time {
    margin: 0;
    font-size: clamp(0.66rem, 1.6vw, 0.74rem);
    font-weight: 650;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.55);
    max-width: 9.5rem;
    text-wrap: balance;
  }

  @keyframes roomBreathPulse {
    0%,
    100% {
      opacity: 0.82;
      filter: brightness(1);
    }

    50% {
      opacity: 1;
      filter: brightness(1.12);
    }
  }

  .history-wing-right {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    margin-right: clamp(0rem, 1.5vw, 0.75rem);
    animation: historyWingDriftRight 10s ease-in-out infinite;
  }

  .history-wing-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
    animation: historyStatFloat 7s ease-in-out infinite;
  }

  .history-wing-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.65rem, 1.6svh, 0.95rem);
    width: 100%;
  }

  .history-wing-stats .history-wing-stat:nth-child(1) {
    animation-delay: 0.35s;
  }

  .history-wing-stats .history-wing-stat:nth-child(2) {
    animation-delay: 0.7s;
  }

  .history-wing-stats .history-wing-stat:nth-child(3) {
    animation-delay: 1.05s;
  }

  .history-wing-label {
    font-size: clamp(0.62rem, 1.6vw, 0.72rem);
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
  }

  .history-wing-label::before {
    content: "";
    display: block;
    width: clamp(0.42rem, 1.2vw, 0.52rem);
    height: clamp(0.42rem, 1.2vw, 0.52rem);
    margin: 0 auto 0.32rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0.85rem rgba(255, 255, 255, 0.45);
  }

  .history-wing-stat-low .history-wing-label::before {
    background: rgba(191, 219, 254, 0.95);
    box-shadow: 0 0 0.75rem rgba(147, 197, 253, 0.6);
  }

  .history-wing-stat-mid .history-wing-label::before {
    background: rgba(196, 181, 253, 0.95);
    box-shadow: 0 0 0.85rem rgba(167, 139, 250, 0.55);
  }

  .history-wing-stat-high .history-wing-label::before {
    background: rgba(254, 202, 202, 0.95);
    box-shadow: 0 0 0.75rem rgba(251, 191, 36, 0.5);
  }

  .history-wing-stat strong {
    font-size: clamp(1.05rem, 3.4vw, 1.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.055em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 1.4rem rgba(255, 255, 255, 0.32);
  }

  .history-wing-stat.is-focus strong {
    font-size: clamp(1.2rem, 4vw, 1.72rem);
    text-shadow: 0 0 1.8rem rgba(255, 255, 255, 0.42);
  }

  .history-wing-count {
    font-size: clamp(0.62rem, 1.5vw, 0.72rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 0.9rem rgba(255, 255, 255, 0.2);
    animation: historyStatFloat 8s ease-in-out infinite;
    animation-delay: 1.4s;
  }

  @keyframes historyWingDriftLeft {
    0%,
    100% {
      transform: translateX(clamp(-1.1rem, -2.5vw, -0.35rem)) translateY(0);
    }

    50% {
      transform: translateX(clamp(-0.35rem, -0.8vw, 0rem)) translateY(-0.4rem);
    }
  }

  @keyframes historyWingDriftRight {
    0%,
    100% {
      transform: translateX(clamp(1.1rem, 2.5vw, 0.35rem)) translateY(0);
    }

    50% {
      transform: translateX(clamp(0.35rem, 0.8vw, 0rem)) translateY(-0.38rem);
    }
  }

  @keyframes historyStatFloat {
    0%,
    100% {
      transform: translateY(0);
      opacity: 0.92;
    }

    50% {
      transform: translateY(-0.22rem);
      opacity: 1;
    }
  }

  @keyframes loaderPulse {
    0%,
    100% {
      transform: scale(1);
      opacity: 0.72;
      filter: brightness(1);
    }
  
    50% {
      transform: scale(1.025);
      opacity: 1;
      filter: brightness(1.08);
    }
  }
  
  @keyframes dotBounce {
    0%,
    80%,
    100% {
      transform: translateY(0);
      opacity: 0.35;
    }
  
    40% {
      transform: translateY(-0.16em);
      opacity: 1;
    }
  }
  
  @media (max-width: 720px) {
    .screen {
      grid-template-columns: 1fr 1fr;
      grid-template-rows: auto auto auto;
      row-gap: 0.75rem;
      align-items: start;
      padding: 1rem 0.85rem 1.25rem;
      overflow-y: auto;
      overflow-x: hidden;
    }

    .temperature-card {
      grid-column: 1 / -1;
      grid-row: 1;
      transform: translateY(-0.4rem);
    }

    .room-glimpse {
      grid-column: 1;
      grid-row: 2;
      justify-self: center;
      margin: 0;
      animation: none;
    }

    .history-wing-right {
      grid-column: 2;
      grid-row: 2;
      justify-self: center;
      padding: 0;
      max-height: none;
      animation: none;
      margin: 0;
      width: 100%;
    }
  }

  @media (max-height: 740px) {
    .room-breath {
      height: clamp(4.5rem, 14svh, 6.5rem);
    }

    .temperature-card {
      gap: clamp(1.1rem, 3vw, 1.6rem);
    }

    .night-tip-text {
      font-size: 0.66rem;
      line-height: 1.3;
      max-width: 11rem;
    }
  }