: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: #4fb0ff;
  --accent-secondary: #ffcc33;
  --danger: #ff4466;
  --focus-ring: #4fb0ff;
  --focus-glow: rgba(79, 176, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

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; }

/* --- 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;
}
.header h1 { font-size: 22px; font-weight: 600; flex: 1; }
.header-meta { font-size: 13px; color: var(--text-secondary); }

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

/* --- Focus States (critical for EMG/D-pad) --- */
.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* --- Navigation Bar --- */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-item.primary { background: var(--accent-primary); color: #0a0a0f; }
.nav-item.primary:focus { background: #7cc4ff; }

/* --- Tabs --- */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.tab-item {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  min-height: 40px;
}
.tab-item.active { background: var(--bg-tertiary); color: var(--text-primary); }
.tab-item:focus { background: var(--bg-card); color: var(--text-primary); }

/* --- Hero weather card --- */
.hero-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.hero-icon { flex-shrink: 0; }
.hero-svg { width: 96px; height: 96px; }
.hero-main { flex: 1; min-width: 0; }
.hero-temp { font-size: 48px; font-weight: 700; line-height: 1; }
.hero-desc { font-size: 16px; color: var(--text-secondary); margin-top: 6px; }
.hero-place {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Stat grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-shrink: 0;
}
.stat-cell {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  text-align: center;
}
.stat-label { font-size: 11px; color: var(--text-secondary); }
.stat-value { font-size: 17px; font-weight: 700; margin-top: 4px; color: var(--accent-primary); }

/* --- Hourly / daily strip --- */
.strip-container { flex: 1; overflow: hidden; }
.strip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  height: 100%;
  align-items: center;
}
.strip-chip {
  flex-shrink: 0;
  width: 68px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.strip-chip-label { font-size: 12px; color: var(--text-secondary); }
.strip-chip-svg { width: 30px; height: 30px; }
.strip-chip-temp { font-size: 14px; font-weight: 600; }
.strip-chip-pop { font-size: 10px; color: var(--accent-primary); }

/* --- Error States --- */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}
.error-icon { font-size: 40px; }
.error-message { font-size: 14px; color: var(--text-secondary); max-width: 400px; }

/* --- Toast Notifications --- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  border: 1px solid var(--accent-primary);
  transition: transform 0.3s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }

.hidden { display: none !important; }
