/* timer.css - styles specific to pages/timer.html, kept separate from
   style.css since this large-digit display isn't reused elsewhere. */

.timer-panel {
  text-align: center;
  padding: 52px 20px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* A hold on the panel is the timer's touch control, so don't let the
     browser turn it into a scroll or long-press menu. */
  touch-action: none;
  cursor: pointer;
  background: var(--panel-2);
}
.scramble-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto;
}
.scramble-puzzle {
  font: inherit;
  font-weight: 600;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel, #fff);
  color: var(--text);
  cursor: pointer;
}
.scramble-text {
  flex: 1;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.15rem;
  line-height: 1.5;
  word-spacing: 0.2em;
  color: var(--text);
  text-align: center;
  user-select: text;
}
.scramble-bar .secondary-btn { white-space: nowrap; }
.scramble-preview {
  width: 176px;
  margin: 18px auto 8px;
}
.scramble-preview svg { display: block; width: 100%; height: auto; }

@media (max-width: 640px) {
  .scramble-bar { flex-wrap: wrap; }
  .scramble-text { flex-basis: 100%; order: -1; font-size: 1rem; }
}

.timer-display {
  font-family: 'Poppins', "SFMono-Regular", Consolas, monospace;
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.15s ease;
}
.timer-display.timer-holding { color: var(--error-text); }
.timer-display.timer-armed { color: var(--ok-text); }
.timer-display.timer-running { color: var(--accent); }

.timer-status {
  color: var(--muted);
  margin-top: 10px;
}

.timer-options {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.timer-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.timer-stat {
  text-align: center;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.timer-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.timer-stat .timer-stat-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.timer-stat .timer-stat-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

.timer-history-list {
  columns: 2;
  padding-left: 20px;
  margin: 8px 0 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Phone layout: the panel is the touch target, so give it most of the
   screen and centre the clock in it; scale the digits to the width. */
@media (max-width: 600px) {
  .timer-panel {
    min-height: 66vh;
    min-height: 66svh;
    padding: 20px 14px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .scramble-bar { gap: 8px; }
  .scramble-bar .scramble-puzzle, .scramble-bar .secondary-btn { flex: 1 1 0; min-height: 44px; }
  .scramble-text { font-size: 0.95rem; }
  .scramble-preview { width: 140px; margin: 12px auto 4px; }
  .timer-display { font-size: clamp(3.2rem, 19vw, 4.5rem); line-height: 1.1; }
  .timer-status { font-size: 0.92rem; }
  .timer-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .timer-stat { padding: 12px 8px; }
  .timer-stat .timer-stat-value { font-size: 1.15rem; }
  .timer-stat:hover { transform: none; box-shadow: none; }
}
