:root {
  --blue: #3c7cf3;
  --blue-soft: #e6f1ff;
  --border: #dfe3ea;
  --text: #1c2633;
  --muted: #5b6572;
  --bg: #f4f6fb;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

.topbar .link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 4px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.highlight {
  background: var(--blue-soft);
  border-color: #c8d9ff;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #3e5fa7;
  margin-bottom: 8px;
}

.time-remaining {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.big-time {
  font-size: 38px;
  font-weight: 700;
  color: #11326f;
}

.meta {
  font-size: 14px;
  color: #1b2c55;
  text-align: right;
}

.controls .control-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

.field small {
  color: var(--muted);
}

.preset-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  border: 1px solid var(--border);
  background: #f7f8fb;
  border-radius: 18px;
  padding: 6px 12px;
  cursor: pointer;
}

.action-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-weight: 600;
}

button.primary {
  background: var(--blue);
  color: #fff;
}

button.secondary {
  background: #eef2f8;
  color: #1a2a46;
}

button.ghost {
  background: #f4f5f9;
  color: #2f3b52;
  border: 1px solid var(--border);
}

.status-card .status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #f0f2f6;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3c7cf3, #5b9dff);
  transition: width 0.4s ease;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.summary-box {
  background: #f7f8fb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.summary-box .label {
  color: var(--muted);
  font-size: 13px;
}

.summary-box .value {
  font-weight: 700;
  font-size: 16px;
}

.dual {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(260px, 1fr);
  gap: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stat {
  background: #f9fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.stat .label {
  color: var(--muted);
  font-size: 13px;
}

.stat .value {
  font-weight: 700;
  font-size: 18px;
}

.history {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.history .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.history .note {
  color: var(--muted);
  font-size: 13px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.small {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.full {
  width: 100%;
}

.auth-card {
  max-width: 420px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

.alert {
  background: #ffe7e5;
  color: #b6403c;
  border: 1px solid #f5b5af;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.chart-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.chart-card h4 {
  margin: 0 0 8px 0;
}

.donut {
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 16px auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0deg, var(--blue) 0deg, #e6e8ef 0deg);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 12%;
  background: #fff;
  border-radius: 50%;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
  z-index: 1;
}

.donut-value {
  font-size: 28px;
  font-weight: 700;
}

.donut-label {
  color: var(--muted);
  font-size: 13px;
}

.percent {
  font-weight: 700;
}

@media (max-width: 800px) {
  .dual {
    grid-template-columns: 1fr;
  }
}
