:root {
  --bg: #0b0a1f;
  --bg-deep: #05040f;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f1eefc;
  --muted: #a9a3c9;
  --gold: #e9c877;
  --gold-soft: rgba(233, 200, 119, 0.14);
  --violet: #9d8cff;
  --error: #ff9a9a;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 9%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 33% 62%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 91% 44%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 83%, rgba(255, 255, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 7% 88%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(ellipse at 50% -10%, #2a1f5c 0%, transparent 60%),
    linear-gradient(var(--bg), var(--bg-deep));
  background-attachment: fixed;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 16px 40px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

.intro {
  text-align: center;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

h1 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 500;
  line-height: 1.15;
}

.lede {
  margin-top: 12px;
  color: var(--muted);
}

form {
  margin-top: 32px;
  text-align: center;
}

#time {
  width: 100%;
  max-width: 340px;
  padding: 14px 16px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(3rem, 16vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#time::placeholder {
  color: rgba(233, 200, 119, 0.25);
}

#time:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft), 0 0 40px rgba(233, 200, 119, 0.12);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

button {
  font: inherit;
  cursor: pointer;
}

.primary,
.secondary {
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
}

.primary {
  color: #1c1505;
  background: var(--gold);
  border: 1px solid var(--gold);
}

.primary:hover {
  background: #f3d896;
}

.secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.secondary:hover {
  background: var(--surface-strong);
}

button:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.error {
  min-height: 1.6em;
  margin-top: 10px;
  color: var(--error);
  font-size: 0.95rem;
}

.chip-group {
  margin-top: 20px;
}

.chip-group h2 {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 6px 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.chip:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.link {
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  background: none;
  border: none;
}

.link:hover {
  color: var(--text);
}

.result {
  margin-top: 32px;
  padding: 28px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  scroll-margin-top: 16px;
  animation: rise 0.4s ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result {
    animation: none;
  }
}

.result-head {
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(157, 140, 255, 0.4);
  border-radius: 999px;
}

.big-time {
  margin-top: 10px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(3.4rem, 18vw, 5.2rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 40px rgba(233, 200, 119, 0.35);
}

.result h2 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  text-transform: capitalize;
}

.message {
  margin-top: 18px;
  font-size: 1.05rem;
  text-align: center;
}

.result h3 {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.actions {
  margin-top: 26px;
  padding: 20px;
  background: var(--gold-soft);
  border: 1px solid rgba(233, 200, 119, 0.35);
  border-radius: 16px;
}

.actions ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.actions li {
  position: relative;
  padding-left: 40px;
  counter-increment: step;
}

.actions li + li {
  margin-top: 12px;
}

.actions li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  color: #1c1505;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  background: var(--gold);
  border-radius: 50%;
}

.affirmation {
  margin-top: 18px;
  padding-top: 14px;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  text-align: center;
  border-top: 1px solid rgba(233, 200, 119, 0.3);
}

.areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.area {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.area p {
  margin-top: 6px;
  font-size: 0.95rem;
}

.breakdown {
  margin-top: 24px;
}

.breakdown dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 12px 0 0;
}

.breakdown dt {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.breakdown dt.root {
  color: var(--violet);
}

.breakdown dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  align-self: center;
}

footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
