:root {
  --fondo: #ffffff;
  --pillola: #1b130e;
  --pillola-alta: #2d2119;
  --crema: #f6eee3;
  --crema-spenta: rgba(246, 238, 227, 0.52);
  --accento: #c98a4b;
  --vapore: #cdbba7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--pillola);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 16px 16px;
}

/* the pill: espresso lacquer, a 1px edge that takes the light on top, soft layered shadows */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  width: min(256px, calc(100vw - 32px));
  height: 60px;
  padding: 0 20px 0 64px;
  border-radius: 30px;
  color: var(--crema);
  background:
    linear-gradient(180deg, var(--pillola-alta) 0%, var(--pillola) 58%, #120c08 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 214, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(30, 16, 6, 0.22),
    0 6px 14px -6px rgba(46, 24, 8, 0.42),
    0 22px 38px -18px rgba(46, 24, 8, 0.45);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  isolation: isolate;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(201, 138, 75, 0);
  transition: box-shadow 0.25s ease;
}
.btn:focus-visible::after {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--accento);
}

/* a warm light under the pointer, inside the lacquer */
.btn__light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.btn__light::before {
  content: "";
  position: absolute;
  left: var(--mx, 70%);
  top: var(--my, 0%);
  width: 180px;
  height: 120px;
  margin: -60px 0 0 -90px;
  background: radial-gradient(closest-side, rgba(255, 214, 168, 0.16), rgba(255, 214, 168, 0));
  opacity: var(--luce, 0);
}

/* the round window with the cup pokes its steam out above the pill */
.cup {
  position: absolute;
  left: -2px;
  top: -44px;
  width: 64px;
  height: 96px;
  overflow: visible;
  pointer-events: none;
}
.cup__disc { stroke: rgba(255, 236, 214, 0.1); stroke-width: 0.8; }
.cup__shadow { fill: rgba(0, 0, 0, 0.4); }
.cup__saucer { stroke: #e7d8c4; stroke-width: 1.6; stroke-linecap: round; }
.cup__handle { fill: none; stroke: #e2d3bf; stroke-width: 1.6; stroke-linecap: round; }
.cup__coffee { fill: #6b4128; }
.cup__glint { stroke: rgba(255, 255, 255, 0.9); stroke-width: 1; stroke-linecap: round; }
.cup__rimlight { fill: none; stroke: rgba(255, 236, 214, 0.16); stroke-width: 0.8; stroke-linecap: round; }
.cup__ring { fill: none; stroke: var(--accento); stroke-width: 1; opacity: 0; }
.cup__check {
  fill: none;
  stroke: #fff8ee;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

/* the words: three lines in one row, one shows at a time */
.btn__words {
  position: relative;
  flex: 1;
  height: 22px;
  overflow: hidden;
}
.btn__label {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 22px;
  font-size: 16px;
  font-weight: 580;
  font-stretch: 100%;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
[data-busy] { color: var(--crema-spenta); font-weight: 520; }
[data-done] [data-time] { font-variant-numeric: tabular-nums; color: #f2c28d; }
[data-busy], [data-done] { opacity: 0; }

.btn__side {
  position: relative;
  height: 22px;
  min-width: 42px;
  overflow: hidden;
  text-align: right;
}
.btn__price, .btn__paid {
  position: absolute;
  right: 0;
  top: 0;
  line-height: 22px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--crema-spenta);
  white-space: nowrap;
}
.btn__paid { color: #f2c28d; opacity: 0; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  fill: #ffffff;
  stroke: #1b130e;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}

@media (max-height: 300px) {
  .stage { padding-top: 48px; }
}
