:root {
  --carta: #f3f1ec;          /* the warm paper of the page */
  --card: #ffffff;           /* the card */
  --inchiostro: #15171a;     /* the text */
  --testo-2: #67645e;        /* the secondary text */
  --testo-3: #a9a49b;        /* the small labels */
  --linea: #e6e2d9;          /* hairlines */
  --piatto: #ece9e2;         /* a tile that barely moved today */
  --accento: #13995c;        /* the one accent: green, the tiles that are up today */
  --giu: #c9574a;            /* a soft red, only for the tiles that are down */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
  font-size: clamp(10px, min(2.6vw, 2.5vh), 20px);
}

.card {
  position: relative;
  width: min(32em, 94vw);
  padding: 1.3em 1.35em 1.1em;
  background: var(--card);
  border-radius: 1.4em;
  box-shadow:
    0 0 0 1px rgba(21, 23, 26, .06),
    0 1px 2px rgba(21, 23, 26, .05),
    0 .6em 1.4em -.4em rgba(21, 23, 26, .12),
    0 2.4em 4em -1.6em rgba(21, 23, 26, .16);
}
.card__sheen {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,0) 30%);
  pointer-events: none;
}

.head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; margin-bottom: 1em; }
.head__left { display: grid; gap: .3em; }
.brand { display: inline-flex; align-items: center; gap: .4em; font-size: .8em; font-weight: 620; color: var(--testo-2); }
.brand__mark { width: 1.15em; height: 1.15em; color: var(--accento); }
.title { font-size: 1.55em; font-weight: 700; font-stretch: 112%; letter-spacing: -.025em; line-height: 1; }
.head__right { display: grid; justify-items: end; gap: .25em; }
.total { font-size: 1.3em; font-weight: 660; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.day { display: inline-flex; align-items: center; gap: .3em; font-size: .78em; font-weight: 600; color: var(--accento); font-variant-numeric: tabular-nums; }
.day__arrow { width: .85em; height: .85em; }

.pills {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  padding: .22em;
  margin-bottom: .8em;
  background: #f1efea;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(21, 23, 26, .04);
}
.pills__thumb {
  position: absolute; left: 0; top: .22em; bottom: .22em;
  width: 10px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(21,23,26,.1), 0 .3em .8em -.3em rgba(21,23,26,.18);
}
.pill {
  position: relative;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .8em; font-weight: 600; font-stretch: 105%;
  color: var(--testo-2);
  padding: .5em 1.15em;
  border-radius: 999px;
  transition: color .25s ease;
}
.pill.is-on { color: var(--inchiostro); }
@media (hover: hover) { .pill:not(.is-on):hover { color: var(--inchiostro); } }
.pill:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

.map {
  position: relative;
  height: clamp(150px, 44vh, 330px);
  border-radius: .7em;
}
.map__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.tile { cursor: pointer; }
.tile__lift { transition: filter .25s ease; }
.tile.is-up .tile__lift { filter: drop-shadow(0 6px 10px rgba(21,23,26,.16)) drop-shadow(0 1px 2px rgba(21,23,26,.12)); }
.tile__ring { fill: none; stroke: var(--inchiostro); stroke-width: 1.5; opacity: 0; transition: opacity .2s ease; }
.tile.is-up .tile__ring { opacity: .9; }
.tile__name { font-weight: 640; letter-spacing: -.01em; }
.tile__pct { font-weight: 560; font-variant-numeric: tabular-nums; }
.tile__chg { font-weight: 560; font-variant-numeric: tabular-nums; }

.tip {
  position: absolute; left: 0; top: 0;
  display: grid; gap: .12em;
  padding: .55em .75em .6em;
  background: rgba(21, 23, 26, .92);
  color: #fff;
  border-radius: .6em;
  font-size: .78em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 .6em 1.4em -.4em rgba(21,23,26,.4);
}
.tip__k { font-weight: 600; color: rgba(255,255,255,.7); font-size: .9em; }
.tip__v { font-weight: 680; font-size: 1.15em; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tip__c { font-weight: 560; font-variant-numeric: tabular-nums; font-size: .9em; }

.foot { display: flex; align-items: center; gap: 1em; margin-top: .8em; font-size: .7em; font-weight: 560; color: var(--testo-2); flex-wrap: nowrap; }
.legend { display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; }
.legend__sw { width: .8em; height: .8em; border-radius: .22em; display: inline-block; }
.legend__sw--down { background: #e9cdc7; }
.legend__sw--flat { background: var(--piatto); }
.legend__sw--up { background: var(--accento); }
.foot__note { margin-left: auto; color: var(--testo-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .foot__note { display: none; } }
