/* ========== Design tokens ========== */
:root{
  --bg: #ffffff;
  --ink: #2f3d4a;         /* deep slate/navy for text */
  --muted: #7f8a94;       /* subtle gray text */
  --stroke: #9eacb9;      /* light gray-blue border */
  --cta: #2f3d4a;         /* same ink for solid button */
  --cta-ink: #ffffff;
  --radius: 10px;
  --space-1: 8px;
  --space-2: 14px;
  --space-3: 20px;
  --space-4: 28px;
  --space-5: 40px;
  --shadow: 0 1px 0 rgba(0,0,0,.02);
}

/* ========== Base reset-ish ========== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* ========== Page container ========== */
.container{
  max-width: 840px;             /* matches the centered narrow feel */
  margin: 0 auto;
  padding: clamp(16px, 5vw, 48px);
}

/* ========== Title + description ========== */
h1{
  margin: 0 0 var(--space-2);
  text-align: center;
  font-family: "Spectral", Georgia, Cambria, "Times New Roman", serif; /* optional */
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: clamp(26px, 3.2vw, 34px);
}

#description{
  margin: 0 0 var(--space-5);
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ========== Button grid (3 x 2) ========== */
.buttons{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}

.activity-btn{
  appearance: none;
  background: transparent;
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  padding: var(--space-4) 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .02s ease, border-color .15s ease, background .15s ease;
  box-shadow: var(--shadow);
}

.activity-btn:hover{ border-color: #8aa0b3; }
.activity-btn:active{ transform: translateY(1px); }
.activity-btn:disabled{ opacity: .6; cursor: not-allowed; }

/* ========== Reward box ========== */
.activity-output{
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  min-height: 140px;
  padding: var(--space-4) var(--space-4) var(--space-5);
  display: grid;
  place-items: center;
  text-align: center;
  margin-bottom: var(--space-5);
  position: relative;
}

/* “REWARD” label centered with letter spacing + a light rule under it */
.activity-output::before{
  content: "R E W A R D";
  display: block;
  letter-spacing: 0.6em;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: var(--space-3);
}

/* the thin line */
.activity-output::after{
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: var(--space-3);
  height: 2px;
  background: #e5ebf0;
}

/* the activity text that JS injects */
.reward{
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

/* ========== Timer area (hidden initially) ========== */
.timer-area{
  display: none; /* starts hidden; JS/CSS shows it when needed */
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-4);
}

#time-input{
  /* Make the input look like plain text (no visible box) */
  width: auto;
  min-width: 80px;
  text-align: center;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1.1;
  color: var(--ink);
  font-family: inherit;
}

/* In focus mode show large, plain digits (still using the same input element) */
.focus-ui #time-input{
  font-family: "Spectral", Georgia, Cambria, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(48px, 10vw, 120px);
  letter-spacing: .04em;
  text-align: center;
  min-width: 220px;
  padding: 0;
  border: 0;
  background: transparent;
}

#start-pause-btn{
  border: 0;
  background: var(--cta);
  color: var(--cta-ink);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
  #countdown {
    display: none;
  }

/* ========== Primary CTA (Start Quest) ========== */
.controls{
  display: grid;
  place-items: center;
}

#next-btn{
  appearance: none;
  border: 0;
  background: var(--cta);
  color: var(--cta-ink);
  padding: 14px 26px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  transition: transform .02s ease, filter .15s ease, opacity .15s ease;
}
#next-btn:hover{ filter: brightness(1.1); }
#next-btn:active{ transform: translateY(1px); }

/* ========== Accessibility focus ========== */
:focus-visible{
  outline: 3px solid #8fb5d6;
  outline-offset: 2px;
}

/* ========== Small screens ========== */
@media (max-width: 720px){
  .buttons{ grid-template-columns: 1fr; }
}

/* ======= FOCUS MODE (after Next is clicked) ======= */

/* Entered by adding .focus-ui to .container */
.focus-ui #timer-area{
  display: grid;             /* center like the mock */
  place-items: center;
  gap: 24px;
  margin: 24px 0 32px;
}

/* Big, calm digits */
.focus-ui .countdown{
  font-family: "Spectral", Georgia, Cambria, "Times New Roman", serif; /* optional */
  font-weight: 600;
  font-size: clamp(64px, 12vw, 140px);
  letter-spacing: .04em;
  line-height: 1;
  color: #3f5060;
}

/* Single primary button beneath the digits */
.focus-ui #start-pause-btn{
  min-width: 180px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
}

/* Hide the time input visually in focus mode (still usable by JS) */
#time-input.hidden{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

/* Spacing above reward box in focus mode */
.focus-ui .activity-output{
  margin-top: 32px;
}
