/* ClearSight — calm, high-contrast, large-target UI for tired eyes */

:root {
  --bg: #0f1420;
  --panel: #1a2233;
  --ink: #e8eef7;
  --dim: #93a1b8;
  --accent: #7ec8ff;
  --accent-warm: #ffd37e;
  --warn: #ff9d7e;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

body { display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid #26314a;
}
.topbar h1 { font-size: 1.3rem; font-weight: 600; letter-spacing: .5px; }
.logo { width: 34px; height: 34px; }
.clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  font-size: 1.05rem;
  padding: 4px 12px;
  border: 1px solid #2c3a58;
  border-radius: 999px;
}

/* ---------- layout ---------- */
#app { flex: 1; display: flex; justify-content: center; padding: 28px 18px 60px; }
.screen {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  animation: fadein .35s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

h2 { font-size: 1.6rem; margin-bottom: 10px; color: var(--accent); }
.lead { color: var(--dim); font-size: 1.1rem; line-height: 1.55; margin-bottom: 22px; }
.fineprint { margin-top: 26px; color: #5d6b85; font-size: .85rem; line-height: 1.5; max-width: 460px; }

/* ---------- buttons ---------- */
.btn {
  font-size: 1.15rem;
  padding: 14px 30px;
  margin: 8px;
  border: none; border-radius: var(--radius);
  background: #2a3754;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.btn:hover { transform: scale(1.03); background: #34446a; }
.btn.big { font-size: 1.3rem; padding: 18px 38px; background: var(--accent); color: #0b1626; font-weight: 600; }
.btn.big:hover { background: #9bd6ff; }
.btn.warn { background: #4a2f2a; color: var(--warn); }
.btn.warn:hover { background: #5d3b33; }
.btn.ghost { background: transparent; border: 1px solid #3a4a6e; color: var(--dim); }
.btn.danger { border-color: #5d3b33; color: var(--warn); }
.btn.danger:hover { background: #3a2320; }
.btn.round {
  width: 64px; height: 64px; border-radius: 50%;
  font-size: 1.4rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.btnrow { display: flex; flex-wrap: wrap; justify-content: center; }

/* ---------- sample / story text ---------- */
.sample {
  background: var(--panel);
  border: 1px solid #26314a;
  border-radius: var(--radius);
  padding: 34px 28px;
  margin: 10px 0 22px;
  width: 100%;
  min-height: 150px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.6;
}
.sample.story { min-height: 200px; max-height: 62vh; overflow-y: auto; overflow-wrap: anywhere; }
.sample.center { text-align: center; }

/* ---------- stepper ---------- */
.stepper { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }
.stepper-value { font-size: 1.3rem; min-width: 90px; color: var(--accent-warm); font-variant-numeric: tabular-nums; }

/* ---------- progress ---------- */
.progress {
  width: 100%; height: 8px; border-radius: 99px;
  background: #223050; margin-bottom: 18px; overflow: hidden;
}
.progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .3s ease; }

/* ---------- stats / summary ---------- */
.stats {
  background: var(--panel); border: 1px solid #26314a; border-radius: var(--radius);
  padding: 18px 26px; margin-bottom: 20px; width: 100%;
  color: var(--dim); font-size: 1.05rem; line-height: 1.9; text-align: left;
}
.stats b { color: var(--ink); }

/* ---------- canvas stages ---------- */
.stage {
  width: 100%; height: 46vh;
  background: #0a0e18;
  border: 1px solid #26314a; border-radius: var(--radius);
  display: block;
}
/* tall screens (bounce / pursuit): canvas height is set live in JS (fitCanvas) */
.screen.tall { min-height: 0; }
.screen.tall .stage { flex: none; }
.countdown {
  margin-top: 14px; font-size: 1.4rem; color: var(--accent-warm);
  font-variant-numeric: tabular-nums;
}

/* ---------- near-far ---------- */
.focusword {
  font-size: 3.2rem; letter-spacing: 8px; font-weight: 700;
  color: var(--accent);
  background: var(--panel); border: 1px solid #26314a; border-radius: var(--radius);
  padding: 40px 30px; margin: 12px 0 8px; width: 100%;
}
.roundlabel { color: var(--dim); margin-top: 6px; }

/* ---------- toast & banner ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #223050; border: 1px solid #35507e; color: var(--ink);
  padding: 14px 26px; border-radius: 999px; font-size: 1.05rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: fadein .3s ease;
  z-index: 50;
}
.enough {
  position: fixed; top: 0; left: 0; right: 0;
  background: #3d3325; color: var(--accent-warm);
  text-align: center; padding: 12px; font-size: 1.05rem;
  border-bottom: 1px solid #6b5a3a;
  z-index: 60;
}

.notice {
  background: #3d3325; color: var(--accent-warm);
  border: 1px solid #6b5a3a; border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 16px; font-size: 1.05rem; line-height: 1.5;
}

.abort {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  font-size: .95rem; padding: 10px 16px; margin: 0;
  opacity: .75;
}
.abort:hover { opacity: 1; }

/* ---------- progress chart ---------- */
.chartwrap {
  width: 100%; background: var(--panel); border: 1px solid #26314a;
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.chartwrap h3 { color: var(--ink); font-size: 1.05rem; margin-bottom: 8px; text-align: left; }
.chartnote { color: #5d6b85; font-size: .85rem; font-weight: 400; }
#progress-chart { width: 100%; height: auto; display: block; }
.chartlegend { color: var(--dim); font-size: .9rem; text-align: left; margin-top: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 6px 0 14px; }
.dot.blue { background: var(--accent); margin-left: 0; }
.dot.amber { background: var(--accent-warm); }

/* ---------- credits footer ---------- */
.credits {
  text-align: center; padding: 10px 12px 14px;
  color: #46516b; font-size: .72rem; letter-spacing: .3px;
}
.credits a { color: #5d6b85; text-decoration: none; }
.credits a:hover { color: var(--accent); }

.hidden { display: none !important; }

@media (max-width: 560px) {
  .btn.big { font-size: 1.15rem; padding: 15px 26px; }
  .focusword { font-size: 2.2rem; letter-spacing: 4px; }
}
