:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #17150f;
  --soft: rgba(23, 21, 15, 0.5);
  --line: rgba(23, 21, 15, 0.1);
  --lv: #f07a1a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 16px;
}

.uv {
  position: relative;
  width: min(340px, 100%);
  padding: 14px 16px 12px;
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(23, 21, 15, 0.06),
    0 1px 2px rgba(23, 21, 15, 0.05),
    0 16px 30px -14px rgba(23, 21, 15, 0.16);
  isolation: isolate;
  overflow: clip;
}
/* a warm light inside the card, behind the chart, in the colour of the level */
.uv::before {
  content: "";
  position: absolute;
  inset: 34% 6% 4%;
  z-index: -1;
  border-radius: 50%;
  background: var(--lv);
  opacity: 0.15;
  filter: blur(30px);
  transition: background-color 0.6s ease;
}
.uv__head { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.uv__title { font-size: 15px; font-weight: 680; font-stretch: 108%; letter-spacing: -0.008em; }
.uv__place { font-size: 11.5px; font-weight: 560; color: var(--soft); white-space: nowrap; }
.uv__place span { display: inline-block; min-width: 2.55em; text-align: right; color: var(--ink); font-weight: 660; }

.uv__read { display: flex; align-items: baseline; gap: 9px; margin-top: 2px; }
.uv__num {
  display: inline-block;
  min-width: 0.62em;
  font-size: clamp(40px, 13vh, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variation-settings: "wght" var(--w, 600), "wdth" 96;
  color: var(--lv);
  transition: color 0.5s ease;
}
.uv__level { height: 20px; overflow: hidden; font-size: 14px; line-height: 20px; font-weight: 640; }
.uv__level span { display: block; white-space: nowrap; }

.uv__chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 34vh;
  margin-top: 2px;
  color: var(--lv);
  overflow: visible;
  cursor: crosshair;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.5s ease;
}
.uv__chart text { font-family: inherit; font-size: 9.5px; font-weight: 560; fill: var(--soft); text-anchor: middle; transition: fill 0.25s ease; }
.uv__chart text.is-near { fill: var(--ink); }
.uv__three { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; stroke-linecap: round; }
.uv__base { stroke: var(--line); stroke-width: 1; }
.uv__curve { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.uv__curve--day { stroke: rgba(23, 21, 15, 0.14); stroke-width: 1.6; stroke-dasharray: 1; }
.uv__curve--past { stroke: currentColor; stroke-width: 2.4; }
.uv__hair { stroke: rgba(23, 21, 15, 0.22); stroke-width: 1; stroke-dasharray: 1.5 3.5; }
.uv__tick { stroke: rgba(23, 21, 15, 0.26); stroke-width: 1; stroke-linecap: round; }
/* the hours in which the index is 3 or more: protection is needed */
.uv__protect { stroke: currentColor; stroke-width: 4; stroke-linecap: round; opacity: 0.9; }
.uv__halo { fill: currentColor; opacity: 0.14; }
.uv__ray { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.uv__core { fill: #ffffff; stroke: currentColor; stroke-width: 2.4; }

.uv__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--line); }
.uv__advice { flex: 1; min-width: 0; height: 18px; overflow: hidden; font-size: 12.5px; line-height: 18px; font-weight: 600; }
.uv__advice span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv__window { flex: none; font-size: 11.5px; font-weight: 560; color: var(--soft); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #17150f;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-width: 400px) {
  .uv__foot { flex-direction: column; align-items: flex-start; gap: 1px; padding-top: 7px; }
  .uv__advice { flex: none; width: 100%; }
}

/* larger in a roomy window, so the preview is not a small card in a big page */
@media (min-width: 700px) and (min-height: 500px) { .uv { zoom: 1.5; } }
@media (min-width: 1100px) and (min-height: 760px) { .uv { zoom: 2.1; } }
