:root {
  --fondo: #f3f3f1;
  --carta: #ffffff;
  --inchiostro: #111214;
  --grigio: #6b6d74;
  --grigio-chiaro: #a9abb2;
  --linea: rgba(17, 18, 20, 0.08);
  --tinta: #3d6af5;
  --sole: #f5b53d;
  --nuvola: #ffffff;
  --nuvola-bordo: #c9ccd4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 12px;
}

/* the card: one surface, a hairline border and a wide soft shadow */
.card {
  position: relative;
  width: min(360px, 100%);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 22px;
  padding: clamp(12px, 3.4vh, 18px) 18px clamp(10px, 2.8vh, 14px);
  box-shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 18px 44px -18px rgba(17, 18, 20, 0.22);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.4s ease;
  user-select: none;
  -webkit-user-select: none;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(17, 18, 20, 0.05), 0 22px 50px -18px rgba(17, 18, 20, 0.26); }
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--grigio);
}
.card__app { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--inchiostro); }
.card__mark { width: 16px; height: 16px; fill: var(--tinta); }
.card__place { font-weight: 500; }

.now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(6px, 2vh, 12px);
}

.icon {
  flex: none;
  width: clamp(54px, 15vh, 70px);
  height: clamp(54px, 15vh, 70px);
  overflow: visible;
}
.icon__core { fill: var(--sole); }
.icon__rays line { stroke: var(--sole); stroke-width: 2.6; stroke-linecap: round; }
.icon__cloud { fill: var(--nuvola); stroke: var(--nuvola-bordo); stroke-width: 1.4; stroke-linejoin: round; }
.icon__shadow { fill: rgba(17, 18, 20, 0.07); }
.icon__shine { fill: none; stroke: rgba(255, 255, 255, 0.95); stroke-width: 1.6; stroke-linecap: round; }
.icon__drops line { stroke: var(--tinta); stroke-width: 2.4; stroke-linecap: round; }
.icon__splash path { fill: none; stroke: var(--tinta); stroke-width: 1.3; stroke-linecap: round; }

.now__text { min-width: 0; }
.now__temp {
  display: flex;
  align-items: flex-start;
  font-size: clamp(30px, 9vh, 40px);
  font-weight: 560;
  font-variation-settings: "wdth" 92;
  letter-spacing: -0.03em;
  line-height: 1;
}
.now__deg { color: var(--grigio-chiaro); font-weight: 400; }

/* the number that rolls: old value up and out, new value up from below */
.roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 1em;
  line-height: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.roll span { display: block; }

.now__say {
  margin-top: 5px;
  font-size: clamp(13px, 3.6vh, 15px);
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.now__sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--grigio);
  white-space: nowrap;
}

/* sixty bars, one a minute, over three faint guide lines */
.chart {
  position: relative;
  margin-top: clamp(8px, 2.6vh, 16px);
  height: clamp(70px, 20vh, 104px);
  touch-action: none;
  cursor: ew-resize;
}
.chart__lines {
  position: absolute;
  inset: 0 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart__lines span {
  display: block;
  border-top: 1px dashed rgba(17, 18, 20, 0.09);
  font-size: 9px;
  color: var(--grigio-chiaro);
  text-align: right;
  line-height: 1;
  padding-top: 3px;
  letter-spacing: 0.02em;
}
.chart__lines span:last-child { padding-top: 2px; }

.chart__bars {
  position: absolute;
  inset: 0 50px 0 0;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.bar i {
  display: block;
  width: 100%;
  border-radius: 2px 2px 1px 1px;
  background: var(--tinta);
  transform-origin: 50% 100%;
}
.bar.is-dry i { background: #dadce2; }

.chart__scrub {
  position: absolute;
  top: -4px;
  bottom: 0;
  left: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
}
.chart__line {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: -0.5px;
  width: 1px;
  background: var(--inchiostro);
}
.chart__knob {
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--carta);
  border: 1.5px solid var(--inchiostro);
}
.chart__tip {
  position: absolute;
  top: -10px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.chart__tip b { font-weight: 650; }

.axis {
  position: relative;
  height: 11px;
  margin: 6px 50px 0 0;
  font-size: 10px;
  line-height: 1;
  color: var(--grigio-chiaro);
}
.axis span { position: absolute; top: 0; white-space: nowrap; }
.axis span:nth-child(1) { left: 0; }
.axis span:nth-child(2) { left: 16.667%; transform: translateX(-30%); }
.axis span:nth-child(3) { left: 33.333%; transform: translateX(-30%); }
.axis span:nth-child(4) { left: 50%; transform: translateX(-30%); }
.axis span:nth-child(5) { left: 66.667%; transform: translateX(-30%); }
.axis span:nth-child(6) { left: 83.333%; transform: translateX(-30%); }

.card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: clamp(8px, 2.4vh, 12px);
  padding-top: clamp(7px, 2vh, 10px);
  border-top: 1px solid var(--linea);
  font-size: 12px;
  color: var(--grigio);
}
.card__total b { color: var(--inchiostro); font-weight: 650; }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #fff; stroke: #111; stroke-width: 1.2; stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  z-index: 5;
}

@media (max-width: 380px) {
  .card { padding-left: 14px; padding-right: 14px; }
  .now__say { font-size: 13px; }
}
