/*
  style.css — how the tracker looks. Flat and quiet, in the same colours as
  Rep Counter. The colours are defined once here as "variables" and reused.
  v0.2.0: sliders across the full width, counters in a row along the bottom.
  Light only (the app looks the same with the phone set to dark).
*/

:root {
  --page: #f6f5f1;
  --card: #ffffff;
  --ink: #1c1b19;
  --ink-muted: #6b6860;
  --line: #dcd9d0;
  /* A see-through black that darkens whatever is behind (Rep Counter's "Darker"). */
  --darker: rgba(0, 0, 0, 0.13);
  /* The bleed slider's fill: a muted red, see-through like the others. */
  --bleed: rgba(179, 64, 46, 0.35);
  --flash: rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--page);
}

body {
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  /* No text selection or phone pop-up menus while dragging and holding. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
}

/* The whole app is exactly one screen tall: day bar, board, footer. */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* ---------- Day bar ---------- */

.day-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 4px;
}

.day-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.day-arrow {
  width: 56px;
  height: 56px;
  border: 0;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
}

.day-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ---------- Board: sliders (2/3) and counters (1/3) ---------- */

/* The sliders take all the room left; the counters sit in a row below. */
.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  padding: 0 10px;
}

.sliders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* One slider: a tall column. The fill rises from the bottom to its value. */
.slider {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--card);
  cursor: ns-resize;
  /* A finger on the column moves the slider instead of scrolling. */
  touch-action: none;
}

.slider-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: var(--darker);
  transition: height 0.12s ease-out;
}

/* While dragging, follow the finger exactly. */
.slider.is-dragging .slider-fill {
  transition: none;
}

.slider-bleed .slider-fill {
  background: var(--bleed);
}

/* The icon and value sit at the top of the column. "relative" lifts them
   above the fill. */
.slider-top {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
}

.slider-value {
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Not set yet for this day: quieter. */
.slider.is-unset .slider-value {
  color: var(--ink-muted);
  font-weight: 400;
}

.slider-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ---------- Counters ---------- */

.counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.counter {
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.counter-icon {
  width: 28px;
  height: 28px;
}

.counter-count {
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.counter.is-zero .counter-count {
  color: var(--line);
}

.counter-name {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* A short flash when a count changes, so the tap is felt. */
.counter.is-bumped {
  animation: bump 0.4s ease-out;
}

@keyframes bump {
  0% {
    background: var(--darker);
  }
  100% {
    background: var(--card);
  }
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px 10px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
