/* style.css — 打刻サイト共通デザイントークン */

:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #ece7db;
  --ink: #20262e;
  --ink-muted: #5b6672;
  --border: #ddd6c4;

  --accent: #1f3a52;
  --accent-strong: #16293b;
  --accent-ink: #ffffff;

  --go: #2f7d5c;
  --go-strong: #245f45;
  --pause: #b4622b;
  --pause-strong: #904e22;
  --danger: #b3423a;
  --danger-strong: #8f342d;

  --focus: #2f7d5c;
  --shadow: 0 1px 2px rgba(32, 38, 46, 0.06), 0 8px 24px rgba(32, 38, 46, 0.08);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131820;
    --surface: #1b222c;
    --surface-2: #232c38;
    --ink: #edeef0;
    --ink-muted: #93a0ac;
    --border: #2c3644;

    --accent: #6f9dbf;
    --accent-strong: #8fb4d1;
    --accent-ink: #0d141c;

    --go: #4fae83;
    --go-strong: #6bc79c;
    --pause: #e08a4e;
    --pause-strong: #eda269;
    --danger: #e06a62;
    --danger-strong: #ea847d;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #131820;
  --surface: #1b222c;
  --surface-2: #232c38;
  --ink: #edeef0;
  --ink-muted: #93a0ac;
  --border: #2c3644;

  --accent: #6f9dbf;
  --accent-strong: #8fb4d1;
  --accent-ink: #0d141c;

  --go: #4fae83;
  --go-strong: #6bc79c;
  --pause: #e08a4e;
  --pause-strong: #eda269;
  --danger: #e06a62;
  --danger-strong: #ea847d;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
}

body {
  font-family: "Barlow", -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: balance;
  margin: 0;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent-strong); }

button {
  font-family: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  gap: 16px;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 15px;
}

.clock {
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  padding: 12px 0 4px;
  color: var(--accent);
}
.clock-date {
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
  margin-top: -12px;
}

.punch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.punch-btn {
  position: relative;
  border: none;
  border-radius: var(--radius);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 18px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
}
.punch-btn:active { transform: scale(0.97); }
.punch-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.punch-btn.go { background: var(--go); }
.punch-btn.go.recommended { box-shadow: 0 0 0 3px color-mix(in srgb, var(--go) 45%, transparent), var(--shadow); }
.punch-btn.pause { background: var(--pause); }
.punch-btn.pause.recommended { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pause) 45%, transparent), var(--shadow); }

.next-tag {
  position: absolute;
  top: -11px;
  right: -6px;
  background: var(--ink);
  color: var(--bg);
  font-family: "Barlow", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.punch-btn .sub {
  font-family: "Barlow", sans-serif;
  font-weight: 500;
  font-size: 12px;
  opacity: 0.85;
}

.banner {
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.banner.success { background: color-mix(in srgb, var(--go) 18%, var(--surface)); color: var(--go-strong); }
.banner.error { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger-strong); }

.log-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.log-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.log-list .type { font-weight: 600; }
.log-list .time { color: var(--ink-muted); }

.log-empty {
  color: var(--ink-muted);
  font-size: 14px;
  padding: 8px 0;
}

.footer-note {
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  max-width: 480px;
}

.footer-note a { color: var(--ink-muted); text-decoration: underline; }

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}
@keyframes spin { to { transform: rotate(360deg); } }
