/* Dolcella Cube Club — the clear acrylic cube filled with chocolate is the whole idea. */
:root {
  --ink: #2b1a12;          /* cocoa ink */
  --ink-soft: #6b5a50;
  --milk: #8a5636;         /* milk chocolate */
  --milk-top: #a86c45;
  --milk-side: #6e4229;
  --pearl: #eef0ee;        /* acrylic-on-light background */
  --surface: #ffffff;
  --acrylic: #b9c3c1;      /* clear box edge */
  --berry: #c7303f;        /* only for the strawberry reward */
  --ok: #2f7d4f;
  --radius-sheet: 22px;
  --radius-ticket: 10px;
  --display: "Italiana", "Didot", "Bodoni 72", serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--pearl);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
main { max-width: 440px; margin: 0 auto; padding: 20px 20px 48px; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.wordmark { display: block; line-height: 0; }
.wordmark img { display: block; height: 54px; width: auto; }
.club { font-size: 13px; color: var(--ink-soft); }

/* ---------- headline ---------- */
h1 {
  font: 400 40px/1.08 var(--display);
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}
.lede { margin: 0 0 28px; color: var(--ink-soft); font-size: 17px; max-width: 34ch; }
h2 { font: 600 15px/1.3 var(--body); margin: 36px 0 12px; }

/* ---------- the cubes ---------- */
.card { margin: 0 0 8px; }
.card-name { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.cubes { display: flex; gap: 10px; margin: 0 0 10px; }
.cube { width: 54px; height: 60px; flex: none; }
.cube .face { stroke: var(--acrylic); stroke-width: 1.5; stroke-linejoin: round; fill: rgba(255, 255, 255, 0.55); }
.cube .face.r, .cube .face.l { fill: rgba(255, 255, 255, 0.25); }
.cube.full .t { fill: var(--milk-top); stroke: var(--milk-side); }
.cube.full .l { fill: var(--milk); stroke: var(--milk-side); }
.cube.full .r { fill: var(--milk-side); stroke: var(--milk-side); }
.cube.full .gloss { display: block; }
.cube .gloss { display: none; fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 2; stroke-linecap: round; }
.cube.new { animation: drop 620ms cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes drop {
  0% { transform: translateY(-36px); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; }
}
.progress-note { font-size: 15px; color: var(--ink-soft); margin: 0; }
.progress-note strong { color: var(--ink); font-weight: 600; }

/* ---------- rewards: tickets, not cards ---------- */
.tickets { display: grid; gap: 12px; }
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 16px 22px;
  background: var(--surface);
  border-radius: var(--radius-ticket);
  border-left: 6px solid var(--milk);
}
.ticket::before {           /* perforation */
  content: "";
  position: absolute; left: -6px; top: 8px; bottom: 8px; width: 6px;
  background: radial-gradient(circle at 0 50%, var(--pearl) 2.5px, transparent 3px) 0 0 / 6px 10px repeat-y;
}
.ticket.straw { border-left-color: var(--berry); }
.ticket-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.ticket-meta { font-size: 13px; color: var(--ink-soft); }

/* ---------- controls ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; }
input[type="tel"], input[type="text"], input[type="password"] {
  font: 500 22px/1.2 var(--body);
  letter-spacing: 0.02em;
  padding: 14px 16px;
  border: 1.5px solid var(--acrylic);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
input:focus { outline: none; border-color: var(--milk); box-shadow: 0 0 0 3px rgba(138, 86, 54, 0.2); }
input.code { letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); margin: 4px 0 18px; }
.check input { width: 20px; height: 20px; accent-color: var(--milk); margin-top: 1px; flex: none; }

button {
  font: 700 17px/1 var(--body);
  border: 0;
  border-radius: 999px;
  padding: 17px 22px;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  width: 100%;
}
button.small { width: auto; padding: 11px 16px; font-size: 14px; background: var(--milk); }
button.ghost { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 12px; font-weight: 600; }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--milk); outline-offset: 3px; }
.fine { font-size: 12.5px; color: var(--ink-soft); margin-top: 14px; }
.fine a { color: inherit; }
.error { color: var(--berry); font-weight: 600; font-size: 14px; min-height: 1.2em; margin: 0 0 10px; }

/* ---------- strawberry moment ---------- */
.berry-win { color: var(--berry); }
.berry-art { width: 92px; height: 92px; margin: 0 0 18px; }

/* ---------- redeem sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(43, 26, 18, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet-body {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 26px 22px 30px;
}
.sheet h3 { font: 400 30px/1.1 var(--display); margin: 0 0 6px; }
.sheet p { margin: 0 0 20px; color: var(--ink-soft); }

/* full-screen redeemed proof — the live clock makes screenshots useless */
.redeemed {
  position: fixed; inset: 0; z-index: 20;
  background: var(--milk); color: #fff;
  display: grid; place-content: center; text-align: center; padding: 24px;
}
.redeemed[hidden] { display: none; }
.redeemed .big { font: 400 46px/1.05 var(--display); margin: 18px 0 8px; }
.redeemed .clock { font: 700 44px/1 var(--body); font-variant-numeric: tabular-nums; margin: 22px 0 6px; }
.redeemed .tick { width: 84px; height: 84px; margin: 0 auto; animation: pulse 1s ease-in-out infinite alternate; }
.redeemed button { margin-top: 30px; background: #fff; color: var(--ink); }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }

.center { text-align: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--acrylic); border-top-color: var(--milk); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .cube.new, .redeemed .tick, .spinner { animation: none; }
}

/* ---------- admin ---------- */
.admin main { max-width: 980px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #e3e6e4; }
th { font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font: 400 34px/1.1 var(--display); }
.stat span { font-size: 13px; color: var(--ink-soft); }
.scroll { overflow-x: auto; }
