:root {
  --bg-primary: #000000; /*pure black = transparent on additive display, lets real world show through*/
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --success: #00ff88;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 8px; /*8dp safe margin — edge elements get clipped by rubberbanding*/
  box-sizing: border-box;
}

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}
.header h1 {
  font-size: 28px;
  font-weight: 700;
  flex: 1;
}
.header-meta {
  font-size: 14px;
  color: var(--accent-secondary);
}
.back-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

/* --- Content Area --- */
.content {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
}
.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}
.card-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Big buttons (primary focusable targets) --- */
.big-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px; /*minimum tap target per display guidelines*/
  padding: 0 20px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  font-size: 18px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  /*only the container reacts to focus; content stays legible*/
  transition: transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
              border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
              box-shadow 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
              background 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}
.big-btn-icon {
  font-size: 24px;
  width: 36px;
  text-align: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}
.content-label { flex: 1; }
.counter-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-secondary);
  flex-shrink: 0;
}

/* --- Focus states (critical for EMG/D-pad) --- */
.focusable { outline: none; }
.big-btn:focus,
.back-btn:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 24px var(--focus-glow);
  background: var(--bg-card);
  transform: scale(calc(1 - 8/88)); /*targeted state: -8dp*/
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: 24px;
  font-size: 16px;
  max-width: 536px;
  border: 1px solid var(--accent-primary);
  transition: transform 300ms cubic-bezier(0.6, 0, 0.4, 1);
  z-index: 100;
  pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }

/* --- Utility --- */
.hidden { display: none !important; }
.text-accent { color: var(--accent-primary); }
