:root {
  color-scheme: light;
  --ink: #1c1915;
  --paper: #f6f1e7;
  --amber: #e39b2b;
  --line: #ddd4c4;
  --card: #fffaf2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", serif;
}

a { color: inherit; }

.wrap {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand img { width: 44px; height: 44px; }

nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }

nav a[aria-current="page"] { text-decoration-thickness: 3px; }

.notice {
  margin: 20px 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
}

.face {
  margin: 8px 0 18px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.7rem, 14vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 100%;
}

.controls, .presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }

label { display: grid; gap: 4px; font-size: 0.95rem; }

input, button {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 8px;
  min-height: 48px;
}

input { width: 5.2rem; padding: 0 10px; font-variant-numeric: tabular-nums; }

button { padding: 0 14px; cursor: pointer; }

button.primary { background: var(--amber); }

button:disabled { opacity: 0.45; cursor: default; }

.laps { margin: 18px 0 0; padding: 0; list-style: none; }

.laps li { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px 0; font-variant-numeric: tabular-nums; }

footer { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px 18px; font-size: 0.95rem; }

@media (max-width: 360px) {
  .wrap { width: min(880px, calc(100% - 20px)); }
  .face { font-size: 2.5rem; }
}
