:root {
  --indigo: #3B3597;
  --indigo2: #4C5FD1;
  --coral: #FF6A3D;
  --amber: #F5A623;
  --cream: #FBF7EF;
  --muted: #8a8399;
  --line: rgba(0,0,0,0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--indigo);
  font-family: 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

#app.phone {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}

.screen {
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.screen[hidden] { display: none; }

.screen[data-bg="indigo"] { background: var(--indigo); }
.screen[data-bg="cream"] { background: var(--cream); }
/* data-bg="dynamic" background is set inline via JS to match the active preset color */

/* ---------- Splash ---------- */
#screen-splash {
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.splash-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.mascot { display: block; }
.mascot-lg { width: 150px; height: auto; }
.mascot-md { width: 66px; height: auto; }
.mascot-sm { width: 56px; height: auto; }

.wordmark {
  font-family: 'Petrona', serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--indigo);
}
.wordmark-light { font-size: 34px; color: var(--cream); }

.tagline {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: rgba(251,247,239,0.85);
  text-align: center;
}

/* ---------- Intro ---------- */
#screen-intro {
  align-items: center;
  justify-content: center;
  padding: 32px;
}

/* ---------- Setup ---------- */
#screen-setup {
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.setup-center {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.headline {
  font-family: 'Petrona', serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--indigo);
  text-align: center;
  line-height: 1.25;
  margin: 0;
}
.subtext {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  margin-top: -12px;
}
.name-field {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 2px solid var(--indigo);
  border-radius: 999px;
  background: var(--cream);
  display: block;
}
.name-field input {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--indigo);
  text-align: center;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
}
.name-field input::placeholder { color: #b7b2c9; }
.intro-center {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.intro-subtext-dark {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(251,247,239,0.9);
  text-align: center;
  margin-top: 24px;
}
#screen-intro .wordmark { margin-top: 20px; }
#screen-intro .intro-presets { margin-top: 60px; gap: 13px; width: 100%; }
#screen-intro .preset-card { padding: 9px 16px; gap: 14px; border-radius: 22px; width: 100%; }
#screen-intro .preset-text { flex: 1; }
#screen-intro .preset-badge { width: 44px; height: 44px; }
#screen-intro .preset-badge span { font-size: 14px; }
#screen-intro .preset-text { gap: 0; }
#screen-intro .preset-label { font-size: 14px; }
#screen-intro .preset-sub { font-size: 11px; line-height: 1.25; }
#screen-intro .intro-btn { margin-top: 46px; background: var(--cream); color: var(--indigo); }
.name-field.shake { animation: name-field-shake 0.4s; border-color: var(--coral); }
@keyframes name-field-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.link-btn {
  all: unset;
  cursor: pointer;
  padding: 8px 4px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--indigo);
}

/* ---------- Main ---------- */
#screen-main { padding: 32px 20px 24px; }
.main-inner { display: flex; flex-direction: column; flex: 1; }
.main-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.flip-blocks { display: flex; gap: 4px; }
.flip-block {
  background: var(--indigo);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 34px;
  text-align: center;
}
.flip-block span {
  font-family: 'Petrona', serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--cream);
}
.stat-label { font-size: 13px; font-weight: 500; color: var(--indigo); }
.dog-name-fill { font-weight: 700; }

.section-label {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}

.presets { display: flex; flex-direction: column; gap: 20px; }
.preset-card {
  all: unset;
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 26px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08);
  border: 3px solid transparent;
}
.preset-card.selected { border-color: var(--indigo); }
.preset-badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.preset-badge span { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; }
.preset-text { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.preset-label { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; color: var(--cream); }
.preset-sub { font-size: 13px; font-weight: 500; color: rgba(251,247,239,0.9); line-height: 1.45; }

.flex-grow { flex-grow: 1; }

.about-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--indigo);
  border-radius: 24px 24px 0 0;
  padding: 18px 20px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  margin: 0 -20px -24px;
  cursor: pointer;
  border: none;
}
.about-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 15px; color: var(--cream); }
.about-sub { font-size: 12px; font-weight: 500; color: rgba(251,247,239,0.85); margin-top: 4px; }

