:root {
  --fondo: #000000;
  --grafite: #19191b;
  --grafite-alta: #26262a;
  --carta: #f4efe7;
  --grigio: #8a857d;
  --legno-chiaro: #ead7b8;
  --legno: #d8bc93;
  --legno-scuro: #b8946a;
  --venatura: rgba(120, 82, 44, 0.16);
  --inchiostro: #1b140d;
  --sedia: #6a5444;
  --sedia-alta: #94796a;
  --accento: #ffb45e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--carta);
  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; -webkit-tap-highlight-color: transparent; }

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

/* the booker keeps the room of the open table, so nothing jumps while it grows */
.booker {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
  min-width: min(320px, calc(100vw - 32px));
  min-height: min(170px, 60vh);
}

/* the table: the pill and, behind it, the chairs and the warm light under the wood */
.table { position: relative; }
.table__glow {
  position: absolute; left: 6%; right: 6%; top: 30%; bottom: -30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 180, 94, 0.30), rgba(255, 180, 94, 0));
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}
.chairs { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }

/* one chair: an element for GSAP, its body for the CSS; the backrest is the darker bar on the outer side */
.chair { position: absolute; left: 0; top: 0; width: 26px; height: 13px; margin: -6.5px 0 0 -13px; opacity: 0; }
.chair__body {
  position: absolute; inset: 0;
  border-radius: 4px 4px 5px 5px;
  background: linear-gradient(180deg, var(--sedia-alta), var(--sedia));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 4px rgba(0, 0, 0, 0.5);
}
.chair__back {
  position: absolute; left: 0; right: 0; top: -2px; height: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #5b4637, #3a2c22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* the shell: a graphite pill at rest, the wooden top when open; GSAP animates its width */
.shell {
  position: relative;
  width: 178px;
  height: 60px;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6), 0 14px 26px -14px rgba(0, 0, 0, 0.9);
}
.skin { position: absolute; inset: 0; border-radius: inherit; }
.skin--ink {
  background: linear-gradient(180deg, var(--grafite-alta), var(--grafite) 62%);
}
.skin--wood {
  opacity: 0;
  background:
    radial-gradient(120% 140% at 30% 0%, rgba(255, 248, 236, 0.55), rgba(255, 248, 236, 0) 55%),
    linear-gradient(180deg, var(--legno-chiaro), var(--legno) 55%, var(--legno-scuro));
  box-shadow: inset 0 -3px 6px rgba(110, 70, 30, 0.25);
}
.skin__grain {
  position: absolute; inset: 0; border-radius: inherit;
  background:
    repeating-linear-gradient(178.6deg, transparent 0 5px, var(--venatura) 5px 6px, transparent 6px 13px),
    repeating-linear-gradient(181.2deg, transparent 0 9px, rgba(255, 255, 255, 0.10) 9px 10px, transparent 10px 21px);
  mix-blend-mode: multiply;
  opacity: 0.9;
}
/* a soft band of light that crosses the wood as it opens */
.shell__shine {
  position: absolute; top: -20%; bottom: -20%; left: 0; width: 70px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 252, 244, 0.42), rgba(255, 255, 255, 0));
  opacity: 0;
  pointer-events: none;
}
.shell__edge {
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  white-space: nowrap;
  border-radius: inherit;
  z-index: 2;
}
.face--idle { padding: 0 24px 0 20px; font-size: 16px; font-weight: 560; font-variation-settings: "wdth" 100; color: var(--carta); }
.face--idle:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.face__label { display: inline-block; font-variation-settings: "wdth" 100; }
.mini { width: 26px; height: 18px; flex: none; overflow: visible; }
.mini__top { fill: none; stroke: var(--legno); stroke-width: 1.5; }
.mini__chair { stroke: var(--legno); stroke-width: 1.6; stroke-linecap: round; }

.face--done { gap: 9px; padding: 0 24px 0 20px; font-size: 15.5px; font-weight: 560; color: var(--carta); opacity: 0; pointer-events: none; }
.tick { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accento); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* what sits on the wooden top */
.panel {
  position: absolute; left: 0; top: 0; height: 100%; width: max-content;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  white-space: nowrap;
  color: var(--inchiostro);
  z-index: 2;
  opacity: 0;
  visibility: hidden;
}
.stepper { display: flex; align-items: center; gap: 4px; }
.step {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(60, 36, 14, 0.08);
  box-shadow: inset 0 0 0 1px rgba(60, 36, 14, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background-color 0.2s, opacity 0.2s;
}
.step svg { width: 18px; height: 18px; fill: none; stroke: var(--inchiostro); stroke-width: 1.8; stroke-linecap: round; }
.step[disabled] { opacity: 0.35; cursor: default; }
.step:focus-visible, .quick:focus-visible, .confirm:focus-visible { outline: 2px solid var(--inchiostro); outline-offset: 2px; }
@media (hover: hover) {
  .step:not([disabled]):hover { background: rgba(60, 36, 14, 0.15); }
}

.count { display: grid; justify-items: center; min-width: 40px; line-height: 1; }
.count__win { position: relative; display: block; width: 100%; height: 22px; overflow: hidden; }
.count__roll { position: absolute; inset: 0; }
.count__digit {
  position: absolute; left: 0; right: 0; top: 0;
  text-align: center;
  font-size: 21px; font-weight: 640; font-variant-numeric: tabular-nums;
  line-height: 22px;
}
.count__word { margin-top: 2px; font-size: 10px; font-weight: 560; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(27, 20, 13, 0.55); }

.quick {
  position: relative;
  height: 38px;
  display: flex; align-items: baseline; gap: 6px;
  padding: 0 13px;
  border-radius: 19px;
  background: rgba(60, 36, 14, 0.07);
  box-shadow: inset 0 0 0 1px rgba(60, 36, 14, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  line-height: 38px;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.quick__day { font-size: 12.5px; font-weight: 520; color: rgba(27, 20, 13, 0.66); transition: color 0.25s; }
.quick__time { font-size: 15px; font-weight: 660; font-variant-numeric: tabular-nums; }
.quick[aria-pressed="true"] {
  background: var(--inchiostro);
  color: var(--carta);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 8px -3px rgba(40, 20, 0, 0.55);
}
.quick[aria-pressed="true"] .quick__day { color: rgba(244, 239, 231, 0.62); }
@media (hover: hover) {
  .quick[aria-pressed="false"]:hover { background: rgba(60, 36, 14, 0.13); }
}

.confirm {
  position: relative;
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--inchiostro);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 4px 10px -4px rgba(40, 20, 0, 0.7);
  opacity: 0;
  visibility: hidden;
}
.confirm__fill { position: absolute; inset: 0; border-radius: 50%; background: var(--accento); transform: scale(0); }
.confirm svg { position: relative; width: 20px; height: 20px; fill: none; stroke: var(--carta); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

.note {
  font-size: 12.5px; font-weight: 500; color: var(--grigio);
  opacity: 0;
  white-space: nowrap;
}
.note span { color: var(--carta); }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #fff;
  stroke: #000; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}
