/* paleta extraida do app Hub XP (print enviado pelo user). */
:root {
  --bg:           #ffffff;
  --surface:     #fafafa;
  --text:         #1a1a1a;
  --text-soft:    #6e6e6e;
  --rule:         #e7e7e7;
  --ring-track:   #ececec;
  --ring-bar:     #f0a900;   /* amarelo XP — preenche em 30s */
  --pill-bg:      #fbf1d4;
  --pill-fg:      #8a6516;
  --code-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--code-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: 18px;
  padding: 18px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.topbar__title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  flex: 1;
  text-align: center;
}
.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: default;
}
.iconbtn[disabled] { opacity: 0.85; }

/* hero (titulo + sub) */
.hero { display: flex; flex-direction: column; gap: 8px; }
.hero__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 8px 0 0;
}
.hero__sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
  margin: 0;
}

/* anel + codigo */
.ring-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 18px auto 6px;
  display: grid;
  place-items: center;
}

/* aneis decorativos concentricos atras */
.rings-bg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.rings-bg span {
  position: absolute;
  border: 1px solid var(--rule);
  border-radius: 50%;
  opacity: 0.5;
}
.rings-bg span:nth-child(1) { width: 100%; height: 100%; opacity: 0.35; }
.rings-bg span:nth-child(2) { width: 86%;  height: 86%;  opacity: 0.45; }
.rings-bg span:nth-child(3) { width: 72%;  height: 72%;  opacity: 0.55; }
.rings-bg span:nth-child(4) { width: 58%;  height: 58%;  opacity: 0.7;  }
.rings-bg span:nth-child(5) { width: 44%;  height: 44%;  opacity: 0.85; }

/* progress ring SVG (preenche em 30s) */
.progress {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  transform: rotate(-90deg);   /* comeca no topo */
}
.progress__track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 7;
}
.progress__bar {
  fill: none;
  stroke: var(--ring-bar);
  stroke-width: 9;
  stroke-linecap: round;
  /* dashoffset 100 = vazio, 0 = cheio. JS atualiza. */
}

.code {
  position: relative;
  z-index: 2;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.meta {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin: 0;
  min-height: 16px;
}

/* footer pill */
.footer { display: flex; justify-content: center; }
.pill {
  appearance: none;
  border: none;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 120ms ease;
  width: 100%;
}
.pill:hover { filter: brightness(0.97); }
.pill:active { filter: brightness(0.94); }

/* states */
.code--stale { color: var(--text-soft); }
.meta--err { color: #b14b4b; }
