/* The Try at home button with three frames packed into the box */
:root {
  --fondo: #ffffff;
  --inchiostro: #17181c;        /* the pill */
  --inchiostro-alto: #2a2c33;   /* the lid, a step lighter */
  --tenue: #7a7a82;
  --carta: #f6f1ea;             /* the little cards the frames sit on */
  --tartaruga: #9a5a32;         /* the tortoise frame */
  --rosa: #c4867a;              /* the cat-eye frame */
  --nastro: #e0a458;            /* the tape across the box */
  --verde: #5fc08b;             /* the shipped tick */
}

* { box-sizing: border-box; margin: 0; }
html { font-size: clamp(14px, min(1.9vw, 3.1vh), 23px); }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage { height: 100vh; display: grid; place-items: center; padding: 1rem; }

.wrap {
  position: relative;
  width: min(22rem, 92vw);
  display: flex; flex-direction: column; align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 0;
}

/* ---- the pill: GSAP moves the button (y, scale), the body inside changes width ---- */
.pill {
  appearance: none; border: 0; padding: 0; background: none;
  font: inherit; color: #fff; cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  display: block;
}
.pill:focus-visible { outline: none; }
.pill:focus-visible .pill__body { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--nastro), 0 16px 30px -18px rgba(23,24,28,0.8); }

.pill__body {
  position: relative; display: block;
  width: 18.5rem; height: 3.6rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #212329, var(--inchiostro) 60%);
  box-shadow:
    0 18px 32px -20px rgba(23,24,28,0.85),
    0 6px 12px -8px rgba(23,24,28,0.35),
    0 1px 2px rgba(23,24,28,0.16),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.4);
  overflow: hidden;
}
.pill__light {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(9rem 5rem at var(--lx, 50%) var(--ly, 50%), rgba(255,255,255,0.12), transparent 70%);
  opacity: 0;
}
.pill__sweep {
  position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.16) 45%, rgba(255,236,205,0.22) 50%, transparent 60%);
  opacity: 0;
}

/* ---- the icon on the left: a box, then a tick ---- */
.lead { position: absolute; left: 0.62rem; top: 50%; margin-top: -1.18rem; width: 2.36rem; height: 2.36rem; }
.lead__well {
  position: absolute; inset: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.07);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), inset 0 1px 0 rgba(255,255,255,0.08);
}
.lead__box, .lead__tick { position: absolute; width: 1.2rem; height: 1.2rem; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lead__box { stroke: #fff; stroke-width: 1.4; }
.lead__flap { stroke: var(--nastro); }
.lead__tick { stroke: #0e2a1b; stroke-width: 2.2; opacity: 0; }

/* ---- the words ---- */
.say {
  position: absolute; left: 3.5rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.1rem; text-align: left;
}
.say__win { position: relative; display: block; height: 1.3rem; width: 9.4rem; overflow: hidden; }
.say__now, .say__next {
  position: absolute; left: 0; top: 0; line-height: 1.3rem; white-space: nowrap;
  font-size: 1rem; font-weight: 640; font-variation-settings: "wdth" 100; letter-spacing: -0.01em;
}
.say__sub { font-size: 0.7rem; color: rgba(255,255,255,0.56); white-space: nowrap; letter-spacing: 0.005em; }

/* ---- the tray on the right: three slots, the frames, the lid ---- */
.tray {
  position: absolute; right: 0.55rem; top: 50%; margin-top: -1.2rem;
  width: 7.9rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.18rem;
}
.slot {
  width: 2.38rem; height: 1.95rem; border-radius: 0.62rem;
  background: linear-gradient(180deg, #0c0d10, #141519);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.04), 0 1px 0 rgba(255,255,255,0.07);
  opacity: 0;
}
.chip {
  position: absolute; left: 0; top: 50%; margin-top: -0.82rem;
  width: 2.2rem; height: 1.64rem; border-radius: 0.52rem;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #fffdf9, var(--carta));
  box-shadow: 0 4px 8px -3px rgba(0,0,0,0.55), 0 1px 1px rgba(0,0,0,0.3), inset 0 -1px 0 rgba(120,90,60,0.14), inset 0 1px 0 #fff;
}
.chip svg { width: 1.7rem; height: 0.86rem; fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.chip--tort svg { stroke: var(--tartaruga); }
.chip--ink svg { stroke: #1d1e23; }
.chip--rose svg { stroke: var(--rosa); }

.lid {
  position: absolute; left: -0.1rem; right: -0.1rem; top: -0.08rem; bottom: -0.08rem;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #34363e, var(--inchiostro-alto) 55%, #24262c);
  box-shadow: 0 6px 10px -6px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.16), inset 0 0 0 1px rgba(255,255,255,0.05);
  display: grid; place-items: center;
  overflow: hidden;
  visibility: hidden;
  z-index: 30;
}
.lid__name {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5), 0 -1px 0 rgba(255,255,255,0.06);
  padding-left: 0.32em;
  margin-top: 0.62rem;
}
.lid__tape {
  position: absolute; left: 0; right: 0; top: 0.5rem; height: 0.36rem;
  background: linear-gradient(180deg, #f0bd78, var(--nastro) 60%, #c98a40);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  overflow: hidden;
  transform-origin: 0 50%;
}
.lid__shine {
  position: absolute; top: 0; bottom: 0; left: 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  opacity: 0;
}

/* ---- the line under the pill ---- */
.hint {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; color: var(--tenue);
}
.hint__icon { width: 0.82rem; height: 0.82rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hint__win { position: relative; display: block; height: 1.1rem; width: 15rem; overflow: hidden; }
.hint__now, .hint__next { position: absolute; left: 0; top: 0; line-height: 1.1rem; white-space: nowrap; }

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

/* the pilot's pointer, drawn */
.pointer {
  position: absolute; left: 0; top: 0; width: 1.25rem; height: 1.25rem; z-index: 9; pointer-events: none;
  opacity: 0; filter: drop-shadow(0 2px 3px rgba(20, 20, 24, 0.3));
}
.pointer svg { width: 100%; height: 100%; fill: #fff; stroke: #141418; stroke-width: 1.3; stroke-linejoin: round; }
