:root {
  --bg: #000;
  --fg: #cfe9d2;
  --digital: #16ff72;
  --warn: #ff4d4f;
  --accent: #ffc400;
  --work: #16ff72;
  --rest: #ffc400;
  --emom: #19d1ff;
  --panel: #0a0a0a;
  --border: #1f1f1f;
  --button: #141414;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  display: grid;
  place-items: center;
  padding: 16px;
}

.app {
  width: min(980px, 100%);
  display: grid;
  gap: 14px;
}

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

h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 1px;
  color: #9ce8a6;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.card.fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 998;
  border-radius: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
}

/* btn fullscreen */
.btn.fullscreen {
  z-index: 999;
  top: 0;
  position: fixed;
  right: 0;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

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

label {
  font-size: 14px;
  color: #7e8f82;
  display: inline-grid;
  gap: 6px;
}

select, input[type="number"] {
  background: var(--button);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  min-width: 120px;
  outline: none;
}
select:focus, input:focus { border-color: #2dff8b; }

.btn {
  background: var(--button);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.04s ease, background 0.2s ease, border 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--digital); color: #0a0a0a; font-weight: 800; }
.btn.warn { background: var(--warn); color: #0a0a0a; font-weight: 800; }

.stage { display: grid; gap: 6px; text-align: center; padding: 8px 0; }
.phase { font-weight: 900; letter-spacing: 1px; font-size: clamp(18px, 4vw, 28px); color: var(--accent); }
.time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-weight: 900;
  letter-spacing: 2px;
  font-size: clamp(64px, 18vw, 160px);
  color: var(--digital);
  line-height: 1;
}
.info { color: #7e8f82; font-size: clamp(13px, 2.8vw, 16px); }
.controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.help { text-align: center; font-size: 13px; color: #7e8f82; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  place-items: center;
  z-index: 999;
}
.overlay.show { display: grid; }
.countdown {
  font-size: clamp(84px, 20vw, 220px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
  color: var(--accent);
}
.count-go { color: var(--work); }

.phase.work { color: var(--work); }
.phase.rest { color: var(--rest); }
.phase.emom { color: var(--emom); }

.time-line {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  justify-content: center;
}

.round-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-weight: 900;
  letter-spacing: 2px;
  font-size: clamp(64px, 18vw, 160px);
  color: var(--warn);
  line-height: 1;
}