/* ---------- Timer / BreakTimer shared ---------- */
#screen-timer, #screen-breaktimer {
  align-items: center;
  padding: 32px 20px 40px;
}
.timer-inner { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; }
.pill {
  align-self: flex-start;
  border-radius: 999px;
  padding: 9px 18px;
  margin-bottom: 8px;
}
.pill span, .pill { font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700; }
.timer-center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  width: 100%;
}
.ring {
  width: 260px; height: 260px;
  max-width: 70vw; max-height: 70vw;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box;
}
.ring-time { font-family: 'Petrona', serif; font-weight: 700; font-size: 54px; }
.controls { display: flex; align-items: center; justify-content: center; gap: 20px; }
.ctrl-btn {
  all: unset;
  cursor: pointer;
  box-sizing: border-box;
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ctrl-outline { background: transparent; border: 2.5px solid var(--coral); }
.ctrl-solid { background: var(--cream); }

/* work timer: color is set inline per preset */
#screen-timer { background: var(--cream); }

/* break timer: solid color bg, cream ring/text/buttons */
.pill-light { background: var(--cream); }
.ring-light { border: 12px solid var(--cream); }
.ring-time-light { color: var(--cream); }

/* ---------- Break (activity card) ---------- */
#screen-break { padding: 32px 20px 28px; }
.break-inner { display: flex; flex-direction: column; flex: 1; }
.break-flex { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.break-card {
  background: var(--cream);
  border-radius: 28px;
  padding: 26px;
  max-height: 46vh;
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 8px 0 rgba(0,0,0,0.08);
}
.break-card-title {
  font-family: 'Petrona', serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
}
.break-card-copy {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-line;
}
.dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dot-btn { all: unset; cursor: pointer; padding: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cream); }
.go-find-btn {
  all: unset;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  padding: 15px;
  border-radius: 999px;
  background: var(--cream);
  margin-top: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 15px;
  width: 100%;
}

/* ---------- Session End ---------- */
#screen-sessionend { align-items: center; justify-content: center; padding: 32px; gap: 26px; }
.sessionend-inner { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.stat-row-center { flex-direction: column; gap: 12px; }
.flip-blocks-lg { gap: 6px; }
.flip-block-lg { position: relative; border-radius: 14px; padding: 14px 22px; min-width: 44px; overflow: hidden; }
.flip-block-lg span { font-size: 42px; }
.flip-block-lg::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: rgba(0,0,0,0.18);
}
.caption { font-family: 'Petrona', serif; font-size: 15px; font-weight: 600; color: var(--indigo); text-align: center; }
.solid-pill-btn {
  all: unset;
  cursor: pointer;
  box-sizing: border-box;
  padding: 15px 32px;
  border-radius: 999px;
  background: var(--indigo);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--cream);
  box-shadow: 0 5px 0 rgba(0,0,0,0.08);
  text-align: center;
}

/* ---------- About ---------- */
#screen-about { padding: 32px 24px 28px; }
.about-inner { display: flex; flex-direction: column; flex: 1; }
.back-link {
  all: unset;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 18px;
  align-self: flex-start;
}
.about-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.about-titles { display: flex; flex-direction: column; line-height: 1.05; }
.about-eyebrow { font-family: 'Petrona', serif; font-weight: 700; font-size: 18px; color: var(--indigo); }
.about-title-lg { font-family: 'Petrona', serif; font-weight: 700; font-size: 27px; color: var(--indigo); }
.about-cards { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.about-card-block { border-radius: 24px; padding: 20px; }
.about-card-indigo2 { background: var(--indigo2); }
.about-card-coral { background: var(--coral); }
.about-card-heading { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; color: var(--cream); margin-bottom: 10px; }
.about-card-body { font-size: 14px; line-height: 1.6; color: rgba(251,247,239,0.94); margin-bottom: 16px; }
.about-card-indigo2 .about-card-body { margin-bottom: 0; }
.about-listen-btn {
  all: unset;
  cursor: pointer;
  box-sizing: border-box;
  display: inline-block;
  background: var(--cream);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--coral);
}

/* ---------- Paywall ---------- */
#screen-paywall { align-items: center; padding: 40px 28px 36px; }
.paywall-inner { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; }
.paywall-headline {
  font-family: 'Petrona', serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--indigo);
  text-align: center;
  line-height: 1.3;
  margin: 25px 0 60px;
}
#screen-paywall .mascot-lg { width: 230px; }
.price-card {
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.05);
  margin-bottom: 24px;
}
.price-row { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 16px; }
.price-amount { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 20px; color: var(--indigo); }
.price-once { font-size: 13px; font-weight: 500; color: var(--muted); }
.feature-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.feature-check {
  width: 18px; height: 18px; border-radius: 50%; background: var(--coral);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.feature-text { font-size: 13px; font-weight: 500; color: var(--indigo); }
.unlock-btn { margin-top: 20px; margin-bottom: 14px; box-shadow: 0 5px 0 rgba(0,0,0,0.1); }
.restore-link {
  all: unset;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
