*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --digit: #ff9900;
  --digit-dim: #994d00;
  --text: #888888;
  --text-hover: #bbbbbb;
  --border: #222222;
  --display-size: 18vw;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.toolbar {
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  z-index: 10;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.icon-btn:hover {
  color: var(--text-hover);
}

.timer-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
}

.display-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.display {
  font-family: 'DSEG7 Classic', monospace;
  font-size: var(--display-size);
  font-weight: 700;
  color: var(--digit);
  letter-spacing: 0.04em;
  line-height: 1;
  user-select: none;
  text-shadow: 0 0 20px rgba(255, 153, 0, 0.35);
  transition: font-size 0.2s ease;
}

.display.finished {
  animation: pulse 0.6s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

.setup-panel {
  transition: opacity 0.2s;
}

.setup-panel.hidden {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

.time-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.time-inputs label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.time-inputs label span {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #555;
}

.time-inputs input {
  width: 56px;
  padding: 6px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-hover);
  font-size: 16px;
  text-align: center;
  -moz-appearance: textfield;
}

.time-inputs input::-webkit-outer-spin-button,
.time-inputs input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.time-inputs input:focus {
  outline: none;
  border-color: #444;
}

.time-inputs .colon {
  font-family: 'DSEG7 Classic', monospace;
  font-size: 24px;
  color: var(--digit-dim);
  padding-bottom: 8px;
}

.controls {
  display: flex;
  gap: 12px;
  padding-bottom: 2rem;
}

.ctrl-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-hover);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ctrl-btn:hover:not(:disabled) {
  border-color: #444;
  color: #ddd;
}

.ctrl-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.ctrl-btn.subtle {
  color: var(--text);
}

.dashboard {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.dashboard.hidden {
  display: none;
}

.dashboard-inner {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0a0a;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.dashboard-header h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-hover);
  letter-spacing: 0.05em;
}

.dashboard-content {
  overflow-y: auto;
  padding: 8px 0;
}

.day-row {
  padding: 14px 20px;
  border-bottom: 1px solid #111;
}

.day-row:last-child {
  border-bottom: none;
}

.day-date {
  font-size: 13px;
  color: var(--text-hover);
  margin-bottom: 6px;
}

.day-stats {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text);
}

.day-stats span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-stats strong {
  font-size: 18px;
  font-weight: 400;
  color: var(--digit);
  font-family: 'DSEG7 Classic', monospace;
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: #555;
}

@media (max-width: 600px) {
  :root {
    --display-size: 14vw;
  }

  .time-inputs input {
    width: 48px;
  }
}
