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

:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --accent: #4f8ef7;
  --accent2: #34d399;
  --warn: #f97316;
  --text: #e2e8f0;
  --muted: #64748b;
  --radius: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 60px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
header p  { color: var(--muted); margin-top: 6px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 24px;
}

/* Gauge */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.gauge-ring {
  position: relative;
  width: 200px;
  height: 200px;
}

.gauge-ring svg { transform: rotate(-90deg); }

.gauge-ring .track { stroke: #2a2d3a; }
.gauge-ring .fill  { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.3s linear; }

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.gauge-unit  { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* Stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat {
  background: #12141e;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-value { font-size: 1.25rem; font-weight: 600; }

/* Progress bar */
.progress-wrap { margin-bottom: 24px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.progress-bar { height: 6px; background: #2a2d3a; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; width: 0%; transition: width 0.2s ease; }

/* Button */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover:not(:disabled) { opacity: .88; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Phase indicator */
.phase {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 20px;
  margin-bottom: 16px;
}

/* History table */
.history { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.history th { color: var(--muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: .5px; padding: 0 8px 10px; text-align: left; }
.history td { padding: 8px; border-top: 1px solid #2a2d3a; }
.history tr:first-child td { border-top: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-dl  { background: #1e3a5f; color: var(--accent); }
.badge-ul  { background: #14402e; color: var(--accent2); }
.badge-lat { background: #2d1e10; color: var(--warn); }

footer {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
