/* ============================================================
   Truei — design tokens
   Palette is drawn from the app's own subject: a target circle
   held in soft focus in a dim room. Deep low-light background
   (comfortable for repeated eye exercises), a teal "focus" accent
   echoing an iris highlight, and a warm amber for the moving
   target / primary actions.
   ============================================================ */
:root {
  /* Color */
  --ink-950: #0B1220;   /* app background — dim, low glare */
  --ink-900: #101a2e;
  --surface: #131b2e;   /* cards / panels */
  --surface-raised: #304573;     /*  #1b2740;  */
  --hairline: #34456F; 
  --hairline-focus: #7186BC;
  --text-primary: #efefef; 
  --text-muted: #cccccc;
  --focus-teal: #ACBCDC;     /*  #4fd1c5  accent: calm, "iris" highlight */
  --focus-teal-dim: #2c7a72;
  --target-amber: #f2a65a;   /* accent: the moving target / primary CTA */
  --target-amber-dim: #b9773a;
  --danger: #f2685a;
  --danger-dim: #4a201c;
  --success: #6fcf97;

  /* Type */
  --font-display: system-ui, ui-serif, serif;
  --font-body: system-ui, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* Layout */
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --gutter: 20px;
  --max-width: 480px; /* mobile-first, single column */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-950);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; color: var(--text-muted); font-weight: 500; }

p { line-height: 1.5; color: var(--text-muted); margin: 0 0 12px; }

a { color: var(--focus-teal); text-decoration: none; }

.screen {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px var(--gutter) 100px;
  flex: 1;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  /*  color: var(--focus-teal);  */
  color: var(--target-amber);
  margin-bottom: 6px;
  display: block;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 10px 20px 10px 20px;
  margin-bottom: 16px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 7px 14px;
  background: var(--ink-900);
  border: 2px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-body);
}

.field input:focus,
.field select:focus,
button:focus-visible,
a:focus-visible {
  /*  outline: 2px solid var(--focus-teal);  */
  outline: 2px solid var(--hairline-focus); 
  outline-offset: 2px;
}

.field input[type="color"] {
  width: 56px;
  height: 40px;
  border: 1px solid var(--hairline);  
  border-radius: var(--radius-sm);  
  background: none;
  padding: 0;
}

.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.stack-sm > * + * { margin-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

button, .btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
button:active { transform: scale(0.98); }

.btn-primary {
  background: var(--target-amber);
  color: #1a0f04;
  font-size: 1.5rem;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-ghost {
  background: transparent;
  color: var(--focus-teal);
  width: auto;
  padding: 8px 4px;
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
}

.bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, var(--ink-950) 60%, transparent);
  padding: 20px var(--gutter) 24px;
  display: flex;
  justify-content: center;
}
.bottom-bar > * { max-width: var(--max-width); width: 100%; }

.error-banner {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}
.error-banner.visible { display: block; }

.test-mode-banner {
  background: var(--target-amber-dim);
  color: var(--target-amber);
  border: 1px solid var(--target-amber);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}
.test-mode-banner.visible { display: block; }

.tabs {
  display: flex;
  background: var(--ink-900);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}
.tabs button {
  width: 38%;
  padding: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.tabs button.active {
  background: var(--surface-raised);
  color: var(--text-primary);
}
.tabs div {
  width: 24%;
  text-align: center; 
  vertical-align: middle;
  /*  display: flex;  */
  /*  align-items: center;  */
  padding: 10px 3px 10px 3px;
  background: transparent;
  color: var(--target-amber);
  font-size: 0.9rem;
}



/* Advanced-only fields are hidden by default in CSS (not just via JS)
   so that Simple Settings truly shows only the spec-mandated 4 options
   on first paint, before settings.js has run. JS toggles this with an
   explicit inline display value when Advanced mode is selected. */
[data-advanced-only] {
  display: none;
}


/* --------------------------------------------------
This space is for a logo. 
This CSS class is not yet used.  
-------------------------------------------------- */
div.Truei_GIF {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  position: relative;
}






/* ---- Signature element: the focus ring ----
   A pulsing concentric-circle motif that echoes the app's own
   moving target. Used on load/auth screens, never inside the
   exercise canvas itself (that stays exactly per user settings). */
.focus-ring {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  position: relative;
}
.focus-ring span {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--focus-teal);
  border-radius: 50%;
  opacity: 0;
  animation: focus-pulse 2.4s ease-out infinite;
}
.focus-ring span:nth-child(2) { animation-delay: 0.8s; }
.focus-ring span:nth-child(3) { animation-delay: 1.6s; }
.focus-ring::after {
  content: "";
  position: absolute;
  inset: 36px;
  background: var(--target-amber);
  border-radius: 50%;
}
@keyframes focus-pulse {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .focus-ring span { animation: none; opacity: 0.35; }
}

.helper-text { font-size: 1rem; color: var(--text-muted); margin-top: 6px; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--focus-teal-dim);
  color: var(--focus-teal);
}

hr.hairline { border: none; border-top: 1px solid var(--hairline); margin: 20px 0; }

.thumb-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb-list img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--hairline); }

::selection { background: var(--focus-teal-dim); }
